| 1 | Patch-Source: https://www.linuxfromscratch.org/patches/blfs/svn/firefox-140.9.0esr-llvm_22-1.patch
|
| 2 | From 47df0945909c669c987b8835b7324cfa51e33f40 Mon Sep 17 00:00:00 2001
|
| 3 | From: Antoine Martin <[email protected]>
|
| 4 | Date: Sat, 4 Apr 2026 16:55:12 -0400
|
| 5 | Subject: [PATCH 2/2] llvm 22 fixes
|
| 6 |
|
| 7 | Submitted by: Xi Ruoyao <[email protected]>
|
| 8 | Date: 2026-03-07
|
| 9 | Initial Package Version: 140.8.0
|
| 10 | Upstream Status: Applied in rust-bindgen and skcms but not applied
|
| 11 | for Firefox yet. Reported at firefix PR 1977771
|
| 12 | comment 2.
|
| 13 | Origin: 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.
|
| 18 | Description: 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 |
|
| 24 | diff --git a/gfx/skia/skia/modules/skcms/src/Transform_inl.h b/gfx/skia/skia/modules/skcms/src/Transform_inl.h
|
| 25 | index bc10e7d..99faf25 100644
|
| 26 | |
| 27 | |
| 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.
|
| 39 | diff --git a/third_party/rust/bindgen/clang.rs b/third_party/rust/bindgen/clang.rs
|
| 40 | index 19f3e70..c7e1531 100644
|
| 41 | |
| 42 | |
| 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 | --
|
| 61 | 2.53.0
|
| 62 |
|