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 49E9F13838B for ; Sun, 28 Sep 2014 23:37:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67189E0955; Sun, 28 Sep 2014 23:37:40 +0000 (UTC) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E2400E0941 for ; Sun, 28 Sep 2014 23:37:38 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id gb8so7548585lab.30 for ; Sun, 28 Sep 2014 16:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hSaekFBCGUicbRiozOc8lwn74Vl+5p6g4r7+u9Inl9U=; b=jNrHqfQJIFHXSzhi5Q2FDmpDtyEPExqBCpEhCeekrHVNTE90SQSqdCdp1mifWuvgMe 6WUV/MsWIey8wQ8qUJFZcMQydIptZp6c+BVbQ5jLAvvdxj4u2NXQGzBBOZMVwh8gKcE9 uS6502Fs9LdYLyne9soY9XTNlSXtpjku8cQPu0YWx6fQCCTLQj15p5/Bfqxd65O05J3B ER6Q7OxVZiyl/gwnFjkgy0YWavoPFpK+2q81fB5GdgtjfALn6OFXmdfZDdQMUV/3y1uB fy/wq7QuRWqlsSDFojUSf63aiIpCL+6+KNRxPu/to3OdzCMJfLfORLQWYRJWQeT3jONf qPDg== 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 X-Received: by 10.152.87.10 with SMTP id t10mr12555840laz.22.1411947457284; Sun, 28 Sep 2014 16:37:37 -0700 (PDT) Received: by 10.114.57.141 with HTTP; Sun, 28 Sep 2014 16:37:37 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Sep 2014 00:37:37 +0100 Message-ID: Subject: Re: [gentoo-user] Re: bloated by gcc From: Jorge Almeida To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 695c9ba2-0853-4c3d-91a3-e34b2f7ee3a0 X-Archives-Hash: 8df78077a184e03e167c7c17aa064a5c On Sun, Sep 28, 2014 at 10:56 PM, walt wrote: > On 09/28/2014 01:44 AM, Jorge Almeida wrote: >> I'm having a somewhat disgusting issue on my Gentoo: binaries are >> unaccountably large. >> > Are you cross-compiling for different hardware? I'm just curious what results > you get with --march=native. Nope. Actually, I compiled with --march=native, with no difference (probably because my code is not fancy enough to make use of whatever stuff that pulls), but then tried i686 just to enable comparing with non-Gentoo systems. The purpose is to have small static binaries compiled against dietlibc to be used in the same computer (compile once and forget about future software incompatibilities!). I compiled against glibc to make sure the problem is not with dietlibc. > > Also, I looked up data-sections and function-sections (which I'd never heard > of before today :) The gcc man page says the resulting executable will be > larger and slower, and not to use them "unless there are significant benefits" > but then doesn't say what those benefits might be. Hm, cryptic. > I found those flags in the net (probably StackOverflow), looking for ways to optimize size. Maybe what you read was not meant to static compiling? Anyway, I used these flags in 4 systems (including LFS in the same computer as Gentoo) and only the Gentoo system has this behaviour... Thanks, Jorge >