[前][次][番号順一覧][スレッド一覧]

ruby-changes:74372

From: Nobuyoshi <ko1@a...>
Date: Sun, 6 Nov 2022 22:06:26 +0900 (JST)
Subject: [ruby-changes:74372] 9627aab825 (master): `--disable-jit-support` should disable YJIT successfully

https://git.ruby-lang.org/ruby.git/commit/?id=9627aab825

From 9627aab82524e71b702479b4fa5e24b36cced398 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 6 Nov 2022 15:59:32 +0900
Subject: `--disable-jit-support` should disable YJIT successfully

Even if `rustc` is available, it should not be an error unless
`--enable-yjit` is explicitly given.
---
 common.mk    |  2 +-
 configure.ac | 16 ++++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/common.mk b/common.mk
index aea4d02c5f..88934378f4 100644
--- a/common.mk
+++ b/common.mk
@@ -303,7 +303,7 @@ showflags: https://github.com/ruby/ruby/blob/trunk/common.mk#L303
 	"	LC_ALL = $(LC_ALL)" \
 	"	LC_CTYPE = $(LC_CTYPE)" \
 	"	MFLAGS = $(MFLAGS)" \
-	"	RUST = $(RUST)" \
+	"	RUSTC = $(RUSTC)" \
 	"	YJIT_RUSTC_ARGS = $(YJIT_RUSTC_ARGS)" \
 	$(MESSAGE_END)
 	-@$(CC_VERSION)
diff --git a/configure.ac b/configure.ac
index bb83865010..8c176db836 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3754,15 +3754,19 @@ AC_ARG_ENABLE(yjit, https://github.com/ruby/ruby/blob/trunk/configure.ac#L3754
     AS_HELP_STRING([--enable-yjit],
     [enable experimental in-process JIT compiler that requires Rust build tools [default=no]]),
     [YJIT_SUPPORT=$enableval],
-    [
-        AS_IF([test x"$RUSTC" != "xno"],
+    [AS_CASE(["$enable_jit_support:$YJIT_TARGET_OK:$RUSTC"],
+        [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 ],
-                [YJIT_SUPPORT="$YJIT_TARGET_OK"],
+                [YJIT_SUPPORT=yes],
                 [YJIT_SUPPORT=no]
-            ),
+            )
+        ], [
             [YJIT_SUPPORT=no]
-        )
-    ]
+        ]
+    )]
 )
 
 CARGO=
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]