Skip to content

Commit

Permalink
LLVM: Add unified LLD JLL, and add driver entrypoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Oct 15, 2024
1 parent 599e452 commit 021985b
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 6 deletions.
6 changes: 3 additions & 3 deletions L/LLVM/Clang_unified/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ version = v"0.1"
llvm_full_versions = [
v"15.0.7+10",
v"16.0.6+4",
v"17.0.6+5"
v"17.0.6+5",
v"18.1.7+3",
v"19.1.1+0",
]

augment_platform_block = """
Expand Down Expand Up @@ -59,5 +61,3 @@ for (i, build) in enumerate(builds)
skip_audit=true, dont_dlopen=true, julia_compat="1.10",
augment_platform_block)
end

# bump
2 changes: 1 addition & 1 deletion L/LLVM/LLD@14/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ for (i, build) in enumerate(builds)
augment_platform_block)
end

#let's build!
# bump
2 changes: 2 additions & 0 deletions L/LLVM/LLD@15/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ for (i, build) in enumerate(builds)
skip_audit=true, julia_compat="1.9",
augment_platform_block)
end

# bump
2 changes: 2 additions & 0 deletions L/LLVM/LLD@16/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ for (i, build) in enumerate(builds)
skip_audit=true, julia_compat="1.11",
augment_platform_block)
end

# bump
2 changes: 2 additions & 0 deletions L/LLVM/LLD@17/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ for (i, build) in enumerate(builds)
skip_audit=true, julia_compat="1.11",
augment_platform_block)
end

# bump
3 changes: 2 additions & 1 deletion L/LLVM/LLD@18/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ for (i, build) in enumerate(builds)
skip_audit=true, julia_compat="1.12",
augment_platform_block)
end
#!

# bump
3 changes: 2 additions & 1 deletion L/LLVM/LLD@19/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ for (i, build) in enumerate(builds)
skip_audit=true, julia_compat="1.12",
augment_platform_block)
end
#!

# bump
63 changes: 63 additions & 0 deletions L/LLVM/LLD_unified/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using BinaryBuilder, Pkg
using Base.BinaryPlatforms

const YGGDRASIL_DIR = "../../.."
include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl"))
include(joinpath(YGGDRASIL_DIR, "platforms", "llvm.jl"))
include("../common.jl")

name = "LLD_unified"
version = v"0.1"
llvm_full_versions = [
v"15.0.7+10",
v"16.0.6+4",
v"17.0.6+5",
v"18.1.7+3",
v"19.1.1+0",
]

augment_platform_block = """
using Base.BinaryPlatforms
$(LLVM.augment)
function augment_platform!(platform::Platform)
augment_llvm!(platform)
end"""

# determine exactly which tarballs we should build
builds = []
for llvm_assertions in (false, true), llvm_full_version in llvm_full_versions
llvm_full_version >= v"15" || continue
libllvm_version = llvm_full_version
_, _, sources, script, platforms, products, dependencies =
configure_extraction(ARGS, llvm_full_version, "LLD", libllvm_version;
assert=llvm_assertions, augmentation=true,
dont_dlopen=false)
# ignore the output version, as we want a unified JLL
dependencies = map(dependencies) do dep
# ignore the version of any LLVM dependency, as we'll automatically load
# an appropriate version of LLD via platform augmentations
# TODO: make this an argument to `configure_extraction`?
if isa(dep, Dependency) && contains(dep.pkg.name, "LLVM")
Dependency(dep.pkg.name; dep.platforms)
else
dep
end
end
push!(builds, [name, version, sources, script, platforms, products, dependencies])
end

# don't allow `build_tarballs` to override platform selection based on ARGS.
# we handle that ourselves by calling `should_build_platform`
non_platform_ARGS = filter(arg -> startswith(arg, "--"), ARGS)

# `--register` should only be passed to the latest `build_tarballs` invocation
non_reg_ARGS = filter(arg -> arg != "--register", non_platform_ARGS)

for (i, build) in enumerate(builds)
build_tarballs(i == lastindex(builds) ? non_platform_ARGS : non_reg_ARGS,
build...;
skip_audit=true, dont_dlopen=true, julia_compat="1.10",
augment_platform_block)
end
5 changes: 5 additions & 0 deletions L/LLVM/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,11 @@ function configure_extraction(ARGS, LLVM_full_version, name, libLLVM_version=not
script = lldscript
products = [
ExecutableProduct("lld", :lld, "tools"),
ExecutableProduct("ld.lld", :ld_lld, "tools"), # Unix
ExecutableProduct("ld64.lld", :ld64_lld, "tools"), # macOS
ExecutableProduct("lld-link", :lld_link, "tools"), # Windows
ExecutableProduct("wasm-ld", :wasm_ld, "tools"), # WebAssembly

ExecutableProduct("dsymutil", :dsymutil, "tools"),
]

Expand Down

0 comments on commit 021985b

Please sign in to comment.