mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
The 'unwind-link' facility allows glibc to support thread cancellation
and exit (pthread_cancel, pthread_exiti, backtrace) by dynamically
loading the unwind library at runtime, preventing a hard dependency on
libgcc_s within libc.so.
When building with libunwind (for clang/LLVM toolchains [1]), two
assumptions in the existing code break:
1. The runtime library is libunwind.so instead of libgcc_s.so.
2. libgcc relies on __gcc_personality_v0 to handle unwinding mechanics.
libunwind exposes the standard '_Unwind_*' accessors directly.
This patch adapts `unwind-link` to handle both environments based on
the HAVE_CC_WITH_LIBUNWIND configuration:
* The UNWIND_SONAME macro now selects between LIBGCC_S_SO and
LIBUNWIND_SO.
* For libgcc, it continues to resolve `__gcc_personality_v0`.
* For libunwind, it instead resolves the standard
_Unwind_GetLanguageSpecificData, _Unwind_SetGR, _Unwind_SetIP,
and _Unwind_GetRegionStart helpers.
* unwind-resume.c is updated to implement wrappers for these
accessors that forward calls to the dynamically loaded function
pointers, effectively shimming the unwinder.
Tests and Makefiles are updated to link against `$(libunwind)` where
appropriate.
Reviewed-by: Sam James <sam@gentoo.org>
[1] https://github.com/libunwind/libunwind
73 lines
2.2 KiB
Plaintext
73 lines
2.2 KiB
Plaintext
# This file (and shlib-versions files in sysdeps directories) defines
|
|
# the shared library version numbers we will install.
|
|
|
|
# The following lines list the associated versions to use for various
|
|
# libraries. The entire list is processed, with earlier entries
|
|
# taking precedence over later entries (and the files from sysdeps
|
|
# directories coming before those from other subdirectories, which
|
|
# come before this file).
|
|
|
|
# This file can use cpp-style conditionals starting with % instead of #
|
|
# to test the symbols defined in config.h by configure.
|
|
|
|
# In the optional second column, there can one or more symbol set names
|
|
# listed, which must be in ascending version order reading left to right
|
|
# and must appear in this same order in the Versions.def file. Each listed
|
|
# version subsumes all prior versions back to the previous listed version.
|
|
#
|
|
# An entry with DEFAULT in the first column gives a default second
|
|
# column to apply when the matching entry for a particular library has
|
|
# no second column. The defaults must precede the entries they apply
|
|
# to.
|
|
|
|
# Library=version Earliest symbol set (optional)
|
|
# --------------- ------------------------------
|
|
|
|
# We use the ELF ABI standard name for the default.
|
|
ld=ld.so.1
|
|
|
|
# The -ldl interface (see <dlfcn.h>) is the same on all platforms.
|
|
libdl=2
|
|
|
|
# So far the -lutil interface is the same on all platforms, except for the
|
|
# `struct utmp' format, which depends on libc.
|
|
libutil=1
|
|
|
|
# Version number 2 is used on other systems for the BIND 4.9.5 resolver
|
|
# interface.
|
|
libresolv=2
|
|
|
|
# Interface revision of nss_* modules. This must match NSS_SHLIB_REVISION
|
|
# in nss/nsswitch.h, which determines the library names used for service
|
|
# names given in /etc/nsswitch.conf.
|
|
libnss_files=2
|
|
libnss_dns=2
|
|
libnss_compat=2
|
|
libnss_ldap=2
|
|
libnss_hesiod=2
|
|
libnss_db=2
|
|
|
|
# Version for libnsl with YP and NIS+ functions.
|
|
libnsl=1
|
|
|
|
# The gross patch for programs assuming broken locale implementations.
|
|
libBrokenLocale=1
|
|
|
|
# The real-time library from POSIX.1b.
|
|
librt=1
|
|
|
|
# The asynchronous name lookup library.
|
|
libanl=1
|
|
|
|
# This defines the libgcc soname version this glibc is to load for
|
|
# asynchronous cancellation to work correctly.
|
|
libgcc_s=1
|
|
|
|
# The vector math library
|
|
libmvec=1
|
|
|
|
# The malloc debug library
|
|
libc_malloc_debug=0
|
|
|
|
libunwind=1
|