Bug 703095 - ghostscript fails to build on arm64-darwin (Apple Silicon on macOS Big Sur)
Summary: ghostscript fails to build on arm64-darwin (Apple Silicon on macOS Big Sur)
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 9.53.3
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-07 17:57 UTC by fxcoudert
Modified: 2021-02-11 15:57 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fxcoudert 2020-11-07 17:57:39 UTC
The build fails with:

./obj/aux/echogs -w ./obj/ldt.tr -n - clang   -o ./bin/gs
./obj/aux/echogs -a ./obj/ldt.tr -n -s ./obj/gsromfs0.o ./obj/gs.o -s
cat ./obj/gsld.tr >> ./obj/ldt.tr
./obj/aux/echogs -a ./obj/ldt.tr -s -  -lm -ldl  -liconv      -lpthread -lm 
if [ x != x ]; then LD_RUN_PATH=; export LD_RUN_PATH; fi; \
	XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
	PSI_FEATURE_DEVS= FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \
	DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \
	DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \
	DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \
	DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \
	DEVICE_DEVS_EXTRA= \
	/bin/sh <./obj/ldt.tr
Undefined symbols for architecture arm64:
  "_png_init_filter_functions_neon", referenced from:
      _png_read_filter_row in pngrutil.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/gs] Error 1



This is because the build target is detected as arm instead of aarch64 (or arm64). This is fixed by updating config.guess and config.sub with the latest versions from https://git.savannah.gnu.org/gitweb/?p=config.git
Comment 1 Chris Liddell (chrisl) 2020-11-19 07:51:48 UTC
We get the config.guess and config.sub files from automake, as I was under the impression they were distributed with automake, and not independently.

I was really hoping automake would roll out an update for this.
Comment 2 Chris Liddell (chrisl) 2021-02-11 15:57:05 UTC
I've updated to the latest automake release, and testing suggests that, plus a couple of other changes makes the build happy on Apple MacOS/M1.

So the next release (in a month or so) should see M1 properly supported.