]> git.pld-linux.org Git - packages/thunderbird.git/blob - llvm18.patch
add fixes for llvm >= 18
[packages/thunderbird.git] / llvm18.patch
1 From cd10f3ba0d83f34ca978cc4c7a552b72fdd068aa Mon Sep 17 00:00:00 2001
2 From: David Tolnay <dtolnay@gmail.com>
3 Date: Tue, 28 Nov 2023 11:18:39 -0800
4 Subject: [PATCH 1/2] Flatten cursor.kind() matching in Item::parse down to one
5  match
6
7 ---
8  bindgen/ir/item.rs | 84 ++++++++++++++++++++++------------------------
9  1 file changed, 41 insertions(+), 43 deletions(-)
10
11 diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs
12 index 0556452bfa..4f2d361e51 100644
13 --- a/third_party/rust/bindgen/ir/item.rs
14 +++ b/third_party/rust/bindgen/ir/item.rs
15 @@ -1427,53 +1427,52 @@
16              }
17          }
18  
19 -        // Guess how does clang treat extern "C" blocks?
20 -        if cursor.kind() == CXCursor_UnexposedDecl {
21 -            Err(ParseError::Recurse)
22 -        } else {
23 +        match cursor.kind() {
24 +            // Guess how does clang treat extern "C" blocks?
25 +            CXCursor_UnexposedDecl => Err(ParseError::Recurse),
26 +
27              // We allowlist cursors here known to be unhandled, to prevent being
28              // too noisy about this.
29 -            match cursor.kind() {
30 -                CXCursor_MacroDefinition |
31 -                CXCursor_MacroExpansion |
32 -                CXCursor_UsingDeclaration |
33 -                CXCursor_UsingDirective |
34 -                CXCursor_StaticAssert |
35 -                CXCursor_FunctionTemplate => {
36 -                    debug!(
37 -                        "Unhandled cursor kind {:?}: {:?}",
38 -                        cursor.kind(),
39 -                        cursor
40 -                    );
41 -                }
42 -                CXCursor_InclusionDirective => {
43 -                    let file = cursor.get_included_file_name();
44 -                    match file {
45 -                        None => {
46 -                            warn!(
47 -                                "Inclusion of a nameless file in {:?}",
48 -                                cursor
49 -                            );
50 -                        }
51 -                        Some(filename) => {
52 -                            ctx.include_file(filename);
53 -                        }
54 -                    }
55 -                }
56 -                _ => {
57 -                    // ignore toplevel operator overloads
58 -                    let spelling = cursor.spelling();
59 -                    if !spelling.starts_with("operator") {
60 +            CXCursor_MacroDefinition |
61 +            CXCursor_MacroExpansion |
62 +            CXCursor_UsingDeclaration |
63 +            CXCursor_UsingDirective |
64 +            CXCursor_StaticAssert |
65 +            CXCursor_FunctionTemplate => {
66 +                debug!(
67 +                    "Unhandled cursor kind {:?}: {:?}",
68 +                    cursor.kind(),
69 +                    cursor
70 +                );
71 +                Err(ParseError::Continue)
72 +            }
73 +            CXCursor_InclusionDirective => {
74 +                let file = cursor.get_included_file_name();
75 +                match file {
76 +                    None => {
77                          warn!(
78 -                            "Unhandled cursor kind {:?}: {:?}",
79 -                            cursor.kind(),
80 +                            "Inclusion of a nameless file in {:?}",
81                              cursor
82                          );
83                      }
84 +                    Some(filename) => {
85 +                        ctx.include_file(filename);
86 +                    }
87                  }
88 +                Err(ParseError::Continue)
89 +            }
90 +            _ => {
91 +                // ignore toplevel operator overloads
92 +                let spelling = cursor.spelling();
93 +                if !spelling.starts_with("operator") {
94 +                    warn!(
95 +                        "Unhandled cursor kind {:?}: {:?}",
96 +                        cursor.kind(),
97 +                        cursor
98 +                    );
99 +                }
100 +                Err(ParseError::Continue)
101              }
102 -
103 -            Err(ParseError::Continue)
104          }
105      }
106  
107
108 From 2997017b5a3065b83e9d76f0080d6cb99c94c0c1 Mon Sep 17 00:00:00 2001
109 From: David Tolnay <dtolnay@gmail.com>
110 Date: Tue, 28 Nov 2023 11:21:18 -0800
111 Subject: [PATCH 2/2] Handle CXCursor_LinkageSpec in Clang 18+
112
113 ---
114  bindgen/ir/item.rs | 7 +++++--
115  1 file changed, 5 insertions(+), 2 deletions(-)
116
117 diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs
118 index 4f2d361e51..dd587b088b 100644
119 --- a/third_party/rust/bindgen/ir/item.rs
120 +++ b/third_party/rust/bindgen/ir/item.rs
121 @@ -1433,8 +1433,11 @@ impl Item {
122          }
123  
124          match cursor.kind() {
125 -            // Guess how does clang treat extern "C" blocks?
126 -            CXCursor_UnexposedDecl => Err(ParseError::Recurse),
127 +            // On Clang 18+, extern "C" is reported accurately as a LinkageSpec.
128 +            // Older LLVM treat it as UnexposedDecl.
129 +            CXCursor_LinkageSpec | CXCursor_UnexposedDecl => {
130 +                Err(ParseError::Recurse)
131 +            }
132  
133              // We allowlist cursors here known to be unhandled, to prevent being
134              // too noisy about this.
135 --- a/third_party/rust/bindgen/.cargo-checksum.json.orig        2024-04-12 22:55:53.000000000 +0200
136 +++ b/third_party/rust/bindgen/.cargo-checksum.json     2024-04-17 13:45:41.721869437 +0200
137 @@ -1 +1 @@
138 -{"files":{"Cargo.toml":"ae6de5b309f8bf07c259436b1113ccf405b2d7dd862e1b289bfef47a550956d1","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"9cbda648159897f93a07dbe90a1ee9ba92e2b020a02bc9725b87db4d025df3b6","clang.rs":"a38d153516c6685b46723010793b2f4e8b16468f3cd3296781dea6e485cd66da","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"7d727a737c616f7f2d3a07d825be8baad9078b3f35ad96277904559b4534ffcc","codegen/error.rs":"5e308b8c54b68511fc8ea2ad15ddac510172c4ff460a80a265336440b0c9653d","codegen/helpers.rs":"5f24007a09e50db7bd2b49b07100cfed649c7b22232558e28c99c759d5d14152","codegen/impl_debug.rs":"71d8e28873ba2de466f2637a824746963702f0511728037d72ee5670c51194cb","codegen/impl_partialeq.rs":"f4599e32c66179ae515a6518a3e94b686689cf59f7dd9ab618c3fb69f17d2c77","codegen/mod.rs":"25ef86b9dd894b40724d78b99e2743654f09bb427a23ccf5940a620c6408688e","codegen/postprocessing/merge_extern_blocks.rs":"be5c5ff6d3d3d4e940814c4dc77f8d687aa6b053dcfbd2185c09616ba9022bf2","codegen/postprocessing/mod.rs":"d1e8c2864d5194a4cb2f6731c0ef582a55b363df9c4f888c26942ff37f728e1c","codegen/postprocessing/sort_semantically.rs":"3071dd509f2e5d3dfd99cafa6ee19bbacb9fec1c61a0b3f6e284a75c1f2c3db6","codegen/serialize.rs":"b1d8fff0bd9717ee7ca883fd3f376cf7b93adb65dc5bb89ede467b087e985a5f","codegen/struct_layout.rs":"7dfc814d3c914a0c53d8ed031baf543dab1def5959e8ab85220cad69a506383a","deps.rs":"5ee2332fdb10325f3b0a0c6d9ba94e13eb631ef39e955fa958afc3625bdb5448","extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","features.rs":"af20bd617cce27f6716ab3d61a1c8ddfaa46227f4a0d435b08a19d5f277cf8ba","ir/analysis/derive.rs":"ec514585eb40f0e3306bf3302aec0152a2e95e8dce13a67c36b5f00c0cbb76ef","ir/analysis/has_destructor.rs":"7a82f01e7e0595a31b56f7c398fa3019b3fe9100a2a73b56768f7e6943dcc3ce","ir/analysis/has_float.rs":"58ea1e38a59ef208400fd65d426cb5b288949df2d383b3a194fa01b99d2a87fa","ir/analysis/has_type_param_in_array.rs":"d1b9eb119dc14f662eb9bd1394c859f485479e4912589709cdd33f6752094e22","ir/analysis/has_vtable.rs":"368cf30fbe3fab7190fab48718b948caac5da8c9e797b709488716b919315636","ir/analysis/mod.rs":"0c10d8eeb26d7e6f4ce18e9dfb74ea1f9deff5cd350298aca3dc1041b17c20c4","ir/analysis/sizedness.rs":"944443d6aab35d2dd80e4f5e59176ac1e1c463ba2f0eb25d33f1d95dfac1a6d0","ir/analysis/template_params.rs":"d3cc41041b1c45e0b5be2c9f3f1cc0c2341481b9ff51589cba2428df4e6a1ea9","ir/annotations.rs":"f79de09803a3f3ccb33e366a10a707da98cd00a56ba18312ea927d6c977220a4","ir/comment.rs":"5dcfab0095d967daad9b2927093fce3786b1a2146171580afbf526ba56855e36","ir/comp.rs":"b7b28b96e4206b3215881d814661c63c5dd182f34b1163d54bcedbe85998cb06","ir/context.rs":"a7608f7d3dd607647f2af5f45fc7c09483d2a694f91265bba353a71652e2d419","ir/derive.rs":"e5581852eec87918901a129284b4965aefc8a19394187a8095779a084f28fabe","ir/dot.rs":"2d79d698e6ac59ce032840e62ff11103abed1d5e9e700cf383b492333eeebe1f","ir/enum_ty.rs":"0b612e0b57112068455eee519f894016d0a8f425d6a67b98c56b858f57d99f4a","ir/function.rs":"60407267473d785ea33ac854a70c8ca34749bc868024270992deca68a951f74c","ir/int.rs":"68a86182743ec338d58e42203364dc7c8970cb7ec3550433ca92f0c9489b4442","ir/item.rs":"880c982df0843cbdff38b9f9c3829a2d863a224e4de2260c41c3ac69e9148ad4","ir/item_kind.rs":"7666a1ff1b8260978b790a08b4139ab56b5c65714a5652bbcec7faa7443adc36","ir/layout.rs":"61a0e4250ceab889606973f930f4d692837a13a69ae2579738ff09843fed3d65","ir/mod.rs":"713cd537434567003197a123cbae679602c715e976d22f7b23dafd0826ea4c70","ir/module.rs":"7cae5561bcf84a5c3b1ee8f1c3336a33b7f44f0d5ffe885fb108289983fe763e","ir/objc.rs":"4eecdb754542d78acea27d2f547d18d49164047e6efaff8a8d283d6c2dc9875b","ir/template.rs":"4f0e3736558aa8ec359cd9749dc48f87bfff494dd195a67b39cfee7d8a7542ef","ir/traversal.rs":"0c37a0898801ad39bffc8dddd1ee8baa61bb7cf4f3fdc25c8fdd56b6c96ada65","ir/ty.rs":"ba0d7b16a1080caf4960cc7dea0d0800365da0dd5c6e735d508ec448e87b1d40","ir/var.rs":"ced3496cf0683fef91ce94aa09b0ee37255db8425ea8634d52bd73b1b5c160f6","lib.rs":"0bed6f10b2dd25753a40e6e7fa11239f08c05be414ad264c6d7e2f7a8b71f1b2","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","parse.rs":"ccb2c506f08123708ae673b8216404fb22b4c951330662f9b7140b412b063260","regex_set.rs":"7dcc1ad52194f057ea00e8ebc9c23c465ffa6761eed6ba41560d2d02e03c43a6","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"}
139 \ No newline at end of file
140 +{"files":{"Cargo.toml":"ae6de5b309f8bf07c259436b1113ccf405b2d7dd862e1b289bfef47a550956d1","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"9cbda648159897f93a07dbe90a1ee9ba92e2b020a02bc9725b87db4d025df3b6","clang.rs":"a38d153516c6685b46723010793b2f4e8b16468f3cd3296781dea6e485cd66da","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"7d727a737c616f7f2d3a07d825be8baad9078b3f35ad96277904559b4534ffcc","codegen/error.rs":"5e308b8c54b68511fc8ea2ad15ddac510172c4ff460a80a265336440b0c9653d","codegen/helpers.rs":"5f24007a09e50db7bd2b49b07100cfed649c7b22232558e28c99c759d5d14152","codegen/impl_debug.rs":"71d8e28873ba2de466f2637a824746963702f0511728037d72ee5670c51194cb","codegen/impl_partialeq.rs":"f4599e32c66179ae515a6518a3e94b686689cf59f7dd9ab618c3fb69f17d2c77","codegen/mod.rs":"25ef86b9dd894b40724d78b99e2743654f09bb427a23ccf5940a620c6408688e","codegen/postprocessing/merge_extern_blocks.rs":"be5c5ff6d3d3d4e940814c4dc77f8d687aa6b053dcfbd2185c09616ba9022bf2","codegen/postprocessing/mod.rs":"d1e8c2864d5194a4cb2f6731c0ef582a55b363df9c4f888c26942ff37f728e1c","codegen/postprocessing/sort_semantically.rs":"3071dd509f2e5d3dfd99cafa6ee19bbacb9fec1c61a0b3f6e284a75c1f2c3db6","codegen/serialize.rs":"b1d8fff0bd9717ee7ca883fd3f376cf7b93adb65dc5bb89ede467b087e985a5f","codegen/struct_layout.rs":"7dfc814d3c914a0c53d8ed031baf543dab1def5959e8ab85220cad69a506383a","deps.rs":"5ee2332fdb10325f3b0a0c6d9ba94e13eb631ef39e955fa958afc3625bdb5448","extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","features.rs":"af20bd617cce27f6716ab3d61a1c8ddfaa46227f4a0d435b08a19d5f277cf8ba","ir/analysis/derive.rs":"ec514585eb40f0e3306bf3302aec0152a2e95e8dce13a67c36b5f00c0cbb76ef","ir/analysis/has_destructor.rs":"7a82f01e7e0595a31b56f7c398fa3019b3fe9100a2a73b56768f7e6943dcc3ce","ir/analysis/has_float.rs":"58ea1e38a59ef208400fd65d426cb5b288949df2d383b3a194fa01b99d2a87fa","ir/analysis/has_type_param_in_array.rs":"d1b9eb119dc14f662eb9bd1394c859f485479e4912589709cdd33f6752094e22","ir/analysis/has_vtable.rs":"368cf30fbe3fab7190fab48718b948caac5da8c9e797b709488716b919315636","ir/analysis/mod.rs":"0c10d8eeb26d7e6f4ce18e9dfb74ea1f9deff5cd350298aca3dc1041b17c20c4","ir/analysis/sizedness.rs":"944443d6aab35d2dd80e4f5e59176ac1e1c463ba2f0eb25d33f1d95dfac1a6d0","ir/analysis/template_params.rs":"d3cc41041b1c45e0b5be2c9f3f1cc0c2341481b9ff51589cba2428df4e6a1ea9","ir/annotations.rs":"f79de09803a3f3ccb33e366a10a707da98cd00a56ba18312ea927d6c977220a4","ir/comment.rs":"5dcfab0095d967daad9b2927093fce3786b1a2146171580afbf526ba56855e36","ir/comp.rs":"b7b28b96e4206b3215881d814661c63c5dd182f34b1163d54bcedbe85998cb06","ir/context.rs":"a7608f7d3dd607647f2af5f45fc7c09483d2a694f91265bba353a71652e2d419","ir/derive.rs":"e5581852eec87918901a129284b4965aefc8a19394187a8095779a084f28fabe","ir/dot.rs":"2d79d698e6ac59ce032840e62ff11103abed1d5e9e700cf383b492333eeebe1f","ir/enum_ty.rs":"0b612e0b57112068455eee519f894016d0a8f425d6a67b98c56b858f57d99f4a","ir/function.rs":"60407267473d785ea33ac854a70c8ca34749bc868024270992deca68a951f74c","ir/int.rs":"68a86182743ec338d58e42203364dc7c8970cb7ec3550433ca92f0c9489b4442","ir/item.rs":"239b3e4d20498f69ed5f94481ed932340bd58cb485b26c35b09517f249d20d11","ir/item_kind.rs":"7666a1ff1b8260978b790a08b4139ab56b5c65714a5652bbcec7faa7443adc36","ir/layout.rs":"61a0e4250ceab889606973f930f4d692837a13a69ae2579738ff09843fed3d65","ir/mod.rs":"713cd537434567003197a123cbae679602c715e976d22f7b23dafd0826ea4c70","ir/module.rs":"7cae5561bcf84a5c3b1ee8f1c3336a33b7f44f0d5ffe885fb108289983fe763e","ir/objc.rs":"4eecdb754542d78acea27d2f547d18d49164047e6efaff8a8d283d6c2dc9875b","ir/template.rs":"4f0e3736558aa8ec359cd9749dc48f87bfff494dd195a67b39cfee7d8a7542ef","ir/traversal.rs":"0c37a0898801ad39bffc8dddd1ee8baa61bb7cf4f3fdc25c8fdd56b6c96ada65","ir/ty.rs":"ba0d7b16a1080caf4960cc7dea0d0800365da0dd5c6e735d508ec448e87b1d40","ir/var.rs":"ced3496cf0683fef91ce94aa09b0ee37255db8425ea8634d52bd73b1b5c160f6","lib.rs":"0bed6f10b2dd25753a40e6e7fa11239f08c05be414ad264c6d7e2f7a8b71f1b2","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","parse.rs":"ccb2c506f08123708ae673b8216404fb22b4c951330662f9b7140b412b063260","regex_set.rs":"7dcc1ad52194f057ea00e8ebc9c23c465ffa6761eed6ba41560d2d02e03c43a6","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"}
141 diff --git a/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp b/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
142 --- a/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
143 +++ b/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
144 @@ -97,11 +97,11 @@
145      uint32_t width_;
146      uint32_t height_;
147      uint8_t y_;
148      uint8_t u_;
149      uint8_t v_;
150 -    uint32_t timestamp_;
151 +    uint64_t timestamp_;
152    } idr_nalu;
153  };
154  #pragma pack(pop)
155  
156  #define ENCODED_FRAME_MAGIC 0x004000b8
157 diff --git a/dom/media/gtest/TestGMPRemoveAndDelete.cpp b/dom/media/gtest/TestGMPRemoveAndDelete.cpp
158 --- a/dom/media/gtest/TestGMPRemoveAndDelete.cpp
159 +++ b/dom/media/gtest/TestGMPRemoveAndDelete.cpp
160 @@ -359,11 +359,11 @@
161        uint32_t width_;
162        uint32_t height_;
163        uint8_t y_;
164        uint8_t u_;
165        uint8_t v_;
166 -      uint32_t timestamp_;
167 +      uint64_t timestamp_;
168      } idr_nalu;
169    };
170  #pragma pack(pop)
171  
172    GMPVideoFrame* absFrame;
173 diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h
174 --- a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h
175 +++ b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h
176 @@ -300,11 +300,11 @@
177  
178    struct InputImageData {
179      int64_t timestamp_us;
180    };
181    // Map rtp time -> input image data
182 -  DataMutex<std::map<uint32_t, InputImageData>> mInputImageMap;
183 +  DataMutex<std::map<uint64_t, InputImageData>> mInputImageMap;
184  
185    MediaEventProducer<uint64_t> mInitPluginEvent;
186    MediaEventProducer<uint64_t> mReleasePluginEvent;
187  };
188  
189 diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp
190 --- a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp
191 +++ b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp
192 @@ -538,11 +538,11 @@
193      return;
194    }
195  
196    webrtc::VideoFrameType ft;
197    GmpFrameTypeToWebrtcFrameType(aEncodedFrame->FrameType(), &ft);
198 -  uint32_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000;
199 +  uint64_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000;
200  
201    GMP_LOG_DEBUG("GMP Encoded: %" PRIu64 ", type %d, len %d",
202                  aEncodedFrame->TimeStamp(), aEncodedFrame->BufferType(),
203                  aEncodedFrame->Size());
204  
205
This page took 2.235378 seconds and 4 git commands to generate.