[cfe-dev] -r no longer passed to linker under Linux?

David Chisnall theraven at theravensnest.org
Wed Apr 20 06:41:07 PDT 2011


On 20 Apr 2011, at 11:26, David Chisnall wrote:

> I've just started seeing some projects fail to build under Linux with a recent clang, with this telltale message:
> 
> clang: warning: argument unused during compilation: '-r'
> 
> This is then followed by a load of missing symbol errors from the linker.
> 
> This definitely was working a few weeks ago, so it seems to be a regression...
> 
> David

This trivial patch fixes it, but I don't want to apply without understanding why it was broken in the first place...

David

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp	(revision 129848)
+++ lib/Driver/Tools.cpp	(working copy)
@@ -3684,6 +3684,7 @@
   // and for "clang -g foo.o -o foo". Other warning options are already
   // handled somewhere else.
   Args.ClaimAllArgs(options::OPT_w);
+  Args.AddAllArgs(CmdArgs, options::OPT_r);
 
   if (!D.SysRoot.empty())
     CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));





More information about the cfe-dev mailing list