From 707ae683fe9e1307938e2c9892288fbc3bb90aeb Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 17:09:58 +0100 Subject: [PATCH] Package elfutils against the Vinix GCC SDK --- BOOTSTRAP.md | 4 ++- elfutils/PKGBUILD.vile | 58 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 elfutils/PKGBUILD.vile diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index 8197e03..77c515c 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -68,7 +68,9 @@ The packaged musl loader relocated all 150 dynamically linked position-independe The same client's file ownership and exported-symbol comparison against the published initramfs is in `foundation/release-roots-audit-cold-01/x86_64`, receipt SHA-256 `53c9dada6393e3608bd24bfed1f27d194271861f747b023a734ed121f2681e9b`. The comparison found full export coverage at 60 library paths, export differences at eight, and one absent provider for Alpine's `libapk`. -Image assembly verified the packaged trust certificate against the independent test pin and embedded all 70 signed seed packages and the installed vpac database. The staged x86_64 image root is in `foundation/desktop-release-x86-01/install/image/root`, receipt SHA-256 `0859ea6deef81ff172662ac0a671a06c6829a46fc754de459b4025655df1cdb3`. +Image assembly verified the packaged trust certificate against the independent test pin and embedded all 70 signed seed packages and the installed vpac database. The staged x86_64 image root was at `foundation/desktop-release-x86-01/install/image/root`, receipt SHA-256 `0859ea6deef81ff172662ac0a671a06c6829a46fc754de459b4025655df1cdb3`. Restore it, the clean client and the boot fixture tree with `tar --zstd --acls --xattrs -xf foundation/archived-cold-desktop-roots-01/cold-desktop-roots.tar.zst` from the worker's project directory. The archive was compared against the original trees before recycling their disk space. Its receipt SHA-256 is `6a3fcf6a881be02a45ebeaf3da4fb7e524ec9637267f4379aaf2655b66352855`. + +The x86_64 `elfutils` port builds the ELF and DWARF tools with the C++ headers and unwind support from the signed Vinix GCC SDK. A C++ exception probe linked and ran against the SDK's shared runtime before the full build. A fresh install audited ten signed packages, 442 owned files and links, and 42 target ELFs. `elfutils` owns `eu-readelf`, which read its own ELF header, and the separate `libelf` package owns the shared library. See `foundation/elfutils-release-x86_64-03`, receipt SHA-256 `e7a50f31ef41f345a5d1e16c17da3eba7fa730a9852d2508ad9968d840099be4`. The worker resolved all 81 packages in `foundation/xlib-combined-01/repo` into seven stages. For example, BusyBox follows musl and Linux headers, Xlib follows XCB and Xtrans, and the bitmap fonts follow mkfontscale. The order is in `foundation/xlib-order-01/order.tsv` with SHA-256 `51d1464a0a994328c40264105f8b95b7b22a8922cad177daef98e593d4a6930c`. The first signed ARM feed puts both musl and Linux headers in stage zero. Its signed, installed root passed the ownership and ELF audit for 1,165 files and links, including six target ELFs. The worker keeps that receipt in `arm/common/sdk-01-audit.log` with SHA-256 `b315f8d20f2d4c7737fd2e5078c33e12b6183d2ee86a22a9ba6db6852d68c59b`. diff --git a/elfutils/PKGBUILD.vile b/elfutils/PKGBUILD.vile new file mode 100644 index 0000000..c3dfe87 --- /dev/null +++ b/elfutils/PKGBUILD.vile @@ -0,0 +1,58 @@ +defpkgbuild(elfutils, + #:pkgname, "elfutils", + #:pkgver, "0.191", + #:pkgrel, 1, + #:pkgdesc, "ELF and DWARF libraries and utilities", + #:arch, [#:x86-64, #:aarch64], + #:url, "https://sourceware.org/elfutils/", + #:license, "GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later)", + #:depends, ["libelf=0.191-2", "gcc-libs", "musl", "musl-fts", "musl-obstack", "zlib", "xz", "zstd", "bzip2"], + #:makedepends, ["gcc", "argp-standalone", "bsd-compat-headers", "linux-headers", "musl-legacy-error"], + #:provides, ["libdw=0.191", "libasm=0.191"], + #:source, ["https://sourceware.org/elfutils/ftp/0.191/elfutils-0.191.tar.bz2", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/elfutils/fix-aarch64_fregs.patch", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/elfutils/fix-uninitialized.patch", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/elfutils/musl-macros.patch", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/elfutils/musl-asm-ptrace-h.patch"], + #:sha256sums, ["df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871", + "a5b131c65927da751aae47a476f26e59ce53300777d54aef6c65c1eceef1a12d", + "ee94f9ab26049f8100db1b6bfc760454f5a220190a5eb907faee65129ec9e962", + "8e3924f08d4af34a45d0059224ea42b7afdc43837d053243e855cdaf295dde67", + "f03d703dc76002413f4cd04e82c1da79365885df65fbd4eb660f1de42ee41ba9"], + #:prepare, fn() { + for-each(fn(file) { + run("patch", "--batch", "-d", "elfutils-0.191", "-p1", "-i", string-append("../", file)) + }, list("fix-aarch64_fregs.patch", "fix-uninitialized.patch", "musl-macros.patch", "musl-asm-ptrace-h.patch")) + }, + #:build, fn() { + root := get-environment-variable("VPAC_MAKEPKG_ROOT") + selected := get-environment-variable("VPAC_TARGET_ARCH") + arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } + headers := string-append(root, "/usr/include/c++/14.2.0") + arch-headers := string-append(headers, "/", arch, "-linux-musl") + compiler-support := string-append(root, "/usr/lib/gcc/", arch, "-linux-musl/14.2.0/") + run("test", "-f", string-append(arch-headers, "/bits/c++config.h")) + run("test", "-f", string-append(compiler-support, "libgcc_eh.a")) + ; The musl compatibility headers deliberately warn when used. + ; Use the SDK's C++ runtime and unwind tables with the bootstrap driver. + run("env", "CFLAGS=-O2 -D_GNU_SOURCE -Wno-error -Wno-null-dereference", + string-append("CXXFLAGS=-O2 -D_GNU_SOURCE -Wno-error -B", compiler-support, + " -nostdinc++ -isystem ", headers, " -isystem ", arch-headers), + string-append("LDFLAGS=-L", root, "/usr/lib -Wl,--eh-frame-hdr,--no-as-needed,", + root, "/usr/lib/libgcc_s.so.1,--as-needed"), "vinix-configure", "elfutils-0.191/configure", + "--program-prefix=eu-", "--enable-deterministic-archives", + "--disable-nls", "--disable-libdebuginfod", "--disable-debuginfod", "--with-zstd") + run("make") + }, + #:check, fn() { + run("vinix-run", "--library-path", "libelf:libdw:libasm", "src/readelf", "-h", "src/readelf") + run("vinix-run", "--library-path", "libelf:libdw:libasm", "src/readelf", "-V", "libelf/libelf.so") + }, + #:package, fn() { + run("make", "install", string-append("DESTDIR=", pkgdir())) + run("make", "-C", "libelf", "uninstall", string-append("DESTDIR=", pkgdir())) + run("rm", "-f", string-append(pkgdir(), "/usr/lib/pkgconfig/libelf.pc")) + for-each(fn(file) { + run("install", "-Dm644", string-append("elfutils-0.191/", file), string-append(pkgdir(), "/usr/share/licenses/elfutils/", file)) + }, list("COPYING", "COPYING-GPLV2", "COPYING-LGPLV3")) + }) -- 2.56.1