[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.14] xen/arm64: force gcc 10+ to always inline generic atomics helpers



commit f61c5d0ca729eda5e936b8aa2b45c4192e2f2b64
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Sep 11 12:45:33 2020 +0200
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Thu Nov 5 17:48:15 2020 -0800

    xen/arm64: force gcc 10+ to always inline generic atomics helpers
    
    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@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    (cherry picked from commit 5d45ecabe3c0b2097df623ab7b471f8915cfdde6)
---
 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 ($(filter command line environment,$(origin CONFIG_EARLY_PRINTK)),)
     $(error You must use 'make menuconfig' to enable/disable early printk now)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.