Skip to contentSkip to conversation

gcc10 build issue for Arm64

DISCUSSION Jan Beulich 2 participants 3 messages Aug 27, 2020

lore
Share & tools
lore
#0 lore raw

Stefano, Julien,

since it was touching code potentially also affecting Arm, prior to my push of a couple of commits a few minutes ago I also wanted to build-test Arm. While as a fallback all went well with gcc 9.3, with my first (default) attempt with 10.2 I ran into

ld: prelink.o: in function `_spin_lock_cb':
/build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel'
ld: /build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel' make[3]: *** [/build/xen/staging-arm64/xen/xen-syms] Error 1
make[2]: *** [/build/xen/staging-arm64/xen/xen] Error 2
make[1]: *** [install] Error 2
make: *** [install-xen] Error 2

I have no idea how recent the introduction of the issue is, but I hope you'll be able to pinpoint the offending change (and a possible fix) much easier than I would be.

Thanks, Jan

#1 lore raw
Quoted 1 line · Jan Beulich

Stefano, Julien,

Hi Jan,

Quoted 13 lines

since it was touching code potentially also affecting Arm, prior to my push of a couple of commits a few minutes ago I also wanted to build-test Arm. While as a fallback all went well with gcc 9.3, with my first (default) attempt with 10.2 I ran into

ld: prelink.o: in function `_spin_lock_cb':
/build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel'
ld: /build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel' make[3]: *** [/build/xen/staging-arm64/xen/xen-syms] Error 1
make[2]: *** [/build/xen/staging-arm64/xen/xen] Error 2
make[1]: *** [install] Error 2
make: *** [install-xen] Error 2

Quoted 3 lines

I have no idea how recent the introduction of the issue is, but I hope you'll be able to pinpoint the offending change (and a possible fix) much easier than I would be.

It looks like GCC10 will outline atomic helpers by default. The following hack will do the trick:

xen/arch/arm/Rules.mk +1 -0
index e69de29bb2..8dfd9713af 100644
@@ -0,0 +1 @@
+c_flags+=-mno-outline-atomics

I will clean it up to check it also works with older GCC.

Cheers,

Signature · 1 line
Julien Grall
#2 lore raw
Quoted 32 lines · Julien Grall
Quoted 1 line · Jan Beulich

Stefano, Julien,

Hi Jan,

Quoted 13 lines

since it was touching code potentially also affecting Arm, prior to my push of a couple of commits a few minutes ago I also wanted to build-test Arm. While as a fallback all went well with gcc 9.3, with my first (default) attempt with 10.2 I ran into

ld: prelink.o: in function `_spin_lock_cb':
/build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel'
ld: /build/xen/staging-arm64/xen/common/spinlock.c:164: undefined reference to `__aarch64_ldadd4_acq_rel' make[3]: *** [/build/xen/staging-arm64/xen/xen-syms] Error 1
make[2]: *** [/build/xen/staging-arm64/xen/xen] Error 2
make[1]: *** [install] Error 2
make: *** [install-xen] Error 2

Quoted 3 lines

I have no idea how recent the introduction of the issue is, but I hope you'll be able to pinpoint the offending change (and a possible fix) much easier than I would be.

It looks like GCC10 will outline atomic helpers by default. The following hack will do the trick:

xen/arch/arm/Rules.mk +1 -0
index e69de29bb2..8dfd9713af 100644
@@ -0,0 +1 @@
+c_flags+=-mno-outline-atomics
Quoted 1 line

I will clean it up to check it also works with older GCC.

Ah. The option at least is not documented for gcc9. I also think its (conditional) addition belongs in arch.mk, not Rules.mk, judging from how it gets done on x86. But I guess sorting this was meant to be part of your "cleaning it up".

Jan