https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629
--- Comment #24 from Mathieu Malaterre <malat at debian dot org> --- I have change the openvdb.cc code into: % cat openvdb.cc #include "Tree.h" static std::string do_segfault() { return Tree::treeType(); } #ifdef VIS __attribute__((visibility("default"))) #endif void initialize() { do_segfault(); } Now I can demonstrate that the issue only happen when using the visibility flag (no-symptom using the default UNIX mechanism to export all symbols).