public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <matthew.thompson@nasa.gov>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Reducing size of GCC installation?
Date: Tue, 4 Aug 2020 19:26:09 +0000	[thread overview]
Message-ID: <A27CF849-ED98-4F70-A513-D3560E5D5998@contoso.com> (raw)

All,

This might be a FAQ, but my Google-fu is being stymied by the fact that my searches are often finding issues about making executables, etc. made by GCC smaller rather than my issue: making GCC itself smaller.

To wit, I'm trying to build some Docker images and found that the code I'm eventually trying to build with gcc (gfortran, actually) doesn't like the versions from RPMs/DEBs/etc. So, my first step is usually to do what I'm quite used to and build GCC a la:

  ../gcc-10.2.0/configure --prefix=$HOME/GCC/10.2.0 --disable-multilib --enable-languages=c,c++,fortran
  make
  make install

and this works. Huzzah.

But the main issue I have is the desire to make docker images as small as possible. So I obviously remove the build directory, but the install directory itself is pretty beefy:

$ du -hsc GCC/10.2.0/*
295M GCC/10.2.0/bin
12M  GCC/10.2.0/include
24M  GCC/10.2.0/lib
221M GCC/10.2.0/lib64
1.1G GCC/10.2.0/libexec
16M  GCC/10.2.0/share
1.6G total

Ouch. 1.6G.

So I'm looking at any way to make that smaller. My first thought is using strip a posteriori to make executable smaller, but maybe this is A Bad Thing™? I know it can make some of the binaries smaller (of course) but maybe in doing so, things fall apart?

Or perhaps is there a configure option to "ensmallen GCC" upon installation?

Just thought I'd ask and thanks for any help.

Best,
Matt

--
Matt Thompson, SSAI, Ld Scientific Programmer/Analyst
NASA GSFC,    Global Modeling and Assimilation Office
Code 610.1,  8800 Greenbelt Rd,  Greenbelt,  MD 20771
Phone: 301-614-6712                 Fax: 301-614-6246
http://science.gsfc.nasa.gov/sed/bio/matthew.thompson

             reply	other threads:[~2020-08-04 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 19:26 Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] [this message]
2020-08-04 20:24 ` Segher Boessenkool
2020-08-04 21:10   ` [EXTERNAL] " Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]
2020-08-04 20:50 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A27CF849-ED98-4F70-A513-D3560E5D5998@contoso.com \
    --to=matthew.thompson@nasa.gov \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).