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.
This commit is contained in:
Takashi Kokubun 2023-03-07 22:55:43 -08:00
Родитель 6d91df08b5
Коммит 9df1f58e01
1 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -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)