]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Filter out internal abort during ld.so build
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 31 Oct 2025 20:00:49 +0000 (17:00 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 10 Nov 2025 11:58:12 +0000 (08:58 -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.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
configure
configure.ac
elf/Makefile
sysdeps/mach/hurd/configure
sysdeps/mach/hurd/configure.ac

index a69097453738e2e06a2a1d3416ec30d88d38ca5a..df51b0c1a37a84162d87be2e0124dd1a41a76cc9 100755 (executable)
--- a/configure
+++ b/configure
@@ -9027,6 +9027,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.
@@ -9609,6 +9610,9 @@ if test "$libc_cv_attr_after_func_decl" = 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 2409f07dc9367031f67e199dcd16734cb4d94dea..dd0b7a4c7c4059517ae4345d2fde21f5e8988d3c 100644 (file)
@@ -1967,6 +1967,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.
@@ -2252,6 +2253,8 @@ if test "$libc_cv_attr_after_func_decl" = yes; then
    AC_DEFINE(ATTR_AFTER_FUNC_DECL)
 fi
 
+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 7ed95b72af98ca7b77e2cef01050319a061caea6..bcdc6aa625d75a4077dd63f13c40a2d154eaaa2e 100644 (file)
@@ -1487,6 +1487,13 @@ rtld-stubbed-symbols = \
   realloc \
   # 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