From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Lantinga To: hjl@lucon.org (H.J. Lu) Cc: slouken@devolution.com, egcs@egcs.cygnus.com, mindbender@lokigames.com Subject: Re: Large code size? Date: Wed, 24 Mar 1999 15:42:00 -0000 Message-id: X-SW-Source: 1999-03/msg00784.html > > > > 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 ... The final result is: -rwxrwxr-x 1 hercules devel 1011648 Mar 25 07:35 robotcom.so [hercules@asgard robotcom]$ size robotcom.so text data bss dec hex filename 991092 9768 198820 1199680 124e40 robotcom.so [hercules@asgard robotcom]$ file robotcom.so robotcom.so: ELF 32-bit LSB shared object, Intel 80386, version 1, stripped [hercules@asgard robotcom]$ ldd robotcom.so libc.so.6 => /lib/libc.so.6 (0x4012a000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) Removing -funroll-loops from the flags gives us: -rwxrwxr-x 1 hercules devel 948704 Mar 25 07:42 robotcom.so I'm rebuilding the entire application with those flags now. -- -Sam Lantinga (slouken@devolution.com) Lead Programmer, Loki Entertainment Software -- Author of Simple DirectMedia Layer - http://www.devolution.com/~slouken/SDL/ -- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Lantinga To: hjl@lucon.org (H.J. Lu) Cc: slouken@devolution.com, egcs@egcs.cygnus.com, mindbender@lokigames.com Subject: Re: Large code size? Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: X-SW-Source: 1999-03n/msg00789.html Message-ID: <19990331234600.p8IrWi2xlb54S1GX63TtzWTx8cznBDBMp7FbeOHhERw@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 ... The final result is: -rwxrwxr-x 1 hercules devel 1011648 Mar 25 07:35 robotcom.so [hercules@asgard robotcom]$ size robotcom.so text data bss dec hex filename 991092 9768 198820 1199680 124e40 robotcom.so [hercules@asgard robotcom]$ file robotcom.so robotcom.so: ELF 32-bit LSB shared object, Intel 80386, version 1, stripped [hercules@asgard robotcom]$ ldd robotcom.so libc.so.6 => /lib/libc.so.6 (0x4012a000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) Removing -funroll-loops from the flags gives us: -rwxrwxr-x 1 hercules devel 948704 Mar 25 07:42 robotcom.so I'm rebuilding the entire application with those flags now. -- -Sam Lantinga (slouken@devolution.com) Lead Programmer, Loki Entertainment Software -- Author of Simple DirectMedia Layer - http://www.devolution.com/~slouken/SDL/ --