[cef][wam] Make the recipe work with official chromium release tarballs
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch
1 From 1b8ee706e8bb16a9b6c59c832d33b56915d1f410 Mon Sep 17 00:00:00 2001
2 From: Max Ihlenfeldt <max@igalia.com>
3 Date: Tue, 5 Sep 2023 09:51:38 +0000
4 Subject: [PATCH 18/33] [meta-browser] Fix "undefined symbol:
5  PaintOpWriter::SerializedSize<unsigned long>()"
6
7 For some reason, clang 14 (currently used on dunfell and kirkstone)
8 seems to fail to correctly generate a needed instantiation of
9 `cc::PaintOpWriter::SerializedSize<T>()`, and thus the final linking
10 step fails with an "undefined symbol" error.
11
12 We can fix this by explicitly providing a specialization, which does the
13 same thing as the generic implementation.
14
15 Upstream-Status: Inappropriate [specific to older versions of clang]
16 Signed-off-by: Max Ihlenfeldt <max@igalia.com>
17 ---
18  cc/paint/paint_op_writer.h | 8 ++++++++
19  1 file changed, 8 insertions(+)
20
21 diff --git a/cc/paint/paint_op_writer.h b/cc/paint/paint_op_writer.h
22 index 70153c0aa64ac..f47eb934c1eb1 100644
23 --- a/cc/paint/paint_op_writer.h
24 +++ b/cc/paint/paint_op_writer.h
25 @@ -122,6 +122,9 @@ class CC_PAINT_EXPORT PaintOpWriter {
26    static size_t SerializedSize(const PaintRecord& record);
27    static size_t SerializedSize(const SkHighContrastConfig& config);
28  
29 +  template<>
30 +  constexpr size_t SerializedSize<size_t>();
31 +
32    // Serialization of raw/smart pointers is not supported by default.
33    template <typename T>
34    static inline size_t SerializedSize(const T* p);
35 @@ -385,6 +388,11 @@ constexpr size_t PaintOpWriter::SerializedSize<SkGainmapInfo>() {
36           SerializedSizeSimple<uint32_t>();    // fBaseImageType
37  }
38  
39 +template<>
40 +constexpr size_t PaintOpWriter::SerializedSize<size_t>() {
41 +  return SerializedSizeSimple<size_t>();
42 +}
43 +
44  template <typename T>
45  constexpr size_t PaintOpWriter::SerializedSize() {
46    static_assert(std::is_arithmetic_v<T> || std::is_enum_v<T>);
47 -- 
48 2.42.1
49