Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
48 changes: 42 additions & 6 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -173,7 +169,6 @@ sources = [
"!builtins/trunctfxf2.c",
"!builtins/truncxfbf2.c",
"!builtins/truncxfhf2.c",
"!builtins/udivsi3.c",
]

# ── The machine half ────────────────────────────────────────────
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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]
Expand Down
Loading