Commit eca0668a authored by Tor Arne Vestbø's avatar Tor Arne Vestbø Committed by Jani Heikkinen
Browse files

iOS: Ensure that the rename-main logic works for multi-arch builds


We need to tell Xcode which architectures it should set up pre-link
dependencies for, as well as run the rename script in the root object
file directory. We pass it the current architectures so that we only
rename main() for simulator or device, not both.

Change-Id: I095d7c8a22ff0cb2ce872c9a86c93a070c1fcc65
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
Showing with 12 additions and 6 deletions
...@@ -201,7 +201,7 @@ macx-xcode { ...@@ -201,7 +201,7 @@ macx-xcode {
arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator
unset(QMAKE_XCODE_ARCHS) QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS
} else { } else {
# Be more specific about which architecture we're targeting # Be more specific about which architecture we're targeting
contains(QT_ARCH, arm.*): \ contains(QT_ARCH, arm.*): \
......
...@@ -32,17 +32,19 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) { ...@@ -32,17 +32,19 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
# called 'qt_main' now. # called 'qt_main' now.
macx-xcode { macx-xcode {
objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}/${CURRENT_ARCH}" objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}"
archs = "${ARCHS}"
} else { } else {
objects_dir = $$OBJECTS_DIR objects_dir = $$OBJECTS_DIR
isEmpty(objects_dir): \ isEmpty(objects_dir): \
objects_dir = . objects_dir = .
archs = "$$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS"
} }
!isEmpty(QMAKE_PRE_LINK): \ !isEmpty(QMAKE_PRE_LINK): \
QMAKE_PRE_LINK += ";" QMAKE_PRE_LINK += ";"
QMAKE_PRE_LINK += $$QMAKESPEC/rename_main.sh $${objects_dir} QMAKE_PRE_LINK += $$QMAKESPEC/rename_main.sh $${objects_dir} \"$${archs}\"
} }
} }
......
...@@ -41,10 +41,14 @@ ...@@ -41,10 +41,14 @@
## ##
############################################################################# #############################################################################
if [ $# -eq 0 ]; then if [ $# -ne 2 ]; then
echo "usage: $0 <path to object files>" echo "$0: wrong number of arguments for internal tool used by iOS mkspec"
else else
for f in $(find $1 -name '*.o'); do arch_paths=""
for a in $2; do
arch_paths="$arch_paths $1/$a"
done
for f in $(find $arch_paths -name '*.o'); do
# Skip object files without the _main symbol # Skip object files without the _main symbol
nm $f 2>/dev/null | grep -q 'T _main$' || continue nm $f 2>/dev/null | grep -q 'T _main$' || continue
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment