RESOLVED FIXED 284779
REGRESSION(287859@main): Building with USE_SKIA_OPENTYPE_SVG=ON fails with Clang 18.1+
https://bugs.webkit.org/show_bug.cgi?id=284779
Summary REGRESSION(287859@main): Building with USE_SKIA_OPENTYPE_SVG=ON fails with Cl...
Adrian Perez
Reported 2024-12-16 14:14:10 PST
In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.cpp:8: In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.h:14: In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/include/private/base/SkTemplates.h:22: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/memory:78: /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'SkDOMParser' 91 | static_assert(sizeof(_Tp)>0, | ^~~~~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:399:4: note: in instantiation of member function 'std::default_delete<SkDOMParser>::operator()' requested here 399 | get_deleter()(std::move(__ptr)); | ^ /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.cpp:72:8: note: in instantiation of member function 'std::unique_ptr<SkDOMParser>::~unique_ptr' requested here 72 | SkDOM::SkDOM() : fAlloc(4096), fRoot(nullptr) {} | ^ /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.h:20:7: note: forward declaration of 'SkDOMParser' 20 | class SkDOMParser; | ^ 1 error generated.
Attachments
Adrian Perez
Comment 1 2024-12-16 14:16:08 PST
The SkDOMParser declaration is indeed in the source file *after* the SkDOM() constructor definition; shuffling them around makes things work. No idea how this can compile with GCC or with the version of Clang used by Skia for CI, but I will submit the fix to upstream Skia as well.
EWS
Comment 2 2024-12-16 15:15:55 PST
Committed 287913@main (cc31f5736f7e): <https://commits.webkit.org/287913@main> Reviewed commits have been landed. Closing PR #38035 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2024-12-16 15:16:17 PST
htl10
Comment 4 2024-12-16 15:58:37 PST
I think I know why this problem happens. This is the location of what my patch #7 in https://bugs.webkit.org/show_bug.cgi?id=283246 tries to address. src/xml/SkDOM.cpp uses std::unique_ptr , and std::unique_ptr changes behavior when compiled in c++23 mode. Upstream compiles for c++17 by default, webkitgtk does c++23. You can google "std::unique_ptr c++23" to read about the details.
htl10
Comment 5 2024-12-16 16:10:40 PST
I.e. I think the problem is not, strictly speaking, the compiler version, but the c++N mode. I did see it, and that's why there was a patch #7.
Note You need to log in before you can comment on or make changes to this bug.