🌐
GNU
gcc.gnu.org › install › finalinstall.html
Installing GCC: Final installation - GNU Project
January 2, 2026 - We strongly recommend to install into a target directory where there is no previous version of GCC present. Also, the GNAT runtime should not be stripped, as this would break certain features of the debugger that depend on this debugging information (catching Ada exceptions for instance).
🌐
Narkive
gcc-help.gcc.gnu.narkive.com › uHObUmCg › make-install-strip
make install-strip
Post by kevin diggs The install instructions for 4.3.5 say that the GNAT runtime (libraries? gnat1? gnat?) should not be stripped. If the install-strip make target does what I think it does does it know NOT to strip the "GNAT runtime"? It should. If it doesn't, please file a bug report.
🌐
GNU
gnu.org › prep › standards › html_node › Standard-Targets.html
Standard Targets (GNU Coding Standards)
This helps eventual debugging that may be needed later, and nowadays disk space is cheap and dynamic loaders typically ensure debug sections are not loaded during normal execution. Users that need stripped binaries may invoke the install-strip target to do that.
🌐
GNU
gcc.gnu.org › legacy-ml › gcc-patches › 2010-11 › msg00192.html
Ralf Wildenhues - Re: make install-strip with binutils
November 2, 2010 - * configure: Regenerate. * Makefile.def (install-strip-gcc, install-strip-binutils) (install-strip-opcodes, install-strip-ld, install-strip-itcl) (install-strip-sid): Mirror dependencies on non-strip variants of these targets on the respective -strip prerequisites.
🌐
Gnutoolchains
gnutoolchains.com › building
Prebuilt GNU Toolchains for Windows
If you have a multi-core machine, ... jobs you want to have. ... The "install-strip" option is similar to "install", but it will remove debugging information from the binaries....
🌐
Sorush Khajepor
iamsorush.com › posts › build-gcc11
Build GCC 11 from source on Ubuntu - Sorush Khajepor
Build GCC: make -j 16 · My laptop ... you might get errors, read, google and fix them. Then run the make command again. Install compiled files: sudo make install-strip ·...
🌐
GitHub
github.com › is1200-example-projects › mcb32tools › blob › master › Makefile
mcb32tools/Makefile at master · is1200-example-projects/mcb32tools
+make -C "build/gcc" install-strip-gcc · +make -C "build/gcc" install-target-libgcc · · processors: binutils-install | build · mkdir -p build/lib/proc · mkdir -p build/include · cp linkscripts/*.ld build/lib/proc/ cp -r headers/* build/include/ ·
Author   is1200-example-projects
🌐
GitLab
gitlab.haskell.org › glasgow haskell compiler › ghc › issues › #1851
#1851: "make install-strip" should work · Issues · Glasgow Haskell Compiler / GHC · GitLab
November 7, 2007 - With the bindists (not sure about a normal build tree) install-strip doesn't work: $ make install-strip make: *** No rule to make target `install-strip'. Stop. $ It is defined in mk/install.mk, so it presumably is meant to. The blurb after running configure should mention it, too.
🌐
Google Groups
groups.google.com › a › groups.riscv.org › g › sw-dev › c › J_z_KbPJ6zE
How can I do a "make install-strip" of the tools
./configure --prefix=`pwd`/riscv64-unknown-elf-gcc --enable-multilib --disable-float make · This builds and installs the tools but the executables are unstripped. How can I tell the build process to do make install-strip rather than make install for each package?
🌐
Stack Overflow
stackoverflow.com › questions › 43275756 › how-to-make-gcc-binaries-in-release-mode
debugging - How to make GCC binaries in release mode? - Stack Overflow
What is the corresponding option for ./configure? ... It isn't debug vs release. By default, you get -O2 -g, that is optimized but still with debug symbols. You can use make install-strip to remove the debug symbols.
Find elsewhere
🌐
Linux TLDR
linuxtldr.com › home › what is strip command and how to use it?
What is Strip Command and How to Use it? - Linux TLDR
June 11, 2025 - This all-encompassing information, ... indirectly consuming more disk space. The strip command is a GNU utility that is used to remove unnecessary information from your compiled file, reducing its size and making it more difficult ...
Top answer
1 of 4
110

gcc being a compiler/linker, its -s option is something done while linking. It's also not configurable - it has a set of information which it removes, no more no less.

strip is something which can be run on an object file which is already compiled. It also has a variety of command-line options which you can use to configure which information will be removed. For example, -g strips only the debug information which gcc -g adds.

Note that strip is not a bash command, though you may be running it from a bash shell. It is a command totally separate from bash, part of the GNU binary utilities suite.

2 of 4
70

The accepted answer is very good but just to complement your further questions (and also as reference for anyone that end up here).

What's the equivalent to gcc -s in terms of strip with some of its options?

They both do the same thing, removing the symbols table completely. However, as @JimLewis pointed out strip allows finer control. For example, in a relocatable object, strip --strip-unneeded won't remove its global symbols. However, strip or strip --strip-all would remove the complete symbols table.

Which one do you use to reduce the size of executable and speed up its running

The symbols table is a non-allocable section of the binary. This means that it never gets loaded in RAM memory. It stores information that can be useful for debugging purporses, for instance, to print out a stacktrace when a crash happens. A case where it could make sense to remove the symbols table would be a scenario where you have serious constraints of storage capacity (in that regard, gcc -Os -s or make CXXFLAGS="-Os -s" ... is useful as it will result in a smaller slower binary that is also stripped to reduce size further). I don't think removing the symbols table would result into a speed gain for the reasons commented.

Lastly, I recommend this link about stripping shared objects: http://www.technovelty.org/linux/stripping-shared-libraries.html

🌐
GNU
sourceware.org › binutils › docs › binutils › strip.html
strip (GNU Binary Utilities)
Please note that this plugin search directory is not the one used by ld’s -plugin option. In order to make strip use the linker plugin it must be copied into the ${libdir}/bfd-plugins directory. For GCC based compilations the linker plugin is called liblto_plugin.so.0.0.0.
🌐
Baeldung
baeldung.com › home › building › how to strip executables in linux
How to Strip Executables in Linux | Baeldung on Linux
March 18, 2024 - $ gcc –s –o hello_world hello_world.c $ nm hello_world nm: hello_world: no symbols · The -s option removes all of the symbols and relocation information from the executable. As the output of running the nm hello_world command shows, the built executable has no symbols. Therefore, with this approach, we don’t need to use the strip command.
🌐
Stack Overflow
stackoverflow.com › questions › 23725408 › why-is-binary-compiled-with-gcc-not-stripped-by-default
c - why is binary compiled with gcc not stripped by default - Stack Overflow
install is usually used to move files from build directory into its final destination, /usr/bin, /bin, etc. It has options to strip binary, set permissions, etc: linux.die.net/man/1/install ...
🌐
GitHub
github.com › mxe › mxe › issues › 985
Option to strip (native) binaries · Issue #985 · mxe/mxe
November 12, 2015 - Is it possible to automatically strip binaries before or after they were installed? Especially the gcc binaries in the libexec directories are very huge and I personally don't need the debugging symbols. Maybe an option in settings.mk li...
Author   mxe
🌐
Narkive
lfs-support.linuxfromscratch.narkive.com › d4nMcu4m › using-strip-all-everywhere
Using --strip-all everywhere - lfs-support@linuxfromscratch.org
Post by v p I'm going to install LFS and therefore have a question: can I define CFLAGS, CXXFLAGS and LDFLAGS to contain '-s' flag and compile EVERYTHING with it, even GCC and GLIBC? Book says nobody must use You can do anything you like including breaking your build by deviating ignorantly from instructions. FBBG. Post by v p 'strip --strip-all' because of the possibility to damage the system but I won't use the 'strip' utility but I force gcc/ld just _not to include_ the symbols.
🌐
Linux From Scratch
linuxfromscratch.org › lfs › view › development › chapter08 › stripping.html
8.84. Stripping
save_usrlib="$(cd /usr/lib; ls ld-linux*[^g]) libc.so.6 libthread_db.so.1 libquadmath.so.0.0.0 libstdc++.so.6.0.34 libitm.so.1.0.0 libatomic.so.1.2.0" cd /usr/lib for LIB in $save_usrlib; do objcopy --only-keep-debug --compress-debug-sections=zstd $LIB $LIB.dbg cp $LIB /tmp/$LIB strip --strip-unneeded /tmp/$LIB objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB install -vm755 /tmp/$LIB /usr/lib rm /tmp/$LIB done online_usrbin="bash find strip" online_usrlib="libbfd-2.46.0.20260210.so libsframe.so.3.0.0 libhistory.so.8.3 libncursesw.so.6.6 libm.so.6 libreadline.so.8.3 libz.so.1.3.2 libzstd.so.1.5.7
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › c/c++
[SOLVED] Stripping a library? - Raspberry Pi Forums
Packages installed by apt will usually have a call to ldconfig somewhere in their installation script if they install libraries. Kira the Koding Kitty, R.I.P. 8/3/24 ... You can take strip further with superstrip ... https://manned.org/sstrip/20e710ae The source code is here: https://github.com/BR903/ELFkickers/tree/master/sstrip Results: ... $ gcc -O3 fibo.c -o fibo $ ls -l fibo -rwxr-xr-x 1 pi pi 29060 Mar 24 08:51 fibo $ strip fibo $ ls -l fibo -rwxr-xr-x 1 pi pi 9600 Mar 24 08:52 fibo $ ./sstrip fibo $ ls -l fibo -rwxr-xr-x 1 pi pi 8264 Mar 24 08:52 fibo $ ./fibo | tail -c32 4856539211500699706378405156269 $ size fibo text data bss dec hex filename 0 0 0 0 0 fibo $