diff --git a/README_d/ChangeLog b/README_d/ChangeLog index 3289dfd9..61b517d2 100644 --- a/README_d/ChangeLog +++ b/README_d/ChangeLog @@ -1,3 +1,7 @@ +2022-11-27 Arnold D. Robbins + + * README.macosx: Updated. + 2022-11-17 Arnold D. Robbins * 5.2.1: Release tar ball made. diff --git a/README_d/README.macosx b/README_d/README.macosx index 741cf4da..256a7de2 100644 --- a/README_d/README.macosx +++ b/README_d/README.macosx @@ -1,3 +1,12 @@ +Sun 27 Nov 2022 14:54:06 EST +============================ + +Building an x86_64 binary on M1 systems was a bad idea. Not all systems +have Rosetta installed, and there are still ppc and ppc64 systems out +in the world. See https://trac.macports.org/ticket/66329. + +So for now, PMA in enabled for macOS only on x86_64. + Sun 23 Oct 2022 14:24:37 IDT ============================ diff --git a/configure b/configure index 84024e9d..b7020b38 100755 --- a/configure +++ b/configure @@ -12618,15 +12618,18 @@ else $as_nop fi ;; - *darwin*) - # 23 October 2022: See README_d/README.macosx for - # the details on what's happening here. See also - # the manual. - - # Compile as Intel binary all the time, even on M1. - CFLAGS="${CFLAGS} -arch x86_64" - LDFLAGS="${LDFLAGS} -Xlinker -no_pie" - export CFLAGS LDFLAGS + *darwin*) + # 27 November 2022: PMA only works on Intel. + case $host in + x86_64-*) + LDFLAGS="${LDFLAGS} -Xlinker -no_pie" + export LDFLAGS + ;; + *) + # disable on all other macOS systems + use_persistent_malloc=no + ;; + esac ;; *cygwin* | *CYGWIN* | *solaris2.11* | freebsd13.* | openbsd7.* ) true # nothing do, exes on these systems are not PIE diff --git a/extension/configure b/extension/configure index f6c9394b..6e28f0db 100755 --- a/extension/configure +++ b/extension/configure @@ -8832,15 +8832,18 @@ else $as_nop fi ;; - *darwin*) - # 23 October 2022: See README_d/README.macosx for - # the details on what's happening here. See also - # the manual. - - # Compile as Intel binary all the time, even on M1. - CFLAGS="${CFLAGS} -arch x86_64" - LDFLAGS="${LDFLAGS} -Xlinker -no_pie" - export CFLAGS LDFLAGS + *darwin*) + # 27 November 2022: PMA only works on Intel. + case $host in + x86_64-*) + LDFLAGS="${LDFLAGS} -Xlinker -no_pie" + export LDFLAGS + ;; + *) + # disable on all other macOS systems + use_persistent_malloc=no + ;; + esac ;; *cygwin* | *CYGWIN* | *solaris2.11* | freebsd13.* | openbsd7.* ) true # nothing do, exes on these systems are not PIE diff --git a/m4/ChangeLog b/m4/ChangeLog index e2b52353..fb13cf09 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2022-11-27 Arnold D. Robbins + + * pma.m4: Don't build an x86 binary on non-x86 macOS systems. + See https://trac.macports.org/ticket/66329. Thanks to + Marius Schamschula for the report. + 2022-11-17 Arnold D. Robbins * 5.2.1: Release tar ball made. diff --git a/m4/pma.m4 b/m4/pma.m4 index 00f29722..c0535a26 100644 --- a/m4/pma.m4 +++ b/m4/pma.m4 @@ -23,15 +23,18 @@ then [LDFLAGS="${LDFLAGS} -no-pie" export LDFLAGS]) ;; - *darwin*) - # 23 October 2022: See README_d/README.macosx for - # the details on what's happening here. See also - # the manual. - - # Compile as Intel binary all the time, even on M1. - CFLAGS="${CFLAGS} -arch x86_64" - LDFLAGS="${LDFLAGS} -Xlinker -no_pie" - export CFLAGS LDFLAGS + *darwin*) + # 27 November 2022: PMA only works on Intel. + case $host in + x86_64-*) + LDFLAGS="${LDFLAGS} -Xlinker -no_pie" + export LDFLAGS + ;; + *) + # disable on all other macOS systems + use_persistent_malloc=no + ;; + esac ;; *cygwin* | *CYGWIN* | *solaris2.11* | freebsd13.* | openbsd7.* ) true # nothing do, exes on these systems are not PIE