Subject: toolchain/37473: Statically linked executables are much larger in -current
To: None <toolchain-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jmcneill@invisible.ca>
List: netbsd-bugs
Date: 12/04/2007 03:50:01
>Number: 37473
>Category: toolchain
>Synopsis: Statically linked executables are much larger in -current
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 04 03:50:01 +0000 2007
>Originator: Jared D. McNeill
>Release: NetBSD 4.99.39
>Organization:
>Environment:
System: NetBSD black.invisible.ca 4.99.39 NetBSD 4.99.39 (GENERIC) #79: Mon Dec 3 18:58:20 EST 2007 jmcneill@black.invisible.ca:/export/home/jmcneill/branches/jmcneill-pm/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
Statically linked executables are significantly larger on -current
than in 4.0_RC4.
Example sides of an application that does nothing:
4.0_RC4 i386:
-rwxr-xr-x 1 jmcneill wheel 20208 Dec 3 22:18 small
Using built-in specs.
Target: i386--netbsdelf
Configured with: /usr/src/tools/gcc/../../gnu/dist/gcc4/configure --enable-long-long --disable-multilib --enable-threads --disable-symvers --build=i386-unknown-netbsdelf4.99.3 --host=i386--netbsdelf --target=i386--netbsdelf
Thread model: posix
gcc version 4.1.2 20061021 prerelease (NetBSD nb3 20061125)
4.99.20 i386:
-rwxr-xr-x 1 jmcneill wheel 122816 Dec 3 22:49 small
$ cc -v
Using built-in specs.
Target: i386--netbsdelf
Configured with: /usr/src/tools/gcc/../../gnu/dist/gcc4/configure --enable-long-long --disable-multilib --enable-threads --disable-symvers --build=x86_64-unknown-netbsd4.99.12 --host=i386--netbsdelf --target=i386--netbsdelf
Thread model: posix
gcc version 4.1.2 20070110 prerelease (NetBSD nb1 20070603)
4.99.39 amd64:
-rwxr-xr-x 1 jmcneill wheel 155800 Dec 3 21:57 small
$ cc -v
Using built-in specs.
Target: x86_64--netbsd
Configured with: /home/nick/work/netbsd/src-current/tools/gcc/../../gnu/dist/gcc4/configure --enable-long-long --disable-multilib --enable-threads --disable-symvers --build=i386-unknown-netbsdelf4.99.28 --host=x86_64--netbsd --target=x86_64--netbsd --enable-__cxa_atexit
Thread model: posix
gcc version 4.1.3 20070620 prerelease (NetBSD nb1 20070620)
>How-To-Repeat:
$ cat small.c
int main(void) { return 0; }
$ cc small.c -o small && strip small
$ ls -l small
-rwxr-xr-x 1 jmcneill wheel 5472 Dec 3 22:44 small
$ cc small.c -static -o small && strip small
$ ls -l small
-rwxr-xr-x 1 jmcneill wheel 155800 Dec 3 22:44 small
>Fix:
>Unformatted: