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

ruby-changes:74370

From: Nobuyoshi <ko1@a...>
Date: Sun, 6 Nov 2022 06:48:09 +0900 (JST)
Subject: [ruby-changes:74370] 1454f8f219 (master): Add `--target` option to RUSTC when cross-compiling

https://git.ruby-lang.org/ruby.git/commit/?id=1454f8f219

From 1454f8f219890b8134f68e868d8cb1d0a9d2aa20 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 5 Nov 2022 22:19:21 +0900
Subject: Add `--target` option to RUSTC when cross-compiling

---
 common.mk    | 2 ++
 configure.ac | 9 +++------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/common.mk b/common.mk
index 781c323d95..aea4d02c5f 100644
--- a/common.mk
+++ b/common.mk
@@ -303,6 +303,8 @@ showflags: https://github.com/ruby/ruby/blob/trunk/common.mk#L303
 	"	LC_ALL = $(LC_ALL)" \
 	"	LC_CTYPE = $(LC_CTYPE)" \
 	"	MFLAGS = $(MFLAGS)" \
+	"	RUST = $(RUST)" \
+	"	YJIT_RUSTC_ARGS = $(YJIT_RUSTC_ARGS)" \
 	$(MESSAGE_END)
 	-@$(CC_VERSION)
 
diff --git a/configure.ac b/configure.ac
index 7b0c6014b2..9e2ba81a51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3733,7 +3733,7 @@ AS_IF([test x"$MJIT_SUPPORT" = "xyes"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L3733
 
 AC_SUBST(MJIT_SUPPORT)
 
-AC_CHECK_TOOL(RUSTC, [rustc], [no])
+AC_CHECK_PROG(RUSTC, [rustc], [rustc], [no]) dnl no ac_tool_prefix
 
 dnl check if we can build YJIT on this target platform
 AS_CASE(["$target_cpu-$target_os"],
@@ -3757,10 +3757,7 @@ AC_ARG_ENABLE(yjit, https://github.com/ruby/ruby/blob/trunk/configure.ac#L3757
     [
         AS_IF([test x"$RUSTC" != "xno"],
             AS_IF([ echo "fn main() { let x = 1; format!(\"{x}\"); }" | $RUSTC - --emit asm=/dev/null ],
-                AS_IF([test x"$YJIT_TARGET_OK" != "xno"],
-                    [YJIT_SUPPORT=yes],
-                    [YJIT_SUPPORT=no]
-                ),
+                [YJIT_SUPPORT="$YJIT_TARGET_OK"],
                 [YJIT_SUPPORT=no]
             ),
             [YJIT_SUPPORT=no]
@@ -3776,10 +3773,10 @@ AS_CASE(["${YJIT_SUPPORT}"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L3773
     AS_IF([test x"$enable_jit_support" = "xno"],
         AC_MSG_ERROR([--disable-jit-support but --enable-yjit. YJIT requires JIT support])
     )
-    AC_CHECK_TOOL(RUSTC, [rustc], [no])
     AS_IF([test x"$RUSTC" = "xno"],
         AC_MSG_ERROR([rustc is required. Installation instructions available at https://www.rust-lang.org/tools/install])
     )
+    AS_IF([test "$cross_compiling" = yes], [RUSTC="$RUSTC --target=$target"])
 
     AS_CASE(["${YJIT_SUPPORT}"],
     [yes], [
-- 
cgit v1.2.3


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

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