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: Ian Lance Taylor <ian at airs dot com>
- To: "Gary Funck" <gary at intrepid dot com>
- Cc: "Gcc Mailing List" <gcc at gcc dot gnu dot org>
- Date: 12 May 2005 13:46:28 -0400
- Subject: Re: Is -static a link-only switch?
- References: <JCEPIPKHCJGDMPOHDOIGCEGLCOAA.gary@intrepid.com>
"Gary Funck" <gary@intrepid.com> writes:
> Ian Lance Taylor wrote (in part):
> > In fact many targets compile code differently depending upon whether
> > the code is to be put into a shared library or not, but this is
> > controlled via options like -fpic, not -static.
>
> Is it generally safe on all currently supported targets to assert -fno-pic
> when compiling programs that will ultimately be linked with -static asserted?
> Will targets that don't support -fpic (and -fon-pic) complain, or just quietly
> accept the switch?
I believe that -fno-pic will always be accepted, even if it does
nothing.
I'm not sure what you are after here, but I'll note that there are
other related options for specific targets, like MIPS -mno-abicalls.
I'll also note that on most, and perhaps all, targets, you are
permitted to link -fpic code into a statically linked executable, with
some loss of efficiency.
Ian