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

Many visibility warnings building macOS SDK #7281

Closed

Description

@1ec5

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

Activity

  1. added
    macOS
    on Dec 2, 2016
  2. kkaefer commented on Dec 7, 2016

    @kkaefer
    Member

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

  3. 1ec5 commented on Dec 7, 2016

    @1ec5
    ContributorAuthor

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

  4. kkaefer commented on Dec 7, 2016

    @kkaefer
    Member

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildmacOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions