Make setup_pybind11 include -fvisibility=hidden in extra_compile_args
See original GitHub issueWithout that flag, one gets warnings per https://pybind11.readthedocs.io/en/stable/faq.html#someclass-declared-with-greater-visibility-than-the-type-of-its-field-someclass-member-wattributes.
It’s probably just a matter of adding it after -std=c++11
in https://github.com/tbenthompson/cppimport/blob/a2f85f355897badc1a94042802da916820e0657e/cppimport/templating.py#L25 (but before + cfg['compiler_args']
to allow a user to overwrite that if they really, really want to).
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
C++ -fvisibility=hidden -fvisibility-inlines-hidden - Stack Overflow
-fvisibility=hidden makes all your symbols hidden by default. What you then have to do, is choose which functions you want to be visible...
Read more >Visibility - GCC Wiki
Put simply, it hides most of the ELF symbols which would have previously (and unnecessarily) been public. This means: It very substantially ...
Read more >Simple C++ Symbol Visibility Demo - LabJack
This post gives a demonstration/test of the dangers of using default visibility for symbols in C++ shared libraries.
Read more >Visibility in shared objects - IBM
Functions with hidden visibility have a local scope and cannot be called from ... ALL is used to make all functions visible by...
Read more >169017 – backtrace() does not resolve symbols when ...
c -Wl,--export-dynamic */ /* Fails: cc -o backtrace backtrace.c -fvisibility=hidden -Wl,--export-dynamic */ #include <stdio.h> #include <unistd.h> #include < ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah. I noticed and fixed it, but you caught it in the 90 seconds in between commit 1 and 2… You’re super on top of things!
Uh, I think you got the commit wrong: you added
-fvsisibility=default
to setup_pybind11, but I was suggesting to add-fvisibility=hidden
to setup_pybind11 and then in your project which does need default visibility, add-fvisibility=default
.