[PATCH] Make Clang::Driver/linker-opts.c safe on a bare-metal compiler

Richard Barton richard.barton at arm.com
Mon Dec 16 05:24:48 PST 2013


Hi Tim, Meador

Thanks for the review. The attached patch attempts to emulate the GCC
behaviour for LIBRARY_PATH.

 - Environment variable LLVM_HOST_TRIPLE created by the build system is
compared with the -target option to determine if native compilation is used.
 - LIBRARY_PATH environment variable is now only supported when native
compilation taking place.
 - I had to add a special case in the check for ARM vs Thumb to prevent this
being considered a cross-compilation.
 - Clang::Driver/linker-opts.c can now take the "REQUIRES: native" predicate
to only test on supported cases.

I don't know if other target triples will need special casing in the code as
ARM/Thumb has in my patch. If so the check needs to be adapted.

Please review

Thanks
Rich

> -----Original Message-----
> From: Meador Inge [mailto:meadori at codesourcery.com]
> Sent: 11 December 2013 17:32
> To: Tim Northover; Richard Barton
> Cc: cfe-commits at cs.uiuc.edu
> Subject: Re: [PATCH] Make Clang::Driver/linker-opts.c safe on a bare-metal
> compiler
> 
> On 12/11/2013 09:41 AM, Tim Northover wrote:
> 
> > The GCC documentation
> > (http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html) seems
> > to imply it's actually dependent on native vs cross rather than
> > embedded vs Linux. This fits with a few cursory tests I've just done
> > on my toolchains.
> 
> This is correct.  GCC only honors LIBRARY_PATH for native toolchains.
> 
> --
> Meador Inge
> CodeSourcery / Mentor Embedded
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIBRARY-PATH-native-only.patch
Type: application/octet-stream
Size: 2643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131216/abeec5d4/attachment.obj>


More information about the cfe-commits mailing list