Opened 12 years ago

Last modified 3 years ago

#34962 new defect

ghostscript cannot be built for archs that cannot be run

Reported by: devernay (Frédéric Devernay) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: haspatch Cc: mojca (Mojca Miklavec), cooljeanius (Eric Gallager)
Port: ghostscript

Description

ghostscript's configure tries to check if the architecture is big endian using the old way, i.e. trying to run a program. Autoconf has a more clever way of doing this, implemented in the AC_C_BIGENDIAN macro. Just adding the attached patch to the patchfiles fixes this.

Attachments (2)

patch-bigendian.diff (712 bytes) - added by devernay (Frédéric Devernay) 12 years ago.
Portfile (5.2 KB) - added by devernay (Frédéric Devernay) 12 years ago.
updated Portfile for gs 9.06

Download all attachments as: .zip

Change History (11)

Changed 12 years ago by devernay (Frédéric Devernay)

Attachment: patch-bigendian.diff added

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to takanori@…

Is this fix already known to the developers of ghostscript? If not you should report it to them.

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:3 Changed 12 years ago by devernay (Frédéric Devernay)

This problem still exists with GS 9.06 and the 9.05 patches still apply.

There are actually other issues with cross-compiling ghostscript (the ghostscript manual states that configuration files have to be manually edited), and these issues are usually fixed by cross-toolchains, see for example http://repository.timesys.com/buildsources/g/ghostscript/ghostscript-9.05/ http://git.yoctoproject.org/cgit.cgi/poky-contrib/tree/meta/recipes-extended/ghostscript or the patches for embedded linux distributions such as Wind River linux. I guess the GS developpers don't care much about cross-compiling

To properly cross-compile gs (version 9.05 or 9.06), one may apply the ghostscript-9.05-cross.patch and ghostscript-9.05-cross-so.patch that can be found at that http://repository.timesys.com/buildsources/g/ghostscript/ghostscript-9.05/ . I didn't try with the pokylinux files from http://git.yoctoproject.org/cgit.cgi/poky-contrib/tree/meta/recipes-extended/ghostscript but they are probably similar.

With these patches, I was able to build +universal (i386 and x86_64) on a Core Duo (running Snow Leopard), and +universal (i386 and ppc) on a PPC iMac G5 running Leopard.

I'm also attaching the modified Portfile for gs 9.06 (I didn't increment the revision).

comment:4 Changed 12 years ago by takanori@…

Have you reported this problem to the GS developers?

comment:5 Changed 12 years ago by devernay (Frédéric Devernay)

I just did it. Let's hope they'll be wanting to include it in a next release. http://bugs.ghostscript.com/show_bug.cgi?id=693356

Changed 12 years ago by devernay (Frédéric Devernay)

Attachment: Portfile added

updated Portfile for gs 9.06

comment:6 Changed 11 years ago by takanori@…

Ghostscript 9.10 supports new config options to define memory ordering. ('--enable-big-endian' and '--enable-little-endian')

By using these args, your patch can be rewritten like the following, I guess.

…
if {[variant_isset universal]} {
    lappend merger_configure_args(i386)     --enable-little-endian
    lappend merger_configure_args(x86_64)   --enable-little-endian
    lappend merger_configure_args(ppc)      --enable-big-endian
    lappend merger_configure_args(ppc64)    --enable-big-endian
}
…

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:8 Changed 9 years ago by mf2k (Frank Schima)

Owner: changed from takanori@… to macports-tickets@…

takanori has retired. See #47537.

comment:9 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.