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-14 10:56:08 +0200
commite25f67d3e6ba6aa24a355010e0dc3baadbbacb8b (patch)
tree230af0f7d8e04348a97ce274615a45e5b3ff2d41 /configure
parent3fbc68b372741d04f477915bb09efbd2a277a570 (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. Original-patch-by: Greg Bentz (cherry picked from commit 80f6d7862c0e2e41768620d5bd81b0e1d5e3f61f) Change-Id: I5867fc03dde1ef6e2fbf3747bdb9aaf15518eb6a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 18 insertions, 2 deletions
diff --git a/configure b/configure
index 03ed6e70d7..86d456c732 100755
--- a/configure
+++ b/configure
@@ -207,9 +207,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
}
@@ -791,6 +791,7 @@ CFG_DECLARATIVE=auto
CFG_DECLARATIVE_DEBUG=yes
CFG_WEBKIT=auto # (yes|no|auto|debug)
CFG_JAVASCRIPTCORE_JIT=auto
+CFG_STACK_PROTECTOR_STRONG=auto
CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
CFG_GFX_ON="linuxfb multiscreen"
@@ -898,6 +899,7 @@ XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
XPLATFORM_INTEGRITY=no # Whether target platform is INTEGRITY (*integrity*)
XPLATFORM_SYMBIAN=no # Whether target platform is SYMBIAN (*symbian*)
XPLATFORM_SYMBIAN_SBSV2=no # Whether target platform is SYMBIAN_SBSV2 (symbian-sbsv2)
+XPLATFORM_QNX=no
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
@@ -1690,6 +1692,7 @@ while [ "$#" -gt 0 ]; do
case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac
case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
+ case "$XPLATFORM" in *qnx-*|*blackberry-*) XPLATFORM_QNX=yes;; esac
;;
device-option)
DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
@@ -2999,6 +3002,7 @@ case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac
case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
+case "$XPLATFORM" in *qnx-*|*blackberry-*) XPLATFORM_QNX=yes;; esac
if [ -d "$PLATFORM" ]; then
QMAKESPEC="$PLATFORM"
@@ -3478,6 +3482,17 @@ if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; 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
@@ -7274,6 +7289,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_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then