All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/wolfssl: fix build on MIPS r6
@ 2026-11-01 10:28 Yegor Yefremov via buildroot
  2026-11-01 16:23 ` Thomas Petazzoni via buildroot
  2026-11-06 16:11 ` Raphaël Mélotte via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-11-01 10:28 UTC (permalink / raw)
  To: buildroot; +Cc: Sergio Prado

The MIPS assembly code in wolfcrypt/src/sp_int.c uses the
multu/dmultu, mflo and mfhi instructions and clobbers the hi/lo
registers. These were removed in MIPS release 6, so the build fails
on MIPS64 r6:

  wolfcrypt/src/sp_int.c:4217:5: error: the register '$hi' cannot be clobbered in 'asm' for the current target

and on MIPS32 r6:

  wolfcrypt/src/sp_int.c:4418:5: error: the register '%hi' cannot be clobbered in 'asm' for the current target

BR2_PACKAGE_WOLFSSL_ASM_SUPPORTS was meant to exclude MIPS64 r6, but
the mips64/mips64el conditions test BR2_MIPS_CPU_MIPS32R6, which can
never be set for a 64-bit CPU, and the mips/mipsel condition has no
r6 exclusion at all. Test BR2_MIPS_CPU_MIPS64R6 for mips64/mips64el
and BR2_MIPS_CPU_MIPS32R6 for mips/mipsel instead, so assembly is
disabled on all r6 CPUs.

Commit d8dc5315eb71 ("package/wolfssl: disable assembly when not
supported") introduced BR2_PACKAGE_WOLFSSL_ASM_SUPPORTS to fix the
MIPS64 r6 build, but used the wrong r6 symbol for mips64 and added no
r6 exclusion for mips, so the issue was never fixed. It therefore
affects 2023.02 and later, including all maintained branches.

Fixes:
https://autobuild.buildroot.org/results/10c901b8c57f6322b127f1b14c78f73dbb7f28b2

Fixes: d8dc5315eb712eca0a5cbf793a6714a47ab6e57e ("package/wolfssl: disable assembly when not supported")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/wolfssl/Config.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/wolfssl/Config.in b/package/wolfssl/Config.in
index 9d173412fe..8eb789274c 100644
--- a/package/wolfssl/Config.in
+++ b/package/wolfssl/Config.in
@@ -4,9 +4,9 @@ config BR2_PACKAGE_WOLFSSL_ASM_SUPPORTS
 	default y if (BR2_arm || BR2_armeb) && !BR2_ARM_CPU_ARMV4 # clz
 	default y if BR2_powerpc
 	default y if BR2_powerpc64 || BR2_powerpc64le
-	default y if BR2_mips64 && !BR2_MIPS_CPU_MIPS32R6
-	default y if BR2_mips64el && !BR2_MIPS_CPU_MIPS32R6
-	default y if BR2_mips || BR2_mipsel
+	default y if BR2_mips64 && !BR2_MIPS_CPU_MIPS64R6
+	default y if BR2_mips64el && !BR2_MIPS_CPU_MIPS64R6
+	default y if (BR2_mips || BR2_mipsel) && !BR2_MIPS_CPU_MIPS32R6
 	default y if BR2_riscv && BR2_RISCV_ISA_RVM
 	default y if BR2_s390x
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-06 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01 10:28 [Buildroot] [PATCH] package/wolfssl: fix build on MIPS r6 Yegor Yefremov via buildroot
2026-11-01 16:23 ` Thomas Petazzoni via buildroot
2026-11-06 16:11 ` Raphaël Mélotte via buildroot

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.