This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f1b9c24444 nss: build NSPR for arm64 on Apple Silicon
f1b9c24444 is described below

commit f1b9c2444487691fc604bec548108babc0b487c3
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Jun 11 16:14:30 2026 -0400

    nss: build NSPR for arm64 on Apple Silicon
    
    NSPR 4.20's bundled config.guess predates Apple Silicon and reports the
    build triple as arm-apple-darwin (bare 'arm'). NSPR's configure then maps
    target_cpu=arm to CPU_ARCH=arm and appends '-arch arm' to CC, so ld picks
    the nonexistent 32-bit armv4t target and the link fails:
    
        ld: unknown -arch name: armv4t
    
    NSS runs its own configure and ignores the tree-wide ARCH_FLAGS=-arch arm64,
    so this has to be fixed in NSPR's configure directly. Add a hunk to
    nss_macosx.patch that maps ARM on Darwin to the correct macOS arch name
    arm64 (both the bare 'arm' from the old config.guess and a real
    aarch64/arm64 triple).
    
    Verified the augmented patch chain (nss.patch, nss_sizes.patch,
    nss_macosx.patch) applies cleanly in order against pristine nss-3.39 and
    yields CPU_ARCH=arm64 in nspr/configure.
---
 main/nss/nss_macosx.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/main/nss/nss_macosx.patch b/main/nss/nss_macosx.patch
index 8592113c6b..a6ccc1d011 100644
--- a/main/nss/nss_macosx.patch
+++ b/main/nss/nss_macosx.patch
@@ -1,3 +1,22 @@
+diff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
+--- misc/nss-3.39/nspr/configure       2018-08-28 05:42:28.000000000 -0700
++++ misc/build/nss-3.39/nspr/configure 2020-10-06 07:41:59.563345390 -0700
+@@ -6570,8 +6570,14 @@
+     AS='$(CC) -x assembler-with-cpp'
+     CFLAGS="$CFLAGS -Wall -fno-common"
+     case "${target_cpu}" in
++        aarch64|arm64)
++            CPU_ARCH=arm64
++            ;;
+         arm*)
+-            CPU_ARCH=arm
++            # On Apple Silicon the bundled config.guess reports the bare CPU
++            # "arm"; the macOS arch name is "arm64" (plain "arm" makes ld pick
++            # the nonexistent armv4t).  Treat any arm on Darwin as arm64.
++            CPU_ARCH=arm64
+             ;;
+         i*86*|x86_64)
+             if test -n "$USE_64"; then
 diff -ur misc/nss-3.39/nss/lib/sqlite/config.mk 
misc/build/nss-3.39/nss/lib/sqlite/config.mk
 --- misc/nss-3.39/nss/lib/sqlite/config.mk     2018-08-31 05:55:53.000000000 
-0700
 +++ misc/build/nss-3.39/nss/lib/sqlite/config.mk       2018-09-10 
10:36:01.074375000 -0700

Reply via email to