Skip to content

Commit

Permalink
Add LLVM18 Bootstrap (#9415)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Krimmer <[email protected]>
  • Loading branch information
jkrimmer and Jonas Krimmer authored Sep 25, 2024
1 parent de30be6 commit 2324c29
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 0_RootFS/LLVMBootstrap@18/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Include everything common between our LLVM versions (That's a lot)
include("../llvm_common.jl")

# Build the tarballs, then upload to Yggdrasil releases

name = "LLVMBootstrap"
version = v"18.1.7"
sources, script, products, dependencies = llvm_build_args(;version=version)
ndARGS, deploy_target = find_deploy_arg(ARGS)
# Earlier versions of GCC can cause Clang to fail with `error: unknown target CPU 'x86-64'`
# https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/112#issuecomment-776940748
build_info = build_tarballs(ndARGS, name, version, sources, script, [host_platform], products, dependencies;
skip_audit=true, preferred_gcc_version=v"8")
if deploy_target !== nothing
upload_and_insert_shards(deploy_target, name, version, build_info)
end
31 changes: 31 additions & 0 deletions 0_RootFS/LLVMBootstrap@18/bundled/patches/install-prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
starting from llvm14 the install prefix breaks via symlinks;
/usr/lib/llvm14/lib/cmake/llvm/LLVMConfig.cmake goes up 3 directories to find
/usr/lib/llvm14/include as LLVM_INCLUDE_DIRS, but to even use this cmake folder
at all it has to be symlinked to /usr/lib/cmake/llvm .. so the directory it
instead uses is just /usr/include, which is not where the cmake includes are.
this hardcodes them to the install prefix we pass via cmake, which should
always be correct, and what cmake tries to autodetect anyway.

also see: https://reviews.llvm.org/D29969

this is supposedly fixed now, but for some reason it still isn't
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -41,6 +41,8 @@
#

set(LLVM_CONFIG_CODE "
+# this is wrong when automatically detected
+set(LLVM_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")
# LLVM_BUILD_* values available only from LLVM build tree.
set(LLVM_BUILD_BINARY_DIR \"${LLVM_BINARY_DIR}\")
set(LLVM_BUILD_LIBRARY_DIR \"${LLVM_LIBRARY_DIR}\")
@@ -109,8 +111,6 @@
#
# Generate LLVMConfig.cmake for the install tree.
#
-
-find_prefix_from_config(LLVM_CONFIG_CODE LLVM_INSTALL_PREFIX "${LLVM_INSTALL_PACKAGE_DIR}")

extend_path(LLVM_CONFIG_MAIN_INCLUDE_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_INCLUDEDIR}")
# This is the same as the above because the handwritten and generated headers
1 change: 1 addition & 0 deletions 0_RootFS/llvm_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ llvm_tags = Dict(
v"15.0.7" => "8dfdcc7b7bf66834a761bd8de445840ef68e4d1a",
v"16.0.6" => "7cbf1a2591520c2491aa35339f227775f4d3adf6",
v"17.0.6" => "6009708b4367171ccdbf4b5905cb6a803753fe18",
v"18.1.7" => "768118d1ad38bf13c545828f67bd6b474d61fc55",
)

function llvm_sources(;version = "v8.0.1", kwargs...)
Expand Down

0 comments on commit 2324c29

Please sign in to comment.