xref: /trunk/main/nss/nss_macosx.patch (revision 2a8fa3f06b2c9d1595434663e9efddc53f9375b2)
1diff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
2--- misc/nss-3.39/nspr/configure    2018-08-28 05:42:28.000000000 -0700
3+++ misc/build/nss-3.39/nspr/configure  2020-10-06 07:41:59.563345390 -0700
4@@ -6570,8 +6570,14 @@
5     AS='$(CC) -x assembler-with-cpp'
6     CFLAGS="$CFLAGS -Wall -fno-common"
7     case "${target_cpu}" in
8+        aarch64|arm64)
9+            CPU_ARCH=arm64
10+            ;;
11         arm*)
12-            CPU_ARCH=arm
13+            # On Apple Silicon the bundled config.guess reports the bare CPU
14+            # "arm"; the macOS arch name is "arm64" (plain "arm" makes ld pick
15+            # the nonexistent armv4t).  Treat any arm on Darwin as arm64.
16+            CPU_ARCH=arm64
17             ;;
18         i*86*|x86_64)
19             if test -n "$USE_64"; then
20diff -ur misc/nss-3.39/nss/lib/sqlite/config.mk misc/build/nss-3.39/nss/lib/sqlite/config.mk
21--- misc/nss-3.39/nss/lib/sqlite/config.mk  2018-08-31 05:55:53.000000000 -0700
22+++ misc/build/nss-3.39/nss/lib/sqlite/config.mk    2018-09-10 10:36:01.074375000 -0700
23@@ -35,9 +35,9 @@
24 # OSAtomicCompareAndSwapPtrBarrier, which is only available on Mac OS X 10.5
25 # (Darwin 9.0) and later. Define SQLITE_WITHOUT_ZONEMALLOC to disable
26 # that code for older versions of Mac OS X. See bug 820374.
27-DARWIN_VER_MAJOR := $(shell uname -r | cut -f1 -d.)
28-DARWIN_LT_9 := $(shell [ $(DARWIN_VER_MAJOR) -lt 9 ] && echo true)
29-ifeq ($(DARWIN_LT_9),true)
30+OSX_TARGET_MINOR := $(shell echo $(MACOSX_DEPLOYMENT_TARGET) | cut -f2 -d.)
31+OSX_MINOR_LT_5 := $(shell [ $(OSX_TARGET_MINOR) -lt 5 ] && echo true)
32+ifeq ($(OSX_MINOR_LT_5),true)
33 OS_CFLAGS += -DSQLITE_WITHOUT_ZONEMALLOC
34 endif
35 endif # Darwin
36