r324948 - Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD.
John Baldwin via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 12 14:22:01 PST 2018
Author: jhb
Date: Mon Feb 12 14:22:01 2018
New Revision: 324948
URL: http://llvm.org/viewvc/llvm-project?rev=324948&view=rev
Log:
Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD.
Summary:
FreeBSD N64 MIPS systems can include 32-bit libraries for O32 in
/usr/lib32 similar to the 32-bit compatibility libraries provided
for FreeBSD/amd64 and FreeBSD/powerpc64.
Reviewers: dim
Reviewed By: dim
Differential Revision: https://reviews.llvm.org/D42972
Modified:
cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp
cfe/trunk/test/Driver/freebsd.c
Modified: cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp?rev=324948&r1=324947&r2=324948&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp Mon Feb 12 14:22:01 2018
@@ -317,6 +317,8 @@ FreeBSD::FreeBSD(const Driver &D, const
// 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::mips ||
+ Triple.getArch() == llvm::Triple::mipsel ||
Triple.getArch() == llvm::Triple::ppc) &&
D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o"))
getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");
Modified: cfe/trunk/test/Driver/freebsd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=324948&r1=324947&r2=324948&view=diff
==============================================================================
--- cfe/trunk/test/Driver/freebsd.c (original)
+++ cfe/trunk/test/Driver/freebsd.c Mon Feb 12 14:22:01 2018
@@ -36,6 +36,12 @@
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
// CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
//
+// Check that O32 MIPS uses /usr/lib32 on a 64-bit tree.
+//
+// RUN: %clang -target mips-freebsd12 %s \
+// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
+//
// Check that the new linker flags are passed to FreeBSD
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
More information about the cfe-commits
mailing list