-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[package] boost/*: ios variant misses two define exports #3867
Comments
When googling for Reading https://www.boost.org/doc/libs/1_74_0/libs/smart_ptr/doc/html/smart_ptr.html#shared_ptr_thread_safety, Could you please report this at https://github.com/boostorg/smart_ptr/issues and/or https://github.com/boostorg/atomic/issues? |
conan does everything right and boost too... the issue seems to be the projects USING the compiled ios boost version. because smart_ptr is header-only the USING projects must declare so in my opinion def package_info(self):
if self.settings.os == "iOS":
self.cpp_info.components["no idea"].defines = ["BOOST_AC_USE_PTHREADS", "BOOST_SP_USE_PTHREADS"] |
Sounds good, def package_info(self):
--- a/recipes/boost/all/conanfile.py
+++ b/recipes/boost/all/conanfile.py
@@ -1245,3 +1245,10 @@
self.cpp_info.components["_libboost"].cxxflags.append("-pthread")
self.cpp_info.components["_libboost"].sharedlinkflags.extend(["-pthread","--shared-memory"])
self.cpp_info.components["_libboost"].exelinkflags.extend(["-pthread","--shared-memory"])
+ elif self.settings.os == "iOS":
+ if self.options.multithreading:
+ # https://github.com/conan-io/conan-center-index/issues/3867
+ # runtime crashes occur when using the default platform-specific reference counter/atomic
+ self.cpp_info.components["headers"].extend(["BOOST_AC_USE_PTHREADS", "BOOST_SP_USE_PTHREADS"])
+ else:
+ self.cpp_info.components["headers"].extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"])
to the pr at #3872 |
Do you happen to know whether |
No, no idea. And don't have the hardware. I can test the simulators if would like so? However, I'm quite sure, all iOS devices are affected. |
Thanks, but only if it does not require much time. I'm still thinking it would be interesting to open an issue at the boostorg repo(s). |
I think it more or less going from https://stackoverflow.com/questions/14692802/boost-threads-in-ios-thread-info-object-is-being-destructed-before-the-thread |
I'm just saying that the upstream project needs to be made aware of the problem. |
Package and Environment Details (include every applicable attribute)
Conan profiles
build.profile
host.profile (ios Simulator)
Steps to reproduce
I'm cross compiling boost from MacOS to iOS Simulator (x86_64). Which works quite well. Awesome job!
However when consuming the library weird runtime crashes occur due to invalid memory access.
Two days of debugging and address sanitizer showed that the consuming product has two defines missing.
-DBOOST_SP_USE_PTHREADS
and-DBOOST_AC_USE_PTHREADS
.conan-center-index/recipes/boost/all/conanfile.py
Lines 764 to 767 in d956a46
May I suggest that you add the flags
-DBOOST_SP_USE_PTHREADS
and-DBOOST_AC_USE_PTHREADS
to thepackage_info
method?conan-center-index/recipes/boost/all/conanfile.py
Line 1014 in d956a46
Thanks for your time!
The text was updated successfully, but these errors were encountered: