taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 437 forks source link

Can we remove "-fdata-sections -ffunction-sections" #18

Closed fuji246 closed 9 years ago

fuji246 commented 10 years ago

See here: http://sourceforge.net/p/log4cplus/mailman/message/31286406/

What steps will reproduce the problem?

  1. Compile logcplus 1.2 in Andriod using cmake
  2. Choose the Release version(Debug works fine)
  3. encounter error log4cplus::internal::__emutls_t._ZN9log4cplus8internal3ptdE causes a section type conflict

What is the expected output? What do you see instead?

Should works fine for release version.

What version of the product are you using? On what operating system?

I'm using mac to cross compile the log4cplus for android, and ndk using is android-ndk-r9d, toolchain is arm-linux-androideabi-g++ (GCC) 4.6 20120106 (prerelease)

Please provide any additional information below.

taka-no-me commented 9 years ago

The toolchain can be stopped from adding these flags by setting ANDROID_FUNCTION_LEVEL_LINKING to OFF. The option is there for a long already but it turns that it was broken. The latest version should be Ok.