All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-arm][PATCH] optee-os: Fix compile with GCC 10
@ 2020-05-19  1:37 Joshua Watt
  2020-05-19 14:51 ` [meta-arm][PATCH v2] " Joshua Watt
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2020-05-19  1:37 UTC (permalink / raw)
  To: meta-arm; +Cc: denys, jdmason, Joshua Watt

Adds a patch to fix compiles with GCC 10 due to the way that libgcc
detects LSE support using __getauxval().

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 ...sable-outline-atomics-when-compiling.patch | 41 +++++++++++++++++++
 .../recipes-security/optee/optee-os_git.bb    |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta-arm/recipes-security/optee/optee-os/0001-core-Disable-outline-atomics-when-compiling.patch

diff --git a/meta-arm/recipes-security/optee/optee-os/0001-core-Disable-outline-atomics-when-compiling.patch b/meta-arm/recipes-security/optee/optee-os/0001-core-Disable-outline-atomics-when-compiling.patch
new file mode 100644
index 0000000..2fd8636
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-os/0001-core-Disable-outline-atomics-when-compiling.patch
@@ -0,0 +1,41 @@
+From f7136c2fade707d0287dbeed031da3def3abdc79 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <JPEWhacker@gmail.com>
+Date: Mon, 18 May 2020 20:00:00 -0500
+Subject: [PATCH] core: Disable outline-atomics when compiling
+
+Disables the automatic detection of LSE (Large System Extension)
+instructions when compiling AArch64 code. GCC 10 implements this
+detection in libgcc using __getauxval(), which optee doesn't implement.
+This requires that the proper -mcpu is passed to GCC so that the code
+can be correctly compiled to use either LSE or load-store-exclusive.
+
+Fixes linker errors like the following when compiling with GCC 10:
+
+ aarch64-linux-ld.bfd: libgcc.a(lse-init.o): in function
+  `init_have_lse_atomics':
+ lse-init.c:44: undefined reference to `__getauxval'
+ core/arch/arm/kernel/link.mk:38: recipe for target
+  'build/core/all_objs.o' failed
+
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874]
+---
+ core/arch/arm/arm.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
+index a18eda3b..c13fad35 100644
+--- a/core/arch/arm/arm.mk
++++ b/core/arch/arm/arm.mk
+@@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?=
+ 
+ arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
+ arm64-platform-cflags-hard-float ?=
+-arm64-platform-cflags-generic ?= -mstrict-align
++arm64-platform-cflags-generic ?= -mstrict-align -mno-outline-atomics
+ 
+ ifeq ($(DEBUG),1)
+ # For backwards compatibility
+-- 
+2.17.1
+
diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_git.bb
index dfff6d1..c13289b 100644
--- a/meta-arm/recipes-security/optee/optee-os_git.bb
+++ b/meta-arm/recipes-security/optee/optee-os_git.bb
@@ -16,6 +16,7 @@ SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_os.git \
     file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \
+    file://0001-core-Disable-outline-atomics-when-compiling.patch \
 "
 
 S = "${WORKDIR}/git"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-arm][PATCH v2] optee-os: Fix compile with GCC 10
  2020-05-19  1:37 [meta-arm][PATCH] optee-os: Fix compile with GCC 10 Joshua Watt
@ 2020-05-19 14:51 ` Joshua Watt
  2020-05-19 15:18   ` Jon Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2020-05-19 14:51 UTC (permalink / raw)
  To: meta-arm; +Cc: denys, jdmason, Joshua Watt

Adds a patch to fix compiles with GCC 10 due to the way that libgcc
detects LSE support using __getauxval().

V2: Incorporate patch changes suggested by upstream

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 ...sable-outline-atomics-when-compiling.patch | 41 +++++++++++++++++++
 .../recipes-security/optee/optee-os_git.bb    |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch

diff --git a/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch b/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch
new file mode 100644
index 0000000..086d433
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch
@@ -0,0 +1,41 @@
+From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <JPEWhacker@gmail.com>
+Date: Mon, 18 May 2020 20:00:00 -0500
+Subject: [PATCH] arm64: Disable outline-atomics when compiling
+
+Disables the automatic detection of LSE (Large System Extension)
+instructions when compiling AArch64 code. GCC 10 implements this
+detection in libgcc using __getauxval(), which optee doesn't implement.
+This requires that the proper -mcpu is passed to GCC so that the code
+can be correctly compiled to use either LSE or load-store-exclusive.
+
+Fixes linker errors like the following when compiling with GCC 10:
+
+ aarch64-linux-ld.bfd: libgcc.a(lse-init.o):
+    in function `init_have_lse_atomics':
+ lse-init.c:44: undefined reference to `__getauxval'
+ core/arch/arm/kernel/link.mk:38:
+    recipe for target 'build/core/all_objs.o' failed
+
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874]
+---
+ core/arch/arm/arm.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
+index a18eda3b..07069c66 100644
+--- a/core/arch/arm/arm.mk
++++ b/core/arch/arm/arm.mk
+@@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?=
+ 
+ arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
+ arm64-platform-cflags-hard-float ?=
+-arm64-platform-cflags-generic ?= -mstrict-align
++arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,)
+ 
+ ifeq ($(DEBUG),1)
+ # For backwards compatibility
+-- 
+2.17.1
+
diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_git.bb
index dfff6d1..07c17f0 100644
--- a/meta-arm/recipes-security/optee/optee-os_git.bb
+++ b/meta-arm/recipes-security/optee/optee-os_git.bb
@@ -16,6 +16,7 @@ SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_os.git \
     file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \
+    file://0001-arm64-Disable-outline-atomics-when-compiling.patch \
 "
 
 S = "${WORKDIR}/git"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-arm][PATCH v2] optee-os: Fix compile with GCC 10
  2020-05-19 14:51 ` [meta-arm][PATCH v2] " Joshua Watt
@ 2020-05-19 15:18   ` Jon Mason
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Mason @ 2020-05-19 15:18 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm, denys

On Tue, May 19, 2020 at 09:51:15AM -0500, Joshua Watt wrote:
> Adds a patch to fix compiles with GCC 10 due to the way that libgcc
> detects LSE support using __getauxval().
> 
> V2: Incorporate patch changes suggested by upstream
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>

Pulled into the master branch.

Thanks,
Jon

> ---
>  ...sable-outline-atomics-when-compiling.patch | 41 +++++++++++++++++++
>  .../recipes-security/optee/optee-os_git.bb    |  1 +
>  2 files changed, 42 insertions(+)
>  create mode 100644 meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch
> 
> diff --git a/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch b/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch
> new file mode 100644
> index 0000000..086d433
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-os/0001-arm64-Disable-outline-atomics-when-compiling.patch
> @@ -0,0 +1,41 @@
> +From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001
> +From: Joshua Watt <JPEWhacker@gmail.com>
> +Date: Mon, 18 May 2020 20:00:00 -0500
> +Subject: [PATCH] arm64: Disable outline-atomics when compiling
> +
> +Disables the automatic detection of LSE (Large System Extension)
> +instructions when compiling AArch64 code. GCC 10 implements this
> +detection in libgcc using __getauxval(), which optee doesn't implement.
> +This requires that the proper -mcpu is passed to GCC so that the code
> +can be correctly compiled to use either LSE or load-store-exclusive.
> +
> +Fixes linker errors like the following when compiling with GCC 10:
> +
> + aarch64-linux-ld.bfd: libgcc.a(lse-init.o):
> +    in function `init_have_lse_atomics':
> + lse-init.c:44: undefined reference to `__getauxval'
> + core/arch/arm/kernel/link.mk:38:
> +    recipe for target 'build/core/all_objs.o' failed
> +
> +Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> +Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874]
> +---
> + core/arch/arm/arm.mk | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
> +index a18eda3b..07069c66 100644
> +--- a/core/arch/arm/arm.mk
> ++++ b/core/arch/arm/arm.mk
> +@@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?=
> + 
> + arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
> + arm64-platform-cflags-hard-float ?=
> +-arm64-platform-cflags-generic ?= -mstrict-align
> ++arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,)
> + 
> + ifeq ($(DEBUG),1)
> + # For backwards compatibility
> +-- 
> +2.17.1
> +
> diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_git.bb
> index dfff6d1..07c17f0 100644
> --- a/meta-arm/recipes-security/optee/optee-os_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-os_git.bb
> @@ -16,6 +16,7 @@ SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
>  SRC_URI = " \
>      git://github.com/OP-TEE/optee_os.git \
>      file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \
> +    file://0001-arm64-Disable-outline-atomics-when-compiling.patch \
>  "
>  
>  S = "${WORKDIR}/git"
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-19 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19  1:37 [meta-arm][PATCH] optee-os: Fix compile with GCC 10 Joshua Watt
2020-05-19 14:51 ` [meta-arm][PATCH v2] " Joshua Watt
2020-05-19 15:18   ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.