Skip to content
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

Native linking warning: warning: direct access in function #1263

Closed
ChrisRisner opened this issue Mar 8, 2017 · 6 comments
Closed

Native linking warning: warning: direct access in function #1263

ChrisRisner opened this issue Mar 8, 2017 · 6 comments
Assignees

Comments

@ChrisRisner
Copy link

I'm running into this warning when building my Xamarin.iOS application:

ld: warning: direct access in function 'realm::SharedGroup::SharedGroup(realm::Replication&, realm::SharedGroupOptions)' from file '/Users/chris/code/MyProject/src/packages/Realm.1.1.0/native/ios/universal/librealm-wrappers.a(client_file_access_cache-iphoneos.o)' to global weak symbol 'realm::util::InterprocessMutex::initialize_statics()' from file '/Users/chris/code/MyProject/src/packages/Realm.1.1.0/native/ios/universal/librealm-wrappers.a(shared_realm.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

I've tried creating a new project and copying the NuGet references assuming there might be an issue there but haven't been able to reproduce this. I did notice the issue has also been reported for the realm-cocoa library so maybe this is an issue with the Xamarin.iOS implementation relying on that?

I'm not exactly sure on which version of Realm this started happening but I'm currently referencing Realm and RealmDatabase version 1.1.0. Happy to provide any other information that might be useful.

@nirinchev
Copy link
Member

That's a harmless warning. It's our fault and we'll fix it in the next release, but feel free to ignore it - you shouldn't get any erroneous behavior.

@ChrisRisner
Copy link
Author

Honestly, the bigger impact is that for some reason, when running the build in Visual Studio Team Systems, something about that warning seems to slow the build down excessively. For example:

2017-03-08T19:56:41.4080220Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:56:41.4114140Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:56:41.4129350Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:56:41.4145910Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:59:35.0865090Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:59:35.0911610Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:59:35.0927260Z MTOUCH: warning MT5203: Native linking warning
2017-03-08T19:59:35.0943170Z MTOUCH: warning MT5203: Native linking warning

Here there appears to be some reason where this appears to cause a three minute delay (four warnings at 56 minutes and then four more at 59 minutes). I'm not entirely sure how that makes sense but it is what appears to be happening. Will continue to ignore for now as long as you're aware it exists.

@nirinchev
Copy link
Member

I'd be surprised if that's what causes the build to take so long. Is this the complete build output and did it take less time with a previous version?

@ChrisRisner
Copy link
Author

Good call. After doing some more testing it seems to be tied to the first time a release build is done which is doing some optimizations that are slowing down the build. It appears as though the above might be the issue as they're the only thing being printed out during the build and they happen over three minutes but it's totally possible it is in fact just the build that is taking a long time.

fealebenpae added a commit that referenced this issue May 11, 2017
nirinchev added a commit that referenced this issue May 15, 2017
* Release 1.3.0

* Release 1.3.0

* Remove our custom ExpressionVisitor

* Silence some benign linker warnings on iOS (#1393)

Closes #1263

* Update dependencies
- Quickjournal
- ThreeLayer

* Mark App.xaml as ApplicationDefinition

* Update benchmarkr

* Update docs project

* Update changelog

* Fix incorrect merge
@odapplications
Copy link

That's a harmless warning. It's our fault and we'll fix it in the next release, but feel free to ignore it - you shouldn't get any erroneous behavior.

Still not working. Just got a similar error:
Warning: direct access in function '_SSL_load_client_CA_file' - to a weak symbol. This was likely caused by different translation units being compiled with different visibility settings.

Using Xamarin.Forms v4.5.0.396 on mac for ios

@fealebenpae
Copy link
Member

Hey @odapplications.
This doesn't sound right - _SSL_load_client_CA_file is a symbol from OpenSSL and Realm doesn't use OpenSSL on Apple platforms. What's the full error message that you're getting?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants