Logging: rejiggle the way we detect the availability of backtrace() API

We had proper CMake tests for all we needed, so we can drop the old
detection we were forced to use way back when. Said test (CMake's own
FindBacktrace.cmake) even found QNX's offering, which we reported as
"yes" in our configure output, but never actually used because it was a
different API. Now we'll report "no" for QNX.

Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f73cfe4cf38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Thiago Macieira 2022-02-18 11:13:25 -08:00
parent 50132fb54b
commit 6358bc9331
3 changed files with 11 additions and 16 deletions

View File

@ -703,6 +703,8 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_commandlineparser
)
qt_internal_extend_target(Core CONDITION QT_FEATURE_backtrace
DEFINES
BACKTRACE_HEADER="${Backtrace_HEADER}"
LIBRARIES
WrapBacktrace::WrapBacktrace
)

View File

@ -14,7 +14,9 @@ set_property(CACHE INPUT_libb2 PROPERTY STRINGS undefined no qt system)
#### Libraries
if((UNIX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
if((UNIX AND NOT QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
# QNX's libbacktrace has an API wholly different from all the other Unix
# offerings
qt_find_package(WrapBacktrace PROVIDED_TARGETS WrapBacktrace::WrapBacktrace MODULE_NAME core QMAKE_LIB backtrace)
endif()
qt_find_package(WrapDoubleConversion PROVIDED_TARGETS WrapDoubleConversion::WrapDoubleConversion MODULE_NAME core QMAKE_LIB doubleconversion)

View File

@ -2,7 +2,7 @@
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
** Copyright (C) 2018 Intel Corporation.
** Copyright (C) 2022 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -107,14 +107,11 @@ extern char *__progname;
#endif
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(regularexpression)
# ifdef __UCLIBC__
# if __UCLIBC_HAS_BACKTRACE__
# define QLOGGING_HAVE_BACKTRACE
# endif
# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
# define QLOGGING_HAVE_BACKTRACE
# endif
#if __has_include(<cxxabi.h>) && QT_CONFIG(backtrace) && QT_CONFIG(regularexpression)
# include <qregularexpression.h>
# include BACKTRACE_HEADER
# include <cxxabi.h>
# define QLOGGING_HAVE_BACKTRACE
#endif
#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>))
@ -152,12 +149,6 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
return qintptr(QThread::currentThreadId());
}
#endif
#ifdef QLOGGING_HAVE_BACKTRACE
# include <qregularexpression.h>
# include <cxxabi.h>
# include <execinfo.h>
#endif
#endif // !QT_BOOTSTRAPPED
#include <cstdlib>