[filesystem] Please take care of #8706
Hi, There is a ticket https://svn.boost.org/trac/boost/ticket/8706 and patch in it that fixes compilation of Boost.Filesystem under Android NDK. Tested patch under latest NDK and it works well. Fix is required to start regression tests for droid platform. -- Best regards, Antony Polukhin
On Sunday 23 June 2013 13:10:55 Antony Polukhin wrote:
Hi,
There is a ticket https://svn.boost.org/trac/boost/ticket/8706 and patch in it that fixes compilation of Boost.Filesystem under Android NDK.
Tested patch under latest NDK and it works well. Fix is required to start regression tests for droid platform.
Unfortunately, it seems Boost.Filesystem is mostly unmaintained lately. So I would suggest to go ahead and commit the change yourself. The change looks harmless enough to me.
Hi Antony, Did you test your patch against some common use cases on Boost::FileSystem 1.54.0 on Android? After applying your patch, boost::filesystem::path works, however it crashes on boost::filesystem::directory_iterator. Are you using directory_iterator on your App? Thanks, Augusto -- View this message in context: http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... Sent from the Boost - Dev mailing list archive at Nabble.com.
2013/7/8 Augusto Righetto
Hi Antony,
Did you test your patch against some common use cases on Boost::FileSystem 1.54.0 on Android?
I'm currently working on running all regression tests under android.
After applying your patch, boost::filesystem::path works, however it crashes on boost::filesystem::directory_iterator. Are you using directory_iterator on your App?
Not directly. But we use Boost.Log that uses boost::filesystem::directory_iterator and it works OK. Give me some more information and may be I'll be able to help you: * What version of Android API are you using? (We use 9) * What libc++ implementation are you using? (We use gnustl_shared) * Have you enabled exceptions and RTTI via -fexceptions and -frtti? * If you run you application from Java using jni, have you enabled filesystem operations (like reading/writing to sdcard)? -- Best regards, Antony Polukhin
After some investigation, I've figured out that the crash only happens when my app links dynamically against boost_system and boost_filesystem. Everything works fine when I link statically. I'm building boost using a standalone toolchain built with NDK 8e 64-bit. The toolchain is targeted to android-14 (actually, android-9 since it is the highest platform available on NDK 8e). My app is linking statically against GNU STL (libstdc++) and supc++ (enabling exceptions). Besides that, I'm enabling -fexceptions and -frtti. Following Google's recommendation about ABI compatibility, I'm enabling -march=armv7-a, -mfloat-abi=softfp and -mfpu=vfpv3-d16. I'm using Android's engineering build, so I'm able to run the Boost's Filesystem test apps directly on device without any Java/Dalvik code. Did you try to build and link Boost as a shared library? -- View this message in context: http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... Sent from the Boost - Dev mailing list archive at Nabble.com.
On 10/07/13 03:41, Augusto Righetto wrote:
After some investigation, I've figured out that the crash only happens when my app links dynamically against boost_system and boost_filesystem. Everything works fine when I link statically.
I'm building boost using a standalone toolchain built with NDK 8e 64-bit. The toolchain is targeted to android-14 (actually, android-9 since it is the highest platform available on NDK 8e).
My app is linking statically against GNU STL (libstdc++) and supc++ (enabling exceptions). Besides that, I'm enabling -fexceptions and -frtti. Following Google's recommendation about ABI compatibility, I'm enabling -march=armv7-a, -mfloat-abi=softfp and -mfpu=vfpv3-d16.
I'm using Android's engineering build, so I'm able to run the Boost's Filesystem test apps directly on device without any Java/Dalvik code.
Did you try to build and link Boost as a shared library?
Are you sure you're compiling and dynamically linking everything (Boost and your app) against the same shared C++ runtime? Ben
Yeap, I'm quite sure. readelf -d is not showing libstdc++ or gnu_shared as dependencies. Did you manage to run tests linking dynamically? On Jul 9, 2013 9:55 PM, "Ben Pope [via Boost]" < ml-node+s2283326n4649560h65@n4.nabble.com> wrote:
On 10/07/13 03:41, Augusto Righetto wrote:
After some investigation, I've figured out that the crash only happens when my app links dynamically against boost_system and boost_filesystem. Everything works fine when I link statically.
I'm building boost using a standalone toolchain built with NDK 8e 64-bit. The toolchain is targeted to android-14 (actually, android-9 since it is the highest platform available on NDK 8e).
My app is linking statically against GNU STL (libstdc++) and supc++ (enabling exceptions). Besides that, I'm enabling -fexceptions and -frtti. Following Google's recommendation about ABI compatibility, I'm enabling -march=armv7-a, -mfloat-abi=softfp and -mfpu=vfpv3-d16.
I'm using Android's engineering build, so I'm able to run the Boost's Filesystem test apps directly on device without any Java/Dalvik code.
Did you try to build and link Boost as a shared library?
Are you sure you're compiling and dynamically linking everything (Boost and your app) against the same shared C++ runtime?
Ben
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... To unsubscribe from [filesystem] Please take care of #8706, click herehttp://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4648813&code=YXVndXN0b3JpZ2hldHRvQGdtYWlsLmNvbXw0NjQ4ODEzfC0xNjU5ODQ2MjQz . NAMLhttp://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
-- View this message in context: http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... Sent from the Boost - Dev mailing list archive at Nabble.com.
Sorry, I was talking about the static version when I've talked about readelf. I don't have access to my computer right now, tomorrow morning I'm going to check and then I'll let you to know. On Jul 9, 2013 9:55 PM, "Ben Pope [via Boost]" < ml-node+s2283326n4649560h65@n4.nabble.com> wrote:
On 10/07/13 03:41, Augusto Righetto wrote:
After some investigation, I've figured out that the crash only happens when my app links dynamically against boost_system and boost_filesystem. Everything works fine when I link statically.
I'm building boost using a standalone toolchain built with NDK 8e 64-bit. The toolchain is targeted to android-14 (actually, android-9 since it is the highest platform available on NDK 8e).
My app is linking statically against GNU STL (libstdc++) and supc++ (enabling exceptions). Besides that, I'm enabling -fexceptions and -frtti. Following Google's recommendation about ABI compatibility, I'm enabling -march=armv7-a, -mfloat-abi=softfp and -mfpu=vfpv3-d16.
I'm using Android's engineering build, so I'm able to run the Boost's Filesystem test apps directly on device without any Java/Dalvik code.
Did you try to build and link Boost as a shared library?
Are you sure you're compiling and dynamically linking everything (Boost and your app) against the same shared C++ runtime?
Ben
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... To unsubscribe from [filesystem] Please take care of #8706, click herehttp://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4648813&code=YXVndXN0b3JpZ2hldHRvQGdtYWlsLmNvbXw0NjQ4ODEzfC0xNjU5ODQ2MjQz . NAMLhttp://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
-- View this message in context: http://boost.2283326.n4.nabble.com/filesystem-Please-take-care-of-8706-tp464... Sent from the Boost - Dev mailing list archive at Nabble.com.
2013/7/9 Augusto Righetto
After some investigation, I've figured out that the crash only happens when my app links dynamically against boost_system and boost_filesystem. Everything works fine when I link statically.
I was having almost the same problems a few weeks ago. When you link dynamically against Boost libraries you must also link dynamically against gnustl_shared. In that case neither Boost not your application must links against static version of gnustl.
I'm building boost using a standalone toolchain built with NDK 8e 64-bit. The toolchain is targeted to android-14 (actually, android-9 since it is the highest platform available on NDK 8e).
My app is linking statically against GNU STL (libstdc++) and supc++ (enabling exceptions).
You must not mix static and shared versions of STL. If you are using at least one dynamic library - than you need to link all your libraries and executables agains dynamic version of STL. Otherwise program won't work. That is because of some global variables inside STL - if you link STL statically to multiple *.so, then each *.so will have it's own instances of global variables. While this may sometimes somehow work with defaul Linux runtime linker, Android has its own linker that won't resolve those conflicts. Besides that, I'm enabling -fexceptions and -frtti.
Following Google's recommendation about ABI compatibility, I'm enabling -march=armv7-a, -mfloat-abi=softfp and -mfpu=vfpv3-d16.
I also define <compileflags>-DBOOST_ASIO_DISABLE_STD_ATOMIC # See https://code.google.com/p/android/issues/detail?id=42735#makechanges <compileflags>-DBOOST_AC_USE_PTHREADS # See https://code.google.com/p/android/issues/detail?id=42735#makechanges <cxxflags>-D_REENTRANT <cxxflags>-D_GLIBCXX__PTHREADS <compileflags>-D__ARM_ARCH_5__ <compileflags>-D__ARM_ARCH_5T__ <compileflags>-D__ARM_ARCH_5E__ <compileflags>-D__ARM_ARCH_5TE__ I'm using Android's engineering build, so I'm able to run the Boost's
Filesystem test apps directly on device without any Java/Dalvik code.
Did you try to build and link Boost as a shared library?
I tried that, but failed. Shared libraries could not link against -lrt (because it does not exists under Android) and some unresolved symbols. So I thought to take care of static builds first. If you succeeded in making dynamic versions of Boost libraries, please tell me how to do it. -- Best regards, Antony Polukhin
participants (4)
-
Andrey Semashev
-
Antony Polukhin
-
Augusto Righetto
-
Ben Pope