Skip to content

Commit

Permalink
setup-toolchain.sh: When translating -arch to -target, keep the origi…
Browse files Browse the repository at this point in the history
…nal -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*).
  • Loading branch information
mstorsjo committed Apr 29, 2020
1 parent 02dbfdf commit 4efe326
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4efe326

Please sign in to comment.