this showed up when trying to address PR40133. Enabling the exception propagation support keeps the __sync_val_compare_and_swap_4 unresolved. /usr/bin/ld: ./atomic-1.exe: hidden symbol `__sync_val_compare_and_swap_4' in /home/doko/gcc/4.4/gcc-4.4-4.4.0/build/gcc/libgcc.a(linux-atomic.o) is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output Linking the shared libstdc++ with both -lgcc_s and -lgcc does fix these. There seem to be two issues: - libtool currently doesn't allow to link with -lgcc_s -lgcc (in this order). see http://gcc.gnu.org/ml/libstdc++/2009-05/msg00064.html - g++ should link be default with -lgcc_s -lgcc? this is how I understand http://gcc.gnu.org/ml/gcc/2009-05/msg00039.html
The SH port does use a linker script to link with both -lgcc_s and -lgcc.
proposed patch at http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00322.html
Subject: Bug 40134 Author: doko Date: Mon Oct 19 14:26:28 2009 New Revision: 152975 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152975 Log: 2009-10-19 Matthias Klose <doko@ubuntu.com> PR target/40134 * config.gcc (arm*-*-linux-*eabi): Use config/t-slibgcc-libgcc. Modified: trunk/gcc/ChangeLog trunk/gcc/config.gcc
Subject: Bug 40134 Author: doko Date: Fri Dec 4 07:47:51 2009 New Revision: 154973 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154973 Log: 2009-12-04 Matthias Klose <doko@ubuntu.com> John David Anglin <dave.anglin@nrc-cnrc.gc.ca> PR target/40134 * config.gcc (hppa*-*-linux*): Use config/t-slibgcc-libgcc. * config/pa/pa-linux.h (LIB_SPEC): Remove. Modified: trunk/gcc/ChangeLog trunk/gcc/config.gcc trunk/gcc/config/pa/pa-linux.h
fixed on the trunk
Subject: Bug 40134 Author: doko Date: Mon Jan 4 15:13:08 2010 New Revision: 155617 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155617 Log: 2010-01-04 Mikael Pettersson <mikpe@it.uu.se> PR target/42503 Backport from mainline: 2009-09-09 Jakub Jelinek <jakub@redhat.com> * config/t-slibgcc-elf-ver (SHLIB_MAKE_SOLINK, SHLIB_INSTALL_SOLINK): New variables. (SHLIB_LINK, SHLIB_INSTALL): Use them. * config/t-slibgcc-libgcc: New file. 2009-10-19 Matthias Klose <doko@ubuntu.com> PR target/40134 * config.gcc (arm*-*-linux-*eabi): Use config/t-slibgcc-libgcc. Added: branches/gcc-4_4-branch/gcc/config/t-slibgcc-libgcc Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/config.gcc branches/gcc-4_4-branch/gcc/config/t-slibgcc-elf-ver
Looks like this is needed for all architectures having such symbols in libgcc.a only – I just backported those for m68k to gcc-4.6 and encountered this issue, which Mikael Pettersson helped to solve.
Looks like this is needed for all architectures having such symbols in libgcc.a only – I just backported those for m68k to gcc-4.6 and encountered this issue, which Mikael Pettersson helped to solve. Just so anyone who’ll encounter these later knows. (Also, rebuild *all* involved DLLs against the libgcc_s.so linker script, not just libstdc++.)