From e9628fbd391972d4ffe5882d283d512df7fa705c Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Mon, 16 May 2016 23:24:36 -0700 Subject: Fix dynamic librariy support detection for platforms without libdl Some platforms (e.g. FreeBSD) do not have libdl, but dlopen and related functions are part of libc. So first check for dlopen in libc, and only if that fails, look for it in libdl. Task-number: QTBUG-52951 Change-Id: I65a8ed18fce157da32f4e1ffeba30d7513385a8f Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- config.tests/unix/dlopen/dlopen.cpp | 39 +++++++++++++++++++++++++++++++++++++ config.tests/unix/dlopen/dlopen.pro | 2 ++ config.tests/unix/libdl/libdl.cpp | 39 ------------------------------------- config.tests/unix/libdl/libdl.pro | 5 ++--- 4 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 config.tests/unix/dlopen/dlopen.cpp create mode 100644 config.tests/unix/dlopen/dlopen.pro delete mode 100644 config.tests/unix/libdl/libdl.cpp (limited to 'config.tests') diff --git a/config.tests/unix/dlopen/dlopen.cpp b/config.tests/unix/dlopen/dlopen.cpp new file mode 100644 index 0000000000..28a82330f2 --- /dev/null +++ b/config.tests/unix/dlopen/dlopen.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char **) +{ + dlopen(0, 0); +} diff --git a/config.tests/unix/dlopen/dlopen.pro b/config.tests/unix/dlopen/dlopen.pro new file mode 100644 index 0000000000..1d34314332 --- /dev/null +++ b/config.tests/unix/dlopen/dlopen.pro @@ -0,0 +1,2 @@ +SOURCES = $$PWD/dlopen.cpp +CONFIG -= qt dylib diff --git a/config.tests/unix/libdl/libdl.cpp b/config.tests/unix/libdl/libdl.cpp deleted file mode 100644 index 28a82330f2..0000000000 --- a/config.tests/unix/libdl/libdl.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - dlopen(0, 0); -} diff --git a/config.tests/unix/libdl/libdl.pro b/config.tests/unix/libdl/libdl.pro index 8ed5231a8f..4016395d35 100644 --- a/config.tests/unix/libdl/libdl.pro +++ b/config.tests/unix/libdl/libdl.pro @@ -1,3 +1,2 @@ -SOURCES = libdl.cpp -CONFIG -= qt dylib -!qnx: LIBS += -ldl +include(../dlopen/dlopen.pro) +LIBS += -ldl -- cgit v1.2.3 From eda29451e958cb4981c254d48a20125988a04a45 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 12 May 2016 17:16:51 +0200 Subject: Enable -separate-debug-info for mingw toolchains Having the debug info in separate files is very helpful, especially on memory constrained 32bit systems. When the debug info is compiled into the object files, processes can run out of memory when trying to load them. Change-Id: I1808a32e855d6a62e17e1b734c511b31db5f03f1 Reviewed-by: Oswald Buddenhagen --- config.tests/unix/objcopy/objcopy.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config.tests') diff --git a/config.tests/unix/objcopy/objcopy.pro b/config.tests/unix/objcopy/objcopy.pro index 3c28b89ef3..3c76ae92ef 100644 --- a/config.tests/unix/objcopy/objcopy.pro +++ b/config.tests/unix/objcopy/objcopy.pro @@ -1,4 +1,7 @@ SOURCES = objcopy.cpp CONFIG -= qt +TARGET = objcopytest -QMAKE_POST_LINK += $$QMAKE_OBJCOPY --only-keep-debug objcopy objcopy.debug && $$QMAKE_OBJCOPY --strip-debug objcopy && $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopy.debug objcopy +load(resolve_target) + +QMAKE_POST_LINK += $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET -- cgit v1.2.3 From defec688d20d32c1d3bc21067968c0c521da47c1 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Sun, 22 May 2016 01:08:10 +0200 Subject: Use -liconv on OpenBSD as well in config.tests OpenBSD iconv is in -liconv, so it needs to be added here. NetBSD has iconv in libc, so only OpenBSD is affected. Patch obtained from Vadim Zhukov , OpenBSD qt ports maintainer. Change-Id: Icce25d154857f0ce161b5f6b7ddac3c150a02bb8 Reviewed-by: Thiago Macieira --- config.tests/unix/iconv/iconv.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.tests') diff --git a/config.tests/unix/iconv/iconv.pro b/config.tests/unix/iconv/iconv.pro index ca12e51947..65273ccc94 100644 --- a/config.tests/unix/iconv/iconv.pro +++ b/config.tests/unix/iconv/iconv.pro @@ -1,3 +1,3 @@ SOURCES = iconv.cpp CONFIG -= qt dylib -mac|mingw|qnx|haiku:LIBS += -liconv +mac|mingw|openbsd|qnx|haiku:LIBS += -liconv -- cgit v1.2.3 From 5c6d27b8dfa695ab04766a1711b00421dba9c7d0 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Tue, 17 May 2016 12:38:44 +0200 Subject: Make eglfs-egldevice check work with pkgconfig as well Until now the check didn't use pkgconfig at all, but using pkgconfig alone does not work for some devices (special cases), so we have to use a combination of both here. Change-Id: Ia19a279d80a65352c467661d91a3762448c23ae6 Reviewed-by: Laszlo Agocs --- config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'config.tests') diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro index 521a911219..d0945465a0 100644 --- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro +++ b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro @@ -6,7 +6,10 @@ for(p, QMAKE_LIBDIR_EGL) { INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS += $$QMAKE_LIBS_EGL - -LIBS += -ldrm - +CONFIG += link_pkgconfig +!contains(QT_CONFIG, no-pkg-config) { + PKGCONFIG += libdrm +} else { + LIBS += -ldrm +} CONFIG -= qt -- cgit v1.2.3 From 644d0e75240811212ed9fd0c21e3bd05db3ba5db Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Fri, 20 May 2016 22:03:39 +0200 Subject: Cleanup NIS support leftover from Qt 3/4 Qt 3/4 had NIS configure options and tests for NIS defines, those were used in QPrintDialog at the time to support NIS-printers. As the implementation went away a long time ago and no NIS featueres are implemented anywhere in Qt, the configure options and config.tests for NIS can be removed. Change-Id: Ie920e6a422540bf938623265b6ee68c793aeff84 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- config.tests/unix/nis/nis.cpp | 44 ------------------------------------------- config.tests/unix/nis/nis.pro | 4 ---- 2 files changed, 48 deletions(-) delete mode 100644 config.tests/unix/nis/nis.cpp delete mode 100644 config.tests/unix/nis/nis.pro (limited to 'config.tests') diff --git a/config.tests/unix/nis/nis.cpp b/config.tests/unix/nis/nis.cpp deleted file mode 100644 index f2d7f223e3..0000000000 --- a/config.tests/unix/nis/nis.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - -int main(int, char **) -{ - char *d; - yp_get_default_domain(&d); - return 0; -} diff --git a/config.tests/unix/nis/nis.pro b/config.tests/unix/nis/nis.pro deleted file mode 100644 index b7f5693b60..0000000000 --- a/config.tests/unix/nis/nis.pro +++ /dev/null @@ -1,4 +0,0 @@ -SOURCES = nis.cpp -CONFIG -= qt dylib -solaris-*:LIBS += -lnsl -else:LIBS += $$QMAKE_LIBS_NIS -- cgit v1.2.3 From 7cbafa8de7bc516f089503d12cab397e7965b8a5 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 27 May 2016 23:47:49 -0700 Subject: Call a function in the MySQL configure test to make sure it links. This fixes a problem where the configure test may produce a false positive on iOS if a copy of libmysql for OS X is located, due to the fact that linking to a dynamic library of a different architecture than expected is not (yet) an error. Change-Id: Id41765f49e31d9c9c3becc3436ff5a69b160b8e0 Reviewed-by: Oswald Buddenhagen --- config.tests/unix/mysql/mysql.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'config.tests') diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp index 9cc2db03d9..3d51c612da 100644 --- a/config.tests/unix/mysql/mysql.cpp +++ b/config.tests/unix/mysql/mysql.cpp @@ -35,5 +35,6 @@ int main(int, char **) { + mysql_get_client_version(); return 0; } -- cgit v1.2.3 From 8c7d6b94d5e1e28c0352c5ae6ac52d4d1ea9b681 Mon Sep 17 00:00:00 2001 From: "Richard J. Moore" Date: Tue, 31 May 2016 17:10:07 +0100 Subject: Detect if the 'openssl' is really libressl at configure time. Qt does not support libressl which reports itself as openssl but uses a high version number. This means that we expect it to have features that it doesn't and will fail to build. Instead detect this situation at configure time and disable the ssl support. Change-Id: I73cca4d1544df2aaca0723c38ba63758c287ec41 Reviewed-by: Ralf Nolden Reviewed-by: Timur Pocheptsov Reviewed-by: Oswald Buddenhagen --- config.tests/unix/openssl/openssl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config.tests') diff --git a/config.tests/unix/openssl/openssl.cpp b/config.tests/unix/openssl/openssl.cpp index 6282bfa328..d0b6cca562 100644 --- a/config.tests/unix/openssl/openssl.cpp +++ b/config.tests/unix/openssl/openssl.cpp @@ -37,6 +37,12 @@ # error "OpenSSL >= 0.9.7 is required" #endif +#include + +#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES) +# error "OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported" +#endif + int main() { } -- cgit v1.2.3 From 37ef6b4968b93859df0af13b228b4abb3a0ef2c1 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Mon, 6 Jun 2016 12:00:11 +0200 Subject: OpenBSD: use clock_gettime() provided by OS The use of clock_gettime() is limited to systems having _POSIX_TIMERS defined, however OpenBSD implements clock_gettime() but does not have the posix define. Enable using clock_gettime() on OpenBSD as well. Change-Id: I785954fe61b42b15755ca625a766c9a95179ae8d Reviewed-by: Thiago Macieira --- config.tests/unix/clock-gettime/clock-gettime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.tests') diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp index 4ba05f70f5..a49359d24c 100644 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ b/config.tests/unix/clock-gettime/clock-gettime.cpp @@ -36,7 +36,7 @@ int main(int, char **) { -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) +#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__) timespec ts; clock_gettime(CLOCK_REALTIME, &ts); #else -- cgit v1.2.3 From 7835b260a9f60c98ee41468b040ac080782afe2f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 27 Oct 2015 19:48:04 -0700 Subject: configure: check whether std::atomic works for function pointers And ask the user to apply one of the patches we're carrying to their Standard Libraries. Change-Id: I7e6338336dd6468ead24ffff141139c79056922e Reviewed-by: Simon Hausmann --- config.tests/common/atomicfptr/atomicfptr.cpp | 58 +++++++++++++++++++++++++ config.tests/common/atomicfptr/atomicfptr.pro | 3 ++ config.tests/common/atomicfptr/icc2016_mac.diff | 18 ++++++++ config.tests/common/atomicfptr/qnx66.txt | 3 ++ 4 files changed, 82 insertions(+) create mode 100644 config.tests/common/atomicfptr/atomicfptr.cpp create mode 100644 config.tests/common/atomicfptr/atomicfptr.pro create mode 100644 config.tests/common/atomicfptr/icc2016_mac.diff create mode 100644 config.tests/common/atomicfptr/qnx66.txt (limited to 'config.tests') diff --git a/config.tests/common/atomicfptr/atomicfptr.cpp b/config.tests/common/atomicfptr/atomicfptr.cpp new file mode 100644 index 0000000000..ce0193dbe4 --- /dev/null +++ b/config.tests/common/atomicfptr/atomicfptr.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Intel Corporation. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +typedef void (*fptr)(int); +typedef std::atomic atomicfptr; + +void testfunction(int) { } + +void test(volatile atomicfptr &a) +{ + fptr v = a.load(std::memory_order_acquire); + while (!a.compare_exchange_strong(v, &testfunction, + std::memory_order_acq_rel, + std::memory_order_acquire)) { + v = a.exchange(&testfunction); + } + + a.store(&testfunction, std::memory_order_release); +} + +int main(int, char **) +{ + atomicfptr fptr(testfunction); + test(fptr); + return 0; +} diff --git a/config.tests/common/atomicfptr/atomicfptr.pro b/config.tests/common/atomicfptr/atomicfptr.pro new file mode 100644 index 0000000000..5509862a30 --- /dev/null +++ b/config.tests/common/atomicfptr/atomicfptr.pro @@ -0,0 +1,3 @@ +SOURCES = atomicfptr.cpp +CONFIG += c++11 console +CONFIG -= qt app_bundle diff --git a/config.tests/common/atomicfptr/icc2016_mac.diff b/config.tests/common/atomicfptr/icc2016_mac.diff new file mode 100644 index 0000000000..5de3b6e19a --- /dev/null +++ b/config.tests/common/atomicfptr/icc2016_mac.diff @@ -0,0 +1,18 @@ +Patch for fixing std::atomic support for function pointers for the Intel +Composer XE 2016 (compiler version 16.0). + +To apply: + cd /opt/intel/compilers_and_libraries_2016/mac/include + sudo patch -p1 < /path-to-this-file/icc2016_mac.diff + +--- include/stdatomic.h.orig 2015-08-28 15:05:13.000000000 -0700 ++++ include/stdatomic.h 2015-08-28 15:19:25.000000000 -0700 +@@ -451,7 +451,7 @@ + } + _STRONG_INLINE atomic() _DEFAULTED + _STRONG_INLINE _CONSTEXPR atomic(T* _Ptr) +- : atomic_address(_Ptr) ++ : atomic_address((void*)_Ptr) + { + } + _STRONG_INLINE T* operator+=(ptrdiff_t _V) volatile diff --git a/config.tests/common/atomicfptr/qnx66.txt b/config.tests/common/atomicfptr/qnx66.txt new file mode 100644 index 0000000000..b4ea9d65b5 --- /dev/null +++ b/config.tests/common/atomicfptr/qnx66.txt @@ -0,0 +1,3 @@ +Patch is available from QNX. Please see + +http://www.qnx.com/download/feature.html?programid=27555 -- cgit v1.2.3