Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903573 - dev-qt/qtwebengine-5.15.8_p20230313: Fails to build with Clang 16
Summary: dev-qt/qtwebengine-5.15.8_p20230313: Fails to build with Clang 16
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH
: 910370 (view as bug list)
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2023-03-30 12:10 UTC by Manuel Nickschas
Modified: 2023-08-04 12:35 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.gz,327.28 KB, application/gzip)
2023-03-30 12:10 UTC, Manuel Nickschas
Details
emerge --info (emerge.info.gz,7.21 KB, application/gzip)
2023-03-30 12:10 UTC, Manuel Nickschas
Details
qtwebengine-5.15.8_p20230313-clang-16.patch (qtwebengine-5.15.8_p20230313-clang-16.patch,435 bytes, patch)
2023-04-06 12:11 UTC, Mark Wright
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Nickschas 2023-03-30 12:10:08 UTC
Compilation with Clang 16 + libcxx fails:

------------------------------------------------------------------------------

/usr/lib/ccache/bin/clang++ -MMD -MF obj/v8/torque_generated_initializers/torque_generated_initializers_jumbo_18.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -
D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_MINOR_MC -DV8_INTL_SUPPORT -DV8_CONCURRENT_MAR
KING -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SNAPSHOT_COMPRESSION -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_REVERSE_JSARGS -DV8_TAR
GET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DDISABLE_UNTRUSTED_CODE_MITIGATIONS -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_REVERSE_JSARGS -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_S
TATIC -DUCHAR_TYPE=uint16_t -I. -Igen -I../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium -I../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8 -I../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/include 
-Igen/v8 -Igen -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-unknown-warning-option -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -f
merge-all-constants -m64 -no-canonical-prefixes -Wall -Wextra -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -
Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-
for-linkage -Wno-max-tokens -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wmissing-field-initializers -Wunreachable-code -Wshorten-64-to-32 -O3 -fno-ident -fdata-sections -ffun
ction-sections -Wexit-time-destructors -Wno-parentheses-equality -Wno-tautological-compare -Wno-thread-safety-attributes -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -f
no-rtti -fvisibility-inlines-hidden -c gen/v8/torque_generated_initializers_jumbo_18.cc -o obj/v8/torque_generated_initializers/torque_generated_initializers_jumbo_18.o
In file included from gen/v8/torque_generated_initializers_jumbo_18.cc:5:
In file included from ./gen/v8/torque-generated/src/objects/intl-objects-tq-csa.cc:1:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/ast/ast.h:10:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/ast/ast-value-factory.h:36:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/heap/factory.h:12:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/execution/messages.h:17:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/handles/handles.h:15:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/objects/objects.h:25:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/objects/field-index.h:10:
In file included from ../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/objects/property-details.h:11:
../../../../qtwebengine-5.15.8_p20230313/src/3rdparty/chromium/v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
1 error generated.

------------------------------------------------------------------------------

Compiles fine with Clang15 + libcxx, so this is a regression with the compiler update.

Reproducible: Always

Steps to Reproduce:
1. Try to compile qtwebengine with Clang 16

Actual Results:  
Fails to build due to -Wenum-constexpr-conversion

Expected Results:  
Package should build with Clang 16
Comment 1 Manuel Nickschas 2023-03-30 12:10:31 UTC
Created attachment 859260 [details]
build.log
Comment 2 Manuel Nickschas 2023-03-30 12:10:46 UTC
Created attachment 859261 [details]
emerge --info
Comment 3 Mark Wright gentoo-dev 2023-04-06 12:11:03 UTC
Created attachment 859617 [details, diff]
qtwebengine-5.15.8_p20230313-clang-16.patch

Thanks for reporting. A workaround is to save the attached
patch (by me) in the directory:
/etc/portage/patches/dev-qt/qtwebengine-5.15.8_p20230313
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-07 02:16:42 UTC
(In reply to Mark Wright from comment #3)
> Created attachment 859617 [details, diff] [details, diff]
> qtwebengine-5.15.8_p20230313-clang-16.patch
> 
> Thanks for reporting. A workaround is to save the attached
> patch (by me) in the directory:
> /etc/portage/patches/dev-qt/qtwebengine-5.15.8_p20230313

This is probably a fine workaround until Qt 6.
Comment 5 Alec Ari 2023-05-22 03:40:04 UTC
Can that patch get merged please? Thanks!
Comment 6 Chris Pritchard 2023-07-07 21:20:48 UTC
Can confirm this is still a problem on 5.15.9_p20230505
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-08 02:49:19 UTC
(In reply to Sam James from comment #4)
> (In reply to Mark Wright from comment #3)
> > Created attachment 859617 [details, diff] [details, diff] [details, diff]
> > qtwebengine-5.15.8_p20230313-clang-16.patch
> > 
> > Thanks for reporting. A workaround is to save the attached
> > patch (by me) in the directory:
> > /etc/portage/patches/dev-qt/qtwebengine-5.15.8_p20230313
> 
> This is probably a fine workaround until Qt 6.

This ended up being wrong, by the way. Clang 17 is going to make it so you can't disable the error.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-18 08:59:15 UTC
*** Bug 910370 has been marked as a duplicate of this bug. ***
Comment 9 Paul Gover 2023-07-27 14:43:18 UTC
I just tried this patch for qtwebengine-5.15.10_p20230623.  Works for me.  I changed the patch name to /etc/portage/patches/dev-qt/qtwebengine\:5 so it's for any slot-5 version.

Given qtwebengine:5 won't compile without this, shouldn't it be part of the ebuild now?  FWIW, I can't get qtwebengine to compile with gcc either; different problems, but it's still broken.

I guess given Sam's comment 7, I'll want to hang on to Clang 16 (until Qt6 hits stable or thereabouts).  AFAICT llvm and its friends are slotted, so it should be possible, though quite how to use it - the doesn't seem to be an "eselect llvm" or "eselect clang", but I'm sure it's a Small Matter of Programming.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-27 14:48:50 UTC
I think backporting https://github.com/v8/v8/commit/d15d49b09dc7aef9edcc4cf6a0cb2b77a0db203f may work.
Comment 11 Larry the Git Cow gentoo-dev 2023-08-04 12:35:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fb7d0a7131b5a5938b12673f4b260d66cc1a527

commit 6fb7d0a7131b5a5938b12673f4b260d66cc1a527
Author:     Denis Pronin <dannftk@yandex.ru>
AuthorDate: 2023-07-13 14:55:14 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-04 12:35:02 +0000

    dev-qt/qtwebengine: fix compiling with clang-16
    
    clang-16 complains about casting an integer value that exceeds an
    enumeration capacity in the class base::BitField
    to not modify chromium code we just cancel warning about this
    circumstance to prevent it from being converted to an error that fails
    compilation
    
    [sam: Note that this is a bandaid and won't work with Clang 17.]
    
    Bug: https://bugs.gentoo.org/903573
    Signed-off-by: Denis Pronin <dannftk@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/31869
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/qtwebengine-5.15.10_p20230623-clang16.patch     | 15 +++++++++++++++
 dev-qt/qtwebengine/qtwebengine-5.15.10_p20230623.ebuild   |  5 ++++-
 2 files changed, 19 insertions(+), 1 deletion(-)