Package LLVM 17 with the installed library search paths
@@ -11,7 +11,7 @@ defpkgbuild(llvm17-dev,
1111 #:arch, [#:x86-64, #:aarch64],
1212 #:license, "Apache-2.0 WITH LLVM-exception",
1313 #:url, "https://llvm.org/",
14- #:depends, ["llvm17-libs=17.0.6-1"],
14+ #:depends, ["llvm17-libs=17.0.6-2"],
1515 #:makedepends, ["linux-headers"],
1616 #:source, if reuse { list() } else { ["llvm-project-17.0.6.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-project-17.0.6.src.tar.xz",
1717 "https://raw.githubusercontent.com/alpinelinux/aports/d556464b9015ef9447ce4ecacad98c956d730bb6/main/llvm17/fix-memory-mf_exec-on-aarch64.patch",
@@ -26,8 +26,11 @@ defpkgbuild(llvm17-dev,
2626 #:prepare, fn() {
2727 if reuse {
2828 ; Use only the tree whose library is the installed runtime from this feed.
29- run("cmp", string-append(build-dir, "/lib/libLLVM-17.so"),
29+ normalized := string-append(srcdir(), "/llvm-runtime-check")
30+ run("env", string-append("DESTDIR=", normalized), "cmake", "--install", build-dir, "--component", "LLVM", "--prefix", "/usr")
31+ run("cmp", string-append(normalized, "/usr/lib/libLLVM-17.so"),
3032 string-append(sdk, "/usr/lib/libLLVM-17.so"))
33+ run("rm", "-r", "--", normalized)
3134 run("test", "-s", string-append(build-dir, "/CMakeCache.txt"))
3235 } else {
3336 ; LLVM's release archive also contains Clang, LLDB and other independent projects.
@@ -49,8 +52,7 @@ defpkgbuild(llvm17-dev,
4952 },
5053 #:package, fn() {
5154 run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "llvm-headers")
52- run("install", "-Dm755", string-append(build-dir, "/bin/llvm-config"),
53- string-append(pkgdir(), "/usr/lib/llvm17/bin/llvm-config"))
55+ run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "llvm-config", "--prefix", "/usr/lib/llvm17")
5456 run("mkdir", "-p", string-append(pkgdir(), "/usr/bin"), string-append(pkgdir(), "/usr/lib/llvm17/lib"))
5557 run("ln", "-s", "../lib/llvm17/bin/llvm-config", string-append(pkgdir(), "/usr/bin/llvm-config-17"))
5658 for-each(fn(soname) {
@@ -1,40 +1,50 @@
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(llvm17-libs,
26 #:pkgname, "llvm17-libs",
37 #:pkgver, "17.0.6",
4- #:pkgrel, 1,
8+ #:pkgrel, 2,
59 #:pkgdesc, "LLVM runtime for the native CPU and AMDGPU (LLVM 17)",
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-17.0.6.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-project-17.0.6.src.tar.xz",
15+ #:source, if reuse { list() } else { ["llvm-project-17.0.6.src.xz::https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-project-17.0.6.src.tar.xz",
1216 "https://raw.githubusercontent.com/alpinelinux/aports/d556464b9015ef9447ce4ecacad98c956d730bb6/main/llvm17/fix-memory-mf_exec-on-aarch64.patch",
1317 "https://raw.githubusercontent.com/alpinelinux/aports/d556464b9015ef9447ce4ecacad98c956d730bb6/main/llvm17/llvm-stack-size.patch",
1418 "rust-feature-tables-17.patch",
15- "https://raw.githubusercontent.com/alpinelinux/aports/d556464b9015ef9447ce4ecacad98c956d730bb6/main/llvm17/0001-Revert-Pseudo-Probe-Make-.pseudo_probe-GC-able.patch"],
16- #:sha256sums, ["58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813",
19+ "https://raw.githubusercontent.com/alpinelinux/aports/d556464b9015ef9447ce4ecacad98c956d730bb6/main/llvm17/0001-Revert-Pseudo-Probe-Make-.pseudo_probe-GC-able.patch"] },
20+ #:sha256sums, if reuse { list() } else { ["58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813",
1721 "0163a3cf492b5d0b91cafc142a6ac4f1333c65bc52e627bbccbf3ad927f8d527",
1822 "3cacabc5c9b540c6240c063f8d9eca64c0f0d955ffec86bafc04d5f9bd986d78",
1923 "8b0d457887e701f264ce4359facaf342f528a36c040cb408be04365127d93e56",
20- "989c86cf3f551afa8959ae976e26721569a744cfce6a75aba886ca50dfa87225"],
24+ "989c86cf3f551afa8959ae976e26721569a744cfce6a75aba886ca50dfa87225"] },
2125 #:prepare, fn() {
22- ; LLVM's release archive also contains Clang, LLDB and other independent projects.
23- run("tar", "-xf", "llvm-project-17.0.6.src.xz", "llvm-project-17.0.6.src/llvm", "llvm-project-17.0.6.src/cmake", "llvm-project-17.0.6.src/third-party")
24- for-each(fn(patch) { run("patch", "--batch", "--fuzz=0", "-d", "llvm-project-17.0.6.src", "-p1", "-i", string-append("../", patch)) },
25- list("fix-memory-mf_exec-on-aarch64.patch", "llvm-stack-size.patch", "rust-feature-tables-17.patch",
26- "0001-Revert-Pseudo-Probe-Make-.pseudo_probe-GC-able.patch"))
26+ if not(reuse) {
27+ ; LLVM's release archive also contains Clang, LLDB and other independent projects.
28+ run("tar", "-xf", "llvm-project-17.0.6.src.xz", "llvm-project-17.0.6.src/llvm", "llvm-project-17.0.6.src/cmake", "llvm-project-17.0.6.src/third-party")
29+ for-each(fn(patch) { run("patch", "--batch", "--fuzz=0", "-d", "llvm-project-17.0.6.src", "-p1", "-i", string-append("../", patch)) },
30+ list("fix-memory-mf_exec-on-aarch64.patch", "llvm-stack-size.patch", "rust-feature-tables-17.patch",
31+ "0001-Revert-Pseudo-Probe-Make-.pseudo_probe-GC-able.patch"))
32+ }
2733 },
2834 #:build, fn() {
29- run("vinix-llvm", "17.0.6", "llvm-project-17.0.6.src/llvm", "build")
30- run("vinix-ninja", "build", "LLVM")
35+ if not(reuse) {
36+ run("vinix-llvm", "17.0.6", "llvm-project-17.0.6.src/llvm", build-dir)
37+ run("vinix-ninja", build-dir, "LLVM")
38+ }
3139 },
3240 #:check, fn() {
33- run("readelf", "-d", "build/lib/libLLVM-17.so")
34- run("test", "-s", "build/lib/libLLVM-17.so")
41+ run("test", "-s", string-append(build-dir, "/lib/libLLVM-17.so"))
3542 },
3643 #:package, fn() {
37- run("install", "-Dm755", "build/lib/libLLVM-17.so", string-append(pkgdir(), "/usr/lib/libLLVM-17.so"))
38- run("ln", "-s", "libLLVM-17.so", string-append(pkgdir(), "/usr/lib/libLLVM-17.0.6.so"))
39- run("install", "-Dm644", "llvm-project-17.0.6.src/llvm/LICENSE.TXT", string-append(pkgdir(), "/usr/share/licenses/llvm17-libs/LICENSE.TXT"))
44+ ; CMake replaces the build-tree RUNPATH while installing the runtime.
45+ run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", build-dir, "--component", "LLVM", "--prefix", "/usr")
46+ run("rm", "-f", "--", string-append(pkgdir(), "/usr/lib/libLLVM.so"))
47+ run("readelf", "-d", string-append(pkgdir(), "/usr/lib/libLLVM-17.so"))
48+ license := string-append(build-dir, "/../llvm-project-17.0.6.src/llvm/LICENSE.TXT")
49+ run("install", "-Dm644", license, string-append(pkgdir(), "/usr/share/licenses/llvm17-libs/LICENSE.TXT"))
4050 })
@@ -49,7 +49,7 @@ 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. 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.
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 17 and 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.
5353
5454The 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`.
5555
@@ -57,6 +57,8 @@ The x86_64 QEMU guest ran the installed `llvm-config-19 --version` and executed
57
158The corresponding client and guest disk are archived in `foundation/archived-x86-llvm19-qemu-roots-01`, receipt SHA-256 `68071f5978f8ecbacced1469e402ef75b8e2485aedf4a086dafcd6fc60ff7ad2`. Extract the checked archive from the worker state directory before replaying the disk receipt check.
259
60+The AArch64 worker packaged `llvm17-libs` 17.0.6-2 and `llvm17-dev` 17.0.6-1 from completed objects. The clean signed development root passed the 16 KiB ELF and ownership audit with ten packages, 3,298 owned paths and 23 target ELFs. See `xorg/llvm/work/arm-dev-reuse-01/17`, receipt SHA-256 `34bc22cabc4b6d42c98e8a736dfee54f5a0e0b70873b5d3218da09834b66e544`.
61+
362The 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.
463
564For those checks, install `vinix-release-x11` and `busybox-init` from the signed feed into a clean root and audit it. Build `egl.v` and `glx.v` against that SDK and place the executables at `/vinix-egl-check` and `/vinix-glx-check` in a disposable guest root. Boot `graphics.sh` using `tests/disk-root.py`. The fixture reads back the expected pixel from current Mesa's surfaceless EGL and again from an authenticated indirect GLX connection to `Xvfb-glx` using the legacy DRI directory.