Compiling lldb, in a cmake sub-project that compiles with visibility
hidden, will generate a "cannot export hidden symbol" error because we
require default visibility. Even though we export using
-Wl,-exported_symbols_list,liblldb.exports, if each .cpp file is
compiled with -fvisibility=hidden, then you'll get this warning and
linking will fail. Essentially -exported_symbols_list is not strong
enough to reverse the -fvisibility=hidden.
Details
Details
- Reviewers
arphaman JDevlieghere
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Is there a way to address this through the preprocessor? We already have the LLDB_API macro, which expands to __declspec(dllexport/import) on windows. Would expanding it do __attribute__((visibility("default"))) (or something) on other platforms help with anything?
Comment Actions
Yes, this IMO should eventually be addressed by explicitly exporting each meant-to-be-exported function with LLDB_ABI and then changing the line this patch adds to use hidden instead of default.
This patch is meant to be a band-aid until that can be done.