ekumenlabs / roscpp_android

Cross compilation scripts for building ROS nodes using the Android NDK.
39 stars 30 forks source link

Upgrade NDK to version 9d #57

Open lamerman opened 7 years ago

lamerman commented 7 years ago

I upgraded NDK to version 9d locally to be able to build position independent executables (PIE). As I understood they are supported starting from android-16. The version of NDK (8e) that is currently used supports only <= android-14. The NDK 9d supports platforms from android-9 to android-19 and we still can build everything: boost, etc...

I tried it already and it works. It compiles and I can run produced binaries like rosbag/record on modern android devices without errors.

What do you think about changing the NDK version? I could help with the small patch actually.

ernestmc commented 7 years ago

Hi @lamerman , I'm not aware of this build option. Would mind explaining why is this useful and in what use cases? Thanks a lot and excuse my ignorance.

lamerman commented 7 years ago

@ernestmc , You can get more information here: http://stackoverflow.com/questions/24818902/running-a-native-library-on-android-l-error-only-position-independent-executab/26422855#26422855

In short starting from android-16 it's not possible to run not position independent executables. Currently you are compiling for android-14 and you cannot run the compiled executables on modern devices >= android 4.1.

What is proposed to update the NDK version. Then the one who compiles ROS for android will be free to choose the target platform from 9 to 19. Currently it's not possible, he can choose only up to 14 because of 8e NDK restriction.

So the user will be to compile with more recent android target no matter what for. For me it's position independent executables, but it's not the main point here. The main is to update NDK if we can, without a lot of effort.

lamerman commented 7 years ago

I opened the pull request #58 with the NDK version upgrade

ernestmc commented 7 years ago

Thanks for your explanation!