glibc/sysdeps
Joseph Myers 5275fc784c Do not build sparc32 libgcc functions into static libc
Since GCC commit f31a019d1161ec78846473da743aedf49cca8c27 "Emit
funcall external declarations only if actually used.", the glibc
testsuite has failed to build for 32-bit SPARC with GCC mainline.

/scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/../../../../sparc64-glibc-linux-gnu/bin/ld: /scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/32/libgcc.a(_divsi3.o): in function `.div':
/scratch/jmyers/glibc-bot/src/gcc/libgcc/config/sparc/lb1spc.S:138: multiple definition of `.div'; /scratch/jmyers/glibc-bot/build/glibcs/sparcv9-linux-gnu/glibc/libc.a(sdiv.o):/scratch/jmyers/glibc-bot/src/glibc/gnulib/../sysdeps/sparc/sparc32/sparcv9/sdiv.S:13: first defined here
/scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/../../../../sparc64-glibc-linux-gnu/bin/ld: disabling relaxation; it will not work with multiple definitions
collect2: error: ld returned 1 exit status
make[3]: *** [../Rules:298: /scratch/jmyers/glibc-bot/build/glibcs/sparcv9-linux-gnu/glibc/nptl/tst-cancel24-static] Error 1

https://sourceware.org/pipermail/libc-testresults/2023q4/012154.html

I'm not sure of the exact sequence of undefined references that cause
first the glibc object file defining .div and then the libgcc object
file defining both .div and .udiv to be pulled in (which must have
been perturbed by that GCC change in a way that introduced the build
failure), but I think the failure illustrates that it's inherently
fragile for glibc to define symbols in separate object files that
libgcc defines in the same object file - and indeed for glibc to
redefine libgcc symbols at all, since the division into object files
shouldn't really be part of the interface between libgcc and libc.

These symbols appear to be in libc only for compatibility, maybe one
of the cases where they were accidentally exported from shared libc in
glibc 2.0 before the introduction of symbol versioning and so programs
started expecting shared libc to provide them.  Thus, there is no need
to have them in static libc.  Add this set of libgcc functions to
shared-only-routines so they are no longer provided in static libc.
(No change is made regarding .mul - dotmul source file - since unlike
the other symbols in this grouping, it doesn't actually appear to be a
libgcc symbol, at least in current GCC.)

Tested with build-many-glibcs.py for sparcv9-linux-gnu with GCC
mainline.
2023-12-19 16:00:11 +00:00
..
aarch64 aarch64: correct CFI in rawmemchr (bug 31113) 2023-12-05 12:49:37 +01:00
alpha elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
arc configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
arm elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
csky configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
generic elf: Ignore LD_BIND_NOW and LD_BIND_NOT for setuid binaries 2023-12-05 13:21:36 -03:00
gnu Add TCP_MD5SIG_FLAG_IFINDEX from Linux 5.6 to netinet/tcp.h. 2023-11-28 13:44:47 +01:00
hppa elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
htl htl: move pthread_attr_setdetachstate into libc 2023-08-24 01:57:22 +02:00
hurd hurd: Fix using interposable hurd_thread_self 2023-05-19 20:45:51 +02:00
i386 elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
ia64 elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
ieee754 math: Add new exp10 implementation 2023-12-04 15:52:11 +00:00
loongarch elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
m68k elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
mach hurd: [!__USE_MISC] Do not #undef BSD macros in ioctls 2023-12-02 21:26:50 +01:00
microblaze configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
mips mips: dl-machine-reject-phdr: Get rid of alloca. 2023-10-02 12:55:27 +00:00
nios2 configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
nptl Fix misspellings in sysdeps/ -- BZ 25337 2023-05-30 23:02:29 +00:00
or1k configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
posix linux: Decorate __libc_fatal error buffer 2023-11-07 10:27:53 -03:00
powerpc powerpc: Add space for HWCAP3/HWCAP4 in the TCB for future Power. 2023-12-15 20:20:14 -06:00
pthread sysdeps: sem_open: Clear O_CREAT when semaphore file is expected to exist [BZ #30789] 2023-11-03 15:19:38 -03:00
riscv riscv: Add support for XTheadBb in string-fz[a,i].h 2023-09-06 09:27:43 -03:00
s390 Avoid padding in _init and _fini. [BZ #31042] 2023-11-30 13:31:23 +01:00
sh elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
sparc Do not build sparc32 libgcc functions into static libc 2023-12-19 16:00:11 +00:00
unix s390: Set psw addr field in getcontext and friends. 2023-12-19 11:00:19 +01:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wordsize-64 hurd: Fix tst-writev test 2023-05-01 13:01:30 +02:00
x86 x86/cet: Check CPU_FEATURE_ACTIVE in permissive mode 2023-12-19 06:58:05 -08:00
x86_64 x86: Unifies 'strlen-evex' and 'strlen-evex512' implementations. 2023-12-18 12:38:01 -06:00