[cfe-dev] Passing -r to the linker

Mike Stump mrs at apple.com
Wed Sep 2 17:46:10 PDT 2009


On Sep 2, 2009, at 4:05 PM, David Chisnall wrote:
> Is there a good reason why -r is not passed to the linker?

It passes it for me:

$ touch t.c
$ clang t.c
Undefined symbols:
   "_main", referenced from:
       start in crt1.10.6.o
ld: symbol(s) not found
$ clang t.c  -r -nostdlib -o me

ConstructJob has:

   Args.AddAllArgs(CmdArgs, options::OPT_r);

which is how it works for me.  You can add this line to yours...  That  
is simple and easy.  Now, as for what's best... I suspect sharing more  
bits between architectures would be good.  This certainly seems like  
one to share.



More information about the cfe-dev mailing list