FreeBSD 3.2 and 100k C++ programs.

James L. Davis
Tue Jun 22 11:28:00 GMT 1999

 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: => /usr/lib/ (0x28065000) => /usr/lib/ (0x2807f000)

 When I compiled the same program, this time, with my old version
of gcc/g++. The resulting binary is 7k and its ldd output is..

a.out => /usr/lib/ (0x28063000) => /usr/lib/ (0x280a0000) => /usr/lib/ (0x280d7000) => /usr/lib/ (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 As I am not subscribed to this list.

More information about the Gcc mailing list