summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-07-29 23:48:32 +0000
committerBob Wilson <bob.wilson@apple.com>2014-07-29 23:48:32 +0000
commitc5e90ae43a74fc42979e2522ac367a1be6bc74cb (patch)
treef194919a76562e2bc4bda9fc63dc1fc3727e1967
parent31a4da4d2e66b504319573b454ea3fc755ebbeea (diff)
Merging r214208:
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_35@214257 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/ToolChain.h7
-rw-r--r--lib/Driver/ToolChains.h5
-rw-r--r--test/Driver/linker-opts.c4
3 files changed, 13 insertions, 3 deletions
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h
index c9a6c4b57f..550e4dfc60 100644
--- a/include/clang/Driver/ToolChain.h
+++ b/include/clang/Driver/ToolChain.h
@@ -116,9 +116,6 @@ public:
StringRef getPlatform() const { return Triple.getVendorName(); }
StringRef getOS() const { return Triple.getOSName(); }
- /// \brief Returns true if the toolchain is targeting a non-native architecture.
- bool isCrossCompiling() const;
-
/// \brief Provide the default architecture name (as expected by -arch) for
/// this toolchain. Note t
std::string getDefaultUniversalArchName() const;
@@ -171,6 +168,10 @@ public:
// Platform defaults information
+ /// \brief Returns true if the toolchain is targeting a non-native
+ /// architecture.
+ virtual bool isCrossCompiling() const;
+
/// HasNativeLTOLinker - Check whether the linker and related tools have
/// native LLVM support.
virtual bool HasNativeLLVMSupport() const;
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 8e5cf04939..73d6959371 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -427,6 +427,11 @@ public:
/// @name ToolChain Implementation
/// {
+ // Darwin tools support multiple architecture (e.g., i386 and x86_64) and
+ // most development is done against SDKs, so compiling for a different
+ // architecture should not get any special treatment.
+ bool isCrossCompiling() const override { return false; }
+
llvm::opt::DerivedArgList *
TranslateArgs(const llvm::opt::DerivedArgList &Args,
const char *BoundArch) const override;
diff --git a/test/Driver/linker-opts.c b/test/Driver/linker-opts.c
index 3fc95ec7d2..24866a63b1 100644
--- a/test/Driver/linker-opts.c
+++ b/test/Driver/linker-opts.c
@@ -5,3 +5,7 @@
// XFAIL: win32
// REQUIRES: clang-driver
// REQUIRES: native
+
+// Make sure that LIBRARY_PATH works for both i386 and x86_64 on Darwin.
+// RUN: env LIBRARY_PATH=%T/test1 %clang -target x86_64-apple-darwin %s -### 2>&1 | FileCheck %s
+// RUN: env LIBRARY_PATH=%T/test1 %clang -target i386-apple-darwin %s -### 2>&1 | FileCheck %s