diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-01-25 08:04:15 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-01-25 08:04:15 +0000 |
commit | f4826e28b96f67096cf808843164b26b960e57f8 (patch) | |
tree | 1297e9904267dfd1869a3146e1d3a2d53ff6d031 /clang/lib/Driver | |
parent | a1f1fd3b60c81f38698404c628c250db63168a75 (diff) | |
download | bcm5719-llvm-f4826e28b96f67096cf808843164b26b960e57f8.tar.gz bcm5719-llvm-f4826e28b96f67096cf808843164b26b960e57f8.zip |
Switch FreeBSD to just include both '/usr/lib32' and '/usr/lib' in the
search paths for 32-bit targets. This avoids having to detect which is
expected for the target system, and the linker should DTRT, and take the
32-bit libraries from the first one when applicable. Thanks to Roman
Divacky for sanity checking this.
llvm-svn: 148939
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index ba0c2b431bf..6b8168e6868 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1628,23 +1628,14 @@ Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA, FreeBSD::FreeBSD(const HostInfo &Host, const llvm::Triple& Triple) : Generic_ELF(Host, Triple) { - // Determine if we are compiling 32-bit code on an x86_64 platform. - bool Lib32 = false; - // FIXME: This is using the Driver's target triple as the host triple! - if (Triple.getArch() == llvm::Triple::x86 && - getDriver().TargetTriple.getArch() == llvm::Triple::x86_64) - Lib32 = true; - - // FIXME: This is using the Driver's target triple as the host triple! - if (Triple.getArch() == llvm::Triple::ppc && - getDriver().TargetTriple.getArch() == llvm::Triple::ppc64) - Lib32 = true; - - if (Lib32) { + // When targeting 32-bit platforms, look for libraries in '/usr/lib32' first; + // for 64-bit hosts that's where they will live. We fall back to '/usr/lib' + // for the remaining cases. + if (Triple.getArch() == llvm::Triple::x86 || + Triple.getArch() == llvm::Triple::ppc) getFilePaths().push_back("/usr/lib32"); - } else { - getFilePaths().push_back("/usr/lib"); - } + + getFilePaths().push_back("/usr/lib"); } Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA, |