Files
buildroot/arch/Config.in.loongarch
Jiaxun Yang bc28c3df6f arch/loongarch: Mark lp64f and lp64s as broken
Toolchain failed to bootstrap with LP64F and LP64S ABIs.

As reported by Julien in [1]:

Testing the "lp64f" ABI with commands:

     cat >.config <<EOF
     BR2_loongarch64=y
     BR2_LOONGARCH_FPU_32=y
     BR2_LINUX_KERNEL=y
     BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
     BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
     BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
     BR2_TARGET_ROOTFS_EXT2=y
     # BR2_TARGET_ROOTFS_TAR is not set
     EOF
     make olddefconfig
     make

fails in host-gcc-initial with output:

     Assembler messages:
     /tmp/ccEkwSsD.s:28: Error: register save offset not a multiple of 8
     /tmp/ccEkwSsD.s:30: Error: register save offset not a multiple of 8
     /tmp/ccEkwSsD.s:50: Error: register save offset not a multiple of 8

See also autobuilder failures such as [2].

Testing the "lp46s" ABI with commands:

     cat >.config <<EOF
     BR2_loongarch64=y
     BR2_LOONGARCH_FPU_NONE=y
     BR2_LINUX_KERNEL=y
     BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
     BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
     BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
     BR2_TARGET_ROOTFS_EXT2=y
     # BR2_TARGET_ROOTFS_TAR is not set
     EOF
     make olddefconfig
     make

fails in host-gcc-final with output:

     /buildroot/output/host/loongarch64-buildroot-linux-gnusf/bin/ld: cannot find crti.o: No such file or directory
     /buildroot/output/host/loongarch64-buildroot-linux-gnusf/bin/ld: cannot find -lc: No such file or directory
     /buildroot/output/host/loongarch64-buildroot-linux-gnusf/bin/ld: cannot find crtn.o: No such file or directory

See also autobuilder failures with as [3].

This commit marks those ABIs as broken at the moment to allow time
for investigation. Also, since gcc defaults to the "lp64d" ABI which
requires a 64bit FPU is present, the BR2_LOONGARCH_FPU_32 and
BR2_LOONGARCH_FPU_NONE options also needs to be marked as broken
as well. See [4].

[1] https://lore.kernel.org/buildroot/e17da108d1fb4e6abda26445dc053b35@free.fr/
[2] https://autobuild.buildroot.org/results/f98570293823867e6c43a1672e1a4b43ca1e4be5
[3] https://autobuild.buildroot.org/results/cf56c37fabcae964dbf4f96eb43a7e4d964452b6
[4] https://lore.kernel.org/buildroot/7b0f1cb629fce8a57d9b644b8beb8b2a@free.fr/

Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
[Julien:
 - add link to mailing list discussion
 - add configuration to reproduce issues to help future investigations
 - add links to autobuilder failures in commit log
 - mark BR2_LOONGARCH_FPU_{32,NONE} as broken
]
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
2025-08-09 18:22:21 +02:00

139 lines
3.3 KiB
Plaintext

# LoongArch CPU
choice
prompt "Target Architecture Variant"
default BR2_loongarch64_generic if BR2_ARCH_IS_64
config BR2_loongarch64_generic
bool "Generic LoongArch 64-bit"
depends on BR2_ARCH_IS_64
help
Generic LoongArch 64-bit processor.
config BR2_loongarch64_v1_0
bool "LoongArch64 ISA version 1.0"
depends on BR2_ARCH_IS_64
select BR2_ARCH_NEEDS_GCC_AT_LEAST_14
help
LoongArch64 ISA version 1.0 processor.
config BR2_loongarch64_v1_1
bool "LoongArch64 ISA version 1.1"
depends on BR2_ARCH_IS_64
select BR2_ARCH_NEEDS_GCC_AT_LEAST_14
help
LoongArch64 ISA version 1.1 processor.
endchoice
choice
prompt "FPU Type"
default BR2_LOONGARCH_FPU_64
config BR2_LOONGARCH_FPU_64
bool "64"
help
Allow the use of hardware floating-point instructions for
32-bit and 64-bit operations.
config BR2_LOONGARCH_FPU_32
bool "32"
# Only supported by lp64s and lp64f ABIs which are marked as broken
depends on BR2_BROKEN
help
Allow the use of hardware floating-point instructions for
32-bit operations only.
config BR2_LOONGARCH_FPU_NONE
bool "none"
# Only supported by lp64s ABI which is marked as broken
depends on BR2_BROKEN
help
Prevent the use of hardware floating-point instructions.
endchoice
choice
prompt "SIMD Type"
default BR2_LOONGARCH_SIMD_NONE
config BR2_LOONGARCH_SIMD_NONE
bool "none"
help
Prevent the use of hardware SIMD instructions.
config BR2_LOONGARCH_SIMD_LSX
bool "LSX"
depends on BR2_LOONGARCH_FPU_64
help
Enable generating instructions from the 128-bit LoongArch SIMD
Extension (LSX).
config BR2_LOONGARCH_SIMD_LASX
bool "LASX"
depends on BR2_LOONGARCH_FPU_64
help
Enable generating instructions from the 256-bit LoongArch
Advanced SIMD Extension (LASX) and the 128-bit LoongArch
SIMD Extension (LSX).
endchoice
choice
prompt "Target ABI"
default BR2_LOONGARCH_ABI_LP64D if BR2_ARCH_IS_64 && BR2_LOONGARCH_FPU_64
default BR2_LOONGARCH_ABI_LP64F if BR2_ARCH_IS_64 && BR2_LOONGARCH_FPU_32
default BR2_LOONGARCH_ABI_LP64S if BR2_ARCH_IS_64 && BR2_LOONGARCH_SIMD_NONE
config BR2_LOONGARCH_ABI_LP64D
bool "lp64d"
depends on BR2_ARCH_IS_64
depends on BR2_LOONGARCH_FPU_64
config BR2_LOONGARCH_ABI_LP64F
bool "lp64f"
depends on BR2_ARCH_IS_64
# Failed to build host GCC initial, pending investigation
depends on BR2_BROKEN
depends on BR2_LOONGARCH_FPU_64 || BR2_LOONGARCH_FPU_32
config BR2_LOONGARCH_ABI_LP64S
bool "lp64s"
depends on BR2_ARCH_IS_64
# GCC can't find libraries, pending investigation
depends on BR2_BROKEN
endchoice
config BR2_ARCH
default "loongarch64" if BR2_ARCH_IS_64
config BR2_NORMALIZED_ARCH
default "loongarch"
config BR2_ENDIAN
default "LITTLE"
config BR2_GCC_TARGET_ARCH
default "loongarch64" if BR2_loongarch64_generic
default "la64v1.0" if BR2_loongarch64_v1_0
default "la64v1.1" if BR2_loongarch64_v1_1
config BR2_GCC_TARGET_FPU
default "64" if BR2_LOONGARCH_FPU_64
default "32" if BR2_LOONGARCH_FPU_32
default "none" if BR2_LOONGARCH_FPU_NONE
config BR2_GCC_TARGET_SIMD
default "lasx" if BR2_LOONGARCH_SIMD_LASX
default "lsx" if BR2_LOONGARCH_SIMD_LSX
default "none" if BR2_LOONGARCH_FPU_NONE
config BR2_GCC_TARGET_ABI
default "lp64d" if BR2_LOONGARCH_ABI_LP64D
default "lp64f" if BR2_LOONGARCH_ABI_LP64F
default "lp64s" if BR2_LOONGARCH_ABI_LP64S
config BR2_READELF_ARCH_NAME
default "LoongArch"
# vim: ft=kconfig
# -*- mode:kconfig; -*-