You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
one gocha is that -fvisibility=hidden interacts in interesting ways with -flto. I've gotten mapnik working with both combined but it required some careful usage of __attribute__ ((visibility ("default"))) and extern template
Made a preliminary attempt at setting this up in 898-visibility-hidden, seeing the following two linker warnings from Boost when running make run-osx that I'm attributing to the cross-lib exceptions issue with hidden symbols, but trying to track this down I can't find anywhere that we're using boost::throw_exception or boost::exception_detail?
ld: warning: direct access in void boost::throw_exception<boost::bad_function_call>(boost::bad_function_call const&) to global weak symbol typeinfo for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_function_call> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_function_call> >::rethrow() const to global weak symbol typeinfo for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_function_call> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
^ Uh, my branch unexpectedly passed CI when I assumed it wouldn't. Anyone want to review and see if it's actually doing what I think it is? I'm assuming that we'll still need to explicitly set symbol visibility for the public API to actually USE the library in an app? Or is this somehow taken care of through the platform bindings?
Rebasing geojsonvt-2.1.6-rapidjson onto this branch doesn't solve the linker warnings during iOS tests - is visibility not actually set correctly here, or could the issue be that mason packages (like GeoJSONVT) are only built with -fvisibility-inlines-hidden?
Activity
ljbade commentedon Feb 18, 2015
I did not realise you needed this flag Linux/OSX. I know on Windows the default is to only expose specifically marked symbols from shared lib.
mikemorris commentedon Oct 15, 2015
https://gcc.gnu.org/wiki/Visibility has an example of macros with Windows support
mikemorris commentedon Oct 15, 2015
Made a preliminary attempt at setting this up in
898-visibility-hidden, seeing the following two linker warnings from Boost when runningmake run-osxthat I'm attributing to the cross-lib exceptions issue with hidden symbols, but trying to track this down I can't find anywhere that we're usingboost::throw_exceptionorboost::exception_detail?mikemorris commentedon Oct 15, 2015
^ Uh, my branch unexpectedly passed CI when I assumed it wouldn't. Anyone want to review and see if it's actually doing what I think it is? I'm assuming that we'll still need to explicitly set symbol visibility for the public API to actually USE the library in an app? Or is this somehow taken care of through the platform bindings?
mikemorris commentedon Oct 15, 2015
Rebasing
geojsonvt-2.1.6-rapidjsononto this branch doesn't solve the linker warnings during iOS tests - is visibility not actually set correctly here, or could the issue be that mason packages (like GeoJSONVT) are only built with-fvisibility-inlines-hidden?mikemorris commentedon Nov 4, 2015
Halfway there as of #2584 with
-fvisibility-inlines-hiddenmikemorris commentedon Nov 19, 2015
Started work on this again today in
898-visibility-hiddenin light of needs for smaller binaries on Android and iOS.mikemorris commentedon Nov 19, 2015
Not seeing any reduction in iOS binary size from this yet, possible because we're still building a static library? Might need to revisit #828
zugaldia commentedon Nov 20, 2015
FWIW I just did a
make androidfor bothmasterand https://github.com/mapbox/mapbox-gl-native/tree/898-visibility-hidden and these are the results size-wise:I see a smaller size (784,360 bytes less) or is there a better way to measure this impact?
jfirebaugh commentedon Jul 15, 2016
Done for Android in #5656.
kkaefer commentedon Jan 4, 2017
macOS PR in #7509
kkaefer commentedon Jan 5, 2017
iOS is in #7604