<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Dear CLN Mailing List,</div>

<div> </div>

<div>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:</div>

<div> </div>

<div>
<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">#!/bin/bash</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"<br/>
TOOLSPATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"<br/>
export IPHONEOS_DEPLOYMENT_TARGET="10.1"<br/>
pwd=`pwd`</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">findLatestSDKVersion()<br/>
{<br/>
    sdks=`ls $PLATFORMPATH/$1.platform/Developer/SDKs`<br/>
    arr=()<br/>
    for sdk in $sdks<br/>
    do<br/>
       arr[${#arr[@]}]=$sdk<br/>
    done</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">    # Last item will be the current SDK, since it is alpha ordered<br/>
    count=${#arr[@]}<br/>
    if [ $count -gt 0 ]; then<br/>
       sdk=${arr[$count-1]:${#1}}<br/>
       num=`expr ${#sdk}-4`<br/>
       SDKVERSION=${sdk:0:$num}<br/>
    else<br/>
       SDKVERSION="10.1"<br/>
    fi<br/>
}</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">buildit()<br/>
{<br/>
    target=$1<br/>
    hosttarget=$1<br/>
    platform=$2</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">    if [[ $hosttarget == "x86_64" ]]; then<br/>
        hostarget="i386"<br/>
    elif [[ $hosttarget == "arm64" ]]; then<br/>
        hosttarget="arm"<br/>
    fi</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">    export CC="$(xcrun -sdk iphoneos -find clang)"<br/>
    export CPP="$CC -E"<br/>
    export CFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"<br/>
    export AR=$(xcrun -sdk iphoneos -find ar)<br/>
    export RANLIB=$(xcrun -sdk iphoneos -find ranlib)<br/>
    export CPPFLAGS="-arch ${target}  -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"<br/>
    export LDFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk"</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">    mkdir -p $pwd/output/$target</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">     ./configure --prefix="$pwd/output/$target" --disable-shared --disable-sqlite --host=$hosttarget-apple-darwin</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">    make clean<br/>
    make<br/>
    make install<br/>
}</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">findLatestSDKVersion iPhoneOS</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">buildit armv7 iPhoneOS<br/>
buildit armv7s iPhoneOS<br/>
buildit arm64 iPhoneOS<br/>
buildit i386 iPhoneSimulator<br/>
buildit x86_64 iPhoneSimulator</span></span></div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">lipo -create ./output/x86_64/lib/libcln.a ./output/i386/lib/libcln.a -output libcln.a</span></span></div>

<div> </div>

<div>I customised this a bit for GiNaC whih mainly ment swapping the last line with:</div>

<div> </div>

<div><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">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</span></span></div>

<div> </div>

<div>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 ?</div>

<div> </div>

<div><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size:12px;">Also here is my full error message from the linker:</span></span></div>

<div>
<p><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">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)</span></span></p>

<p><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">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</span></span></p>

<p><span style="font-size:12px;"><span style="font-family:courier new,courier,monospace;">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span></span></p>
</div>

<div> </div>

<div>Thanks a lot for your help in advance ! </div>

<div> </div>

<div>Robert  </div>
 </div></div></body></html>