diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ad2b1d..ad676c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,8 +114,14 @@ jobs: # closes its input early turns nm's SIGPIPE into a failed pipeline, # and the step reports a symbol as missing while printing it. symbols=$(nm "$lib") - grep -q ' T ___isPlatformVersionAtLeast' <<<"$symbols" \ - || { echo "::error::$t archive lacks ___isPlatformVersionAtLeast"; grep -i platform <<<"$symbols" || true; exit 1; } + # The availability routine, and the five generic routines the + # M-profile rows supersede with assembly (`comparesf2.c` defines `__ltsf2` + # and its siblings, not a `__comparesf2`), which this package's own + # objects call and which a build (no link) cannot miss on its own. + for sym in ___isPlatformVersionAtLeast ___addsf3 ___ltsf2 ___divsi3 ___mulsf3 ___udivsi3; do + grep -q " T $sym\$" <<<"$symbols" \ + || { echo "::error::$t archive lacks $sym"; grep -iE "platform|sf3|si3|sf2" <<<"$symbols" || true; exit 1; } + done echo " ok $t" n=$((n+1)) done diff --git a/README.md b/README.md index 9483637..5869ca2 100644 --- a/README.md +++ b/README.md @@ -63,16 +63,16 @@ The official LLVM macOS payload builds `libclang_rt.osx.a` and no `ios` or archive only when the file exists. A program that reaches an availability check (`__builtin_available`, or a system header that uses it) then fails at link with `__isPlatformVersionAtLeast` undefined, and nothing said so earlier. The -routine is in `os_version_check.c`, a Darwin translation unit. From 22.1.8.3 this +routine is in `os_version_check.c`, a Darwin translation unit. From 22.1.8.4 this package carries upstream's Darwin selection under `cfg(os = "ios")`, and an iOS application declares it beside its C++ standard library package: ```toml [target.'cfg(os = "ios")'.dependencies] -llvm.compiler-rt-builtins = "22.1.8.3" +llvm.compiler-rt-builtins = "22.1.8.4" llvm.libcxx = "22.1.8.1" ``` -mcpp reports `compiler-runtime compiler-rt (compiler-rt-builtins@22.1.8.3, graph)` +mcpp reports `compiler-runtime compiler-rt (compiler-rt-builtins@22.1.8.4, 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. diff --git a/mcpp.toml b/mcpp.toml index a8db7aa..b086180 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.3" +version = "22.1.8.4" 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/addsf3.c", "!builtins/addtf3.c", "!builtins/atomic.c", "!builtins/atomic_flag_clear.c", @@ -119,11 +118,9 @@ sources = [ "!builtins/atomic_flag_test_and_set_explicit.c", "!builtins/atomic_signal_fence.c", "!builtins/atomic_thread_fence.c", - "!builtins/comparesf2.c", "!builtins/comparetf2.c", "!builtins/crtbegin.c", "!builtins/crtend.c", - "!builtins/divsi3.c", "!builtins/divtc3.c", "!builtins/divtf3.c", "!builtins/divxc3.c", @@ -157,7 +154,6 @@ sources = [ "!builtins/floatunsitf.c", "!builtins/floatuntitf.c", "!builtins/floatuntixf.c", - "!builtins/mulsf3.c", "!builtins/multc3.c", "!builtins/multf3.c", "!builtins/mulxc3.c", @@ -173,7 +169,6 @@ sources = [ "!builtins/trunctfxf2.c", "!builtins/truncxfbf2.c", "!builtins/truncxfhf2.c", - "!builtins/udivsi3.c", ] # ── The machine half ──────────────────────────────────────────── @@ -203,6 +198,11 @@ sources = [ # there is no glob. [target.'cfg(arch = "thumbv6m")'.build] sources = [ + "!builtins/addsf3.c", + "!builtins/comparesf2.c", + "!builtins/divsi3.c", + "!builtins/mulsf3.c", + "!builtins/udivsi3.c", "builtins/arm/addsf3.S", "builtins/arm/aeabi_cdcmpeq_check_nan.c", "builtins/arm/aeabi_cdcmp.S", @@ -231,6 +231,11 @@ sources = [ [target.'cfg(arch = "thumbv7m")'.build] sources = [ + "!builtins/addsf3.c", + "!builtins/comparesf2.c", + "!builtins/divsi3.c", + "!builtins/mulsf3.c", + "!builtins/udivsi3.c", "builtins/arm/addsf3.S", "builtins/arm/aeabi_cdcmpeq_check_nan.c", "builtins/arm/aeabi_cdcmp.S", @@ -259,6 +264,11 @@ sources = [ [target.'cfg(arch = "thumbv7em")'.build] sources = [ + "!builtins/addsf3.c", + "!builtins/comparesf2.c", + "!builtins/divsi3.c", + "!builtins/mulsf3.c", + "!builtins/udivsi3.c", "builtins/arm/addsf3.S", "builtins/arm/aeabi_cdcmpeq_check_nan.c", "builtins/arm/aeabi_cdcmp.S", @@ -287,6 +297,11 @@ sources = [ [target.'cfg(arch = "thumbv8m.base")'.build] sources = [ + "!builtins/addsf3.c", + "!builtins/comparesf2.c", + "!builtins/divsi3.c", + "!builtins/mulsf3.c", + "!builtins/udivsi3.c", "builtins/arm/addsf3.S", "builtins/arm/aeabi_cdcmpeq_check_nan.c", "builtins/arm/aeabi_cdcmp.S", @@ -315,6 +330,11 @@ sources = [ [target.'cfg(arch = "thumbv8m.main")'.build] sources = [ + "!builtins/addsf3.c", + "!builtins/comparesf2.c", + "!builtins/divsi3.c", + "!builtins/mulsf3.c", + "!builtins/udivsi3.c", "builtins/arm/addsf3.S", "builtins/arm/aeabi_cdcmpeq_check_nan.c", "builtins/arm/aeabi_cdcmp.S", @@ -364,6 +384,22 @@ sources = [ # no outline-atomics helper is ever called, and the SME and PAC units serve # configurations these rows do not select. # +# AND THE FIVE GENERIC ROUTINES THE M-PROFILE ROWS SUPERSEDE WITH ASSEMBLY +# STAY IN THE PACKAGE-WIDE LIST. `addsf3`, `comparesf2`, `divsi3`, `mulsf3` +# and `udivsi3` used to be excluded package-wide because `builtins/arm/` +# supplies them on Cortex-M; on an Apple row nothing does, and the package's +# own objects call them (`subsf3` calls `__addsf3`, `modsi3` calls `__divsi3`, +# `udivmodsi4` calls `__udivsi3`). Measured on macos-15 as three `ld64.lld: +# error: undefined symbol` lines in a consumer's link, each referenced from +# this package's own object. AN EXCLUSION IS GLOBAL: a `!` entry in the +# package-wide list removes the file from every row, and a positive entry in +# a row's block does not bring it back (measured: the 22.1.8.4 draft that +# re-listed the five under this block produced an archive without them). So +# the exclusions now sit in the five M-profile blocks, beside the assembly +# that replaces them, and the generic list is what every other row gets. The +# archive check in CI reads the five symbols back so that a build, which does +# not link, cannot hide the omission again. +# # The macOS row is not listed: its payload carries `libclang_rt.osx.a` and the # driver links it. [target.'cfg(os = "ios")'.build]