Support LIBRARY_PATH on all Darwin targets.
authorBob Wilson <bob.wilson@apple.com>
Tue, 29 Jul 2014 20:17:52 +0000 (20:17 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 29 Jul 2014 20:17:52 +0000 (20:17 +0000)
commit9e6e0751b3a856d3a3ffcd70f8311a0e5434268a
tree6f2474d19ff1743230fc64196831dd5bb40cca29
parent82625d3a5fb6a00fb0de934e83d9c3ee201c062b
Support LIBRARY_PATH on all Darwin targets.

r197490 changed the behavior of LIBRARY_PATH to try to match GCC's behavior
for cross compilers and make clang work better on "bare metal" targets.
Unfortunately that change is breaking a number of MacPorts projects because
the LIBRARY_PATH environment variable is being ignored when compiling on a
64-bit host for a 32-bit target. Because the host and target architectures
differ, isCrossCompiling returns true. This does not make sense for Darwin,
where multiple architectures are supported natively via "fat" Mach-O slices
and where development is generally done against SDKs regardless. This patch
fixes the problem by overriding isCrossCompiling to return false for Darwin
toolchains.

llvm-svn: 214208
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/ToolChains.h
clang/test/Driver/linker-opts.c