Dear CLN Mailing List,
 
For a while now I have been trying to run GiNaC with CLN on an IPhone. To achieve that goal I need my Library Build to support some different architectures. So I used this handy bash script to get what I want:
 
#!/bin/bash
PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
TOOLSPATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
export IPHONEOS_DEPLOYMENT_TARGET="10.1"
pwd=`pwd`
findLatestSDKVersion()
{
    sdks=`ls $PLATFORMPATH/$1.platform/Developer/SDKs`
    arr=()
    for sdk in $sdks
    do
       arr[${#arr[@]}]=$sdk
    done
    # Last item will be the current SDK, since it is alpha ordered
    count=${#arr[@]}
    if [ $count -gt 0 ]; then
       sdk=${arr[$count-1]:${#1}}
       num=`expr ${#sdk}-4`
       SDKVERSION=${sdk:0:$num}
    else
       SDKVERSION="10.1"
    fi
}
buildit()
{
    target=$1
    hosttarget=$1
    platform=$2
    if [[ $hosttarget == "x86_64" ]]; then
        hostarget="i386"
    elif [[ $hosttarget == "arm64" ]]; then
        hosttarget="arm"
    fi
    export CC="$(xcrun -sdk iphoneos -find clang)"
    export CPP="$CC -E"
    export CFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"
    export AR=$(xcrun -sdk iphoneos -find ar)
    export RANLIB=$(xcrun -sdk iphoneos -find ranlib)
    export CPPFLAGS="-arch ${target}  -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"
    export LDFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk"
    mkdir -p $pwd/output/$target
     ./configure --prefix="$pwd/output/$target" --disable-shared --disable-sqlite --host=$hosttarget-apple-darwin
    make clean
    make
    make install
}
findLatestSDKVersion iPhoneOS
buildit armv7 iPhoneOS
buildit armv7s iPhoneOS
buildit arm64 iPhoneOS
buildit i386 iPhoneSimulator
buildit x86_64 iPhoneSimulator
lipo -create ./output/x86_64/lib/libcln.a ./output/i386/lib/libcln.a -output libcln.a
 
I customised this a bit for GiNaC whih mainly ment swapping the last line with:
 
lipo -create ./output/armv7/lib/libginac.a  ./output/armv7s/lib/libginac.a ./output/arm64/lib/libginac.a ./output/x86_64/lib/libginac.a ./output/i386/lib/libginac.a -output libginac.a
 
The reason for this causes me to post here. After the build I can not seem to find any output in the arm64, armv7 and armv7s folders. GiNaC has output in all of those folders. Is it not possible to build CLN for those archs ?
 
Also here is my full error message from the linker:

ld: warning: ignoring file /Users/Robert/Documents/CAS_TEST/libcln.a, missing required architecture arm64 in file /Users/Robert/Documents/CAS_TEST/libcln.a (2 slices)

ld: '/Users/Robert/Documents/CAS_TEST/libginac.a(libginac_la-utils.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 
Thanks a lot for your help in advance ! 
 
Robert