Commit afe73a2
committed
Bug 1941482 - Enable Clang 20 support for Firefox with Windows plugin fixes r=glandium
This change adds support for building Firefox with Clang 20, including
critical fixes for the clang-plugin dynamic linking on Windows.
Clang 20 introduced two breaking changes that prevented the clang-plugin
from loading on Windows:
1. The CLANG_ABI macro was added to Attr classes, causing inline methods
like classof() and getAnnotation() to generate dllimport references.
This fails because these methods are defined inline in headers, not
exported from the DLL.
2. The extract_symbols.py script became more aggressive in filtering
symbols, blocking Registry<T> static data members (Head/Tail) that
don't match function signature patterns.
The fix consists of two patches for the Clang 20 build:
- plugin-registry-symbols_clang_20-llvm-pr-163391.patch:
Make extract_symbols.py recognize and export Registry<T>::Head and
::Tail static members for any Registry instantiation.
References Registry<PluginASTAction>::add_node() and ::begin() to force
the linker to include these symbols.
See llvm/llvm-project#163367 and
llvm/llvm-project#163391.
- remove-clang-abi-from-attrs_clang_20.patch: Removes the CLANG_ABI
macro from Attr class generation to prevent dllimport issues with
inline methods in Windows.
See llvm/llvm-project#163349.
Differential Revision: https://phabricator.services.mozilla.com/D2682551 parent 77c24e7 commit afe73a2
File tree
3 files changed
+96
-1
lines changed- build/build-clang
3 files changed
+96
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments