[PATCH] Add support for -R driver flag on OpenBSD

Matthew Dempsky matthew at dempsky.org
Tue Dec 17 12:55:40 PST 2013


On Tue, Dec 17, 2013 at 1:22 AM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> I expect an error to be raised because -R is not a compiler flag. Just
> because GCC used to pass all unknown junk to the linker doesn't mean it
> is valid behavior that should be depended on.

I don't follow.  On FreeBSD/NetBSD/OpenBSD/Solaris, GCC specifically
recognizes that the -R flag takes an argument, and that the -R flag
and its argument should be passed along to the linker when present.
It's not passing "all unknown junk to the linker" as you claim.

Also, why do you expect Clang to raise an error for
"-R/usr/local/lib"?  On OpenBSD, I can compile with "-dylib_file blah"
(a Darwin-specific flag) or even "-andmyaxe" and only get a warning.
Raising an error for "-R/usr/local/lib" seems inconsistent with the
handling of other unknown flags.



More information about the cfe-commits mailing list