summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-06-22 16:17:12 +0200
committerKhem Raj <raj.khem@gmail.com>2022-07-05 09:29:24 -0400
commit201e74960feafc19e8393062180b93139a4b91de (patch)
treeaeb8cff24cd62804ee88473c5194bb1fdb11333b /recipes-devtools
parent9cea73660aa56b461f96487ddcbfba5e7b64fafb (diff)
downloadmeta-clang-201e74960feafc19e8393062180b93139a4b91de.tar.gz
compiler-rt: backport a patch fixing ARMv5 cross-compile
Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB is used for any pre-ARMv6 targets. More specifically, the "#error only supported on ARMv6+" added in D99282 will cause compilation to fail when any source file which includes assembly.h are compiled for pre-ARMv6 targets. Since the only place where DMB is used is syn-ops.h (which is only included by arm/sync_fetch_and_* and these files are excluded from being built for older targets), this patch moves the definition there to avoid the issues described above. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch65
-rw-r--r--recipes-devtools/clang/common.inc1
2 files changed, 66 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch b/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch
new file mode 100644
index 0000000..3616645
--- /dev/null
+++ b/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch
@@ -0,0 +1,65 @@
1From 1c9415806ba6d0d48a160637eea7d1b70efaae69 Mon Sep 17 00:00:00 2001
2From: Pengxuan Zheng <pzheng@quicinc.com>
3Date: Mon, 4 Apr 2022 18:17:03 -0700
4Subject: [PATCH] [compiler-rt][builtins] Move DMB definition to syn-ops.h
5
6Upstream-Status: Backported
7
8Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB
9is used for any pre-ARMv6 targets. More specifically, the "#error only supported
10on ARMv6+" added in D99282 will cause compilation to fail when any source file
11which includes assembly.h are compiled for pre-ARMv6 targets. Since the only
12place where DMB is used is syn-ops.h (which is only included by
13arm/sync_fetch_and_* and these files are excluded from being built for older
14targets), this patch moves the definition there to avoid the issues described
15above.
16
17Reviewed By: efriedma
18
19Differential Revision: https://reviews.llvm.org/D123105
20---
21 compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++++++
22 compiler-rt/lib/builtins/assembly.h | 8 --------
23 2 files changed, 8 insertions(+), 8 deletions(-)
24
25diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h
26index d914f9d3a109..dca201d8aef7 100644
27--- a/compiler-rt/lib/builtins/arm/sync-ops.h
28+++ b/compiler-rt/lib/builtins/arm/sync-ops.h
29@@ -14,6 +14,14 @@
30
31 #include "../assembly.h"
32
33+#if __ARM_ARCH >= 7
34+#define DMB dmb
35+#elif __ARM_ARCH >= 6
36+#define DMB mcr p15, #0, r0, c7, c10, #5
37+#else
38+#error DMB is only supported on ARMv6+
39+#endif
40+
41 #define SYNC_OP_4(op) \
42 .p2align 2; \
43 .syntax unified; \
44diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h
45index 06aa18162e3b..69a3d8620f92 100644
46--- a/compiler-rt/lib/builtins/assembly.h
47+++ b/compiler-rt/lib/builtins/assembly.h
48@@ -189,14 +189,6 @@
49 JMP(ip)
50 #endif
51
52-#if __ARM_ARCH >= 7
53-#define DMB dmb
54-#elif __ARM_ARCH >= 6
55-#define DMB mcr p15, #0, r0, c7, c10, #5
56-#else
57-#error Only use this with ARMv6+
58-#endif
59-
60 #if defined(USE_THUMB_2)
61 #define WIDE(op) op.w
62 #else
63--
642.25.1
65
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index b61d239..7cbd7f4 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -45,6 +45,7 @@ SRC_URI = "\
45 file://0033-lldb-Link-with-libatomic-on-x86.patch \ 45 file://0033-lldb-Link-with-libatomic-on-x86.patch \
46 file://0034-clang-exclude-openembedded-distributions-from-settin.patch \ 46 file://0034-clang-exclude-openembedded-distributions-from-settin.patch \
47 file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ 47 file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \
48 file://0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch \
48 " 49 "
49# Fallback to no-PIE if not set 50# Fallback to no-PIE if not set
50GCCPIE ??= "" 51GCCPIE ??= ""