-fvisibility-inlines-hidden - causes all inlined class member functions to have hidden visibility, causing significant export symbol table size & binary size reductions
-fvisibility-ms-compat - attempts to use visibility settings to make GCC’s C++ linkage model compatible with that of Microsoft Visual Studio.
-fno-semantic-interposition - compiler assumes that if interposition happens for functions the overwriting function will have precisely the same semantics (and side effects).
Recommendations for shared libraries on Linux
Build with -fvisibility=hidden (every declaration not explicitly marked with a visibility attribute has a hidden visibility) , -Bsymbolic (bind defined symbols locally)
Mark only exported functions as __attribute__((visibility(“protected”))) (indicates that the symbol will be placed in the dynamic symbol table, but that references within the defining module will bind to the local symbol. The symbol cannot be overridden by another module.)
Takeaways
Linux and Windows designs are fundamentally different
The Linux design is burdened by archaic design goals