Skip to content

Commit e76628b

Browse files
authored
Fix old clang/llvm version that broke after LLVM16 (#332)
* Put install-dir flag behind a version * Fix typo * Revert new tests for runner issues
1 parent ead8580 commit e76628b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Runner.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ end
155155
host_platform::AbstractPlatform = $(repr(default_host_platform)),
156156
compilers::Vector{Symbol} = [:c],
157157
allow_unsafe_flags::Bool = false,
158-
lock_microarchitecture::Bool = true)
158+
lock_microarchitecture::Bool = true,
159+
gcc_version::Union{Nothing,VersionNumber}=nothing,
160+
clang_version::Union{Nothing,VersionNumber}=nothing)
159161
160162
We generate a set of compiler wrapper scripts within our build environment to force all
161163
build systems to honor the necessary sets of compiler flags to build for our systems.
@@ -172,6 +174,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
172174
lock_microarchitecture::Bool = true,
173175
bootstrap::Bool = !isempty(bootstrap_list),
174176
gcc_version::Union{Nothing,VersionNumber}=nothing,
177+
clang_version::Union{Nothing,VersionNumber}=nothing
175178
)
176179
# Wipe that directory out, in case it already had compiler wrappers
177180
rm(bin_path; recursive=true, force=true)
@@ -340,7 +343,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
340343
])
341344
end
342345
end
343-
if Sys.islinux(p) && !isnothing(gcc_version)
346+
if Sys.islinux(p) && !isnothing(gcc_version) && (clang_version >= v"16")
344347
append!(flags, ["--gcc-install-dir=/opt/$(aatriplet(p))/lib/gcc/$(aatriplet(p))/$(gcc_version)"])
345348
end
346349
if Sys.iswindows(p)
@@ -1320,12 +1323,15 @@ function runner_setup!(workspaces, mappings, workspace_root, verbose, kwargs, pl
13201323
# Determine version of GCC toolchain.
13211324
gcc = filter(s -> s.name == "GCCBootstrap" && platforms_match(s.target, platform), shards)
13221325
gcc_version = length(gcc) == 1 ? only(gcc).version : nothing
1326+
1327+
clang = filter(s -> s.name == "LLVMBootstrap", shards)
1328+
clang_version = length(clang) == 1 ? only(clang).version : nothing
13231329
# Construct environment variables we'll use from here on out
13241330
platform::Platform = get_concrete_platform(platform; compilers..., extract_kwargs(kwargs, (:preferred_gcc_version,:preferred_llvm_version))...)
13251331
envs::Dict{String,String} = merge(platform_envs(platform, src_name; rust_version, verbose, compilers...), extra_env)
13261332

13271333
# JIT out some compiler wrappers, add it to our mounts
1328-
generate_compiler_wrappers!(platform; bin_path=compiler_wrapper_path, gcc_version, compilers..., extract_kwargs(kwargs, (:allow_unsafe_flags,:lock_microarchitecture))...)
1334+
generate_compiler_wrappers!(platform; bin_path=compiler_wrapper_path, gcc_version, clang_version, compilers..., extract_kwargs(kwargs, (:allow_unsafe_flags,:lock_microarchitecture))...)
13291335
push!(workspaces, compiler_wrapper_path => "/opt/bin")
13301336

13311337
if isempty(bootstrap_list)

0 commit comments

Comments
 (0)