[Pre-RFC] target-glibc: Proposal to add native support for GLIBC versions for the -gnu targets
comex:
cfsetspeed
@comex gave a really great example.
I just want to
zackw:
If so, please clarify what your feature is meant to do.
@comex gave really good examples of where this would be useful (thank you!)
I just want to clarify that this feature is literally about making what zig-build does natively in Rust without depending on the zig infrastructure.
This scenario illustrates a situation where control over symbol versioning is limited.
Consider a static library that uses the cfsetspeed function. During the linking process, the final executable will incorporate either cfsetspeed@GLIBC_2.33 or cfsetspeed@GLIBC_2.19. The specific version chosen depends on the build environment.
The static library itself references cfsetspeed without specifying an exact symbol version. Therefore, the linker determines the version. It selects the latest available version within the C library at the time of linking on the build system. This static library could be written in various programming languages, including Rust, C, or C++.
This proposal suggests bringing the stub libc libraries generated from the abilists files in at the moment, right before linking. This, to some extent, "fakes" a sysroot override.
Discussion in the ATmosphere