Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't static link vectorscan into another shared library on Mac OS without exporting vectorscan symbols #161

Closed
jeffplaisance opened this issue Jun 27, 2023 · 1 comment · Fixed by #164

Comments

@jeffplaisance
Copy link

jeffplaisance commented Jun 27, 2023

I am using vectorscan in a shared library that is intended to be used with the jvm through jni. For various java-related reasons, the shared library is bundled in a jar file for distribution. Bundling multiple shared libraries into the jar and having one load the others is tricky and annoying, so I prefer to static link the dependencies of the library directly into the shared object file, so that it works standalone. For this to work correctly, it is important that I can control which symbols the library exports, as I don't want it to export any symbols from its dependencies, as they may potentially conflict with other versions of the same dependency that are also loaded by the same process. On gcc/linux I can use -Wl,--exclude-libs,ALL in the linker options to do this, but that doesn't work in clang/mac. To fix this, I am proposing the addition of #ifndef HS_PUBLIC_API ... #endif around the #define for HS_PUBLIC_API so that I can define it to be empty from cmake and avoid exporting the symbols.

@jeffplaisance
Copy link
Author

jeffplaisance commented Jun 27, 2023

i opened a pull request: #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants