Re: loongarch64-linux-gcc: error: unrecognized argument in option '-march=la32v1.0'
From: Arnd Bergmann
Date: Mon Aug 10 2026 - 16:06:14 EST
On Mon, Aug 10, 2026, at 21:47, kernel test robot wrote:
>
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> head: 06cf61899d6498b33e4b7c87d99d5bd471ccc375
> commit: 3d9aba6618d115750729bba2d1f8af180bd7d3bd LoongArch: Adjust
> build infrastructure for 32BIT/64BIT
> date: 4 months ago
> config: loongarch-randconfig-001-20260811
> (https://download.01.org/0day-ci/archive/20260811/202608110230.c32X9KXj-lkp@xxxxxxxxx/config)
> compiler: loongarch64-linux-gcc (GCC) 15.2.0
> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20260811/202608110230.c32X9KXj-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new
> version of
> the same patch/commit), kindly add following tags
> | Fixes: 3d9aba6618d1 ("LoongArch: Adjust build infrastructure for
> 32BIT/64BIT")
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes:
> https://lore.kernel.org/oe-kbuild-all/202608110230.c32X9KXj-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
>>> loongarch64-linux-gcc: error: unrecognized argument in option '-march=la32v1.0'
I see that this option is supported by gcc-16 but not gcc-15.
Clang-22 also doesn't have it, not sure about clang-23 or higher.
How about this change?
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -224,6 +224,7 @@ choice
config 32BIT
bool "32-bit kernel"
+ depends on GCC_VERSION >= 160000 || CLANG_VERSION >= 230000
help
Select this option if you want to build a 32-bit kernel.