fix quoting problems in ios main() renamer

Task-number: QTBUG-45125
Change-Id: I6fc724509e25a43bb229715f7e486bf9c3553f53
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-03-20 11:56:01 +01:00
parent 81dfba6ae9
commit f702d5c327
2 changed files with 11 additions and 8 deletions

View File

@ -33,19 +33,20 @@ equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
# called 'qt_main' now. # called 'qt_main' now.
macx-xcode { macx-xcode {
objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" objects_dir = "\"${OBJECT_FILE_DIR}-${CURRENT_VARIANT}\""
archs = "${ARCHS}" archs = "\"${ARCHS}\""
} else { } else {
objects_dir = $$OBJECTS_DIR isEmpty(OBJECTS_DIR): \
isEmpty(objects_dir): \
objects_dir = . objects_dir = .
archs = "$$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS" else: \
objects_dir = $$shell_quote($$OBJECTS_DIR)
archs = $$shell_quote($$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} \"$${archs}\" QMAKE_PRE_LINK += $$shell_quote($$QMAKESPEC/rename_main.sh) $$objects_dir $$archs
} }
} }

View File

@ -38,9 +38,11 @@ if [ $# -ne 2 ]; then
else else
arch_paths="" arch_paths=""
for a in $2; do for a in $2; do
arch_paths="$arch_paths $1/$a" arch_paths="$arch_paths
$1/$a"
done done
for f in $(find $arch_paths -name '*.o'); do for f in $(IFS="
"; 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