From: Bob Wilson Date: Tue, 29 Jul 2014 23:48:32 +0000 (+0000) Subject: Merging r214208: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5e90ae43a74fc42979e2522ac367a1be6bc74cb;p=clang Merging r214208: git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_35@214257 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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