Changes between Version 14 and Version 15 of Building/CrossCompiling/iOS


Ignore:
Timestamp:
Aug 20, 2013 8:03:31 AM (2 years ago)
Author:
lukexi
Comment:

Updated arm-apple-darwin10-gcc to build armv7/armv7s fat binaries

Legend:

Unmodified
Added
Removed
Modified
  • Building/CrossCompiling/iOS

    v14 v15  
    2121
    2222TARGET_GCC=$TARGET_BIN/arm-apple-darwin10-llvm-gcc-4.2
    23 TARGET_CFLAGS="-isysroot $TARGET_PLATFORM -march=armv7 -mcpu=cortex-a8 -mfpu=neon"
     23TARGET_CFLAGS="-isysroot $TARGET_PLATFORM -mcpu=cortex-a8 -mfpu=neon"
    2424
     25allArgs=$@
     26
     27# Only need lipo when we're building object files
     28if [[ "$allArgs" == *.o* ]]
     29then
     30# Find the filename
     31fileName=$(echo "$allArgs" | sed 's|.*-o \([^.]*\)\.o.*|\1|')
     32
     33# Create filename variants for armV7 and armV7s
     34fileNameForArmv7=$fileName-armv7
     35fileNameForArmv7s=$fileName-armv7s
     36
     37# Call gcc twice, once for each architecture, outputting to our filename variants
     38$TARGET_GCC $TARGET_CFLAGS "-march=armv7" ${allArgs//$fileName.o/$fileNameForArmv7.o}
     39$TARGET_GCC $TARGET_CFLAGS "-march=armv7s" ${allArgs//$fileName.o/$fileNameForArmv7s.o}
     40
     41# Lipo the two filename variants together
     42lipo $fileNameForArmv7.o $fileNameForArmv7s.o -create -output $fileName.o
     43else
     44# If not building object files, call regularly.
    2545exec $TARGET_GCC $TARGET_CFLAGS "$@"
     46fi
    2647}}}
    2748