This is an archive of the discontinued LLVM Phabricator instance.

Android target support (as part of LLDB build)
AbandonedPublic

Authored by tberghammer on Nov 7 2014, 5:34 PM.

Details

Summary

Some minor changes needed in order to build LLVM as part of LLDB build using Android NDK. A new define ANDROID_NDK is used in order to differentiate from LLVM standalone build vs LLVM as part of LLDB build.

Diff Detail

Event Timeline

achien_bsi updated this revision to Diff 15952.Nov 7 2014, 5:34 PM
achien_bsi retitled this revision from to Android target support (as part of LLDB build).
achien_bsi updated this object.
achien_bsi edited the test plan for this revision. (Show Details)
achien_bsi added a subscriber: Unknown Object (MLST).
vharron edited edge metadata.EditedNov 19 2014, 2:37 PM
Why are you using the __ANDROID_NDK__ define?  I think we should use __ANDROID__ instead.  If it's not defined in out build, we should define it (instead of __ANDROID_NDK__)

I've checked Android NDK versions 3, 9, and 21 and all of them automatically have these symbols defined when building with Android.mk

__ANDROID__
ANDROID

vharron@tifa:~/dev/defines$ cat jni/main.c
#include <stdio.h>

int
main() {

#ifdef __ANDROID__
  printf("__ANDROID__\n");
#endif
#ifdef ANDROID
  printf("ANDROID\n");
#endif
#ifdef __ANDROID_NDK__
  printf("__ANDROID_NDK__\n");
#endif

}
vharron@tifa:~/dev/defines$ strings libs/armeabi/libhello-android-9.so | egrep ANDROID
__ANDROID__
ANDROID
vharron@tifa:~/dev/defines$ vi jni/Application.mk
vharron@tifa:~/dev/defines$ ~/Downloads/android-ndk-r10c/ndk-build
[armeabi] Compile thumb  : hello-android-21 <= main.c
[armeabi] SharedLibrary  : libhello-android-21.so
[armeabi] Install        : libhello-android-21.so => libs/armeabi/libhello-android-21.so
vharron@tifa:~/dev/defines$ strings libs/armeabi/libhello-android-21.so | egrep ANDROID
__ANDROID__
ANDROID

Tamas, please commandeer this revision and use or close.

tberghammer commandeered this revision.Feb 23 2015, 2:52 AM
tberghammer edited reviewers, added: achien_bsi; removed: tberghammer.

I don't fully understand what is the goal of this CL, but I think most of it don't make too much help to us now, so I will abandon it.

tberghammer abandoned this revision.Feb 23 2015, 2:52 AM