diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-29 19:58:08 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-12 22:04:50 +0000 |
commit | 4a1bafcc4ee5b7d968620808e155c1617aa6f273 (patch) | |
tree | 28a4dd4e551c19f16376f33aea4f45b630f165ce | |
parent | ce50eb4a733ab93b4ca3bf206b56f61c989fe717 (diff) |
get rid of test type 'shell'
it's bound to the bourne shell, which is not readily available on
windows hosts.
on the way, the pch, fvisibility, and bsymbolic_functions tests were
rewritten as regular compile tests. they now just verify that qmake's
built-in support for the tested features actually works.
Change-Id: Ibac246f21b5ececa40da3f576dc789982eaf9fdf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | config.tests/common/pch/header.h | 1 | ||||
-rw-r--r-- | config.tests/common/pch/pch.pro | 3 | ||||
-rw-r--r-- | config.tests/common/pch/source.cpp | 44 | ||||
-rwxr-xr-x | config.tests/unix/bsymbolic_functions.test | 31 | ||||
-rwxr-xr-x | config.tests/unix/fvisibility.test | 74 | ||||
-rwxr-xr-x | config.tests/unix/precomp.test | 54 | ||||
-rw-r--r-- | config.tests/unix/reduce_exports/fvisibility.c | 52 | ||||
-rw-r--r-- | config.tests/unix/reduce_exports/reduce_exports.pro | 5 | ||||
-rw-r--r-- | config.tests/unix/reduce_relocs/bsymbolic_functions.c | 44 | ||||
-rw-r--r-- | config.tests/unix/reduce_relocs/reduce_relocs.pro | 5 | ||||
-rw-r--r-- | configure.json | 15 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 19 |
12 files changed, 160 insertions, 187 deletions
diff --git a/config.tests/common/pch/header.h b/config.tests/common/pch/header.h new file mode 100644 index 0000000000..ebc22c4fb0 --- /dev/null +++ b/config.tests/common/pch/header.h @@ -0,0 +1 @@ +#define HEADER_H diff --git a/config.tests/common/pch/pch.pro b/config.tests/common/pch/pch.pro new file mode 100644 index 0000000000..a6f842dff0 --- /dev/null +++ b/config.tests/common/pch/pch.pro @@ -0,0 +1,3 @@ +CONFIG += precompile_header +PRECOMPILED_HEADER = header.h +SOURCES = source.cpp diff --git a/config.tests/common/pch/source.cpp b/config.tests/common/pch/source.cpp new file mode 100644 index 0000000000..855672ffa8 --- /dev/null +++ b/config.tests/common/pch/source.cpp @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the configuration of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HEADER_H +#error no go +#endif + +int main() { return 0; } diff --git a/config.tests/unix/bsymbolic_functions.test b/config.tests/unix/bsymbolic_functions.test deleted file mode 100755 index 4d66ee6de0..0000000000 --- a/config.tests/unix/bsymbolic_functions.test +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -BSYMBOLIC_FUNCTIONS_SUPPORT=no -COMPILER=$1 -VERBOSE=$2 - - -cat >>bsymbolic_functions.c << EOF -#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) -#error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)." -#endif - -int main() { return 0; } -EOF - -if [ "$VERBOSE" = "yes" ] ; then - echo $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c - $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c && BSYMBOLIC_FUNCTIONS_SUPPORT=yes -else - $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes -fi -rm -f bsymbolic_functions.c libtest.so - -# done -if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then - [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled." - exit 0 -else - [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled." - exit 1 -fi diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test deleted file mode 100755 index 621af95e63..0000000000 --- a/config.tests/unix/fvisibility.test +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -FVISIBILITY_SUPPORT=no -COMPILER=$1 -VERBOSE=$2 - -CMDLINE= - - -RunCompileTest() { - cat >>fvisibility.c << EOF -#if defined(__GNUC__) -# if (__GNUC__ < 4) -# error "GCC3 with backported visibility patch is known to miscompile Qt" -# endif -__attribute((visibility("default"))) void blah(); -#elif defined(__SUNPRO_CC) -# if (__SUNPRO_CC < 0x0550) -# error "SunStudio 8 or later is required for ELF visibility" -# endif -__global void blah(); -#else -# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" -#endif -EOF - - if [ "$VERBOSE" = "yes" ] ; then - echo $COMPILER -c $CMDLINE fvisibility.c - $COMPILER -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes - else - $COMPILER -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes - fi - rm -f fvisibility.c fvisibility.o -} - - -case "$COMPILER" in -*g++*|*c++*|*qcc*) - CMDLINE="-fvisibility=hidden" - RunCompileTest - ;; - -aCC*) - ;; - -icpc) - ICPC_VERSION=`icpc -dumpversion` - case "$ICPC_VERSION" in - 8.*|9.*|10.0) - # 8.x, 9.x, and 10.0 don't support symbol visibility - ;; - *) - # the compile test works for the intel compiler because it mimics gcc's behavior - CMDLINE="-fvisibility=hidden" - RunCompileTest - ;; - esac - ;; - -CC) - # This should be SunStudio. If not, it'll get caught. - CMDLINE="-xldscope=hidden" - RunCompileTest - ;; -esac - -# done -if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then - [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled." - exit 0 -else - [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled." - exit 1 -fi diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test deleted file mode 100755 index 0b8377b21a..0000000000 --- a/config.tests/unix/precomp.test +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -PRECOMP_SUPPORT=no -COMPILER=$1 -VERBOSE=$2 - -case "$COMPILER" in -*icpc) - cat >header.h <<EOF -#define HEADER_H - -EOF - >header.cpp - cat >source.cpp <<EOF -#ifndef HEADER_H -#error no go -#endif - -EOF - - rm -f header.pchi - $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \ - && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \ - && PRECOMP_SUPPORT=yes - - rm -f header.h header.cpp source.cpp - rm -f header.pchi header.o source.o - ;; - -*g++*|c++|*qcc*) - case `"$COMPILER" -dumpversion 2>/dev/null` in - 3.*) - ;; - *) - - >precomp_header.h - if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then - $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes - fi - rm -f precomp_header.h precomp_header.h.gch - ;; - esac - ;; -esac - - -# done -if [ "$PRECOMP_SUPPORT" != "yes" ]; then - [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled." - exit 0 -else - [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled." - exit 1 -fi diff --git a/config.tests/unix/reduce_exports/fvisibility.c b/config.tests/unix/reduce_exports/fvisibility.c new file mode 100644 index 0000000000..71af9d99a3 --- /dev/null +++ b/config.tests/unix/reduce_exports/fvisibility.c @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the configuration of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#if defined(__GNUC__) +# if (__GNUC__ < 4) +# error "GCC3 with backported visibility patch is known to miscompile Qt" +# endif +__attribute((visibility("default"))) void blah(); +#elif defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x0550) +# error "SunStudio 8 or later is required for ELF visibility" +# endif +__global void blah(); +#else +# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" +#endif diff --git a/config.tests/unix/reduce_exports/reduce_exports.pro b/config.tests/unix/reduce_exports/reduce_exports.pro new file mode 100644 index 0000000000..dc8adc2637 --- /dev/null +++ b/config.tests/unix/reduce_exports/reduce_exports.pro @@ -0,0 +1,5 @@ +TEMPLATE = lib +CONFIG += dll hide_symbols +SOURCES = fvisibility.c + +isEmpty(QMAKE_CFLAGS_HIDESYMS): error("Nope") diff --git a/config.tests/unix/reduce_relocs/bsymbolic_functions.c b/config.tests/unix/reduce_relocs/bsymbolic_functions.c new file mode 100644 index 0000000000..36ff410c81 --- /dev/null +++ b/config.tests/unix/reduce_relocs/bsymbolic_functions.c @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the configuration of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) +# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129). +#endif + +int main() { return 0; } diff --git a/config.tests/unix/reduce_relocs/reduce_relocs.pro b/config.tests/unix/reduce_relocs/reduce_relocs.pro new file mode 100644 index 0000000000..2f23465a3f --- /dev/null +++ b/config.tests/unix/reduce_relocs/reduce_relocs.pro @@ -0,0 +1,5 @@ +TEMPLATE = lib +CONFIG += dll bsymbolic_functions +SOURCES = bsymbolic_functions.c + +isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope") diff --git a/configure.json b/configure.json index 0c811e2275..f2b0df292d 100644 --- a/configure.json +++ b/configure.json @@ -251,9 +251,8 @@ }, "precompile_header": { "description": "precompiled header support", - "type": "shell", - "test": "unix/precomp.test", - "args": "$$QMAKE_CXX yes" + "type": "compile", + "test": "common/pch" }, "use_gold_linker": { "description": "gold linker", @@ -267,15 +266,13 @@ }, "reduce_exports": { "description": "symbol visibility support", - "type": "shell", - "test": "unix/fvisibility.test", - "args": "$$QMAKE_CXX yes" + "type": "compile", + "test": "unix/reduce_exports" }, "reduce_relocations": { "description": "-Bsymbolic-functions support", - "type": "shell", - "test": "unix/bsymbolic_functions.test", - "args": "$$QMAKE_CXX yes" + "type": "compile", + "test": "unix/reduce_relocs" }, "skip_modules": { "description": "modules to skip", diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 711eec8a2c..7a289f7b94 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -248,25 +248,6 @@ defineTest(qtConfParseCommandLine) { } } -defineTest(qtConfTest_shell) { - test = $$eval($${1}.test) - dir = $$replace(test, [^/]*$, "") - test = $$replace(test, ([^/]*/)*, "") - args = $$eval($${1}.args) - # replace any things like $$QMAKE_CXX by their values - eval(args = $$args) - - test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$dir - test_out_dir = $$shadowed($$test_dir) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" - - mkpath($$test_out_dir)|error() - - qtRunLoggedCommand("$$test_cmd_base $$test_dir/$${test} $${args}"): \ - return(false) - return(true) -} - defineReplace(qtConfToolchainSupportsFlag) { test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" |