toolchain/gcc: use ELFv2 ABI on ppc64 with musl
authorStijn Tintel <stijn@linux-ipv6.be>
Tue, 22 Sep 2020 11:02:58 +0000 (14:02 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 21 Dec 2021 19:35:29 +0000 (21:35 +0200)
At configuration time, gcc assumes that ppc64be targets use the ELFv1
ABI, and ppc64le targets use the ELFv2 ABI. However, musl libc does not
support the ELFv1 ABI on ppc64 at all, regardless of the endianness.

Therefore, when building for a ppc64 arch and with musl libc, instruct
gcc to use the ELFv2 ABI.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93157 for more info.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Rui Salvaterra <rsalvaterra@gmail.com>
toolchain/gcc/common.mk

index a1950028883676329765129fd9d6dc0faf5a8871..bef4fa37f8f90466c304c4a3c836d4912ea5025f 100644 (file)
@@ -108,6 +108,7 @@ GCC_CONFIGURE:= \
                $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
                        --with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
                $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
+               $(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \
                --with-gmp=$(TOPDIR)/staging_dir/host \
                --with-mpfr=$(TOPDIR)/staging_dir/host \
                --with-mpc=$(TOPDIR)/staging_dir/host \