diff options
author | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2020-05-30 22:27:24 +0000 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-06-23 08:44:02 -0300 |
commit | fb3c377da24217614c0e84a738c9e2f61742f54c (patch) | |
tree | a1a3965c98b6a865f01f982568e855edd3da7ba6 /recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch | |
parent | b354d998bff234fea016d4e14d937c5af7eaf150 (diff) | |
download | meta-freescale-fb3c377da24217614c0e84a738c9e2f61742f54c.tar.gz |
optee-os: backport gcc10 compilation fix from upstream
Backport PR 3891 [1] from OP-TEE upstream repository. This PR solves
GCC10 compilation issue when new compiler option `outline-atomics` is
not implemented and causes the linker error.
In addition, above upstream PR solves issue with 'cc-option` macro,
which is necessary to be used to provide comptibility with GCC <10 to
disable the `outline-atomics` option, since it is present only in GCC10.
[1]: https://github.com/OP-TEE/optee_os/pull/3891
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch')
-rw-r--r-- | recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch b/recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch deleted file mode 100644 index 605daccc..00000000 --- a/recipes-security/optee-imx/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | From ef5327d7e9d74a433b0a1f2ca2f4cf3953797350 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrey Zhizhikin <andrey.z@gmail.com> | ||
3 | Date: Fri, 22 May 2020 21:01:15 +0000 | ||
4 | Subject: [PATCH] arm64: Disable outline-atomics when compiling | ||
5 | |||
6 | This is a backport of upstream patch [1] with adaptions to optee-imx | ||
7 | version in this layer. | ||
8 | |||
9 | Original patch uses $(call cc-option,-mno-outline-atomics,) to disable | ||
10 | outline-atomics which itself is broken and required 4 additional patches | ||
11 | to be compatible with gcc and clang. | ||
12 | |||
13 | This is resolved in the upstream PR [2], which is applicable to the | ||
14 | latest upstream version. | ||
15 | |||
16 | NXP fork contains old version of OP-TEE, and therefore would receive the | ||
17 | update for Makefiles with new version. Since it is not required to make | ||
18 | current NXP version compatible with old compiler versions on master | ||
19 | branch - outline-atomics are disabled directly. | ||
20 | |||
21 | Original patch description: | ||
22 | --------------------------------------------------------------------- | ||
23 | Disables the automatic detection of LSE (Large System Extension) | ||
24 | instructions when compiling AArch64 code. GCC 10 implements this | ||
25 | detection in libgcc using __getauxval(), which optee doesn't implement. | ||
26 | This requires that the proper -mcpu is passed to GCC so that the code | ||
27 | can be correctly compiled to use either LSE or load-store-exclusive. | ||
28 | |||
29 | Fixes linker errors like the following when compiling with GCC 10: | ||
30 | |||
31 | aarch64-linux-ld.bfd: libgcc.a(lse-init.o): | ||
32 | in function `init_have_lse_atomics': | ||
33 | lse-init.c:44: undefined reference to `__getauxval' | ||
34 | core/arch/arm/kernel/link.mk:38: | ||
35 | recipe for target 'build/core/all_objs.o' failed | ||
36 | --------------------------------------------------------------------- | ||
37 | |||
38 | Upstream-Status: Backport [e07c2b062846df4385542f4e4fe08b40cf7d8191] | ||
39 | |||
40 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | ||
41 | |||
42 | [1]: https://github.com/OP-TEE/optee_os/pull/3891/commits/e07c2b062846df4385542f4e4fe08b40cf7d8191 | ||
43 | [2]: https://github.com/OP-TEE/optee_os/pull/3891 | ||
44 | Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> | ||
45 | --- | ||
46 | core/arch/arm/arm.mk | 2 +- | ||
47 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
48 | |||
49 | diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk | ||
50 | index aa101be8..8cb2b2e2 100644 | ||
51 | --- a/core/arch/arm/arm.mk | ||
52 | +++ b/core/arch/arm/arm.mk | ||
53 | @@ -88,7 +88,7 @@ arm32-platform-aflags-no-hard-float ?= | ||
54 | |||
55 | arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only | ||
56 | arm64-platform-cflags-hard-float ?= | ||
57 | -arm64-platform-cflags-generic ?= -mstrict-align | ||
58 | +arm64-platform-cflags-generic ?= -mstrict-align -mno-outline-atomics | ||
59 | |||
60 | ifeq ($(DEBUG),1) | ||
61 | # For backwards compatibility | ||
62 | -- | ||
63 | 2.17.1 | ||
64 | |||