Question

Looks like with Xcode 5 and the removal of LLVM-GCC-4.2 and its replacement by Clang, building libjpeg-turbo for iOS devices now fails during the compilation of NEON support.

Configure step:

export PLATFORM="iPhoneOS"
export IPHONE_SDK="7.0"
export IPHONE_MIN_VERSION="5.0"

export DEVELOPER=`xcode-select --print-path`
export DEVROOT="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export SDKROOT="${DEVROOT}/SDKs/${PLATFORM}${IPHONE_SDK}.sdk"
export CC=`xcrun -find gcc`
export LD=`xcrun -find ld`
export IOS_CFLAGS="-arch armv7"
export CFLAGS="-O3 ${IOS_CFLAGS} -isysroot ${SDKROOT}"
export LDFLAGS="${IOS_CFLAGS} -isysroot ${SDKROOT}"
export CPPFLAGS="${CFLAGS}"
export CFLAGS="${CFLAGS} -miphoneos-version-min=${IPHONE_MIN_VERSION}"

./configure --with-jpeg8 --host arm-apple-darwin --enable-static --disable-shared
...
checking if we have SIMD optimisations for cpu type... yes (arm)
checking if the assembler is GNU-compatible and can be used... yes
...

Build step:

make -j4
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in java
echo timestamp > classnodist_noinst.stamp
Making all in simd
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -E -I.. -I../simd ./jsimdcfg.inc.h | grep -E "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > jsimdcfg.inc
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
if /bin/sh ../libtool --mode=compile --tag=CC /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..  -I..  -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk  -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -MT jsimd_arm.lo -MD -MP -MF ".deps/jsimd_arm.Tpo" -c -o jsimd_arm.lo jsimd_arm.c; \
    then mv -f ".deps/jsimd_arm.Tpo" ".deps/jsimd_arm.Plo"; else rm -f ".deps/jsimd_arm.Tpo"; exit 1; fi
/bin/sh ../libtool --mode=compile gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/usr/bin/gcc  -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -c -o jsimd_arm_neon.lo jsimd_arm_neon.S
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
make[3]: *** [jsimd_arm_neon.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
 /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -MT jsimd_arm.lo -MD -MP -MF .deps/jsimd_arm.Tpo -c jsimd_arm.c -o jsimd_arm.o
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Any idea how to fix this? The build succeeds if disabling SIMD support but that's obviously not great.

Was it helpful?

Solution

It has been fixed by the maintainer of libjpeg-turbo: http://sourceforge.net/mailarchive/message.php?msg_id=31902025

What is needed is a special CLANG compatible version of gas-preprocessor: http://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor/

OTHER TIPS

There is a known issue when cross-compiling for iOS on OSX: http://sourceforge.net/mailarchive/message.php?msg_id=30462917

In short, you need to run

$ autoreconf -fiv

in the libjpeg-turbo directory before running configure.

On OSX 10.9 and Xcode 5, below are the versions of tools that you will need to compile the lib successfully. Newer versions will not work.

  • autoconf 2.69
  • nasm 2.08.01
  • automake 1.13

Alternatively, you can just use the prebuilt binaries that comes with the DMG: http://sourceforge.net/mailarchive/forum.php?thread_name=5255ABCE.8070705%40users.sourceforge.net&forum_name=libjpeg-turbo-users

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top