From 1273a1ddcab67c8ccca61c7c7c52c6049be4c336 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 3 Mar 2024 15:10:51 +0000 Subject: tls: use C code for x86_64 sp_256_sub_8_p256_mod() There's an upstream bug report: https://bugs.busybox.net/show_bug.cgi?id=15679 that if BusyBox is built for x86_64 with gcc and the use of OpenSSL for wget is disabled, failures ensue. A similar issue also affects the busybox-w32 build with the comparable configuration. The problem appears to be in the assembly code for the function sp_256_sub_8_p256_mod(), as forcing the use of the provided C code seems to fix both upstream and busybox-w32. Since my knowledge of x64_64 assembler is non-existent, someone else will need to determine the actual issue. For the moment, just avoid the faulty code. Saves 32 bytes in the 64-bit build. (GitHub issue #263) --- networking/tls_sp_c32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networking/tls_sp_c32.c b/networking/tls_sp_c32.c index a593c5c40..999033034 100644 --- a/networking/tls_sp_c32.c +++ b/networking/tls_sp_c32.c @@ -422,7 +422,7 @@ static void sp_256_sub_8_p256_mod(sp_digit* r) : "memory" ); } -#elif ALLOW_ASM && defined(__GNUC__) && defined(__x86_64__) +#elif ALLOW_ASM && defined(__GNUC__) && defined(__x86_64__) && ENABLE_PLATFORM_POSIX static void sp_256_sub_8_p256_mod(sp_digit* r) { uint64_t reg; -- cgit v1.2.3-55-g6feb