From 9df1f58e018a0c7fd4d9268d9aeb71b277c653db Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 7 Mar 2023 22:55:43 -0800 Subject: [PATCH] Link libcapstone no matter what cargo does libcapstone used to break when it's linked from C and Rust at the same time, but it doesn't seem to happen anymore. Maybe it's related to recent symbol hygiene changes. Thank you if that's the case. This commit allows you to make both --enable-rjit=dev and --enable-yjit=dev work in the same binary. --- configure.ac | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index f79c900099..e2309607ca 100644 --- a/configure.ac +++ b/configure.ac @@ -3864,16 +3864,12 @@ AC_ARG_ENABLE(rjit, )] ) -AS_CASE(["${RJIT_SUPPORT}"], +AS_CASE(["$RJIT_SUPPORT"], [yes|dev], [ - AS_CASE(["${RJIT_SUPPORT}"], + AS_CASE(["$RJIT_SUPPORT"], [dev], [ - # Link libcapstone for --rjit-dump-disasm. If YJIT links libcapstone - # with cargo, linking libcapstone here doesn't work. It should be - # linked for RJIT only when YJIT doesn't. - AS_IF([test -z "$CARGO_BUILD_ARGS"], [ - AC_CHECK_LIB([capstone], [cs_disasm]) - ]) + # Link libcapstone for --rjit-dump-disasm + AC_CHECK_LIB([capstone], [cs_disasm]) # Enable RJIT_STATS (vm_insns_count of --rjit-stats) AC_DEFINE(RUBY_DEBUG, 1)