[cfe-dev] Passing -r to the linker

Daniel Dunbar daniel.dunbar at gmail.com
Sun Aug 15 09:15:26 PDT 2010


On Aug 13, 2010, at 7:25, Dimitry Andric <dimitry at andric.com> wrote:

> On 2010-08-13 14:18, David Chisnall wrote:
>> I have a problem with a few projects that pass -r as a link flag to clang - this isn't passed to the linker, so there end up being a large number of unresolved reference errors.  Apparently it is correctly passed on some platforms, but not others (FreeBSD in this case).
>
> Yes, this is a real difference in command line option processing between
> gcc and clang.  Probably for old-time compatibility's sake, gcc just
> passes unknown options through to the linker, while clang seems to just
> swallow them. :)

I don't believe this to be correct. GCC passes *a lot* of options
through to the linker, buy certainly not all unrecognized options.

You just need to updater the toolchain definition for your platform to
pass -r through.

 - Daniel

> As a workaround, you can use "-Wl,-r", if that is possible for your
> projects.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list