public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to force gcc to build always statically linked binaries?
@ 2006-06-02 19:09 Ioannis E. Venetis
  2006-06-02 19:27 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Ioannis E. Venetis @ 2006-06-02 19:09 UTC (permalink / raw)
  To: gcc-help

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

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

* Re: How to force gcc to build always statically linked binaries?
  2006-06-02 19:09 How to force gcc to build always statically linked binaries? Ioannis E. Venetis
@ 2006-06-02 19:27 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2006-06-02 19:27 UTC (permalink / raw)
  To: Ioannis E. Venetis, MSX to GCC

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

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

end of thread, other threads:[~2006-06-02 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-02 19:09 How to force gcc to build always statically linked binaries? Ioannis E. Venetis
2006-06-02 19:27 ` John Love-Jensen

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