Skip to content

Commit

Permalink
dev-qt/qtbase: fix build with gcc15, incl. for revdeps
Browse files Browse the repository at this point in the history
Issue is in public headers, so revbump is necessary. Please ensure
update to qtbase-6.7.2-r2 before reporting new bugs while testing
gcc15. Thankfully most normal users should have updated long before
gcc15 is keyworded (and further stabled) so there should be little
need to set lower bounds.

Closes: https://bugs.gentoo.org/937808
Closes: https://bugs.gentoo.org/937809
Closes: https://bugs.gentoo.org/937824
Closes: https://bugs.gentoo.org/937825
Closes: https://bugs.gentoo.org/937828
Closes: https://bugs.gentoo.org/937829
Thanks-to: Sam James <[email protected]>
Signed-off-by: Ionen Wolkens <[email protected]>
  • Loading branch information
ionenwks committed Aug 13, 2024
1 parent 1bef275 commit 486b070
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dev-qt/qtbase/files/qtbase-6.7.2-gcc15-odr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
https://codereview.qt-project.org/c/qt/qtbase/+/582403
From: Sam James <[email protected]>
Date: Sat, 10 Aug 2024 16:43:05 +0100
Subject: [PATCH] Fix ODR violation for IsFloatType_v

With recent GCC 15 trunk, I started to see:
```
ld: .../kwalletentry.cc.o:(.rodata+0x0): multiple definition of `QtPrivate::IsFloatType_v<_Float16>';
src/runtime/kwalletd/backend/CMakeFiles/KF6WalletBackend.dir/cbc.cc.o:(.rodata+0x0): first defined here
```

The issue is that constexpr is only implicitly inline for functions or
static data members [0], so the two constexpr IsFloatType_v definitions
here cause an ODR violation.

Explicitly mark them as inline constexpr.

[0] http://eel.is/c++draft/dcl.constexpr#1.sentence-3
--- a/src/corelib/global/qcomparehelpers.h
+++ b/src/corelib/global/qcomparehelpers.h
@@ -348,9 +348,9 @@

template <typename T>
-constexpr bool IsFloatType_v = std::is_floating_point_v<T>;
+inline constexpr bool IsFloatType_v = std::is_floating_point_v<T>;

#if QFLOAT16_IS_NATIVE
template <>
-constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
+inline constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.6.1-forkfd-childstack-size.patch
"${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch
"${FILESDIR}"/${PN}-6.7.2-CVE-2024-39936.patch
"${FILESDIR}"/${PN}-6.7.2-gcc15-odr.patch
)

src_prepare() {
Expand Down
1 change: 1 addition & 0 deletions dev-qt/qtbase/qtbase-6.7.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch
"${FILESDIR}"/${PN}-6.6.1-forkfd-childstack-size.patch
"${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch
"${FILESDIR}"/${PN}-6.7.2-gcc15-odr.patch
)

src_prepare() {
Expand Down
1 change: 1 addition & 0 deletions dev-qt/qtbase/qtbase-6.8.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch
"${FILESDIR}"/${PN}-6.6.1-forkfd-childstack-size.patch
"${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch
"${FILESDIR}"/${PN}-6.7.2-gcc15-odr.patch
)

src_prepare() {
Expand Down
1 change: 1 addition & 0 deletions dev-qt/qtbase/qtbase-6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch
"${FILESDIR}"/${PN}-6.6.1-forkfd-childstack-size.patch
"${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch
"${FILESDIR}"/${PN}-6.7.2-gcc15-odr.patch
)

src_prepare() {
Expand Down

0 comments on commit 486b070

Please sign in to comment.