Hi Thomas,

On Sun, 4 Jan 2026 at 23:14, Thomas Weißschuh <[email protected]> wrote:
> Since LLVM commit 39e30508a7f6 ("[Driver][Sparc] Default to -mcpu=v9 for
> 32-bit Linux/sparc64 (#109278)"), clang defaults to -mcpu=v9 for 32-bit
> SPARC builds. -mcpu=v9 generates instructions which are not recognized
> by qemu-sparc and qemu-system-sparc. Instead qemu-sparc32plus and
> qemu-system-sparc64 with a 64-bit kernel and CONFIG_COMPAT are needed.
>
> Rework the test setup so that -mcpu=v9 also works correctly.
>
> Signed-off-by: Thomas Weißschuh <[email protected]>

Thanks for your patch!

> --- a/tools/testing/selftests/nolibc/Makefile.nolibc
> +++ b/tools/testing/selftests/nolibc/Makefile.nolibc
> @@ -117,7 +117,7 @@ DEFCONFIG_riscv32    = rv32_defconfig
>  DEFCONFIG_riscv64    = defconfig
>  DEFCONFIG_s390x      = defconfig
>  DEFCONFIG_loongarch  = defconfig
> -DEFCONFIG_sparc32    = sparc32_defconfig
> +DEFCONFIG_sparc32    = sparc64_defconfig

How can we test sparc32 using a 64-bit kernel?

>  DEFCONFIG_sparc64    = sparc64_defconfig
>  DEFCONFIG_m68k       = virt_defconfig
>  DEFCONFIG_sh4        = rts7751r2dplus_defconfig
> @@ -155,7 +155,7 @@ QEMU_ARCH_riscv32    = riscv32
>  QEMU_ARCH_riscv64    = riscv64
>  QEMU_ARCH_s390x      = s390x
>  QEMU_ARCH_loongarch  = loongarch64
> -QEMU_ARCH_sparc32    = sparc
> +QEMU_ARCH_sparc32    = sparc64
>  QEMU_ARCH_sparc64    = sparc64
>  QEMU_ARCH_m68k       = m68k
>  QEMU_ARCH_sh4        = sh4
> @@ -164,6 +164,7 @@ QEMU_ARCH            = $(QEMU_ARCH_$(XARCH))
>  QEMU_ARCH_USER_ppc64le = ppc64le
>  QEMU_ARCH_USER_mipsn32le = mipsn32el
>  QEMU_ARCH_USER_mipsn32be = mipsn32
> +QEMU_ARCH_USER_sparc32 = sparc32plus
>  QEMU_ARCH_USER         = $(or 
> $(QEMU_ARCH_USER_$(XARCH)),$(QEMU_ARCH_$(XARCH)))
>
>  QEMU_BIOS_DIR = /usr/share/edk2/
> @@ -195,7 +196,7 @@ QEMU_ARGS_riscv32    = -M virt -append "console=ttyS0 
> panic=-1 $(TEST:%=NOLIBC_T
>  QEMU_ARGS_riscv64    = -M virt -append "console=ttyS0 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
>  QEMU_ARGS_s390x      = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
>  QEMU_ARGS_loongarch  = -M virt -append "console=ttyS0,115200 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
> -QEMU_ARGS_sparc32    = -M SS-5 -m 256M -append "console=ttyS0,115200 
> panic=-1 $(TEST:%=NOLIBC_TEST=%)"
> +QEMU_ARGS_sparc32    = -M sun4u -append "console=ttyS0,115200 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
>  QEMU_ARGS_sparc64    = -M sun4u -append "console=ttyS0,115200 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
>  QEMU_ARGS_m68k       = -M virt -append "console=ttyGF0,115200 panic=-1 
> $(TEST:%=NOLIBC_TEST=%)"
>  QEMU_ARGS_sh4        = -M r2d -serial file:/dev/stdout -append 
> "console=ttySC1,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Reply via email to