[PATCH] GCC compatibility: pass -z linker options to the linker

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jul 15 15:06:12 PDT 2014


On Tue, Jul 15, 2014 at 02:33:58PM -0700, Eric Christopher wrote:
> On Tue, Jul 15, 2014 at 1:33 PM, Reid Kleckner <rnk at google.com> wrote:
> > ================
> > Comment at: include/clang/Basic/DiagnosticDriverKinds.td:122
> > @@ -121,1 +121,3 @@
> >
> > +def warn_linker_args_take_Wl : Warning<"linker argument -z should be -Wl,-z">,
> > +  InGroup<InvalidCommandLineArgument>;
> > ----------------
> > Maybe "linker argument %0 should be escaped with -Wl, and commas"?  Specifically, I think many users won't realize that they need to escape the second space after -z.
> >
> > Alternatively, I would be happy if we removed this diagnostic, but I know Joerg won't.  My preferred resolution is, again, that we ask GCC to document -z as a linker option and then we support it without equivocation.
> >
> 
> I've gone ahead and documented it in gcc here:
> 
> dzur:~/sources/gcc> svn ci
> Sending        gcc/ChangeLog
> Sending        gcc/doc/invoke.texi
> Transmitting file data ..
> Committed revision 212575.
> 
> Please go ahead and remove the diagnostic. I apologize about the churn
> for you. Once that's settled do you have commit access or do you need
> someone to commit for you?

I don't think that changes anything. Random linker options should not be
passed directly to the driver. Fixing that also helps with deployed
clang versions, so a warning is certainly an improvement.

Joerg



More information about the cfe-commits mailing list