]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Filter out internal abort during ld.so build
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Apr 2022 17:17:07 +0000 (14:17 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:45:23 +0000 (13:45 -0300)
clang might generate an abort call when cleanup functions (set by
__attribute__ ((cleanup)) calls functions not marked as nothrow.

The hurd already provides abort for the loader at
sysdeps/mach/hurd/dl-sysdep.c, and adding it rtld-stubbed-symbols
triggers duplicate symbols.

configure
configure.ac
elf/Makefile
sysdeps/mach/hurd/configure
sysdeps/mach/hurd/configure.ac

index 122020db69796f2395e8157d32b68180ca7d0fbd..3c926be3ecd9ff4412f0496d72d632fd8cf9e890 100755 (executable)
--- a/configure
+++ b/configure
@@ -8915,6 +8915,7 @@ libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 pthread_in_libc=yes
+abort_in_ld=no
 
 # Iterate over all the sysdep directories we will use, running their
 # configure fragments.
@@ -9468,6 +9469,9 @@ if test "$pthread_in_libc" = yes; then
 fi
 
 
+config_vars="$config_vars
+abort-in-ld = $abort_in_ld";
+
 ac_config_files="$ac_config_files config.make Makefile"
 
 ac_config_commands="$ac_config_commands default"
index 14a0f2dee89954376ef25d9143fe16b1f9d3b6ec..890f1b1c9c300d4d3644fb542aac4f7cb01bf5e6 100644 (file)
@@ -1916,6 +1916,7 @@ libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 pthread_in_libc=yes
+abort_in_ld=no
 
 # Iterate over all the sysdep directories we will use, running their
 # configure fragments.
@@ -2181,6 +2182,8 @@ if test "$pthread_in_libc" = yes; then
 fi
 AC_SUBST(pthread_in_libc)
 
+LIBC_CONFIG_VAR([abort-in-ld],[$abort_in_ld]);
+
 AC_CONFIG_FILES([config.make Makefile])
 AC_CONFIG_COMMANDS([default],[[
 case $CONFIG_FILES in *config.make*)
index dd21fe6241105c5a9c102ae3efb1e6816cf95bde..e95747c7950827f8c79001523e14ab8506aee064 100644 (file)
@@ -1495,6 +1495,13 @@ rtld-stubbed-symbols += \
   __GI___vsyslog_chk \
   # rtld-stubbed-symbols
 
+ifeq (no,$(abort-in-ld))
+# clang might generate an abort call for cleanup functions.
+rtld-stubbed-symbols += \
+  __GI_abort \
+  # rtld-stubbed-symbols
+endif
+
 ifeq ($(have-ssp),yes)
 # rtld is not built with the stack protector, so these references will
 # go away in the rebuilds.
index 6ca3bab5112795f53ecba43d1c610fe9a9b10f0a..743bad5fcba620729e79637adac30ef30ca7ac7e 100644 (file)
@@ -220,4 +220,6 @@ fi
 
 # Hurd has libpthread as a separate library.
 pthread_in_libc=no
+# Hurd already provides abort implementation for the loader
+abort_in_ld=yes
 
index 1695e94eccb04d67a887dc36b25d37100bc2ddd1..6d33feed0e78dd53df4fb56ad8c85cc087f57408 100644 (file)
@@ -48,3 +48,5 @@ fi
 
 # Hurd has libpthread as a separate library.
 pthread_in_libc=no
+# Hurd already provides abort implementation for the loader
+abort_in_ld=yes