summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch')
-rw-r--r--recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch
new file mode 100644
index 00000000..086d4333
--- /dev/null
+++ b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch
@@ -0,0 +1,41 @@
1From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Mon, 18 May 2020 20:00:00 -0500
4Subject: [PATCH] arm64: Disable outline-atomics when compiling
5
6Disables the automatic detection of LSE (Large System Extension)
7instructions when compiling AArch64 code. GCC 10 implements this
8detection in libgcc using __getauxval(), which optee doesn't implement.
9This requires that the proper -mcpu is passed to GCC so that the code
10can be correctly compiled to use either LSE or load-store-exclusive.
11
12Fixes linker errors like the following when compiling with GCC 10:
13
14 aarch64-linux-ld.bfd: libgcc.a(lse-init.o):
15 in function `init_have_lse_atomics':
16 lse-init.c:44: undefined reference to `__getauxval'
17 core/arch/arm/kernel/link.mk:38:
18 recipe for target 'build/core/all_objs.o' failed
19
20Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
21Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874]
22---
23 core/arch/arm/arm.mk | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
27index a18eda3b..07069c66 100644
28--- a/core/arch/arm/arm.mk
29+++ b/core/arch/arm/arm.mk
30@@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?=
31
32 arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
33 arm64-platform-cflags-hard-float ?=
34-arm64-platform-cflags-generic ?= -mstrict-align
35+arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,)
36
37 ifeq ($(DEBUG),1)
38 # For backwards compatibility
39--
402.17.1
41