[packages/uv] ExcludeArch: x32

arekm arekm at pld-linux.org
Fri May 1 03:56:16 CEST 2026


commit 3a6dc8626cbb3210d7b58c18ba3b039007ada397
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri May 1 03:56:01 2026 +0200

    ExcludeArch: x32

 aws-lc-x32.patch | 43 -------------------------------------------
 lto.patch        |  8 ++------
 uv.spec          | 34 ++++++++--------------------------
 3 files changed, 10 insertions(+), 75 deletions(-)
---
diff --git a/uv.spec b/uv.spec
index 8eeede5..2ae08ec 100644
--- a/uv.spec
+++ b/uv.spec
@@ -7,7 +7,7 @@
 # 32-bit linkers can't fit uv's debug info into the ~3 GB process
 # address space, so drop debuginfo and the -debuginfo/-debugsource
 # subpackages on 32-bit only.
-%ifarch %{ix86} %{arm} x32
+%ifarch %{ix86} %{arm}
 %define		_enable_debug_packages	0
 %endif
 
@@ -26,7 +26,6 @@ Source0:	https://github.com/astral-sh/uv/archive/%{version}/%{name}-%{version}.t
 Source1:	%{name}-crates-%{crates_ver}.tar.xz
 # Source1-md5:	2ff89da4d7c0cdb37b70d94652dd815d
 Patch0:		lto.patch
-Patch1:		aws-lc-x32.patch
 URL:		https://github.com/astral-sh/uv
 BuildRequires:	bzip2-devel
 BuildRequires:	cargo
@@ -39,6 +38,11 @@ BuildRequires:	xz
 BuildRequires:	xz-devel
 %{?rust_req}
 ExclusiveArch:	%{rust_arches}
+# aws-lc-sys (uv's TLS backend via aws-lc-rs) does not support x32:
+# multiple inline-asm and 64-bit-limb paths gate on OPENSSL_X86_64
+# alone, treating it as synonymous with 64-bit BN_ULONG, which breaks
+# under x32's 32-bit pointers. aws-lc upstream lists no x32 target.
+ExcludeArch:	x32
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -97,29 +101,11 @@ Zshowe dopełnianie składni dla polecenia uv.
 
 %prep
 %setup -q -a1
-%ifarch %{ix86} %{arm} x32
+%ifarch %{ix86} %{arm}
 %patch -P0 -p1
 %endif
 
-# aws-lc-sys vendored source: gate RSAZ_ENABLED and EC_NISTP s2n-bignum
-# 64-bit paths on OPENSSL_64_BIT (broken on x32 where OPENSSL_X86_64 is
-# defined but BN_ULONG is uint32_t). Refresh vendored crate checksums
-# so cargo accepts the modified files in offline mode.
-awslc_files="vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/bn/rsaz_exp.h
-vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/ec/ec_nistp.h"
-for f in $awslc_files; do
-    sha256sum "$f"
-done > aws-lc-x32.sha256.old
-%patch -P1 -p1
-while read old_sum f; do
-    new_sum=$(sha256sum "$f" | cut -f1 -d' ')
-    %{__sed} -i -e "s/$old_sum/$new_sum/" vendor/aws-lc-sys/.cargo-checksum.json
-done < aws-lc-x32.sha256.old
-rm -f aws-lc-x32.sha256.old
-
-# use our offline registry
 export CARGO_HOME="$(pwd)/.cargo"
-
 mkdir -p "$CARGO_HOME"
 cat >.cargo/config.toml <<EOF
 [source.crates-io]
@@ -133,11 +119,7 @@ EOF
 export CARGO_HOME="$(pwd)/.cargo"
 export CARGO_OFFLINE=true
 export CARGO_TERM_VERBOSE=true
-%ifarch x32
-export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
-export PKG_CONFIG_ALLOW_CROSS=1
-%endif
-%ifarch %{ix86} %{arm} x32
+%ifarch %{ix86} %{arm}
 export RUSTFLAGS="-C debuginfo=0 -C strip=none"
 %endif
 
diff --git a/aws-lc-x32.patch b/aws-lc-x32.patch
deleted file mode 100644
index f9c9f8b..0000000
--- a/aws-lc-x32.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-aws-lc has two gates that condition optimized 64-bit-limb code paths
-on OPENSSL_X86_64 alone. On x32 (x86_64 ISA, 32-bit pointers, 32-bit
-BN_ULONG) OPENSSL_X86_64 is correctly defined but OPENSSL_64_BIT is
-not, and the optimized paths break with -Wincompatible-pointer-types
-because they expect uint64_t* arguments while callers pass uint32_t*.
-
-Add `defined(OPENSSL_64_BIT)` to both gates so x32 falls through to
-the portable Fiat-crypto / generic constant-time paths whose word
-size matches BN_ULONG. Same correctness invariant in two places: the
-optimized 64-bit-limb routines require an actual 64-bit BN_ULONG, not
-just an x86_64 instruction set.
-
-This fixes the cascade of errors in:
-  crypto/fipsmodule/bn/exponentiation.c   (RSAZ_mod_exp_avx512_x2)
-  crypto/fipsmodule/ec/p256.c             (ec_nistp_scalar_mul_public)
-  crypto/fipsmodule/ec/p256-nistz.c       (ecp_nistz256_*, bignum_montinv_p256)
-  crypto/fipsmodule/ec/p384.c, p521.c     (*_jscalarmul_selector)
-
-at their root in the two header gates that flip the limb typedef and
-enable the AVX-512 RSAZ path.
-
---- a/vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/bn/rsaz_exp.h
-+++ b/vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/bn/rsaz_exp.h
-@@ -20,7 +20,8 @@
- extern "C" {
- #endif
-
--#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \
-+#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \
-+    defined(OPENSSL_64_BIT) && \
-     !defined(MY_ASSEMBLER_IS_TOO_OLD_FOR_AVX)
- #define RSAZ_ENABLED
-
---- a/vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/ec/ec_nistp.h
-+++ b/vendor/aws-lc-sys/aws-lc/crypto/fipsmodule/ec/ec_nistp.h
-@@ -17,6 +17,7 @@
- // set, s2n-bignum path is capable.
- #if !defined(OPENSSL_NO_ASM) &&                                                \
-     (defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE)) &&                      \
-+    defined(OPENSSL_64_BIT) &&                                                 \
-     ((defined(OPENSSL_X86_64) && !defined(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX)) || \
-      defined(OPENSSL_AARCH64))
- #  define EC_NISTP_USE_S2N_BIGNUM
diff --git a/lto.patch b/lto.patch
index 7c1c912..777de2b 100644
--- a/lto.patch
+++ b/lto.patch
@@ -1,9 +1,5 @@
-Disable LTO for 32-bit targets. Both fat and thin LTO SIGABRT during
-linking of the uv binary on i686/armv7hl/x32 because LLVM's IR/bitcode
-working set exhausts the ~3 GB process virtual address space. Without
-LTO each crate's symbols stay independent, the linker handles them one
-at a time, and peak memory stays well under the limit. Slightly larger
-and slower binary on 32-bit, but the binary builds.
+Disable LTO on 32-bit: LLVM bitcode working set exceeds ~3 GB user
+VA, link SIGABRTs.
 
 --- a/Cargo.toml
 +++ b/Cargo.toml
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/uv.git/commitdiff/3a6dc8626cbb3210d7b58c18ba3b039007ada397



More information about the pld-cvs-commit mailing list