Skip to content

Commit 1de108a

Browse files
committed
Bump the GCC version when using OCaml.
1 parent 1be4578 commit 1de108a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Rootfs.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ function choose_shards(p::AbstractPlatform;
597597
bootstrap_list::Vector{Symbol} = bootstrap_list,
598598
# Because GCC has lots of compatibility issues, we always default to
599599
# the earliest version possible.
600-
preferred_gcc_version::VersionNumber = getversion(GCC_builds[1]),
600+
preferred_gcc_version::Union{Nothing,VersionNumber} = nothing,
601601
# Because LLVM doesn't have compatibility issues, we always default
602602
# to the newest version possible.
603603
preferred_llvm_version::VersionNumber = getversion(LLVM_builds[end]),
@@ -610,6 +610,17 @@ function choose_shards(p::AbstractPlatform;
610610
preferred_ocaml_version::VersionNumber = maximum(getversion.(OCaml_builds)),
611611
)
612612

613+
# The preferred GCC version depends on the compilers we are using.
614+
if preferred_gcc_version === nothing
615+
preferred_gcc_version = if :ocaml in compilers
616+
# OCaml shards have been compiled agains GCC 6
617+
compatible_gcc_builds = filter(b -> getversion(b) >= v"6", GCC_builds)
618+
getversion(compatible_gcc_builds[1])
619+
else
620+
getversion(GCC_builds[1])
621+
end
622+
end
623+
613624
function find_shard(name, version, archive_type; target = nothing)
614625
# aarch64-apple-darwin is a special platform because it has a single GCCBootstrap
615626
# with a version number different from any other platforms: match this shard with a

0 commit comments

Comments
 (0)