Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 925486 - dev-qt/qtwebengine-6.6.2 fails to build with clang 18
Summary: dev-qt/qtwebengine-6.6.2 fails to build with clang 18
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Qt Bug Alias
URL: https://webrtc.googlesource.com/src/+...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-02-25 10:52 UTC by Mark Wright
Modified: 2024-03-22 07:40 UTC (History)
2 users (show)

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


Attachments
build.log (build.log.xz,361.84 KB, application/x-xz)
2024-02-25 10:55 UTC, Mark Wright
Details
emerge --info (emerge--info.txt,8.74 KB, text/plain)
2024-02-25 10:55 UTC, Mark Wright
Details
qtwebengine-6.6.2-clang-18.patch (qtwebengine-6.6.2-clang-18.patch,4.92 KB, patch)
2024-02-25 10:58 UTC, Mark Wright
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wright gentoo-dev 2024-02-25 10:52:47 UTC
dev-qt/qtwebengine-6.6.2 fails to compile with sys-devel/clang-18.1.0_rc2
with errors all of the same form, narrowing a numeric type where precision
may be lost in the conversion, in the one source file:

../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:192:54: merror: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
  192 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy},
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~


Reproducible: Always

Steps to Reproduce:
With the environment configured to compile with sys-devel/clang-18.1.0_rc2:

emerge -av =dev-qt/qtwebengine-6.6.2
Actual Results:  
[17471/29940] /usr/lib/llvm/18/bin/clang++ -MMD -MF obj/third_party/webrtc/pc/legacy_stats_collector/legacy_stats_collector.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_STRICT_FIELD_TRIALS=0 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DLIBYUV_DISABLE_NEON -Igen -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/abseil-cpp -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/libyuv/include -O1 -march=haswell -g1 -gdwarf-5 -fno-omit-frame-pointer -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-unknown-argument -Wno-unknown-attributes -Wno-unknown-warning-option -Wno-predefined-identifier-outside-function -Wno-unknown-pragmas -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -msse3 -no-canonical-prefixes -fno-omit-frame-pointer -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wno-shadow -Wctad-maybe-unsupported -Wno-parentheses-equality -Wno-tautological-compare -Wno-thread-safety-attributes -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc -o obj/third_party/webrtc/pc/legacy_stats_collector/legacy_stats_collector.o
FAILED: obj/third_party/webrtc/pc/legacy_stats_collector/legacy_stats_collector.o 
/usr/lib/llvm/18/bin/clang++ -MMD -MF obj/third_party/webrtc/pc/legacy_stats_collector/legacy_stats_collector.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_STRICT_FIELD_TRIALS=0 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DLIBYUV_DISABLE_NEON -Igen -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/abseil-cpp -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/libyuv/include -O1 -march=haswell -g1 -gdwarf-5 -fno-omit-frame-pointer -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-unknown-argument -Wno-unknown-attributes -Wno-unknown-warning-option -Wno-predefined-identifier-outside-function -Wno-unknown-pragmas -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -msse3 -no-canonical-prefixes -fno-omit-frame-pointer -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wno-shadow -Wctad-maybe-unsupported -Wno-parentheses-equality -Wno-tautological-compare -Wno-thread-safety-attributes -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc -o obj/third_party/webrtc/pc/legacy_stats_collector/legacy_stats_collector.o
... warnings omitted ...
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:192:54: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
  192 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy},
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:194:8: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
  194 |        info.total_output_duration}};
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:248:54: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
  248 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_input_energy},
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:250:8: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
  250 |        info.total_input_duration}};
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:344:51: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing-const-reference]
  344 |       {StatsReport::kStatsValueNameFramesDecoded, info.frames_decoded},
      |                                                   ^~~~~~~~~~~~~~~~~~~
../../../../../qtwebengine-everywhere-src-6.6.2/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:388:52: error: type 'double' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing-const-reference]
  388 |       {StatsReport::kStatsValueNameFrameRateInput, round(info.framerate_input)},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

... more similar errors in the same file

Expected Results:  
It should build with clang 18.
Comment 1 Mark Wright gentoo-dev 2024-02-25 10:55:21 UTC
Created attachment 885945 [details]
build.log
Comment 2 Mark Wright gentoo-dev 2024-02-25 10:55:59 UTC
Created attachment 885946 [details]
emerge --info
Comment 3 Mark Wright gentoo-dev 2024-02-25 10:58:08 UTC
Created attachment 885947 [details, diff]
qtwebengine-6.6.2-clang-18.patch

Patch (by me) to use static_cast to narrow the types to avoid the clang 18 compiler errors.
Comment 4 Ionen Wolkens gentoo-dev 2024-02-25 11:10:32 UTC
This looks already fixed upstream[1], but qtwebengine uses an older version.

[1] https://webrtc.googlesource.com/src/+/267f9bdd5
Comment 5 Ionen Wolkens gentoo-dev 2024-02-25 12:37:54 UTC
(In reply to Ionen Wolkens from comment #4)
> This looks already fixed upstream[1], but qtwebengine uses an older version.
> 
> [1] https://webrtc.googlesource.com/src/+/267f9bdd5
Albeit I'll go ahead and use your patch given the backport does not apply cleanly and that's simpler :)

Will be removable whenever Qt rebases on >=chromium-122.0.6200.0 if they don't backport first which I assume they will when clang18 is released.

Thanks.
Comment 6 Ionen Wolkens gentoo-dev 2024-02-25 12:48:23 UTC
(In reply to Ionen Wolkens from comment #5)
> (In reply to Ionen Wolkens from comment #4)
> > This looks already fixed upstream[1], but qtwebengine uses an older version.
> > 
> > [1] https://webrtc.googlesource.com/src/+/267f9bdd5
> Albeit I'll go ahead and use your patch given the backport does not apply
> cleanly and that's simpler :)
Or uh, actually need both, this one for 6.6, and the backport for 6.7 which is not far off.
Comment 7 Larry the Git Cow gentoo-dev 2024-02-25 18:46:14 UTC
The bug has been closed via the following commit(s):

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

commit cd804c66f16a9999a72e5b7c21433854a8f8931c
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-02-25 12:52:37 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-02-25 18:45:15 +0000

    dev-qt/qtwebengine: fix build with upcoming clang18
    
    Do not want to trigger rebuilds over this, so straight-to-stable
    with no revbump.
    
    Entirely untested for 6.7, not worrying too much until 6.7.0-rc.
    With some luck Qt may backport this themselves before release.
    Will move in patchset later if the patch needs to stay.
    
    Closes: https://bugs.gentoo.org/925486
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 .../files/qtwebengine-6.6.2-clang18.patch          | 80 ++++++++++++++++++
 .../files/qtwebengine-6.7.0-clang18.patch          | 96 ++++++++++++++++++++++
 dev-qt/qtwebengine/qtwebengine-6.6.2.ebuild        |  1 +
 dev-qt/qtwebengine/qtwebengine-6.6.9999.ebuild     |  1 +
 dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild     |  1 +
 5 files changed, 179 insertions(+)