Bug 702486 - Ghostscript 9.52 does not build on arm64
Summary: Ghostscript 9.52 does not build on arm64
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 9.52
Hardware: PC Linux
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-14 20:00 UTC by Till Kamppeter
Modified: 2020-06-15 16:39 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
ghostscript-disable-ppc-optimisations-in-libpng.patch (1.57 KB, patch)
2020-06-14 20:00 UTC, Till Kamppeter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Till Kamppeter 2020-06-14 20:00:21 UTC
Created attachment 19325 [details]
ghostscript-disable-ppc-optimisations-in-libpng.patch

For the CUPS Snap

https://github.com/OpenPrinting/cups-snap/

I build Ghostscript with the following ./configure command line

./configure --without-x --disable-gtk --with-drivers=pdfwrite,ps2write,cups,pwgraster,pxlmono,pxlcolor --enable-cups --enable-freetype

As Snaps bring their own dependencies I am using the libraries which come with Ghostscript instead of using the system's libraries (the .deb packages use the system's libraries whereever possible).

I have coupled the GitHub repo with the build service of the Snap Store, which makes the Snap being build for 6 architectures after each commit to the repo.

9.52 builds perfectly on i386, amd64, s390x, and armhf, but not on ppc64el and arm64. Problem are internal optimizations in the libpng shipped with Ghostscript.

For ppc64el the problem was already solved after the 9.52 release:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=1c9bd8e0aa4
https://bugs.ghostscript.com/show_bug.cgi?id=702236

Based on this and on a similar fix for arm64 on another free software project

https://github.com/imagemin/optipng-bin/issues/97

I have extended the patch of

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=1c9bd8e0aa4

by adding the arm64 case to the case statement in the patch:

----------
            *arm64*|*aarch64*)
                # Building on arm64 with gcc, disable libpng's neon
                # optimizations.
                if test $GCC = yes; then
                  CFLAGS="$CFLAGS -DPNG_ARM_NEON_OPT=0"
                fi
            ;;
----------

resulting in the attached patch for 9.52, which I have added to the CUPS Snap by the following commit:

https://github.com/OpenPrinting/cups-snap/commit/2f8765c6620e82f04dd73a495f2a76a1babe8ab8

With this the Ghostscript in the CUPs Snap builds on all the 6 architectures.
Comment 1 Till Kamppeter 2020-06-15 16:39:28 UTC
Sorry, forgot that to Ghostscript I can directly upload.

I have committed the fix now as commit a189c020b.