From 4a1bafcc4ee5b7d968620808e155c1617aa6f273 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 29 Jul 2016 19:58:08 +0200 Subject: 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 --- config.tests/common/pch/header.h | 1 + config.tests/common/pch/pch.pro | 3 + config.tests/common/pch/source.cpp | 44 +++++++++++++ config.tests/unix/bsymbolic_functions.test | 31 --------- config.tests/unix/fvisibility.test | 74 ---------------------- config.tests/unix/precomp.test | 54 ---------------- config.tests/unix/reduce_exports/fvisibility.c | 52 +++++++++++++++ .../unix/reduce_exports/reduce_exports.pro | 5 ++ .../unix/reduce_relocs/bsymbolic_functions.c | 44 +++++++++++++ config.tests/unix/reduce_relocs/reduce_relocs.pro | 5 ++ 10 files changed, 154 insertions(+), 159 deletions(-) create mode 100644 config.tests/common/pch/header.h create mode 100644 config.tests/common/pch/pch.pro create mode 100644 config.tests/common/pch/source.cpp delete mode 100755 config.tests/unix/bsymbolic_functions.test delete mode 100755 config.tests/unix/fvisibility.test delete mode 100755 config.tests/unix/precomp.test create mode 100644 config.tests/unix/reduce_exports/fvisibility.c create mode 100644 config.tests/unix/reduce_exports/reduce_exports.pro create mode 100644 config.tests/unix/reduce_relocs/bsymbolic_functions.c create mode 100644 config.tests/unix/reduce_relocs/reduce_relocs.pro (limited to 'config.tests') 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 <header.cpp - cat >source.cpp </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") -- cgit v1.2.3