]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/arm64: force gcc 10+ to always inline generic atomics helpers
authorJan Beulich <jbeulich@suse.com>
Fri, 11 Sep 2020 10:45:33 +0000 (12:45 +0200)
committerJulien Grall <jgrall@amazon.com>
Fri, 11 Sep 2020 12:36:27 +0000 (13:36 +0100)
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

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

index c8186f58288d1713799297656524894d7f05e407..11caec86ba14d8c08d8a5b44d966d1737aa50992 100644 (file)
@@ -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 ($(filter command line environment,$(origin CONFIG_EARLY_PRINTK)),)
     $(error You must use 'make menuconfig' to enable/disable early printk now)