From d9d26e9304baf45e1553962de1a3a81e3a4e6319 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 26 Jul 2023 13:16:33 +0800 Subject: [PATCH 1/2] Fixes to rust triplet target (#2229) --- make.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make.sh b/make.sh index c95f844d76..99728da07f 100755 --- a/make.sh +++ b/make.sh @@ -1013,8 +1013,8 @@ get_rust_triplet() { x86_64-pc-linux-gnu) result=x86_64-unknown-linux-gnu;; aarch64-linux-gnu|aarch64-unknown-linux-gnu) result=aarch64-unknown-linux-gnu;; arm-linux-gnueabihf|arm-unknown-linux-gnueabihf) result=armv7-unknown-linux-gnueabihf;; - x86_64-apple-darwin) result=x86_64-apple-darwin;; - aarch64-apple-darwin) result=aarch64-apple-darwin;; + x86_64-apple-darwin*) result=x86_64-apple-darwin;; + aarch64-apple-darwin*) result=aarch64-apple-darwin;; x86_64-w64-mingw32) result=x86_64-pc-windows-gnu;; *) echo "error: unsupported triplet: ${triplet}"; exit 1;; esac From 26f9d31dc2c79699c4f6ab769d213142a1f56fce Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 26 Jul 2023 16:22:13 +0800 Subject: [PATCH 2/2] Fixes to match rust build triplet and target triplet (#2230) --- configure.ac | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 83be49fd29..75a71ff88d 100644 --- a/configure.ac +++ b/configure.ac @@ -1375,19 +1375,21 @@ AC_SUBST(PROTOC) AC_SUBST(PROTOC_INCLUDE_DIR) dnl If the host and build triplets are the same, we keep this empty -if test x$host = x$build; then +RUST_HOST=`$ac_abs_confdir/make.sh get_rust_triplet "$build"` +if test $? != 0; then +AC_MSG_ERROR("unsupported build system") +fi + +RUST_TARGET=`$ac_abs_confdir/make.sh get_rust_triplet "$host"` +if test $? != 0; then +AC_MSG_ERROR("unsupported host target") +fi + +if test x$RUST_HOST = x$RUST_TARGET; then RUST_TARGET= RUST_HOST= -else - RUST_HOST=`$ac_abs_confdir/make.sh get_rust_triplet "$build"` - if test $? != 0; then - AC_MSG_ERROR("unsupported build system") - fi - RUST_TARGET=`$ac_abs_confdir/make.sh get_rust_triplet "$host"` - if test $? != 0; then - AC_MSG_ERROR("unsupported host target") - fi fi + AC_SUBST(RUST_TARGET) AC_SUBST(RUST_HOST) AM_CONDITIONAL([HAVE_RUST_TARGET], [test x$RUST_TARGET != x])