You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux, libclang typically exports its functions via an explicit listing: libclang.exports.
Because of this, the pathogen_ and clangsharp_ functions aren't being exported on Linux builds. Explicitly setting the visibility (IE: __attribute__((visibility("default")))) does not seem to work when this file is in use, I assume because the linker treats this exports file as the source of truth when it is specified.
In theory we could just list all of our functions here too, but I'm concerned this will lead to mistakes due to the fact that functions will be exported differently depending on the platform. Ideally it should "just work" on Linux like it does on Windows. (Edit: Upon some additional consideration, these mistakes could be prevented by adding some unit tests to either ClangSharp.Pathogen or llvm-project to ensure everything gets exported on all platforms. Although we'd likely want to do this as part of the ClangSharp.Pathogen CI since it's already building libclang.)
For now I've disabled the exports file, which causes the libclang.so file to balloon from 81 MB to 99 MB on my system. It's not clear whether this is caused by all the additional code needed to support these functions or whether it's caused by the fact that a ton of Clang's C++ API is now being exported too. If it's the former, this might just be the workaround.
The text was updated successfully, but these errors were encountered:
Considering libclang.so from the 12.0.0 Ubuntu 16.04 build is 95.4 MB, I'm not sure if this is actually worth the time/effort to shrink it down since it only affects generators and not binding distribution.
PathogenDavid
changed the title
Fix Pathogen and libClangSharp extensions not being exported on Linux
Properly fix Pathogen and libClangSharp extensions not being exported on Linux
Jul 29, 2021
On Linux, libclang typically exports its functions via an explicit listing:
libclang.exports
.Because of this, the
pathogen_
andclangsharp_
functions aren't being exported on Linux builds. Explicitly setting the visibility (IE:__attribute__((visibility("default")))
) does not seem to work when this file is in use, I assume because the linker treats this exports file as the source of truth when it is specified.In theory we could just list all of our functions here too, but I'm concerned this will lead to mistakes due to the fact that functions will be exported differently depending on the platform. Ideally it should "just work" on Linux like it does on Windows. (Edit: Upon some additional consideration, these mistakes could be prevented by adding some unit tests to either
ClangSharp.Pathogen
orllvm-project
to ensure everything gets exported on all platforms. Although we'd likely want to do this as part of theClangSharp.Pathogen
CI since it's already building libclang.)For now I've disabled the exports file, which causes the
libclang.so
file to balloon from 81 MB to 99 MB on my system. It's not clear whether this is caused by all the additional code needed to support these functions or whether it's caused by the fact that a ton of Clang's C++ API is now being exported too. If it's the former, this might just be the workaround.The text was updated successfully, but these errors were encountered: