This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Weak changes cause arm/NetBSD bootstrap failure.
- From: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>
- To: gcc-bugs at gcc dot gnu dot org, rth at redhat dot com
- Cc: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
- Date: Sat, 23 Mar 2002 11:20:04 +0000
- Subject: Weak changes cause arm/NetBSD bootstrap failure.
- Reply-to: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
Richard,
This change,
2002-03-14 Richard Henderson <rth@redhat.com>
...
* varasm.c
...
(asm_emit_uninitialised): Call globalize_decl for weak commons.
is breaking a bootstrap on ARM/NetBSD. Specifically, it's causing the
assembler to die with the message:
/work/rearnsha/gnu/egcs/gcc/xgcc -shared-libgcc -B/work/rearnsha/gnu/egcs/g
cc/ -nostdinc++ -L/work/rearnsha/gnu/egcs/arm-netbsd/libstdc++-v3/src
-L/work/rearnsha/gnu/egcs/arm-netbsd/libstdc++-v3/src/.libs
-B/work/rearnsha/gnu/install/arm-netbsd/bin/ -B/work/rearnsha/gnu/install/a
rm-netbsd/lib/ -isystem /work/rearnsha/gnu/install/arm-netbsd/include
-nostdinc++ -I/work/rearnsha/gnu/egcs/arm-netbsd/libstdc++-v3/include/arm-n
etbsd -I/work/rearnsha/gnu/egcs/arm-netbsd/libstdc++-v3/include
-I/work/rearnsha/gnusrc/egcs/libstdc++-v3/libsupc++
-I/work/rearnsha/gnusrc/egcs/libstdc++-v3/libmath -g -O2
-fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline
-fdiagnostics-show-location=once -g -c /work/rearnsha/gnusrc/egcs/libstdc++
-v3/src/globals.cc -fPIC -DPIC -o .libs/globals.o
/tmp/ccngtKGq.s: Assembler messages:
/tmp/ccngtKGq.s:1246: Error: Symbol `__ZNSt17_Swap_lock_structILi0EE12_S_sw
ap_lockE' can not be both weak and common
gnumake: *** [globals.lo] Error 1
And indeed, we have generated the following assembly code:
.globl __ZNSt17_Swap_lock_structILi0EE12_S_swap_lockE
.weak __ZNSt17_Swap_lock_structILi0EE12_S_swap_lockE
.comm __ZNSt17_Swap_lock_structILi0EE12_S_swap_lockE, 4 @ 4
How can a common symbol, which by definition is just a tentative
allocation of space if there is no initialized alternative, be made weak?
R.