projects/aports·blob master · refs

62 lines · 2.6 KiB

1Patch-Source: https://www.linuxfromscratch.org/patches/blfs/svn/firefox-140.9.0esr-llvm_22-1.patch
2From 47df0945909c669c987b8835b7324cfa51e33f40 Mon Sep 17 00:00:00 2001
3From: Antoine Martin <[email protected]>
4Date: Sat, 4 Apr 2026 16:55:12 -0400
5Subject: [PATCH 2/2] llvm 22 fixes
6
7Submitted by: Xi Ruoyao <[email protected]>
8Date: 2026-03-07
9Initial Package Version: 140.8.0
10Upstream Status: Applied in rust-bindgen and skcms but not applied
11 for Firefox yet. Reported at firefix PR 1977771
12 comment 2.
13Origin: rust-bindgen and skcms upstream repo;
14 the test suite change and two redundant changes
15 cancelling each other out are dropped from the
16 rust-bindgen change; the file paths are manually
17 edited for the firefox source tree.
18Description: Allow building firefox with LLVM (clang) 22.
19---
20 gfx/skia/skia/modules/skcms/src/Transform_inl.h | 4 ++--
21 third_party/rust/bindgen/clang.rs | 10 +++++-----
22 2 files changed, 7 insertions(+), 7 deletions(-)
23
24diff --git a/gfx/skia/skia/modules/skcms/src/Transform_inl.h b/gfx/skia/skia/modules/skcms/src/Transform_inl.h
25index bc10e7d..99faf25 100644
26--- a/gfx/skia/skia/modules/skcms/src/Transform_inl.h
27+++ b/gfx/skia/skia/modules/skcms/src/Transform_inl.h
28@@ -156,8 +156,8 @@ SI F F_from_Half(U16 half) {
29 #elif defined(USING_AVX512F)
30 return (F)_mm512_cvtph_ps((__m256i)half);
31 #elif defined(USING_AVX_F16C)
32- typedef int16_t __attribute__((vector_size(16))) I16;
33- return __builtin_ia32_vcvtph2ps256((I16)half);
34+ typedef _Float16 __attribute__((vector_size(16))) F16;
35+ return __builtin_convertvector((F16)half, F);
36 #else
37 U32 wide = cast<U32>(half);
38 // A half is 1-5-10 sign-exponent-mantissa, with 15 exponent bias.
39diff --git a/third_party/rust/bindgen/clang.rs b/third_party/rust/bindgen/clang.rs
40index 19f3e70..c7e1531 100644
41--- a/third_party/rust/bindgen/clang.rs
42+++ b/third_party/rust/bindgen/clang.rs
43@@ -1210,11 +1210,11 @@ impl Type {
44
45 /// Get a cursor pointing to this type's declaration.
46 pub(crate) fn declaration(&self) -> Cursor {
47- unsafe {
48- Cursor {
49- x: clang_getTypeDeclaration(self.x),
50- }
51- }
52+ let decl = Cursor {
53+ x: unsafe { clang_getTypeDeclaration(self.x) },
54+ };
55+ // Prior to clang 22, the declaration pointed to the definition.
56+ decl.definition().unwrap_or(decl)
57 }
58
59 /// Get the canonical declaration of this type, if it is available.
60--
612.53.0
62