[clang] [libclang] Add missing dllexport annotation (PR #147108)
Tomohiro Kashiwada via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 5 18:03:19 PDT 2025
kikairoya wrote:
> > Still it may be good to figure out why this hasn't been an issue so far, for whoever otherwise were using these dllexport annotations.
>
> I suspect it relates to module definition file (*.def). On MinGW, the symbol is properly exported without annotation.
Regular win32 targets use `libclang.def` to choose symbols to be exported (generated from `libclang-generic.exports` through `LLVM_EXPORT_SYMBOL_FILE`) but it's disabled on most of Unix platforms.
https://github.com/llvm/llvm-project/blob/53359252688692f2b0e25f529335848db94cc166/clang/tools/libclang/CMakeLists.txt#L95-L98
It seems `AND NOT CYGWIN` should be added here.
Even if exported symbols are controlled by `libclang.def`, annotating `__declspec(dllimport)` correctly is still preferred.
https://github.com/llvm/llvm-project/pull/147108
More information about the cfe-commits
mailing list