From 143f2f6e377c28434f310494f3c24879b31adc26 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 25 Jan 2012 21:32:31 +0000 Subject: Try to unbreak the FreeBSD toolchain's detection of 32-bit targets inside a 64-bit freebsd machine with the 32-bit compatibility layer installed. The FreeBSD image always has the /usr/lib32 directory, so test for the more concrete existence of crt1.o. Also enhance the tests for freebsd to clarify what these trees look like and exercise the new code. Thanks to all the FreeBSD folks for helping me understand what caused the failure and how we might fix it. =] That helps a lot. Also, yay build bots. llvm-svn: 148981 --- clang/lib/Driver/ToolChains.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Driver/ToolChains.cpp') diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 44f51e4c5d5..c39d6243465 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1627,11 +1627,11 @@ Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA, FreeBSD::FreeBSD(const Driver &D, const llvm::Triple& Triple) : Generic_ELF(D, Triple) { - // When targeting 32-bit platforms, look for '/usr/lib32' first and fall back - // to '/usr/lib' for the remaining cases. + // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall + // back to '/usr/lib' if it doesn't exist. if ((Triple.getArch() == llvm::Triple::x86 || Triple.getArch() == llvm::Triple::ppc) && - llvm::sys::fs::exists(getDriver().SysRoot + "/usr/lib32")) + llvm::sys::fs::exists(getDriver().SysRoot + "/usr/lib32/crt1.o")) getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32"); else getFilePaths().push_back(getDriver().SysRoot + "/usr/lib"); -- cgit v1.2.3