This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is -static a link-only switch?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]