From: Julien Olivain via buildroot <buildroot@buildroot.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] arch/loongarch: Fix toolchain triple ABI suffix
Date: Wed, 09 Jul 2025 23:26:40 +0200 [thread overview]
Message-ID: <e17da108d1fb4e6abda26445dc053b35@free.fr> (raw)
In-Reply-To: <20250708-loongarch-fabi-v1-1-1c9b4df3dee9@flygoat.com>
Hi Jiaxun,
Thanks for the patch!
On 09/07/2025 00:56, Jiaxun Yang wrote:
> LoongArch GCC infers ABI from triple suffix, thus it's necesessary
> to set up proper triple ABI suffixes for different ABI types.
>
> Adjust ABI suffix as per Table 10. List of possible <fabi-suffix>
> in "LoongArch Toolchain Conventions Version 1.00".
>
> Link:
> https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html
> Link: https://lore.kernel.org/all/20250706105859.292908-1-ju.o@free.fr/
> Suggested-by: Julien Olivain <ju.o@free.fr>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> package/Makefile.in | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index
> 829636900ba950f4e2af4e070b7f979646600bcc..5ebb5f9ba8abd55cf9519cf3eb2a9a774ef9e271
> 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -83,6 +83,14 @@ ABI := $(ABI)hf
> endif
> endif
>
> +# LoongArch Float ABI suffixes
> +ifeq ($(BR2_LOONGARCH_ABI_LP64F),y)
> +ABI = f32
> +endif
> +ifeq ($(BR2_LOONGARCH_ABI_LP64S),y)
> +ABI = sf
> +endif
> +
Unfortunately, while this patch fixes the configure error and goes a bit
further, it is not sufficient for a complete a build for the lp64f and
lp64s ABIs.
The following config to test "lp64d" ABI works
(same as without with patch).
cat >.config <<EOF
BR2_loongarch64=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
BR2_TARGET_EDK2=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_LOONGARCH64_EFI=y
EOF
make olddefconfig
make
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
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
Note, the crt files are in "sf" subdirectory:
output/host/loongarch64-buildroot-linux-gnusf/sysroot/usr/lib/sf/crti.o
Could you have a look, please?
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-07-09 21:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 22:56 [Buildroot] [PATCH] arch/loongarch: Fix toolchain triple ABI suffix Jiaxun Yang
2025-07-09 21:26 ` Julien Olivain via buildroot [this message]
2025-07-10 10:14 ` Jiaxun Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e17da108d1fb4e6abda26445dc053b35@free.fr \
--to=buildroot@buildroot.org \
--cc=jiaxun.yang@flygoat.com \
--cc=ju.o@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox