summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch')
-rw-r--r--recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch62
1 files changed, 0 insertions, 62 deletions
diff --git a/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
deleted file mode 100644
index 0120f5c2..00000000
--- a/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
5From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
6Date: Tue, 13 Oct 2020 22:45:39 +0300
7Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
8
9Never version of libgcc are built with LSE implementation in mind. To
10determine if LSE is available on platform it calls __getauxval(), so in
11some cases we can get undefined reference to __getauxval() error.
12
13Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
14handler depends on atomic operations, so it tries to call
15init_have_lse_atomics() first. This function in turn calls __getauxval(),
16which causes linking error.
17
18In the future we can make __getauxval() to return actual platform
19capabilities.
20
21Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
22Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
23Reviewed-by: Jerome Forissier <jerome@forissier.org>
24---
25 lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
26 lib/libutils/ext/arch/arm/sub.mk | 1 +
27 2 files changed, 13 insertions(+)
28 create mode 100644 lib/libutils/ext/arch/arm/auxval.c
29
30diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
31new file mode 100644
32index 00000000..98bca850
33--- /dev/null
34+++ b/lib/libutils/ext/arch/arm/auxval.c
35@@ -0,0 +1,12 @@
36+// SPDX-License-Identifier: BSD-2-Clause
37+/*
38+ * Copyright (c) 2020, EPAM Systems
39+ */
40+
41+#include <compiler.h>
42+
43+unsigned long int __getauxval (unsigned long int type);
44+unsigned long int __getauxval (unsigned long int type __unused)
45+{
46+ return 0;
47+}
48diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
49index dc5eed67..2e779066 100644
50--- a/lib/libutils/ext/arch/arm/sub.mk
51+++ b/lib/libutils/ext/arch/arm/sub.mk
52@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
53 endif
54 srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
55 srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
56+srcs-y += auxval.c
57 ifneq ($(sm),ldelf) # TA, core
58 srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
59 srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
60--
612.25.1
62