[Bug libstdc++/60348] -static-libstdc++ broken

nachms+gcc at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 27 12:43:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60348

--- Comment #4 from Nach <nachms+gcc at gmail dot com> ---
(In reply to Marc Glisse from comment #3)
> man nm:
> 
>            "U" The symbol is undefined.
> 
>            "u" The symbol is a unique global symbol.  This is a GNU
> extension [...]
> 
> The program does run fine for me with exactly the same compiler on debian.
> 
> How did it fail to run for you, with what error message?

The issue isn't that it can't run on a machine with a proper libstdc++
installed, the issue is that -static-libstdc++ is broken, meaning the binary
cannot run on a system without libstdc++ installed (or a too old version).

Trying to run the Debian compiled binary on RHEL5 is giving me:

./test: symbol lookup error: ./test: undefined symbol:
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE

And on RHEL5 system: objdump -T ./test | grep
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE
0000000000690c00      DO .bss   0000000000000020  Base       
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE

Where on Debian it gives:
0000000000690c00 u    DO .bss   0000000000000020  Base       
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE

In the past when -static-libstdc++ was working, binaries ran just fine on older
systems.



More information about the Gcc-bugs mailing list