summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominic Sacré <dominic.sacre@gmx.de>2016-06-14 10:20:30 +0200
committerDominic Sacré <dominic.sacre@gmx.de>2016-06-14 10:20:30 +0200
commita07ea851caa097acfa3d76fcaeef33e63aa58ef2 (patch)
tree7b8e7eb550f0040f23cdef2aabe2a9577860c4ad
parent0cb950a68db7221217232ec9479a5a4b83637d62 (diff)
downloadmeta-clang-a07ea851caa097acfa3d76fcaeef33e63aa58ef2.tar.gz
clang: Fix AEABI helper calling convention for musl targets
AEABI floating point helper functions always use AAPCS (soft-float) calling convention. Recognize MUSLEABI targets to fix the code generated for musl-based hard-float builds. Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
-rw-r--r--recipes-devtools/clang/clang/0001-ARMTargetLowering-Handle-MUSLEABI-to-fix-AEABI-helpe.patch51
-rw-r--r--recipes-devtools/clang/clang_git.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0001-ARMTargetLowering-Handle-MUSLEABI-to-fix-AEABI-helpe.patch b/recipes-devtools/clang/clang/0001-ARMTargetLowering-Handle-MUSLEABI-to-fix-AEABI-helpe.patch
new file mode 100644
index 0000000..78756cd
--- /dev/null
+++ b/recipes-devtools/clang/clang/0001-ARMTargetLowering-Handle-MUSLEABI-to-fix-AEABI-helpe.patch
@@ -0,0 +1,51 @@
1From fded84c3b6db127a0520b8216a82fe6c4b400247 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Dominic=20Sacr=C3=A9?= <dominic.sacre@gmx.de>
3Date: Tue, 14 Jun 2016 09:50:21 +0200
4Subject: [PATCH] ARMTargetLowering: Handle MUSLEABI to fix AEABI helper
5 calling convention
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10AEABI floating point helper functions always use AAPCS (soft-float)
11calling convention. Recognize MUSLEABI targets to fix the code generated
12for musl-based hard-float builds.
13
14Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
15---
16 lib/Target/ARM/ARMISelLowering.cpp | 2 +-
17 lib/Target/ARM/ARMSubtarget.h | 5 +++++
18 2 files changed, 6 insertions(+), 1 deletion(-)
19
20diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
21index a2daa89..f4ed6f3 100644
22--- a/lib/Target/ARM/ARMISelLowering.cpp
23+++ b/lib/Target/ARM/ARMISelLowering.cpp
24@@ -254,7 +254,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,
25 // RTLIB
26 if (Subtarget->isAAPCS_ABI() &&
27 (Subtarget->isTargetAEABI() || Subtarget->isTargetGNUAEABI() ||
28- Subtarget->isTargetAndroid())) {
29+ Subtarget->isTargetAndroid() || Subtarget->isTargetMUSLEABI())) {
30 static const struct {
31 const RTLIB::Libcall Op;
32 const char * const Name;
33diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
34index 4d54e57..3ba330b 100644
35--- a/lib/Target/ARM/ARMSubtarget.h
36+++ b/lib/Target/ARM/ARMSubtarget.h
37@@ -399,6 +399,11 @@ public:
38 TargetTriple.getEnvironment() == Triple::GNUEABIHF) &&
39 !isTargetDarwin() && !isTargetWindows();
40 }
41+ bool isTargetMUSLEABI() const {
42+ return (TargetTriple.getEnvironment() == Triple::MUSLEABI ||
43+ TargetTriple.getEnvironment() == Triple::MUSLEABIHF) &&
44+ !isTargetDarwin() && !isTargetWindows();
45+ }
46
47 // ARM Targets that support EHABI exception handling standard
48 // Darwin uses SjLj. Other targets might need more checks.
49--
502.8.4
51
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 2a6aa58..286906d 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -18,6 +18,7 @@ SRC_URI = "${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};n
18 file://0001-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-compile.patch \ 18 file://0001-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-compile.patch \
19 file://0002-Do-not-assume-linux-glibc.patch \ 19 file://0002-Do-not-assume-linux-glibc.patch \
20 file://0001-triplet-Add-musl-support.patch \ 20 file://0001-triplet-Add-musl-support.patch \
21 file://0001-ARMTargetLowering-Handle-MUSLEABI-to-fix-AEABI-helpe.patch \
21 file://0001-driver-Add-musl-ldso-support.patch;patchdir=tools/clang \ 22 file://0001-driver-Add-musl-ldso-support.patch;patchdir=tools/clang \
22 file://0001-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \ 23 file://0001-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \
23 file://0001-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ 24 file://0001-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \