How to force gcc to build always statically linked binaries?

John Love-Jensen eljay@adobe.com
Fri Jun 2 19:27:00 GMT 2006


Hi Ioannis,

Try this (in shorthand):

mkdir ~/MySpoofedGCC

PATH=~/MySpoofedGCC:$PATH

vi ~/MySpoofedGCC/gcc
-----------------
#!/bin/bash

/bin/gcc -static "$@"
-----------------

Does that make sense?

I've used that successfully to put in a few flags I wanted everywhere and
always, such as -D_GLIBCXX_FULLY_DYNAMIC_STRING.  But I used a BIG HAMMER.
I changed gcc to gcc-real, and made my script where gcc was located.  That
works on a personal machine, but would make people upset if it was a shared
gcc for a lot of people.

--Eljay



More information about the Gcc-help mailing list