From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: slouken@devolution.com (Sam Lantinga) Cc: egcs@egcs.cygnus.com Subject: Re: Large code size? Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: References: X-SW-Source: 1999-03n/msg00796.html Message-ID: <19990331234600.DQjGnABo2kYgAy8j64SV0PXxXghtIYITHM69yP1RWMk@z> > > > > > > The egcs version (compiled with egcs 1.1.1, -O2 -funroll-loops): > > > > > -rwxrwxr-x 1 hercules devel 1534443 Mar 25 1999 robotcom.so > > > > > > > > > > The VC++ version (compiled with VC++ 5.0, /G5 /Ox /Ot /Og /Oi /Op /Ob2) > > > > > -r-xr-xr-x 1 hercules devel 654336 Mar 14 10:26 robotcom.dll > > > > > > > > > > Any ideas why this might be? > > > > > > > Did you try to apply 'strip.exe' to the resulting binary? > > > What does > > > # size robotcom.so > > # file robotcom.so > > > say? BTW, how did you make robotcom.so? > > > We built robotcom.so with the compiler flags: > g++ -O2 -funroll-loops -fno-exceptions -DLINUX_BETA -D_REENTRANT > and the linker flags: > cc -shared -nostartfiles -s -o robotcom.so ... > If that is exactly what you use on Linux, they are wrong. You should use # g++ -O2 -fPIC -funroll-loops -fno-exceptions -DLINUX_BETA -D_REENTRANT # g++ -shared -s -o robotcom.so ... BTW, you should read ftp://sunsite.unc.edu/pub/Linux/GCC/elf.ps.gz if you want to program under Linux. It is kind of dated. But it is still quite useful. -- H.J. Lu (hjl@gnu.org)