This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is -static a link-only switch?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Gary Funck <gary at intrepid dot com>
- Cc: Gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 12 May 2005 11:43:47 -0400
- Subject: Re: Is -static a link-only switch?
- References: <JCEPIPKHCJGDMPOHDOIGIEGKCOAA.gary@intrepid.com>
On Thu, May 12, 2005 at 08:37:54AM -0700, Gary Funck wrote:
>
> Does the -static switch play any role during compilation, or is it
> a link-only switch? A quick review of gcc.c, indicates that -static
> may play a role on some targets:
>
> /* %{static:} simply prevents an error message if the target machine
> doesn't handle -static. */
... in its link specs.
> I can think of target OS's that might define a different ABI for procedure calls
> for programs compiled with -static asserted, than when compiled for a dynamic
> linking environment, but can't quite tell if in fact -static has any effect
> during compilation.
I don't know of any; it was a close call on one RTOS I worked on
recently, but it turned out that nothing else was necessary. This sort
of applies to MIPS but that gets a separate option (-fno-pic
-mno-abicalls).
--
Daniel Jacobowitz
CodeSourcery, LLC