From 32e24e011ec206f99c61b981cabb6ed5fe06a57b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 16 Mar 2022 09:34:29 -0700 Subject: [PATCH] qversiontagging.h: remove the attempt to use the "retain" attribute GCC 11 knows about it, meaning __has_attribute(retain) = 1 regardless of whether GCC can emit code for it. Clang has a similar limitation. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587 Fixes: QTBUG-101753 Change-Id: Ic30914a4448d4bc28974fffd16dce9a78cdefe5b Reviewed-by: Marc Mutz --- src/corelib/global/qversiontagging.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h index 761a0473adb..cb922e6eb3d 100644 --- a/src/corelib/global/qversiontagging.h +++ b/src/corelib/global/qversiontagging.h @@ -137,11 +137,7 @@ struct QVersionTag # ifdef Q_OS_DARWIN # define QT_VERSION_TAG_SECTION __attribute__((section("__DATA,.qtversion"))) # endif -# if __has_attribute(retain) -# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), retain, used)) -# else -# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), used)) -# endif +# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), used)) # define QT_VERSION_TAG2(sym, imp) \ extern "C" Q_DECL_IMPORT const char sym; \ QT_VERSION_TAG_ATTRIBUTE QT_VERSION_TAG_SECTION constexpr inline QtPrivate::QVersionTag sym ## _use(&sym)