How to force gcc to build always statically linked binaries?

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

 



Hello,

I managed to compile gcc 4.1.0 as a cross-compiler for alphaev56-unknown-linux-gnu and I am using it for quite some time now.The binaries that this compiler produces are fed to a simulator, which currently accepts only statically linked binaries. As a result, I am always passing the -static flag during linking. However, the number of Makefiles has grown quite a bit and adding this flag to all the places where it is required is becoming more difficult.

Therefore, I am trying to find a way to automatically force gcc to include this option during linking. I searched quite a bit and I think that this can be achieved through a specs file. I used gcc -dumpspecs to see the default settings, but I am not sure what additions I have to make and where exactly in the file.

Apart from using a specs file, is there another way to do this, maybe while configuring gcc before building it? I noticed that there is a --disable-shared configuration option, but I am not certain if it does what I want.

Hope that somebody can help!

Ioannis

[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