Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/notes/bugfix-14625.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# iOS standalones with RevZip externals and iOS Min Version >= 7.0 do not build
2 changes: 1 addition & 1 deletion engine/engine-mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cp \"$TARGET_BUILD_DIR/revsecurity.dylib\" \"$TARGET_BUILD_DIR/standalone-mobile-community.app/\"";
shellScript = "# SN-2015-02-19: [[ Bug 14625 ]] Only copy revsecurity.dylib fo rthe simulator\nif [ \"${SDK_NAME:0:8}\" != \"iphoneos\" ]; then\n cp \"$TARGET_BUILD_DIR/revsecurity.dylib\" \"$TARGET_BUILD_DIR/standalone-mobile-community.app/\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
8 changes: 6 additions & 2 deletions ide-support/revdeploylibraryios.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ end deployIsAvailable
function deployListTargets
local tTargets

-- SN-2015-02-18: [[ ARM64 ]] We dropped support for
-- iOS Simulators < 5.1
put "5.1,6.1,7.1,8.1" into tAvailableSimulators

repeat for each key tKey in sDeploySimulators
if tKey >= "4.2" then
if tKey is among the items of tAvailableSimulators then
put "iPad Simulator" && tKey & return after tTargets
end if
if tKey >= "4.0" then
if tKey is among the items of tAvailableSimulators then
put "iPhone Simulator" && tKey & return after tTargets
end if
end repeat
Expand Down
57 changes: 39 additions & 18 deletions ide-support/revsaveasiosstandalone.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
-- Make the minimum run version of the engine 4.3
-- SN-2015-02-05: [[ Bug 14422 ]] The linker minimum iphoneOS version
-- should be relevant with the desired minimum version.
put revGetMinimumOSByArch(tSettings["ios,minimum version"]) into tVersion
put "-miphoneos-version-min=" & tVersion["armv7"] & return after tLinkCommand
-- SN-2015-02-19: [[ Bug 14625 ]] Minimum version is architecture-specific
--put revGetMinimumOSByArch(tSettings["ios,minimum version"]) into tVersion
--put "-miphoneos-version-min=" & tVersion["armv7"] & return after tLinkCommand

-- MW-2013-06-26: [[ CloneAndRun ]] Only dead strip if an installed env.
if revEnvironmentIsInstalled() then
Expand Down Expand Up @@ -373,15 +374,6 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
end if
end repeat

-- Make a temporary file for link options and execute it
local tLinkOptionsFile
put tempName() into tLinkOptionsFile

-- MM-2011-09-28: Create the engine for the instruction set specified in the build type setting.
--
put tempName() into tSDKs[tInstSet]["engine file"]
put tLinkCommand & "-o" && quote & tSDKs[tInstSet]["engine file"] & quote & return into url ("binfile:" & tLinkOptionsFile)

-- Compute the list of archs in the fat binary
local tRawArchs
put shell("otool -fv" && quote & mapFilePath(tSDKs[tInstSet]["runtime path"] & slash & "Standalone") & quote) into tRawArchs
Expand All @@ -391,21 +383,50 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget

local tArchs
if tRawArchs contains "ARM64" then
put "-arch arm64 " after tArchs
put "arm64 " after tArchs
end if
if tRawArchs contains "V7" then
put "-arch armv7 " after tArchs
put "armv7 " after tArchs
end if

-- MM-2013-09-23: [[ iOS7 Support ]] Use g++ instead of llvm-g++-4.2. XCode 5.0 uses llvm 5.0.
-- g++ appears to be sym-linked to the appropriate compiler in all SDKS.
-- SN-2015-02-19: [[ Bug 14625 ]] Build each binary separately according
-- to their architecture.
put empty into tArchSpecificEngineList
repeat for each word tArch in tArchs
-- Make a temporary file for link options and execute it
local tLinkOptionsFile
put tempName() into tLinkOptionsFile

put tempName() into tArchSpecificEngineFile
put tLinkCommand & "-o" && quote & tArchSpecificEngineFile & quote & return into url ("binfile:" & tLinkOptionsFile)

local tiPhoneMinVersion
if tArch = "arm64" then
put "7.0.0" into tiPhoneMinVersion
else
put "5.1.1" into tiPhoneMinVersion
end if
-- MM-2013-09-23: [[ iOS7 Support ]] Use g++ instead of llvm-g++-4.2. XCode 5.0 uses llvm 5.0.
-- g++ appears to be sym-linked to the appropriate compiler in all SDKS.
-- SN-2015-02-19: [[ Bug 14625 ]] The minimum iOS version is bound to the architecture
get shell("g++ -arch " & tArch && "-miphoneos-version-min=" & tiPhoneMinVersion && quote & "@" & tLinkOptionsFile & quote)

put tArchSpecificEngineFile & space after tArchSpecificEngineList
delete file tLinkOptionsFile
if it is not empty or there is no file tArchSpecificEngineFile then
throw "linking for" && tInstSet && " (" & tArch & ") failed with " & it
end if
end repeat

-- MM-2011-09-28: Create the engine for the instruction set specified in the build type setting.
--
get shell("g++ " & tArchs && quote & "@" & tLinkOptionsFile & quote)
put tempName() into tSDKs[tInstSet]["engine file"]
-- SN-2015-02-19: [[ Bug 14625 ]] Make the fat binary with the architecture-specific engines
get shell("lipo -create " & tArchSpecificEngineList & " -output " & quote & tSDKs[tInstSet]["engine file"] & quote)

delete file tLinkOptionsFile
if it is not empty or there is no file tSDKs[tInstSet]["engine file"] then
throw "linking for" && tInstSet && "failed with " & it
end if
end if

-- Put the path back the way it was
put tOldPath into $PATH
Expand Down
1 change: 1 addition & 0 deletions revzip/src/revzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */

#if defined(TARGET_SUBPLATFORM_IPHONE) || defined(TARGET_SUBPLATFORM_ANDROID)
#define stricmp strcasecmp
#include <unistd.h>
#endif

#define REVZIP_READ_BUFFER_SIZE 8192
Expand Down
5 changes: 3 additions & 2 deletions rules/Global Mobile.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ GCC_THREADSAFE_STATICS = NO
SHARED_PRECOMPS_DIR=$(OBJROOT)/Precompiled/$(CURRENT_ARCH)
GLOBAL_GCC_PREPROCESSOR_DEFINITIONS=_MOBILE TARGET_PLATFORM_MOBILE TARGET_SUBPLATFORM_IPHONE
GCC_VERSION =
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1
IPHONEOS_DEPLOYMENT_TARGET[arch=armv7] = 5.1.1
IPHONEOS_DEPLOYMENT_TARGET[arch=arm64] = 7.0.0
TARGETED_DEVICE_FAMILY = 1,2
ALWAYS_SEARCH_USER_PATHS = NO
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
SDKROOT=iphoneos
ARCHS_STANDARD=armv7 arm64
ARCHS_STANDARD=armv7 arm64
66 changes: 61 additions & 5 deletions tools/build-extension-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ DEPS=`cat "$SRCROOT/$PRODUCT_NAME.ios"`
DEPS=${DEPS//library /-l}
DEPS=${DEPS//framework /-framework }

ARCHS="-arch ${ARCHS// / -arch }"
if [ "$SYMBOLS" != "" ]; then
SYMBOLS="-Wl,-exported_symbol -Wl,${SYMBOLS// / -Wl,-exported_symbol -Wl,}"
fi
Expand All @@ -21,13 +20,70 @@ else
BIN_DIR=$DEVELOPER_BIN_DIR
fi

$BIN_DIR/g++ -dynamiclib $ARCHS -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -dead_strip -Wl,-x $SYMBOLS $DEPS

# MW-2011-09-19: Updated to build universal binary version of lcext - by passing
# the process through g++ we get it all for free!
# MW-2013-06-26: [[ CloneAndRun ]] When in 'Debug' mode, don't strip all global symbols.
if [ $CONFIGURATION = "Debug" ]; then
$BIN_DIR/g++ -nodefaultlibs -Wl,-r $ARCHS -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,"$SRCROOT/$PRODUCT_NAME.ios" -Wl,-exported_symbol -Wl,___libinfoptr_$PRODUCT_NAME $STATIC_DEPS
STRIP_OPTIONS="-Wl,-r"
else
STRIP_OPTIONS="-Wl,-r -Wl,-x"
fi

# SN-2015-02019: [[ Bug 14625 ]] We build and link each arch separately, and lipo them
# togother once it's done.

# We still want to produce revsecurity.dylib for the simulator
if [ "${SDK_NAME:0:8}" != "iphoneos" -a "${EXECUTABLE_NAME}" = "revsecurity" ]; then
BUILD_DYLIB=1
else
$BIN_DIR/g++ -nodefaultlibs -Wl,-r -Wl,-x $ARCHS -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,"$SRCROOT/$PRODUCT_NAME.ios" -Wl,-exported_symbol -Wl,___libinfoptr_$PRODUCT_NAME $STATIC_DEPS
BUILD_DYLIB=0
fi

LCEXT_FILE_LIST=""
DYLIB_FILE_LIST=""

# Link architecture-specifically the libraries
for ARCH in $(echo $ARCHS | tr " " "\n")
do
LCEXT_FILE="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext_${ARCH}"
DYLIB_FILE="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib_${ARCH}"

# arm64 is only from iOS 7.0.0
if [ ${ARCH} = "arm64" -o ${ARCH} = "x86_64" ]; then
MIN_VERSION="7.0"
else
MIN_VERSION="5.1"
fi

if [ $BUILD_DYLIB -eq 1 ]; then
OUTPUT=$($BIN_DIR/g++ -dynamiclib -arch ${ARCH} -miphoneos-version-min=${MIN_VERSION} -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "${DYLIB_FILE}" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -dead_strip -Wl,-x $SYMBOLS $DEPS)

if [ -n "$OUTPUT" ]; then
echo "Linking ""${DYLIB_FILE}""failed:"
echo $OUT
exit -1
fi
fi

OUTPUT=$($BIN_DIR/g++ -nodefaultlibs $STRIP_OPTIONS -arch ${ARCH} -miphoneos-version-min=${MIN_VERSION} -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "${LCEXT_FILE}" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,"$SRCROOT/$PRODUCT_NAME.ios" -Wl,-exported_symbol -Wl,___libinfoptr_$PRODUCT_NAME $STATIC_DEPS)

if [ -n "$OUTPUT" ]; then
echo "Linking ""${LCEXT_FILE}""failed:"
echo $OUT
exit -1
fi

LCEXT_FILE_LIST+=" ${LCEXT_FILE}"
DYLIB_FILE_LIST+=" ${DYLIB_FILE}"
done

# Lipo the generated libs
lipo -create ${LCEXT_FILE_LIST} -output "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext"

# Cleanup the lcext_$ARCH files generated
rm ${LCEXT_FILE_LIST}

if [ $BUILD_DYLIB -eq 1 ]; then
lipo -create ${DYLIB_FILE_LIST} -output "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib"
rm ${DYLIB_FILE_LIST}
fi
6 changes: 1 addition & 5 deletions tools/build-ios.osx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
BASEDIR=$(dirname $0)
cd $BASEDIR/..

./sdks/Xcode_4_2/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator5.0 ARCHS=i386
./sdks/Xcode_4_2/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator5.1 ARCHS=i386
./sdks/Xcode_4_6/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator6.1 ARCHS=i386
./sdks/Xcode_5_1/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator7.1 ARCHS="i386 x86_64"
./sdks/Xcode_6_0/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator8.0 ARCHS="i386 x86_64"
./sdks/Xcode_6_1/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphonesimulator8.1 ARCHS="i386 x86_64"

./sdks/Xcode_4_2/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphoneos5.0 ARCHS=armv7
./sdks/Xcode_4_6/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphoneos6.1 ARCHS=armv7
./sdks/Xcode_5_1/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphoneos7.1 ARCHS="armv7 arm64"
./sdks/Xcode_6_1/usr/bin/xcodebuild -project stage-mobile.xcodeproj -configuration Release -sdk iphoneos8.1 ARCHS="armv7 arm64"