Repository navigation
C compiled by with cc on Linux stays at the glibc floor: a build system's probe for a newer function no longer links - #3604
Merged
Merged
Conversation
added 2 commits
November 24, 2026 22:33
…hold a function newer than the pin only by its versioned name, so a build system's probe for one does not link (#3603)
This was referenced Nov 25, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3603.
The bug. On Linux a C library that
with getbuilds from source could need a newer glibc than the machine that built it. curl's configure asked whethermemset_explicit(glibc 2.43) exists; the SDK's link stubs answered yes; curl called it; the program then did not start on glibc 2.39 (version GLIBC_2.43 not found).Root cause.
build/sdk.with,sdk_glibc_stub_sources: a symbol with no version at or below the 2.28 pin is made the default version (if default_ver < 0 and not floor_any: default_ver = newest), so that a prebuilt archive compiled against a newer glibc links. A probe is the same kind of reference, an unversioned one.The fix. A second stub directory,
usr/lib/floor, andwith ccsearches it first.sdk_write_floor_stubs), from the stubs already there: each library is copied with the hidden bit set on every.gnu.versionentry whose version is above the pin. Such a symbol is then present only by its versioned name. No SDK is regenerated or republished, and a sysroot copied out of an SDK built before this gets the directory too.stat,fstat,lstat,fstatatand their 64 forms,mknod,mknodat,__isoc23_*,__libc_single_threaded,_dl_find_object). An archive built there has no other spelling to offer.usr/libas before, so a prebuilt archive that names a newer function still links there.One consequence to know: a
with cclink of a prebuilt archive that calls a newer function by choice (not one of the kept names) now fails, naming the symbol, where it used to link and then need that glibc.Tests.
test/host_toolchain/cc_floor_probe.c(CMake's probe shape formemset_explicit) must not link;cc_floor_kept.cmust. Both run in:no-host-toolchainon Linux.Evidence (5e4d520 unless noted)
undefined symbol: memset_explicit; the kept names link and run;cc_hello.cbuilds and runs;with get c.zlibbuilds. At the first commit, the libcurl release scenario (a copy, with the recipe's TLS option set to mbedtls by a throwaway override that never left the container) passes all seven steps including the HTTPS run, and the rebuiltlibcurl.ahas no reference tomemset_explicit. Before the fix that same run stopped atGLIBC_2.43 not found.:no-host-toolchaingreen with both new lines in its verdict. The second commit changes spelling only (the ceremony census), and the seed checksbuild.with.:no-host-toolchaincannot run inside the Docker leg (its sandbox needs a namespace Docker refuses), which is why the aarch64 fixtures were run directly.