0

I am attempting to compile Ghostscript (ver. 9-22) for iOS 11 to replace an older, 32-bit version of the library that was build for iOS 9 and before. Following the instructions found here, I altered the final step in order to give me an arm64 dynamic library:

ar -crs libgs_arm64_release.a obj/*.o

However, if I do a:

lipo -info libgs_arm64_release.a 

it tells me that:

input file libgs_arm64_release.a is not a fat file
Non-fat file: libgs_arm64_release.a is architecture: x86_64

Thinking I was using the wrong tool, I also tried looking at using the lipo from the XCode toolchain per: How to check if a static library is built for 64-bit? but got the same result that is believes it is an x86_64.

Thoughts on what step I am missing to compile for an arm64 architecture?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52

1 Answers1

0

I altered the final step in order to give me an arm64 dynamic library:

ar -crs libgs_arm64_release.a obj/*.o

ar is just the archive tool, that builds a library from the compiled object files. If you want an ARM library you have to specify this in the compile step via some switch like -arch armv7.

Are you sure you used the correct Makefile? The projects seems to have one for the Simulator (which is x86) and for the actual devices (ARM).

Community
  • 1
  • 1
mschmidt
  • 2,740
  • 4
  • 17
  • 31
  • Yes, that is later to create a fat binary by bringing multiple architectures together. Right now, I am just attempting to create the correct *.a file. In regards to comment about the compile step, the ./configure looks like: ./configure CC="gcc -arch arm64" --disable-cups --disable-sse2 – Perry Hoekstra Dec 19 '17 at 22:34
  • I was looking at the instructions found here: https://www.ghostscript.com/doc/9.22/Make.htm#Mac_build on building Ghostscript for the Mac OSX. – Perry Hoekstra Dec 19 '17 at 22:38
  • Just a warning here. As far as I'm aware, the Apple Store policies make it impossible to create an App which is AGPL. Obviously if this is a personal project then that's not a problem. But you can't use GPL Ghostscript for an app in the App Store. – KenS Dec 20 '17 at 09:44
  • @Perry: sorry, ignore my answer, it should have been a comment since it was just a guess. – mschmidt Dec 20 '17 at 09:47
  • This is an internal, business app that has licensed Ghostscript. – Perry Hoekstra Dec 20 '17 at 13:50