libstdc++ - SystemV vs Gnu/Linux ABI
Mathias Winkel
mathias.winkel@gmail.com
Wed Mar 19 19:18:00 GMT 2014
Dear all,
for quite a while I have been using a self-built GCC (version 4.8.1 and
4.9/svn-trunk) on a Blue Gene/Q (PowerPC) machine.
After I updated my compiler this week, I could not execute produced
statically linked binaries any more.
The difference between executables compiled with the old and the new
compiler is apparently the ABI:
$ file a.out-gcc4.9
a.out-gcc4.9: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500,
version 1 (*GNU/Linux*), statically linked, for GNU/Linux 2.4.21, not
stripped
$ file a.out-gcc4.8.1
a.out-gcc4.8.1: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500,
version 1 (*SYSV*), statically linked, for GNU/Linux 2.4.21, not stripped
I narrowed the difference between both compiler versions down to the
libstdc++:
$ ar -x /bgsys/local/gcc/4.9/powerpc64-bgq-linux/lib64/libstdc++.a
$ file *.o | grep "(GNU/Linux)"
bitmap_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
compatibility-ldbl.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
ext-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
locale-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
mt_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
pool_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
random.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
string-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
wlocale-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
wstring-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC
or cisco 7500, version 1 (GNU/Linux), not stripped
$ ar -x /bgsys/local/gcc/4.8.1/powerpc64-bgq-linux/lib64/libstdc++.a
$ file bitmap_allocator.o compatibility-ldbl.o ext-inst.o locale-inst.o
mt_allocator.o pool_allocator.o random.o string-inst.o wlocale-inst.o
wstring-inst.o
bitmap_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
compatibility-ldbl.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
ext-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
locale-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
mt_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
pool_allocator.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
random.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
string-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
wlocale-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
wstring-inst.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or
cisco 7500, version 1 (SYSV), not stripped
As far as I understood (please correct me if I am wrong), the
"(GNU/Linux)" calling convention is being propagated into the final
executable.
A previous Version of gcc-4.9 (built approximately araound Christmas
2013) did not show the problem.
Now: Why does this happen and how can I prevent this behaviour?
In case you need any further information I will be happy to provide them.
Thank you :-)
Mathias
More information about the Libstdc++
mailing list