diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43c5781..77a7977 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,3 +130,51 @@ jobs: n=$((n+1)) done [ "$n" = "2" ] || { echo "::error::built $n rows, expected 2"; exit 1; } + + # THE OK-IMAGE ROWS (`-openkal`, openkal SPEC clause 12), with the + # mcpp that has the target until it is released. The 128-bit routines are + # in the AArch64 archive (a `long double` is 128 bits there) and the 80-bit + # complex multiply in the x86_64 one, each read back from the archive. + openkal: + name: builds for the ok-image rows + runs-on: ubuntu-24.04 + timeout-minutes: 60 + env: + MCPP_SOURCE_REF: release/2026.10.26.2 + XLINGS_VERSION: v2026.10.26.1 + XLINGS_NON_INTERACTIVE: '1' + steps: + - uses: actions/checkout@v4 + - name: Install xlings + run: | + curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \ + https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ + | bash -s "$XLINGS_VERSION" + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + - name: The mcpp that has the target + run: | + xlings update > /dev/null 2>&1 || true + xlings install mcpp -y -g + mcpp self config --mirror GLOBAL + src="$RUNNER_TEMP/mcpp-src" + git clone --quiet --depth 1 --branch "$MCPP_SOURCE_REF" https://github.com/mcpp-community/mcpp.git "$src" + rm -f "$src/.xlings.json" + ( cd "$src" && mcpp build --release ) + built=$(find "$src/target" -type f -name mcpp | head -1) + [ -n "$built" ] || { echo "::error::mcpp did not build"; exit 1; } + echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH" + - name: Both rows build and define their wide routines + run: | + set -euo pipefail + for pair in "x86_64-openkal:__mulxc3" "aarch64-openkal:__multf3"; do + t="${pair%%:*}"; sym="${pair#*:}" + rm -rf target + mcpp build --target "$t" || { echo "::error::$t does not build"; exit 1; } + lib=$(find target/"$t" -name 'libcompiler-rt-builtins.a' | head -1) + [ -n "$lib" ] || { echo "::error::$t produced no archive"; exit 1; } + symbols=$(llvm-nm "$lib" 2>/dev/null || nm "$lib") + grep -q " T $sym\$" <<<"$symbols" || { echo "::error::$t archive lacks $sym"; exit 1; } + dups=$(grep ' T ' <<<"$symbols" | awk '{print $NF}' | sort | uniq -d) + [ -z "$dups" ] || { echo "::error::$t archive defines a symbol twice:"; echo "$dups"; exit 1; } + echo " ok $t ($sym)" + done diff --git a/README.md b/README.md index 5616431..e1775aa 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,13 @@ llvm.libcxx = "22.1.8.1" mcpp reports `compiler-runtime compiler-rt (compiler-rt-builtins@22.1.8.5, graph)` on those rows, and prints a degradation naming this package when the payload has no archive for the platform and the graph declares none. + +## The ok-image rows (22.1.8.6) + +For `x86_64-openkal` and `aarch64-openkal` (openkal SPEC clause 12) the +package also builds the 128-bit routines, and on x86_64 the 80-bit ones: an ok +image carries its own C library (openkal-musl), whose `printf` reaches the +128-bit `long double` routines on AArch64. Every other row builds exactly the +set it built before; the exclusions moved from the base set into a +`cfg(not(os = "openkal"))` block, because a negative glob applies to the merged +set and a positive in a later block could not have re-added a file. diff --git a/mcpp.toml b/mcpp.toml index b99f493..f72c027 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -75,7 +75,7 @@ name = "compiler-rt-builtins" # mirrored, carrying different bytes. A version that has been published must # never come to mean something else, so the packaging revision is what moves. # A consumer writes `22.1.8.2` in full: a bare requirement in mcpp is an exact pin. -version = "22.1.8.5" +version = "22.1.8.6" description = "The compiler-rt builtins as a source package: LLVM's replacement for libgcc — the routines a compiler emits calls to — compiled with the consuming program's own flags" # The effective grant, which is what an SBOM consumer needs. 342 of the 347 # vendored files carry this identifier in an SPDX header; `LICENSE.compiler-rt` @@ -110,7 +110,6 @@ sources = [ # thumbv7m-none-eabi` compiled 770 objects and not one from `builtins/arm`, # and the link failed on `__aeabi_uldivmod`. - "!builtins/addtf3.c", "!builtins/atomic.c", "!builtins/atomic_flag_clear.c", "!builtins/atomic_flag_clear_explicit.c", @@ -118,15 +117,34 @@ sources = [ "!builtins/atomic_flag_test_and_set_explicit.c", "!builtins/atomic_signal_fence.c", "!builtins/atomic_thread_fence.c", - "!builtins/comparetf2.c", "!builtins/crtbegin.c", "!builtins/crtend.c", - "!builtins/divtc3.c", - "!builtins/divtf3.c", - "!builtins/divxc3.c", "!builtins/emutls.c", "!builtins/enable_execute_stack.c", "!builtins/eprintf.c", +] + +# ── The 128-bit and 80-bit routines, by target ─────────────────── +# +# Every row before 22.1.8.6 excluded them, and still does, through the block +# below: ARM has neither format, and the bare-metal rows' C library does not +# reach them. The rows that do are the ok images (`-openkal`, openkal SPEC +# clause 12), whose C library is built from source inside the image: on +# AArch64 a `long double` is 128 bits and `printf' formats it through +# `__extenddftf2', `__multf3' and their relatives --- measured, an image over +# openkal-musl was refused by `okld check` for importing six of them --- and +# on x86_64 it is 80 bits, whose complex arithmetic is `__mulxc3'. +# +# A NEGATIVE GLOB IS APPLIED TO THE MERGED SET (see `[build]` above), so the +# exclusions moved out of the base set into a block that every other target +# matches; a positive in an openkal block could not have re-added them. +[target.'cfg(not(os = "openkal"))'.build] +sources = [ + "!builtins/addtf3.c", + "!builtins/comparetf2.c", + "!builtins/divtc3.c", + "!builtins/divtf3.c", + "!builtins/divxc3.c", "!builtins/extendbfsf2.c", "!builtins/extenddftf2.c", "!builtins/extendhftf2.c", @@ -171,6 +189,28 @@ sources = [ "!builtins/truncxfhf2.c", ] +# AArch64 has no 80-bit format: the 128-bit routines stay, the 80-bit ones go. +[target.'cfg(all(os = "openkal", arch = "aarch64"))'.build] +sources = [ + "!builtins/divxc3.c", + "!builtins/extendhfxf2.c", + "!builtins/extendxftf2.c", + "!builtins/fixunsxfdi.c", + "!builtins/fixunsxfsi.c", + "!builtins/fixunsxfti.c", + "!builtins/fixxfdi.c", + "!builtins/fixxfti.c", + "!builtins/floatdixf.c", + "!builtins/floattixf.c", + "!builtins/floatundixf.c", + "!builtins/floatuntixf.c", + "!builtins/mulxc3.c", + "!builtins/powixf2.c", + "!builtins/trunctfxf2.c", + "!builtins/truncxfbf2.c", + "!builtins/truncxfhf2.c", +] + # ── The machine half ──────────────────────────────────────────── # # ONE LIST FOR ALL SEVEN, AND IT IS THE v6-M ONE — THE INTERSECTION, NOT