FreeBSD 3.2 and 100k C++ programs.
James L. Davis
jld@rconnect.com
Tue Jun 22 11:28:00 GMT 1999
Hello,
I just installed egcs 1.1.2 on FreeBSD 3.2 and it's behaving odd.
C programs compile with the standard "gcc program.c" and link shared by
default. However, C++ programs link semi-shared. C++ programs link
staticly with libstdc++.a and listg++.a but link libc and libm shared.
So, a compiled and linked C++ program ends up being 100-600k and here is
its ldd output..
a.out:
libm.so.2 => /usr/lib/libm.so.2 (0x28065000)
libc.so.2 => /usr/lib/libc.so.3 (0x2807f000)
When I compiled the same program, this time, with my old 2.7.2.1 version
of gcc/g++. The resulting binary is 7k and its ldd output is..
a.out libg++.so.4 => /usr/lib/libg++.so.4 (0x28063000)
libstdc++.so.2 => /usr/lib/libstdc++.so.2 (0x280a0000)
libm.so.2 => /usr/lib/libm.so.2 (0x280d7000)
libc.so.3 => /usr/lib/libc.so.3 (0x280f1000)
I tried building egcs with --enable-shared and
--enable-version-specific-runtime-libs. Both of which did nothing.
Suggestions are appreciated, please send directly to my address
jld@rconnect.com. As I am not subscribed to this list.
More information about the Gcc
mailing list