me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Restore the published AArch64 MPFR decimal ABI

diviocity committed 5 days ago · bb00972beea3b3059bfdc8b3403b23a379e0aa63 View patch
Unverified signature 3 files changed +30 -4
BOOTSTRAP.md +2 -0

@@ -42,6 +42,8 @@ The released arm64 kernel uses 16 KiB pages. For every nonempty ELF load segment

4242

4343The initial arm64 survey covered 22 distinct archive names. Thirteen contained an incompatible load segment, affecting 28 of 53 packaged executables and shared objects. BusyBox 1.38.0-4 and both initial musl releases were affected. The Linux UAPI and fortify headers contained no executable or shared object. Earlier arm64 installation and ownership receipts predate this kernel check. The worker stores the source archive hashes and segment offsets in `arm/abi16/previous-02`, receipt SHA-256 `676679a285a3ccd67bbd85ea2415fbc46e0e79b4f6bfc9bb5e9a12c310bd54f6`. The wrong-machine, historical BusyBox, header-only and x86_64 musl controls are in `arm/abi16/archive-controls-01`, receipt SHA-256 `cc8e171dc5febc3ec75a7a3c30a008c9e49bd7bbc8e9d7ace465c576dee762e1`.

4444

45+MPFR needs a cross-compiler with BID decimal support. On aarch64 the worker used the pinned Ubuntu GCC 14.2 cross-compiler as a build tool, Vinix musl headers and a static decimal support archive built from the GCC source used for the Vinix runtime. The compiler inputs and probe are recorded in `gnu/arm/decimal-compiler/receipts.sha256`. The signed MPFR 4.2.1-5 has SHA-256 `e44e82b8761f1bc286c48778be25d227d3081e116f19c68752815f683fabbf82` and retains all 697 published exports. Reproduce the check with `mpfr/decimal.c` and `mpfr/thread-state.c` linked against the signed SDK. The released kernel ran both fixtures and round-tripped decimal64 and decimal128 while keeping two threads' floating-point state separate. See `gnu/arm/logs/mpfr-decimal-131/receipts.sha256` and `gnu/arm/logs/numeric-decimal-guest-132/serial.log`, SHA-256 `4f5302374bc2f94137fd31ad6c3015fd95fe0282b6f87e7141d06a17edbb5820` and `0a16a54024c57e6751d814eb6f7ab9122aadd4322f145ca1409139dace70c894`.

46+

4547The desktop metapackage requires musl 1.2.6-4 or later on arm64 and 1.2.6-2 or later on x86_64. The test-signed ARM 1.2.6-3 loader itself had 16 KiB load segments. Its GCC specs let the cross toolchain override that setting for a newly linked shared library. The expected ARM minimum excludes this SDK. The worker checked the architecture-specific version constraints with native vpac metadata in `foundation/release-musl-floor-02`, receipt SHA-256 `2d6886c3bc9fdc7ef38945d303c92cb3b877eba9d67c2fa25b49f46d73019e8a`.

4648

4749Run `python3 tests/exec-linkage.py x86_64 "$client" "$auditor" --proot "$(command -v proot)"` on an x86_64 worker to exercise the installed loader against each dynamic executable in an audited root. For a Vinix guest, use `--fixture "$work/linkage.sh"` and pass that script to the boot harness. Packaged musl 1.2.6 applies relocations before returning from `--list`. It resolved all 109 dynamic executables in the signed 106-package x86_64 root. Renaming the exported `OPENSSL_init_ssl` symbol in an isolated copy of libssl caused the loader to reject `/usr/bin/openssl` with status 127. See `foundation/exec-linkage-01`, receipt SHA-256 `cb2fdec09f4b9e7c873ec82d672af576e9e0c26484f9496744588323a01ed3a0`.

mpfr/PKGBUILD.vile +7 -4

@@ -5,22 +5,25 @@ libc := if arm { "musl>=1.2.6-4" } else { "musl" }

55defpkgbuild(mpfr,

66 #:pkgname, "mpfr",

77 #:pkgver, "4.2.1",

8- #:pkgrel, if arm { 4 } else { 3 },

8+ #:pkgrel, if arm { 5 } else { 3 },

99 #:pkgdesc, "Multiple precision floating-point arithmetic with correct rounding",

1010 #:arch, [#:x86-64, #:aarch64],

1111 #:url, "https://www.mpfr.org/",

1212 #:license, "LGPL-3.0-or-later",

1313 #:depends, list(libc, if arm { "gmp>=6.3.0-3" } else { "gmp" }),

14- #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpfr-4.2.1.tar.xz", "thread-state.c"],

15- #:sha256sums, ["277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2", "2950b3f63b5596ce23f83edbee76ef80d3266aa936ff88dc7fab5d97b6ce8acd"],

14+ #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpfr-4.2.1.tar.xz", "thread-state.c", "decimal.c"],

15+ #:sha256sums, ["277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2", "2950b3f63b5596ce23f83edbee76ef80d3266aa936ff88dc7fab5d97b6ce8acd",

16+ "c43b2b4185f324d67351e2e15a9ee97beb2ba27b30d1543b9ab2e5e4286a3396"],

1617 #:build, fn() {

1718 run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpfr-4.2.1/configure",

18- "--enable-shared", "--enable-static", "--enable-thread-safe")

19+ "--enable-shared", "--enable-static", "--enable-thread-safe", "--enable-decimal-float=bid")

1920 run("make")

2021 },

2122 #:check, fn() {

2223 run("vinix-cc", "-std=gnu17", "-pthread", "-Impfr-4.2.1/src", "thread-state.c", "-Lsrc/.libs", "-lmpfr", "-lgmp", "-o", "thread-state")

2324 run("vinix-run", "--library-path", "src/.libs", "./thread-state")

25+ run("vinix-cc", "-std=gnu17", "-Impfr-4.2.1/src", "decimal.c", "-Lsrc/.libs", "-lmpfr", "-lgmp", "-o", "decimal")

26+ run("vinix-run", "--library-path", "src/.libs", "./decimal")

2427 },

2528 #:package, fn() {

2629 run("make", string-append("DESTDIR=", pkgdir()), "install")

mpfr/decimal.c new file +21 -0

@@ -0,0 +1,21 @@

1+#define MPFR_WANT_DECIMAL_FLOATS

2+#include <mpfr.h>

3+#include <stdio.h>

4+

5+int main(void)

6+{

7+ volatile _Decimal64 input64 = 1234567890123456.dd;

8+ volatile _Decimal128 input128 = 1234567890123456789012345678901234.dl;

9+ mpfr_t number;

10+ mpfr_init2(number, 160);

11+ int valid = mpfr_buildopt_decimal_p()

12+ && mpfr_set_decimal64(number, input64, MPFR_RNDN) == 0

13+ && mpfr_get_decimal64(number, MPFR_RNDN) == input64

14+ && mpfr_set_decimal128(number, input128, MPFR_RNDN) == 0

15+ && mpfr_get_decimal128(number, MPFR_RNDN) == input128;

16+ mpfr_clear(number);

17+ if (!valid)

18+ return 1;

19+ puts("MPFR round-tripped C decimal64 and decimal128");

20+ return 0;

21+}