https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113888
Bug ID: 113888 Summary: libm2pim/target.c doesn't assemble on 32-bit Linux/sparc64 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Target Milestone: --- Target: sparc64-unknown-linux-gnu When doing a multilib build of trunk on Linux/sparc64, the 32-bit libm2pim/target.c fails to assemble: libtool: compile: /var/gcc/regression/master/6.6.15-gcc-gas-gld/build/./gcc/xgcc -B/var/gcc/regression/master/6.6.15-gcc-gas-gld/build/./gcc/ -B/vol/gcc/sparc64-unknown-linux-gnu/bin/ -B/vol/gcc/sparc64-unknown-linux-gnu/lib/ -isystem /vol/gcc/sparc64-unknown-linux-gnu/include -isystem /vol/gcc/sparc64-unknown-linux-gnu/sys-include -fchecking=1 -m32 -DHAVE_CONFIG_H -I. -I/vol/gcc/src/hg/master/local/libgm2/libm2pim -I.. -I. -I.. -I/vol/gcc/src/hg/master/local/gcc/m2/gm2-libs -I/vol/gcc/src/hg/master/local/gcc/m2/gm2-libs-iso -DBUILD_GM2_LIBS -I/vol/gcc/src/hg/master/local/libgm2/libm2pim/../ -I/vol/gcc/src/hg/master/local/libgm2/libm2pim/../libm2iso -g -O2 -m32 -MT libm2pim_la-target.lo -MD -MP -MF .deps/libm2pim_la-target.Tpo -c /vol/gcc/src/hg/master/local/libgm2/libm2pim/target.c -fPIC -DPIC -o .libs/libm2pim_la-target.o /tmp/ccoaQS64.s: Assembler messages: /tmp/ccoaQS64.s:110: Error: symbol `exp10' is already defined make[9]: *** [Makefile:676: libm2pim_la-target.lo] Error 1 while 64-bit compilation works. The issue turns out to be multifold: * The preprocessed input has extern long double exp10l (long double __x) __asm__ ("" "exp10") __attribute__ ((__nothrow__ , __leaf__)); * This leads to both the exp10 and exp10l fallback definitions end up with same name (exp10), causing the redefinition error from gas. * Ultimately, the error is different, though: none of HAVE_EXP10 and HAVE_EXP10L are ever checked for, otherwise the fallsbacks wouldn't be used at all. The same applies to a couple of other autoconf macros used inside the libgm2 tree. I'm going to provide a patch to fix all that.