[PATCH] D22904: Fix two bugs for musl-libc on ARM
Diana Picus via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 8 01:35:36 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL277985: Fix two bugs for musl-libc on ARM (authored by rovka).
Changed prior to commit:
https://reviews.llvm.org/D22904?vs=66074&id=67131#toc
Repository:
rL LLVM
https://reviews.llvm.org/D22904
Files:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/linux-ld.c
Index: cfe/trunk/test/Driver/linux-ld.c
===================================================================
--- cfe/trunk/test/Driver/linux-ld.c
+++ cfe/trunk/test/Driver/linux-ld.c
@@ -1613,24 +1613,36 @@
// RUN: --target=thumb-pc-linux-musleabihf \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=thumbv7-pc-linux-musleabi -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=thumbeb-pc-linux-musleabi \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=thumbeb-pc-linux-musleabihf \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=thumbv7eb-pc-linux-musleabi -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=arm-pc-linux-musleabi \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARM %s
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=arm-pc-linux-musleabihf \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=armv7-pc-linux-musleabi -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=armeb-pc-linux-musleabi \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=armeb-pc-linux-musleabihf \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=armv7eb-pc-linux-musleabi -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
+// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-pc-linux-musleabi \
// RUN: | FileCheck --check-prefix=CHECK-MUSL-AARCH64 %s
// RUN: %clang %s -### -o %t.o 2>&1 \
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4274,19 +4274,28 @@
if (Triple.isAndroid())
return Triple.isArch64Bit() ? "/system/bin/linker64" : "/system/bin/linker";
- else if (Triple.isMusl()) {
+
+ if (Triple.isMusl()) {
std::string ArchName;
+ bool IsArm = false;
+
switch (Arch) {
+ case llvm::Triple::arm:
case llvm::Triple::thumb:
ArchName = "arm";
+ IsArm = true;
break;
+ case llvm::Triple::armeb:
case llvm::Triple::thumbeb:
ArchName = "armeb";
+ IsArm = true;
break;
default:
ArchName = Triple.getArchName().str();
}
- if (Triple.getEnvironment() == llvm::Triple::MuslEABIHF)
+ if (IsArm &&
+ (Triple.getEnvironment() == llvm::Triple::MuslEABIHF ||
+ tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard))
ArchName += "hf";
return "/lib/ld-musl-" + ArchName + ".so.1";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22904.67131.patch
Type: text/x-patch
Size: 3101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160808/2f9e9023/attachment.bin>
More information about the cfe-commits
mailing list