summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@rim.com>2012-09-20 14:11:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-01 10:22:06 +0200
commit80f6d7862c0e2e41768620d5bd81b0e1d5e3f61f (patch)
tree9e06efdf82597af4ed89ce5200aca898a137fba9 /configure
parentc6271071b4d0686fef8fe3df215ce84be0305a8b (diff)
Blackberry mkspecs: Refine compiler options
stack-protector-strong gives performance benefits over stack-protector-all and is still checking more than -stack-protector, so seems to be a good middle way and we want to use it when it is there. The -shared option for the compiler (not the linker) prevents a RIM internal version of qcc from forcing -fPIE, and should not harm in general when set. In addition, add a method "compilerSupportsFlag" for Windows as is present in the Unix configure script. Change-Id: Iba300e9cb82f34043e7b36f8e45287a1aed2a1a5 Original-patch-by: Greg Bentz Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 15 insertions, 2 deletions
diff --git a/configure b/configure
index 58d7a86ad7..19eef3f4bb 100755
--- a/configure
+++ b/configure
@@ -230,9 +230,9 @@ compilerSupportsFlag()
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
- "$TEST_COMPILER" "$@" -o conftest.o conftest.cpp
+ $TEST_COMPILER "$@" -o conftest-out.o conftest.cpp
ret=$?
- rm -f conftest.cpp conftest.o
+ rm -f conftest.cpp conftest-out.o
return $ret
}
@@ -783,6 +783,7 @@ CFG_V8SNAPSHOT=auto
CFG_QML_DEBUG=yes
CFG_JAVASCRIPTCORE_JIT=auto
CFG_PKGCONFIG=auto
+CFG_STACK_PROTECTOR_STRONG=auto
# Target architecture
CFG_ARCH=
@@ -2660,6 +2661,17 @@ if [ "$CFG_REDUCE_EXPORTS" != "no" ]; then
fi
fi
+# auto-detect -fstack-protector-strong support (for QNX only currently)
+if [ "$XPLATFORM_QNX" = "yes" ]; then
+ if compilerSupportsFlag -fstack-protector-strong; then
+ CFG_STACK_PROTECTOR_STRONG=yes
+ else
+ CFG_STACK_PROTECTOR_STRONG=no
+ fi
+else
+ CFG_STACK_PROTECTOR_STRONG=no
+fi
+
# detect the availability of the -Bsymbolic-functions linker optimization
if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
@@ -5296,6 +5308,7 @@ if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
fi
[ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
+[ "$CFG_STACK_PROTECTOR_STRONG" = "yes" ] && QT_CONFIG="$QT_CONFIG stack-protector-strong"
[ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
[ "$CFG_STRIP" = "no" ] && QMAKE_CONFIG="$QMAKE_CONFIG nostrip"
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"