Commit a42836f
committed
[Windows] Fix plugin registry symbols not exported/linked with CLANG_LINK_CLANG_DYLIB
When building LLVM with CLANG_LINK_CLANG_DYLIB=ON on Windows, external
plugins cannot register through llvm::Registry<clang::PluginASTAction>
due to two issues:
1. Static data members (Head, Tail) are filtered out during symbol export
2. Static methods (add_node(), begin()) are not linked into the executable
This change fixes both issues:
- Modified extract_symbols.py to recognize and export Registry<T>::Head
and Registry<T>::Tail static members using pattern matching instead of
filtering them out as non-function symbols.
- Added code in driver.cpp that references Registry methods, forcing the
linker to include these symbols in clang.exe even though they're not
directly called by the driver.
Fixes #1633671 parent 0ebcc97 commit a42836f
2 files changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
0 commit comments