"Direct access…" Linker warning in Xcode is misleading
| Originator: | dpolasch | ||
| Number: | rdar://24263457 | Date Originated: | Wed, 20 Jan 2016 20:30:11 GMT |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 7.2 |
| Classification: | Other Bug | Reproducible: | Always |
* SUMMARY The "Direct access…" Linker warning in Xcode is misleading. * STEPS TO REPRODUCE 1. Link a large and complex project which uses boost. Make sure all references to boost link to a static library created by a boost sub-project. 2. Notice that you get many warnings of the form: ld: warning: direct access in boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>() to global weak symbol guard variable for boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>()::ep means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. * RESULTS This warning is misleading. All translation units touching boost::exception_ptr boost::exception_detail::get_static_exception_object have been built with "Symbols Hidden by Default" set to "Yes" * REGRESSION I don't mind the warning, but if it's going to complain at me, it should actually give me a way to fix the problem. And when I do fix the problem, clean, and rebuild, the warning should actually go away. * NOTES It's possible that I'm picking up a copy of boost from some other (third-party) library, but given the warning message emitted by the linker, there's no way to know for sure. If the message is real, please update the linker to include which translation units it's whining about. An exhaustive list would be best.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!