Package LLVM 19 with the installed library search paths
@@ -11,7 +11,7 @@ defpkgbuild(llvm19-dev,
1111 #:arch, [#:x86-64, #:aarch64],
1212 #:license, "Apache-2.0 WITH LLVM-exception",
1313 #:url, "https://llvm.org/",
14- #:depends, ["llvm19-libs=19.1.4-1"],
14+ #:depends, ["llvm19-libs=19.1.4-2"],
1515 #:makedepends, ["linux-headers"],
1616 #:source, if reuse { list() } else { ["llvm-project-19.1.4.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/llvm-project-19.1.4.src.tar.xz",
1717 "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/llvm19/fix-memory-mf_exec-on-aarch64.patch",
@@ -22,8 +22,11 @@ defpkgbuild(llvm19-dev,
2222 #:prepare, fn() {
2323 if reuse {
2424 ; Use only the tree whose library is the installed runtime from this feed.
25- run("cmp", string-append(build-dir, "/lib/libLLVM.so.19.1"),
25+ normalized := string-append(srcdir(), "/llvm-runtime-check")
26+ run("env", string-append("DESTDIR=", normalized), "cmake", "--install", build-dir, "--component", "LLVM", "--prefix", "/usr")
27+ run("cmp", string-append(normalized, "/usr/lib/libLLVM.so.19.1"),
2628 string-append(sdk, "/usr/lib/libLLVM.so.19.1"))
29+ run("rm", "-r", "--", normalized)
2730 run("test", "-s", string-append(build-dir, "/CMakeCache.txt"))
2831 } else {
2932 ; LLVM's release archive also contains Clang, LLDB and other independent projects.
@@ -44,8 +47,7 @@ defpkgbuild(llvm19-dev,
4447 },
4548 #:package, fn() {
4649 run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "llvm-headers")
47- run("install", "-Dm755", string-append(build-dir, "/bin/llvm-config"),
48- string-append(pkgdir(), "/usr/lib/llvm19/bin/llvm-config"))
50+ run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "llvm-config", "--prefix", "/usr/lib/llvm19")
4951 run("mkdir", "-p", string-append(pkgdir(), "/usr/bin"), string-append(pkgdir(), "/usr/lib/llvm19/lib"))
5052 run("ln", "-s", "../lib/llvm19/bin/llvm-config", string-append(pkgdir(), "/usr/bin/llvm-config-19"))
5153 for-each(fn(soname) {
@@ -1,35 +1,45 @@
1+checkpoint := get-environment-variable("VINIX_LLVM_BUILD")
2+reuse := if string?(checkpoint) { not(string=?("", checkpoint)) } else { #f }
3+build-dir := if reuse { checkpoint } else { "build" }
4+
15defpkgbuild(llvm19-libs,
26 #:pkgname, "llvm19-libs",
37 #:pkgver, "19.1.4",
4- #:pkgrel, 1,
8+ #:pkgrel, 2,
59 #:pkgdesc, "LLVM runtime for the native CPU and AMDGPU (LLVM 19)",
610 #:arch, [#:x86-64, #:aarch64],
711 #:license, "Apache-2.0 WITH LLVM-exception",
812 #:url, "https://llvm.org/",
913 #:depends, ["musl", "gcc-libs", "libffi", "libxml2", "zlib", "zstd"],
1014 #:makedepends, ["linux-headers"],
11- #:source, ["llvm-project-19.1.4.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/llvm-project-19.1.4.src.tar.xz",
15+ #:source, if reuse { list() } else { ["llvm-project-19.1.4.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/llvm-project-19.1.4.src.tar.xz",
1216 "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/llvm19/fix-memory-mf_exec-on-aarch64.patch",
13- "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/llvm19/llvm-stack-size.patch"],
14- #:sha256sums, ["3aa2d2d2c7553164ad5c6f3b932b31816e422635e18620c9349a7da95b98d811",
17+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/llvm19/llvm-stack-size.patch"] },
18+ #:sha256sums, if reuse { list() } else { ["3aa2d2d2c7553164ad5c6f3b932b31816e422635e18620c9349a7da95b98d811",
1519 "0163a3cf492b5d0b91cafc142a6ac4f1333c65bc52e627bbccbf3ad927f8d527",
16- "3cacabc5c9b540c6240c063f8d9eca64c0f0d955ffec86bafc04d5f9bd986d78"],
20+ "3cacabc5c9b540c6240c063f8d9eca64c0f0d955ffec86bafc04d5f9bd986d78"] },
1721 #:prepare, fn() {
18- ; LLVM's release archive also contains Clang, LLDB and other independent projects.
19- run("tar", "-xf", "llvm-project-19.1.4.src.xz", "llvm-project-19.1.4.src/llvm", "llvm-project-19.1.4.src/cmake", "llvm-project-19.1.4.src/third-party")
20- for-each(fn(patch) { run("patch", "--batch", "--fuzz=0", "-d", "llvm-project-19.1.4.src", "-p1", "-i", string-append("../", patch)) },
21- list("fix-memory-mf_exec-on-aarch64.patch", "llvm-stack-size.patch"))
22+ if not(reuse) {
23+ ; LLVM's release archive also contains Clang, LLDB and other independent projects.
24+ run("tar", "-xf", "llvm-project-19.1.4.src.xz", "llvm-project-19.1.4.src/llvm", "llvm-project-19.1.4.src/cmake", "llvm-project-19.1.4.src/third-party")
25+ for-each(fn(patch) { run("patch", "--batch", "--fuzz=0", "-d", "llvm-project-19.1.4.src", "-p1", "-i", string-append("../", patch)) },
26+ list("fix-memory-mf_exec-on-aarch64.patch", "llvm-stack-size.patch"))
27+ }
2228 },
2329 #:build, fn() {
24- run("vinix-llvm", "19.1.4", "llvm-project-19.1.4.src/llvm", "build")
25- run("vinix-ninja", "build", "LLVM")
30+ if not(reuse) {
31+ run("vinix-llvm", "19.1.4", "llvm-project-19.1.4.src/llvm", build-dir)
32+ run("vinix-ninja", build-dir, "LLVM")
33+ }
2634 },
2735 #:check, fn() {
28- run("readelf", "-d", "build/lib/libLLVM.so.19.1")
29- run("test", "-s", "build/lib/libLLVM.so.19.1")
36+ run("test", "-s", string-append(build-dir, "/lib/libLLVM.so.19.1"))
3037 },
3138 #:package, fn() {
32- run("install", "-Dm755", "build/lib/libLLVM.so.19.1", string-append(pkgdir(), "/usr/lib/libLLVM.so.19.1"))
33- run("ln", "-s", "libLLVM.so.19.1", string-append(pkgdir(), "/usr/lib/libLLVM-19.so"))
34- run("install", "-Dm644", "llvm-project-19.1.4.src/llvm/LICENSE.TXT", string-append(pkgdir(), "/usr/share/licenses/llvm19-libs/LICENSE.TXT"))
39+ ; CMake replaces the build-tree RUNPATH while installing the runtime.
40+ run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "LLVM", "--prefix", "/usr")
41+ run("rm", "-f", "--", string-append(pkgdir(), "/usr/lib/libLLVM.so"))
42+ run("readelf", "-d", string-append(pkgdir(), "/usr/lib/libLLVM.so.19.1"))
43+ license := string-append(build-dir, "/../llvm-project-19.1.4.src/llvm/LICENSE.TXT")
44+ run("install", "-Dm644", license, string-append(pkgdir(), "/usr/share/licenses/llvm19-libs/LICENSE.TXT"))
3545 })
@@ -49,7 +49,9 @@ On AArch64, libelf 0.191-2 built from elfutils and installed with its signed lib
4949
5050The cold AArch64 LLVM build SDK installed eight signed packages, including GCC's shared runtime, libffi, libxml2, XZ, zlib and Zstd. The worker counted 1,413 owned files and links and 21 target ELFs. The host tools verified CMake 3.28.3 from the pinned Ubuntu archive and the matching 17.0.6 and 19.1.4 TableGen programs in the private build environment. The SDK and host-tool receipts are under `xorg/llvm/arm-runtime-sdk-01` and `xorg/llvm/arm-host-tools-01`, manifest SHA-256 `85a0d963c61842d6696c92bd488f3a7b52f5b8441f172a4ff0ced50ca27a32e9` and `f8d1d5aaafbde5b748e8fa7c9888dbe9761ead42001b89d477120b24ecbbe283`.
5151
52-Keep the completed LLVM runtime build tree until its development archive is packaged. Install the signed runtime in the development SDK and set `VINIX_LLVM_BUILD` to the runtime's CMake build directory inside the same worker environment. The recipe compares the built shared object to the installed runtime and asks Ninja for the headers and `llvm-config` using the existing objects. With the variable unset, the source recipe builds those targets independently. Both recipe fixtures reused a configured tree, packaged headers and a versioned `llvm-config`, and rejected a different runtime file. See `xorg/llvm/reuse-dev-fixture-02`, receipt SHA-256 `8123239e3d4ac7ed770df0f1be8d03bf9e214029e22596438a5b3f105033e9b6`. The release builds and LLVM guest checks are separate gates.
52+Keep the completed LLVM runtime build tree until its development archive is packaged. To package from that tree, set `VINIX_LLVM_BUILD` to its CMake build directory inside the original worker environment. The LLVM 19 recipes use CMake's install components so the packaged library and `llvm-config` have the installed search path. The development recipe compares the CMake-installed library to the signed runtime in its SDK before Ninja builds the remaining `llvm-config` target and headers. With the variable unset, the recipes configure and build their own targets.
53+
54+The x86_64 worker packaged `llvm19-libs` 19.1.4-2 and `llvm19-dev` 19.1.4-1 from the completed source tree. The clean, signed runtime install passed the ELF and ownership audit. Adding the signed development archive in a second clean root brought the totals to ten packages, 3,450 owned paths and 23 target ELFs. See `xorg/llvm/work/runtime19-01/dev-reuse-01`, receipt SHA-256 `03e0efcaf18a9b2226c75e76a6a29089cc1d45965daabc96a64b6d7c9f00994d`.
5355
5456The Mesa 24.2.8 recipe compiles Gallium once and uses one Meson installation to produce `mesa` and `mesa-gallium-sdk`. EGL, GLES and GBM stay in the runtime archive. The SDK archive carries OSMesa and XA for builds that request them. Both architecture plans resolve the split outputs to the same recipe, and the install fixture confirmed that the two outputs own disjoint paths. See `foundation/release-split-plan-01`, receipt SHA-256 `124659b0ae78559071f072e3845c4c5903da1b2f9a0b523931e422b21ac3b585`. The real Mesa binaries still need the LLVM dependencies and their guest graphics checks.
5557