-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple ld: "direct access in function ... to global weak symbol" #8958
Comments
If I am understanding correctly, your proposed flags would make the C++ library compile with Have you tested with this configuration? Can you verify that the test suite and your own programs work under this flag? I ask because We should probably be in good shape here, since Windows depends on proper |
I can confirm that Mixxx builds and runs with this configuration. |
I have been using local builds of Mixxx with this protobuf configuration on macOS as well as builds from GitHub Actions. I have not identified any problems from this. |
microsoft/vcpkg#19908 |
I would support adding If/when we are supporting a build of |
@haberman Can you confirm that vcpkg should merge the PR indicated above then? We want to avoid merging changes in the 'exposed interface' of a thing without the nominal owners of the thing OKing wherever possible:
We can of course back that out if/when a change is adopted in protocol buffers' own CMakeLists.txt. |
@haberman Please have a look at the question above. This let us make progress in the vcpkg repro. Thanks. |
I would prefer to make this change in our own CMake files, so it's tested in our CI. If we patch |
This bug is open since 8 Sep 2021, will you take care about it? |
We rely on users to contribute fixes to system-specific problems like this. We have many users across many different systems. We don't have the bandwidth or the background to drive fixes to a problem like this that so far has only surfaced with one package manager. Please feel free to send a PR to add this flag to our CMakeLists.txt. |
…e builds This avoids the warning: "ld: direct access in function ... to global weak symbol" when building with Apples clang Fixes protocolbuffers#8958
Done. |
I have a similar issue What version of protobuf and what language are you using? What operating system (Linux, Windows, ...) and version? What runtime / compiler are you using (e.g., python version or gcc version) What did you do? What did you expect to see What did you see instead? Recompiling the entire library with -fvisibility=hidden removes some warnings but makes others appear instead. Selectively compiling just a few files with hidden gets me down to just a few warnings. I used this patch to selectively set hidden visibility on some files I couldn't find any way to eliminate those last warnings. Is this a compiler bug, is this version of clang too old? |
My attempt in #9768 |
I can't test that, I'm using autoconf. Don't have ninja. |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it. This issue was closed and archived because there has been no new activity in the 14 days since the |
What version of protobuf and what language are you using?
Version: V3.15.8
Language: C++
What operating system (Linux, Windows, ...) and version?
macOS Catalina 10.15
What runtime / compiler are you using (e.g., python version or gcc version)
GNU 11.2.0
What did you do?
Build mixxx on the GitHub workflows using vcpck.
https://github.com/mixxxdj/mixxx/pull/4225/checks?check_run_id=3403021507
Protobuf is linked as a static library.
What did you expect to see
No warning
What did you see instead?
Anything else we should know about your project / environment
The workaround is to call cmake with these flags:
I have proposed a fix here microsoft/vcpkg#19908 but I was forwarded to check if the issue can be solved directly.
The flag is already used in the Ruby module, here:
protobuf/ruby/ext/google/protobuf_c/extconf.rb
Line 6 in 66d7491
The text was updated successfully, but these errors were encountered: