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

Visibility settings cause warnings when compiling for Release #25

Open
mhaylock opened this issue Oct 28, 2015 · 7 comments
Open

Visibility settings cause warnings when compiling for Release #25

mhaylock opened this issue Oct 28, 2015 · 7 comments
Assignees

Comments

@mhaylock
Copy link

When compiling our app for Release I get warnings like:

ld: warning: direct access in void boost::throw_exception<boost::gregorian::bad_month>
(boost::gregorian::bad_month const&) to global weak symbol typeinfo for 
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::
gregorian::bad_month> > means the weak symbol cannot be overridden at runtime. This was 
likely caused by different translation units being compiled with different visibility 
settings.

I can see this occurs because "Symbols Hidden by Default" is YES in a Release build. A bit of Googling suggests that boost should have been compiled with -fvisibility=hidden -fvisibility-inlines-hidden, which was the case until this commit.

Would the fix be as simple as reintroducing these compilation options, or do they cause other problems?

@danoli3
Copy link
Owner

danoli3 commented Oct 28, 2015

Yeah definitely re-introducing that line. Thanks for this report.

@danoli3 danoli3 self-assigned this Oct 28, 2015
@mhaylock
Copy link
Author

No problem, although (just incase you didn't already mean this) to clarify: it should be re-introduced for both iphone and iphonesim :)

@danoli3
Copy link
Owner

danoli3 commented Oct 28, 2015

Fixed in new releases for 1.59.0 and master.

@danoli3 danoli3 closed this as completed Oct 28, 2015
@mhaylock
Copy link
Author

@danoli3 it's not clear to me why, but trying this new version I get the visibility warnings in Debug now, even if I do change "Symbols Hidden by Default" to YES to DEBUG.

Perhaps I've lead you astray with my suggestion here?

@danoli3
Copy link
Owner

danoli3 commented Oct 28, 2015

I found this:
http://stackoverflow.com/questions/19190458/visibility-linker-warnings-when-compiling-ios-app-that-uses-boost

Interesting might be related to clang++ vs clang.............weird.
Want to try and edit the build script yourself to clang rather than clang++ here:
https://github.com/danoli3/ofxiOSBoost/blob/master/scripts/build-libc%2B%2B.sh#L29

See if that gets rid of the warnings? After re-building

@danoli3 danoli3 reopened this Oct 28, 2015
@mhaylock
Copy link
Author

@danoli3 I did try using clang (saw that myself) with no luck.

I've observed that no matter what the setting for "Symbols Hidden by Default" (including making sure it's consistent in the Pods project as well) it never passes -fvisibility=hidden when compiling while in DEBUG mode. Seems like an Xcode bug, but perhaps I'm missing something…

@danoli3
Copy link
Owner

danoli3 commented Oct 29, 2015

Yeah throw Apple a report: https://bugreport.apple.com

Let me know what their engineers say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants