Skip to content

Commit 661a851

Browse files
authored
[Runner] Hot-fix for as wrapper (#218)
On `aarch64-apple-darwin` currently we have ```console sandbox:${WORKSPACE} # echo 'int main(){}' | gcc -x c - clang-8: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.0' ``` because `clang-8` isn't able to deal with version numbers ≥ 11.0 (I know, right?). This change sets `MACOSX_DEPLOYMENT_TARGET=10.16` for `as` on this platform, to quickly work around the issue, similarly to what Apple does with `SYSTEM_VERSION_COMPAT=1` (ref: https://twitter.com/jeremyhu/status/1285230460402987008).
1 parent 042de00 commit 661a851

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Runner.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,19 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
653653
end
654654

655655
# Write out a bunch of common tools
656-
for tool in (:as, :cpp, :ld, :nm, :libtool, :objcopy, :objdump, :otool,
656+
for tool in (:cpp, :ld, :nm, :libtool, :objcopy, :objdump, :otool,
657657
:strip, :install_name_tool, :dlltool, :windres, :winmc, :lipo)
658658
@eval $(tool)(io::IO, p::AbstractPlatform) = $(wrapper)(io, string("/opt/", aatriplet(p), "/bin/", aatriplet(p), "-", $(string(tool))); allow_ccache=false)
659659
end
660+
as(io::IO, p::AbstractPlatform) =
661+
wrapper(io, string("/opt/", aatriplet(p), "/bin/", aatriplet(p), "-as");
662+
allow_ccache=false,
663+
# At the moment `as` for `aarch64-apple-darwin` is `clang-8`, which can't deal with
664+
# `MACOSX_DEPLOYMENT_TARGET=11.0`, so we pretend to be on 10.16. Note: a better check would be
665+
# `VersionNumber(macos_version(p)) ≥ v"11"`, but sometimes `p` may not have `os_version` set, leading to
666+
# an error. TODO: remove this hack and create `as` wrapper together with the tools above when we
667+
# upgrade `as` to a newer version of Clang.
668+
env=(Sys.isapple(p) && arch(p) == "aarch64") ? Dict("MACOSX_DEPLOYMENT_TARGET"=>"10.16") : Dict{String,String}())
660669

661670
# c++filt is hard to write in symbols
662671
function cxxfilt(io::IO, p::AbstractPlatform)

0 commit comments

Comments
 (0)