glibc/sysdeps/sparc
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
..
bits Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fpu Update sparc libm-test-ulps 2023-07-17 10:09:44 -03:00
nptl Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sparc32 Do not build sparc32 libgcc functions into static libc 2023-12-19 16:00:11 +00:00
sparc64 elf: Remove LD_PROFILE for static binaries 2023-11-21 16:15:42 -03:00
sys Update. 1997-06-29 22:05:27 +00:00
abort-instr.h Update. 2001-04-06 22:47:29 +00:00
atomic-machine.h Fix misspellings in sysdeps/ -- BZ 25337 2023-05-30 23:02:29 +00:00
backtrace.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
configure configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
configure.ac elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
cpu_relax.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
crti.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
crtn.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dl-lookupcfg.h sparc: Fix la_symbind for bind-now (BZ 23734) 2023-07-12 15:29:08 -03:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dl-tls.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Makefile Remove references to the defunct db2 subdir 2023-08-21 18:20:53 +02:00
mempcpy.S Optimize mempcpy on sparc. 2012-03-28 22:35:26 -07:00
preconfigure Remove 32 bit sparc v7 support 2019-11-27 09:37:57 -03:00
sparc-ifunc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sparc-mcount.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stackinfo.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Subdirs Update. 2000-06-14 00:55:24 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
unwind-arch.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00