Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVMCompilerRT] Build for more platforms #7877

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions L/LLVMCompilerRT/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
using BinaryBuilder, Pkg

name = "LLVMCompilerRT"
version = v"16.0.6"
Expand All @@ -14,6 +14,9 @@ sources = [
"https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/cmake-$(version).src.tar.xz",
"39d342a4161095d2f28fb1253e4585978ac50521117da666e2b1f6f28b62f514"
),
ArchiveSource(
"https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.14.sdk.tar.xz",
"0f03869f72df8705b832910517b47dd5b79eb4e160512602f593ed243b28715f"),
DirectorySource("./bundled"),
]

Expand Down Expand Up @@ -51,13 +54,18 @@ else
fi
EOF

# Building this needs a newer SDK
apple_sdk_root=$WORKSPACE/srcdir/MacOSX10.14.sdk
sed -i "s!/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root!$apple_sdk_root!" $CMAKE_TARGET_TOOLCHAIN

# We use could use `${MACOSX_DEPLOYMENT_TARGET}` to specify the SDK version, but it's
# set to 10.10 on x86_64, but compiler-rt requires at least 10.12 and we actually use
# 10.12. On aarch64 it's 11.0, but the CMake script doesn't seem to like values greater
# than 10, so let's just use 10.12 everywhere.
FLAGS+=(
-DDARWIN_macosx_OVERRIDE_SDK_VERSION:STRING=10.12
-DDARWIN_macosx_CACHED_SYSROOT=/opt/${target}/${target}/sys-root
-DCMAKE_SYSROOT=$apple_sdk_root -DCMAKE_FRAMEWORK_PATH=$apple_sdk_root/System/Library/Frameworks
)
fi

Expand All @@ -83,14 +91,17 @@ platforms = supported_platforms()
# some packages on aarch64-apple-darwin, so there is little need to spend time on getting
# this to build for _all_ platforms. The long-term plan is to have these libraries as part
# of LLVMBootstrap: https://github.com/JuliaPackaging/Yggdrasil/pull/1681
filter!(p -> arch(p) == "aarch64" && Sys.isapple(p), platforms)
filter!(p -> arch(p) != "powerpc64le" && !(BinaryBuilder.proc_family(p) == "intel" && libc(p) == "musl"), platforms)

# The products that we will ensure are always built
products = LibraryProduct[
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
dependencies = [
Dependency("XML2_jll"),
Dependency("Zlib_jll"),
BuildDependency(PackageSpec(name="LLVM_full_jll"; version)),
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down