Expand description
Support for “weak linkage” to symbols on Unix
Some I/O operations we do in libstd require newer versions of OSes but we need to maintain binary compatibility with older releases for now. In order to use the new functionality when available we use this module for detection.
One option to use here is weak linkage, but that is unfortunately only
really workable on Linux. Hence, use dlsym to get the symbol value at
runtime. This is also done for compatibility with older versions of glibc,
and to avoid creating dependencies on GLIBC_PRIVATE
symbols. It assumes
that we’ve been dynamically linked to the library the symbol comes from,
but that is currently always the case for things like libpthread/libc.
A long time ago this used weak linkage for the __pthread_get_minstack
symbol, but that caused Debian to detect an unnecessarily strict versioned
dependency on libc6 (#23628).
Modules§
- libc 🔒
Macros§
- syscall 🔒
- weak 🔒
- A combination of
weakcall
andsyscall
. Use the libc function if it’s available, and fall back tolibc::syscall
otherwise. - weakcall 🔒
Structs§
- Weak 🔒
Constants§
Functions§
- fetch 🔒 ⚠