[cfe-commits] r118382 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h lib/Driver/Tools.cpp lib/Driver/Tools.h test/Driver/emit-llvm.c test/Driver/sysroot-flags.c

Frits van Bommel fvbommel at gmail.com
Mon Nov 8 02:16:49 PST 2010


On Sun, Nov 7, 2010 at 9:14 PM, Rafael Espindola
<rafael.espindola at gmail.com> wrote:
> +  if (IsUbuntu(Distro))
> +    ExtraOpts.push_back("-z relro");

Regular binutils ld doesn't mind this, but gold gives an error: "ld:
relro: unknown -z option" (note that there are _two_ spaces in front
of "relro" there)
I think the problem is that you're pushing this as a single argument
with a space in it, and apparently gold doesn't strip the space when
it processes the -z option.
You should probably either push "-zrelro" or push "-z" and "relro"
separately. (neither give an error from the command line, though I
don't know what it's supposed to do so I can't check whether the first
does what's expected...)
The attached patch implements the second option.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gold-relro.patch
Type: text/x-diff
Size: 500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101108/c5448dbd/attachment.patch>


More information about the cfe-commits mailing list