Reducing size of GCC installation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux