From 4efe326b18bb1f592b85f6ac0cf019f2873f79b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 29 Apr 2020 21:55:45 +0300 Subject: [PATCH] setup-toolchain.sh: When translating -arch to -target, keep the original -arch as well The clang driver does a number of rewrites back and forth between arch names and triples. For aarch64/arm64, an input -arch arm64 or -target arm64-apple-darwin ends up rewritten to aarch64-apple-darwin, but at different stages (and -target aarch64-apple-darwin doesn't work at all with current clang versions). Keep the -arch argument, so that we follow the same path of arch/triple rewrites as the original clang, so that -dumpmachine prints the same value for -arch arm64 as it does on macos without this wrapper script (printing aarch64-apple-darwin*). --- setup-toolchain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-toolchain.sh b/setup-toolchain.sh index 15fbc84..cd6fc86 100755 --- a/setup-toolchain.sh +++ b/setup-toolchain.sh @@ -55,7 +55,7 @@ while [ \$# -gt 0 ]; do a=\$1 if [ "\$a" = "-arch" ]; then shift - ARGS+=(-target \$1-apple-darwin16) + ARGS+=(-target \$1-apple-darwin16 -arch \$1) TARGET_SET=1 shift else