From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 08CAF13838B for ; Mon, 29 Sep 2014 16:36:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C046E091E; Mon, 29 Sep 2014 16:36:01 +0000 (UTC) Received: from mx01.admin-box.com (mx01.admin-box.com [78.47.249.108]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 002BEE0909 for ; Mon, 29 Sep 2014 16:35:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx01.admin-box.com (Postfix) with ESMTP id 030CE1E00A6 for ; Mon, 29 Sep 2014 18:35:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mx01.admin-box.com Received: from mx01.admin-box.com ([127.0.0.1]) by localhost (mx01.admin-box.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yn1hyQU6iBHr for ; Mon, 29 Sep 2014 18:35:55 +0200 (CEST) Received: from [130.149.240.154] (admin02.ziik.tu-berlin.de [130.149.240.154]) (Authenticated sender: daniel@troeder.de) by mx01.admin-box.com (Postfix) with ESMTPSA id AF1BE1E008C for ; Mon, 29 Sep 2014 18:35:55 +0200 (CEST) Message-ID: <54298A6B.7060309@admin-box.com> Date: Mon, 29 Sep 2014 18:35:55 +0200 From: Daniel Troeder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] bloated by gcc References: In-Reply-To: OpenPGP: id=BB9D4887; url=http://keyserver.ubuntu.com:11371/pks/lookup?search=0xBB9D4887&op=get Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bNHaoDKDJ18gRL8f5pVCvFQbWR9cPFnKh" X-Archives-Salt: f0d950bc-dc8f-40b3-bb94-3835dfd98b9e X-Archives-Hash: 9b7ddd087c846e7763cbd131b0672f50 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bNHaoDKDJ18gRL8f5pVCvFQbWR9cPFnKh Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 28.09.2014 um 10:44 schrieb Jorge Almeida: > I'm having a somewhat disgusting issue on my Gentoo: binaries are > unaccountably large. >=20 > I'm talking about C programs of my own, so no version related issues > whatsoever. The computer is a core i3 with a 32 bit system. >=20 > Example, for the same program: >=20 > 10275 B on an atom running Slackware 14.1 (gcc 4.8.2) > 5896 B (same, stripped with strip --strip-unneeded) >=20 > 11675 B on i3, Gentoo, gcc 4.8.3 (with default gcc it was worse) > 9704 B stripped >=20 > 8207 B on *the same i3 box* running LFS (gcc 4.9.1) > 5768 B stripped >=20 > When compiling against dietlibc, the difference is even more shocking > (almost double size in Gentoo after stripping). >=20 > Compiled with: > gcc -Os -march=3Di686 -fomit-frame-pointer -pipe -Wall -pedantic > -fdata-sections -ffunction-sections -Wl,--gc-sections > -fno-asynchronous-unwind-tables -std=3Dc99 >=20 > Gentoo: > $ gcc -v > Using built-in specs. > COLLECT_GCC=3D/usr/i686-pc-linux-gnu/gcc-bin/4.8.3/gcc > COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/i686-pc-linux-gnu/4.8.3/lto-wrap= per > Target: i686-pc-linux-gnu > Configured with: > /var/tmp/portage/sys-devel/gcc-4.8.3/work/gcc-4.8.3/configure > --host=3Di686-pc-linux-gnu --build=3Di686-pc-linux-gnu --prefix=3D/usr > --bindir=3D/usr/i686-pc-linux-gnu/gcc-bin/4.8.3 > --includedir=3D/usr/lib/gcc/i686-pc-linux-gnu/4.8.3/include > --datadir=3D/usr/share/gcc-data/i686-pc-linux-gnu/4.8.3 > --mandir=3D/usr/share/gcc-data/i686-pc-linux-gnu/4.8.3/man > --infodir=3D/usr/share/gcc-data/i686-pc-linux-gnu/4.8.3/info > --with-gxx-include-dir=3D/usr/lib/gcc/i686-pc-linux-gnu/4.8.3/include/g= ++-v4 > --with-python-dir=3D/share/gcc-data/i686-pc-linux-gnu/4.8.3/python > --enable-languages=3Dc,c++,fortran --enable-obsolete --enable-secureplt= > --disable-werror --with-system-zlib --disable-nls > --enable-checking=3Drelease --with-bugurl=3Dhttps://bugs.gentoo.org/ > --with-pkgversion=3D'Gentoo 4.8.3' --enable-libstdcxx-time > --enable-shared --enable-threads=3Dposix --enable-__cxa_atexit > --enable-clocale=3Dgnu --disable-multilib --disable-altivec > --disable-fixed-point --with-arch=3Di686 --enable-targets=3Dall > --disable-libgcj --enable-libgomp --disable-libmudflap > --disable-libssp --enable-lto --without-cloog > Thread model: posix > gcc version 4.8.3 (Gentoo 4.8.3) >=20 > LFS: > ## gcc -v > Using built-in specs. > COLLECT_GCC=3Dgcc > COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/i686-pc-linux-gnu/4.9.1/lto-wrap= per > Target: i686-pc-linux-gnu > Configured with: ../gcc-4.9.1/configure --prefix=3D/usr > --enable-languages=3Dc,c++ --disable-multilib --disable-bootstrap > --with-system-zlib > Thread model: posix > gcc version 4.9.1 (GCC) >=20 > Slackware: > Reading specs from /slash/usr/bin/../lib/gcc/i486-slackware-linux/4.8.2= /specs > COLLECT_GCC=3Dgcc > COLLECT_LTO_WRAPPER=3D/slash/usr/bin/../libexec/gcc/i486-slackware-linu= x/4.8.2/lto-wrapper > Target: i486-slackware-linux > Configured with: ../gcc-4.8.2/configure --prefix=3D/usr > --libdir=3D/usr/lib --mandir=3D/usr/man --infodir=3D/usr/info > --enable-shared --enable-bootstrap > --enable-languages=3Dada,c,c++,fortran,go,java,lto,objc > --enable-threads=3Dposix --enable-checking=3Drelease --enable-objc-gc > --with-system-zlib --with-python-dir=3D/lib/python2.7/site-packages > --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp > --enable-lto --with-gnu-ld --verbose --enable-java-home > --with-java-home=3D/usr/lib/jvm/jre --with-jvm-root-dir=3D/usr/lib/jvm > --with-jvm-jar-dir=3D/usr/lib/jvm/jvm-exports --with-arch-directory=3Di= 386 > --with-antlr-jar=3D/root/slackware-current/source/d/gcc/antlr-runtime-3= =2E4.jar > --enable-java-awt=3Dgtk --disable-gtktest --with-arch=3Di486 > --target=3Di486-slackware-linux --build=3Di486-slackware-linux > --host=3Di486-slackware-linux > Thread model: posix > gcc version 4.8.2 (GCC) >=20 > I'm not elfwise, but I could post something to google drive if needed. >=20 > TIA >=20 > Jorge Almeida >=20 Hi :) I have compared some exes and libs from Ubuntu 14.04 and my Gentoo (both x86_64) and for similar versions it seems like most of _my_ Gentoo binaries are around 10% bigger (a few are 10% smaller). I have completely ignored GCC settings (both are 4.8.x though). IMO your sample (one 5-10 kb program) is not representative for the distro in general. I compared: /bin/bash /usr/bin/xterm /bin/bzip2 /bin/gzip /usr/bin/xz /usr/bin/xev /usr/lib/libaspell.so /usr/lib/libdaemon.so IMO you shouldn't compare 4.8.x with 4.9.x. I don't want to dismiss your concern with your specific program. In your case it is a big difference, and I'm curios too, where it comes from. Maybe you can find out more by a more thorough comparation of the flags GCC uses at runtime by comparing the output of: gcc -Q --help=3Dtarget gcc -Q --help=3Doptimizers (Find more --help=3D____ in the man page.) Greetings Daniel --=20 Get my PGP key at: * http://keyserver.ubuntu.com:11371/pks/lookup?op=3Dget&search=3D0x837FB8B5= BB9D4887 * $ gpg --recv-keys --keyserver keyserver.ubuntu.com 0xBB9D4887 --bNHaoDKDJ18gRL8f5pVCvFQbWR9cPFnKh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUKYprAAoJEJCOjMf/yVE3ly0QALyESuewj+DJLo9jzeX+TEA5 Y79iZp4wbxLYl+Zo0O1uK7HUkG3vBd3LJW7XVvnBnGQ/bXReJl7YBJS/YL8gyof6 qSJcAgaoDoUZ5Ni/tWBUe6GX7AEWI5CMMwUsmShI68pMXkdgngggwFDxkbNrm9LD dws4CXoZ+RdSLbyuomgS1Cyxen1cdpR9NhlZHGJrnXyNih2haY7ktKyLSRHjHI0y t5Nbz0mOFeMgSenG64ld2/sObwTRLJbDOsY+jN6BkucgNE+7Fe8pijMqzNiE77Up rwwJDrllPLgUkhZ+g4SskRts2uomaXwpQnD3TmHr4zIEff6XYEDMliGjFSQL6rkE wVQn6fRgW3O0hdOQuDASWC9+a2KtfMo8bI1/0hsPagCtOi7BIhlCQ/vZKINZT7kL 5S3o8yep+lucBhlbFa+z9kWzWyh2MdZuoFKI1LUBJERYrXAB9Pesn19BNIlJxji1 s7iPTD/fJPVKVFpj4JrEYMOKz9OJoZsoI2ZD3EEF9JB/5AgKooy5O000PsVTPn19 SMc6o7XiqJT1Yry6aJQUjL/sr5TWybH6Wk+PkOT5cNUqKDgT1LWVvsiKC4Ze1Tie bc8rT+h7hWYmlh4rjmTcPaJwpVZxonp3QgS+IOZc3Ezqo158to2CNysYWutzdlFR 5HXnkOv2mjPJe8SnN9k7 =VCYd -----END PGP SIGNATURE----- --bNHaoDKDJ18gRL8f5pVCvFQbWR9cPFnKh--