Is -static a link-only switch?
Daniel Jacobowitz
drow@false.org
Thu May 12 15:50:00 GMT 2005
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
More information about the Gcc
mailing list