public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Reducing size of GCC installation?
@ 2020-08-04 19:26 Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]
  2020-08-04 20:24 ` Segher Boessenkool
  2020-08-04 20:50 ` Jonathan Wakely
  0 siblings, 2 replies; 4+ messages in thread
From: Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] @ 2020-08-04 19:26 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-04 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 19:26 Reducing size of GCC installation? Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]
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

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).