Re: [Log4cplus-devel] Failed to compile using cmake android toolchain
Logging Framework for C++
Brought to you by:
wilx
From: Václav Z. <vha...@gm...> - 2014-05-04 06:11:09
|
On 15.8.2013 07:09, Nikita Manovich wrote: > Hi, > > I will look at the problem this week. Probably I will find a solution > and send a patch if it is necessary. Ping. :) This has cropped up again. This time on G+: https://plus.google.com/106712358057058222185/posts/6juUApU1fGa > > > 2013/8/14 Václav Zeman <vha...@gm... <mailto:vha...@gm...>> > > On 14 August 2013 11:58, Vladimir "Equidamoid" Shapranov wrote: > > It seems that the error is caused by -fdata-sections flag set by > > android.toolchain.cmake (line 930). > > I don't actually understand why that flag is needed there but addng > > > > if (ANDROID) > > > > add_definitions(-fno-data-sections) > > > > endif(ANDROID) > > > > > > to log4cplus/src/CMakeLists.txt fixes the issue. > I am glad that you found a work around for this issue. > > I have updated the android.toolchain.cmake file from the OpenCV > repository at > <http://code.opencv.org/projects/opencv/repository/revisions/master/changes/platforms/android/android.toolchain.cmake>. > However the updated file still contains the offending -fdata-sections > flag. I think that we (I actually mean you :) should do two things: > > 1. document the issue and your workaround in README; > 2. complain to Google (fill a bug report) that their NDK > compiler/toolchain does not properly support thread local storage. > > > > > 13.08.2013 21:35 , Václav Zeman пишет: > > > > On 08/12/2013 07:13 PM, Vladimir "Equidamoid" Shapranov wrote: > > > > Hello, > > > > I'm trying to build log4cplus for android using cmake (added > > 'add_subdirectory(path/to/the/source)' to my main CMakeLists.txt). > > The build crashes with the following error: > > [ 48%] Building CXX object > > jni/lib/log4cplus-1.1.1/src/CMakeFiles/log4cplus.dir/global-init.cxx.o > > jni/lib/log4cplus-1.1.1/src/global-init.cxx:268:46: error: > > log4cplus::internal::__emutls_t._ZN9log4cplus8internal3ptdE causes a > > section type conflict with log4cplus::internal::ptd > > jni/lib/log4cplus-1.1.1/src/global-init.cxx:268:46: note: > > 'log4cplus::internal::ptd' was declared here > > > > Is this a bug or I'm doing something wrong? > > > > This looks like a deficiency in the Android tool chain. The only > problem > > with log4cplus is probably that its CMake scripts do not detect > that the > > tool chain is lacking this feature. > > > > I am adding Nikita Manovich to CC because he is the one who has > > contributed the Android port patches. |