diff options
author | Ming Liu <liu.ming50@gmail.com> | 2022-06-22 16:17:12 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-09-08 09:08:54 -0700 |
commit | f7662bef1534bdef96e7c6c8449a3e6a646045ec (patch) | |
tree | 0a897660946f46bdcad6abdd9d90ada5e50ccac2 | |
parent | 5610f95b96fd949a27f92ad0b5a683b3dfd3e549 (diff) | |
download | meta-clang-f7662bef1534bdef96e7c6c8449a3e6a646045ec.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>
(cherry picked from commit 36c4dc63c96fb0962d3825c19b22a166db0f3e4f)
-rw-r--r-- | recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch | 65 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
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 @@ | |||
1 | From 1c9415806ba6d0d48a160637eea7d1b70efaae69 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pengxuan Zheng <pzheng@quicinc.com> | ||
3 | Date: Mon, 4 Apr 2022 18:17:03 -0700 | ||
4 | Subject: [PATCH] [compiler-rt][builtins] Move DMB definition to syn-ops.h | ||
5 | |||
6 | Upstream-Status: Backported | ||
7 | |||
8 | Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB | ||
9 | is used for any pre-ARMv6 targets. More specifically, the "#error only supported | ||
10 | on ARMv6+" added in D99282 will cause compilation to fail when any source file | ||
11 | which includes assembly.h are compiled for pre-ARMv6 targets. Since the only | ||
12 | place where DMB is used is syn-ops.h (which is only included by | ||
13 | arm/sync_fetch_and_* and these files are excluded from being built for older | ||
14 | targets), this patch moves the definition there to avoid the issues described | ||
15 | above. | ||
16 | |||
17 | Reviewed By: efriedma | ||
18 | |||
19 | Differential 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 | |||
25 | diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h | ||
26 | index 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; \ | ||
44 | diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h | ||
45 | index 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 | -- | ||
64 | 2.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 |
50 | GCCPIE ??= "" | 51 | GCCPIE ??= "" |