diff options
Diffstat (limited to 'main/xen/gcc10-arm64-force-inline-atomics.patch')
-rw-r--r-- | main/xen/gcc10-arm64-force-inline-atomics.patch | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/main/xen/gcc10-arm64-force-inline-atomics.patch b/main/xen/gcc10-arm64-force-inline-atomics.patch index 1ffdd2d2126..4491fe94479 100644 --- a/main/xen/gcc10-arm64-force-inline-atomics.patch +++ b/main/xen/gcc10-arm64-force-inline-atomics.patch @@ -1,15 +1,42 @@ -Based on https://lists.xenproject.org/archives/html/xen-devel/2020-09/msg00478.html +From 5d45ecabe3c0b2097df623ab7b471f8915cfdde6 Mon Sep 17 00:00:00 2001 +From: Jan Beulich <jbeulich@suse.com> +Date: Fri, 11 Sep 2020 12:45:33 +0200 +Subject: [PATCH] xen/arm64: force gcc 10+ to always inline generic atomics + helpers -[This patch should be replaced with the committed version, when it's -available from the Xen git repository.] +Recent versions of gcc (at least 10.x) will not inline generic atomics +helpers by default. Instead they will expect the software to either link +with libatomic.so or implement the helpers, which would result in ---- a/xen/arch/arm/Rules.mk 2020-05-14 14:19:32.000000000 +0200 -+++ b/xen/arch/arm/Rules.mk 2020-09-10 11:17:53.640315194 +0200 -@@ -17,6 +17,7 @@ +undefined reference to `__aarch64_ldadd4_acq_rel' + +for us (not having any local implementation). + +To keep the previous behavior, force gcc to always inline the generic +atomics helpers. + +Long term we probably want to avoid relying on gcc atomics helpers as +this doesn't allow us to switch between LSE and LL/SC atomics. + +Suggested-by: Julien Grall <jgrall@amazon.com> +Signed-off-by: Jan Beulich <jbeulich@suse.com> +Reviewed-by: Julien Grall <jgrall@amazon.com> +--- + xen/arch/arm/arch.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xen/arch/arm/arch.mk b/xen/arch/arm/arch.mk +index c8186f5828..11caec86ba 100644 +--- a/xen/arch/arm/arch.mk ++++ b/xen/arch/arm/arch.mk +@@ -12,6 +12,7 @@ CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc +$(call cc-option-add,CFLAGS-$(CONFIG_ARM_64),CC,-mno-outline-atomics) - ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n) - CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE + ifneq ($(filter command line environment,$(origin CONFIG_EARLY_PRINTK)),) + $(error You must use 'make menuconfig' to enable/disable early printk now) +-- +2.20.1 + |