Skip to content

Commit 53c67b1

Browse files
committed
Toolchains: Include clang on macOS GCC builds too
1 parent 88e1223 commit 53c67b1

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

BinaryBuilderToolchains.jl/src/toolchains/CToolchain.jl

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,30 @@ function jll_source_selection(vendor::Symbol, platform::CrossPlatform,
439439
target="clang",
440440
),
441441
]
442-
442+
443+
# Same story here, but for `:gcc` on macOS
444+
clang_jlls = [
445+
JLLSource(
446+
"Clang_jll",
447+
platform;
448+
repo=Pkg.Types.GitRepo(
449+
rev="main",
450+
source="https://github.com/staticfloat/Clang_jll.jl",
451+
),
452+
version=v"17.0.7",
453+
target="clang",
454+
),
455+
JLLSource(
456+
"libLLVM_jll",
457+
platform;
458+
repo=Pkg.Types.GitRepo(
459+
rev="main",
460+
source="https://github.com/staticfloat/libLLVM_jll.jl",
461+
),
462+
version=v"17.0.7",
463+
target="clang",
464+
),
465+
]
443466

444467
# If we're asking for a bootstrap toolchain, give just that and nothing else,
445468
# which is why we `return` from within here.
@@ -458,9 +481,8 @@ function jll_source_selection(vendor::Symbol, platform::CrossPlatform,
458481
target="gcc",
459482
),
460483

461-
# binutils actually needs `clang` to act as assembler...
484+
# binutils actually needs `clang` to act as assembler, so we include it here.
462485
clang_bootstrap_jlls...,
463-
464486
binutils_jlls...,
465487
libc_jlls...,
466488
])
@@ -523,29 +545,15 @@ function jll_source_selection(vendor::Symbol, platform::CrossPlatform,
523545
libstdcxx_libs...,
524546
binutils_jlls...,
525547
])
548+
549+
# binutils actually needs `clang` to act as assembler, so we include it here.
550+
if Sys.isapple(platform.target)
551+
append!(deps, clang_bootstrap_jlls)
552+
end
526553
elseif vendor == :clang || vendor == :clang_bootstrap
527554
if vendor == :clang
528555
append!(deps, [
529-
JLLSource(
530-
"Clang_jll",
531-
platform;
532-
repo=Pkg.Types.GitRepo(
533-
rev="main",
534-
source="https://github.com/staticfloat/Clang_jll.jl",
535-
),
536-
version=v"17.0.7",
537-
target="clang",
538-
),
539-
JLLSource(
540-
"libLLVM_jll",
541-
platform;
542-
repo=Pkg.Types.GitRepo(
543-
rev="main",
544-
source="https://github.com/staticfloat/libLLVM_jll.jl",
545-
),
546-
version=v"17.0.7",
547-
target="clang",
548-
),
556+
clang_jlls...,
549557
binutils_jlls...,
550558
])
551559
else

0 commit comments

Comments
 (0)