views:

109

answers:

0

We're trying to port a commercial SDK software from Linux to Mac OS X and we're running into the problem that ld on Mac OS X does not support the --exclude-libs switch which we use on the linux side. We are linking in static libraries, object files to create a shared library. We want to only expose symbols marked with:

#define EXPORT_API_T(type) __attribute__((visibility("default"))) type EXPORT_API_CALL

One option would be to use: -unexported_symbols_list file and generate the contents of the file through a combination of manual checking and using nm.

Another option is to use strip, which seems to be the old fashion way of doing it.

What do you do when you build an SDK for your customers and want to only expose a limited set of functions?