[cfe-dev] Passing -r to the linker

Dimitry Andric dimitry at andric.com
Fri Aug 13 05:25:16 PDT 2010


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. :)

As a workaround, you can use "-Wl,-r", if that is possible for your
projects.



More information about the cfe-dev mailing list