Support __attribute__ ((visibility ("default"))) ?

Joe Fitzpatrick

New Member
When I did a small beta for my plugin I noticed that c99defs.h defines EXPORT as nothing for non Windows targets.
But if was defined as: __attribute__ ((visibility ("default"))) when __GNUC__ is >= 4 a number of the modules would be smaller on OS X and Linux.

My plugin is an extreme example. I am linking to two large libraries I use a lot. Building with all symbols visible gives a 20M .so file. I conditionally undefined and redefined EXPORT in my module, and the release build dropped to < 1M. The GCC optimizer was able to remove all the portions of the large libraries that I wasn't using.

As a test I altered c99defs.h and altered the MacOSX obs-studio build to set
GCC_SYMBOLS_PRIVATE_EXTERN to true and most the resulting modules were smaller. Nothing as dramatic as my example, but something you might want to take a look at.
 
Top