[filesystem] Please take care of #8706

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[filesystem] Please take care of #8706

Antony Polukhin
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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Andrey Semashev-2
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.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Augusto Righetto
In reply to this post by Antony Polukhin
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
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Antony Polukhin
2013/7/8 Augusto Righetto <[hidden email]>

> 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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

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'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?
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

BenPope81
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
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Augusto Righetto

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]" <[hidden email]> 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-tp4648813p4649560.html
To unsubscribe from [filesystem] Please take care of #8706, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Augusto Righetto
In reply to this post by BenPope81

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]" <[hidden email]> 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-tp4648813p4649560.html
To unsubscribe from [filesystem] Please take care of #8706, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: [filesystem] Please take care of #8706

Antony Polukhin
In reply to this post by Augusto Righetto
2013/7/9 Augusto Righetto <[hidden email]>

> 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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost