Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Many visibility warnings building macOS SDK #7281

Closed
1ec5 opened this issue Dec 2, 2016 · 3 comments
Closed

Many visibility warnings building macOS SDK #7281

1ec5 opened this issue Dec 2, 2016 · 3 comments
Labels
build macOS Mapbox Maps SDK for macOS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Dec 2, 2016

As of 8403883 on master, a clean build of the macOS SDK in Xcode 8.2 results in 136 warnings of the following form:

ld: warning: direct access in function 'mbgl::Tileset const& mapbox::util::variant<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mbgl::Tileset>::get<mbgl::Tileset, (void*)0>() const' from file '/Users/mxn/hub/mapbox-gl-native/build/macos/Debug/libmbgl-core.a(offline_download.o)' to global weak symbol 'typeinfo for mapbox::util::bad_variant_access' from file '/Users/mxn/hub/mapbox-gl-native/build/macos/macos.build/Debug/dynamic.build/Objects-normal/x86_64/NSArray+MGLAdditions.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

GCC_SYMBOLS_PRIVATE_EXTERN is YES for the dynamic target in macos.xcodeproj (whereas it’s NO for the dynamic and static targets in ios.xcodeproj), but setting it to NO doesn’t address the issue.

This issue doesn’t reproduce on the release-ios-v3.4.0 branch.

/cc @kkaefer

@1ec5 1ec5 added build macOS Mapbox Maps SDK for macOS labels Dec 2, 2016
@kkaefer
Copy link
Member

kkaefer commented Dec 7, 2016

GCC_SYMBOLS_PRIVATE_EXTERN adds -fvisibility=hidden for static libraries/executables, but apparently doesn't do this for dynamic libraries.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 7, 2016

What about the iOS dynamic framework? I haven’t noticed these warnings there.

@kkaefer
Copy link
Member

kkaefer commented Dec 7, 2016

That's because we're not yet compiling iOS with -fvisibility=hidden for the core library. PR for iOS is at #7131

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

No branches or pull requests

2 participants