From: Nathan Chancellor <nathan@kernel.org>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
loongarch@lists.linux.dev, Xuefeng Li <lixuefeng@loongson.cn>,
Guo Ren <guoren@kernel.org>, Xuerui Wang <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH V4 14/14] LoongArch: Adjust build infrastructure for 32BIT/64BIT
Date: Thu, 23 Apr 2026 15:06:47 -0700 [thread overview]
Message-ID: <20260423220647.GA3447678@ax162> (raw)
In-Reply-To: <20251127154832.137925-15-chenhuacai@loongson.cn>
Hi Huacai,
Now that this is in -next as commit 3d9aba6618d1 ("LoongArch: Adjust
build infrastructure for 32BIT/64BIT"), I am seeing two issues:
On Thu, Nov 27, 2025 at 11:48:32PM +0800, Huacai Chen wrote:
> Adjust build infrastructure (Kconfig, Makefile and ld scripts) to let
> us enable both 32BIT/64BIT kernel build.
...
> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> index 730f34214519..4bacde9f46d1 100644
> --- a/arch/loongarch/Kconfig
> +++ b/arch/loongarch/Kconfig
> +menu "Kernel type and options"
> +
> +choice
> + prompt "Kernel type"
>
> config 32BIT
> - bool
> + bool "32-bit kernel"
> + help
> + Select this option if you want to build a 32-bit kernel.
>
> config 64BIT
> - def_bool y
> + bool "64-bit kernel"
> + help
> + Select this option if you want to build a 64-bit kernel.
> +
> +endchoice
The way this is written results in a 32-bit kernel when building
ARCH=loongarch allmodconfig or having a previously 64-bit configuration
and running olddefconfig on it, which seems surprising to me. I think it
would be good to either adjust the ordering such that 64BIT is first or
include an explicit default statement like so:
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 3b042dbb2c41..3addd06b3f5a 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -220,6 +220,7 @@ menu "Kernel type and options"
choice
prompt "Kernel type"
+ default 64BIT
config 32BIT
bool "32-bit kernel"
--
> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> index 8d45b860fe56..47516aeea9d2 100644
> --- a/arch/loongarch/Makefile
> +++ b/arch/loongarch/Makefile
...
> @@ -62,9 +66,19 @@ ifneq ($(SUBARCH),$(ARCH))
> endif
> endif
>
> +ifdef CONFIG_32BIT
> +ifdef CONFIG_32BIT_STANDARD
> +ld-emul = $(32bit-emul)
> +cflags-y += -march=la32v1.0 -mabi=ilp32s -mcmodel=normal
> +else # CONFIG_32BIT_REDUCED
> +ld-emul = $(32bit-emul)
> +cflags-y += -march=la32rv1.0 -mabi=ilp32s -mcmodel=normal
> +endif
> +endif
As a result of the above problem, I see
clang: error: ignoring '-mabi=ilp32s' as it conflicts with that implied by '-msoft-float' (lp64s) [-Werror,-Woption-ignored]
clang: error: ignoring '-mabi=ilp32s' as it conflicts with that implied by '-msoft-float' (lp64s) [-Werror,-Woption-ignored]
clang: error: ignoring '-mabi=ilp32s' as it conflicts with that implied by '-msoft-float' (lp64s) [-Werror,-Woption-ignored]
when building configurations that I expected to be 64-bit but had been
turned into 32-bit ones with LLVM. This was also reported by the test
robot with allnoconfig.
https://lore.kernel.org/202604232041.ESJDwVG4-lkp@intel.com/
Maybe some change is needed on the LLVM side?
Cheers,
Nathan
next prev parent reply other threads:[~2026-04-23 22:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 15:48 [PATCH V4 00/14] LoongArch: Add basic LoongArch32 support Huacai Chen
2025-11-27 15:48 ` [PATCH V4 01/14] LoongArch: Add atomic operations for 32BIT/64BIT Huacai Chen
2025-11-27 15:48 ` [PATCH V4 02/14] LoongArch: Add adaptive CSR accessors " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 03/14] LoongArch: Adjust common macro definitions " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 04/14] LoongArch: Adjust boot & setup " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 05/14] LoongArch: Adjust memory management " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 06/14] LoongArch: Adjust process " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 07/14] LoongArch: Adjust time routines " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 08/14] LoongArch: Adjust module loader " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 09/14] LoongArch: Adjust system call " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 10/14] LoongArch: Adjust user accessors " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 11/14] LoongArch: Adjust misc routines " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 12/14] LoongArch: Adjust VDSO/VSYSCALL " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 13/14] LoongArch: Adjust default config files " Huacai Chen
2025-11-27 15:48 ` [PATCH V4 14/14] LoongArch: Adjust build infrastructure " Huacai Chen
2025-11-28 13:57 ` Arnd Bergmann
2025-11-28 14:27 ` Huacai Chen
2026-04-23 22:06 ` Nathan Chancellor [this message]
2026-04-24 4:14 ` Huacai Chen
2026-04-24 11:06 ` WANG Rui
2026-04-24 18:19 ` Nathan Chancellor
2026-04-25 2:29 ` hev
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=20260423220647.GA3447678@ax162 \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.