1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

--disable-jit-support should disable YJIT successfully

Even if `rustc` is available, it should not be an error unless
`--enable-yjit` is explicitly given.
This commit is contained in:
Nobuyoshi Nakada 2022-11-06 15:59:32 +09:00
parent cb899a990a
commit 9627aab825
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2022-11-06 13:06:26 +00:00
2 changed files with 11 additions and 7 deletions

View file

@ -303,7 +303,7 @@ showflags:
" LC_ALL = $(LC_ALL)" \ " LC_ALL = $(LC_ALL)" \
" LC_CTYPE = $(LC_CTYPE)" \ " LC_CTYPE = $(LC_CTYPE)" \
" MFLAGS = $(MFLAGS)" \ " MFLAGS = $(MFLAGS)" \
" RUST = $(RUST)" \ " RUSTC = $(RUSTC)" \
" YJIT_RUSTC_ARGS = $(YJIT_RUSTC_ARGS)" \ " YJIT_RUSTC_ARGS = $(YJIT_RUSTC_ARGS)" \
$(MESSAGE_END) $(MESSAGE_END)
-@$(CC_VERSION) -@$(CC_VERSION)

View file

@ -3754,15 +3754,19 @@ AC_ARG_ENABLE(yjit,
AS_HELP_STRING([--enable-yjit], AS_HELP_STRING([--enable-yjit],
[enable experimental in-process JIT compiler that requires Rust build tools [default=no]]), [enable experimental in-process JIT compiler that requires Rust build tools [default=no]]),
[YJIT_SUPPORT=$enableval], [YJIT_SUPPORT=$enableval],
[ [AS_CASE(["$enable_jit_support:$YJIT_TARGET_OK:$RUSTC"],
AS_IF([test x"$RUSTC" != "xno"], [no:*|yes:no:*|yes:yes:no], [
YJIT_SUPPORT=no
],
[yes:yes:*], [
AS_IF([ echo "fn main() { let x = 1; format!(\"{x}\"); }" | $RUSTC - --emit asm=/dev/null ], AS_IF([ echo "fn main() { let x = 1; format!(\"{x}\"); }" | $RUSTC - --emit asm=/dev/null ],
[YJIT_SUPPORT="$YJIT_TARGET_OK"], [YJIT_SUPPORT=yes],
[YJIT_SUPPORT=no]
),
[YJIT_SUPPORT=no] [YJIT_SUPPORT=no]
) )
], [
[YJIT_SUPPORT=no]
] ]
)]
) )
CARGO= CARGO=