Difference between revisions of "GDC/Installation/Android"
m |
(Update Android info. Lots of things changed :-)) |
||
Line 2: | Line 2: | ||
= GDC on Android = | = GDC on Android = | ||
− | Note: This tutorial should give you a usable GDC for Android. GDC on Android is not supported | + | Note: This tutorial should give you a usable GDC for Android. GDC on Android is not supported and especially phobos may need some updates to be usable. |
= Binaries = | = Binaries = | ||
− | + | Not yet available | |
− | + | = Building a toolchain with GDC for the Android NDK = | |
− | |||
− | |||
− | |||
− | |||
− | = Building a toolchain with | ||
== Linux host == | == Linux host == | ||
− | + | Install all packages required for building the NDK. Then: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | mkdir workdir | |
− | mkdir | + | cd workdir |
− | cd | + | git clone https://android.googlesource.com/platform/ndk |
− | + | git clone https://android.googlesource.com/platform/development | |
− | git clone https://android.googlesource.com/ | + | mkdir src |
− | + | mkdir dest | |
− | + | ./ndk/build/tools/download-toolchain-sources.sh /home/build/workdir/src | |
− | + | ./ndk/build/tools/gen-platforms.sh --minimal | |
− | |||
− | |||
− | mkdir | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | git clone git@github.com:D-Programming-GDC/GDC.git | |
− | cd | + | cd GDC |
− | + | git checkout gdc-4.9 | |
− | + | ./setup-gcc.sh /home/build/workdir/src/gcc/gcc-4.9 | |
cd ../ | cd ../ | ||
− | + | ./ndk/build/tools/build-gcc.sh /home/build/workdir/src /home/build/workdir/dest arm-linux-androideabi-4.9 --verbose --try-64 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | === Building unittests === | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | cd /tmp/ndk-/build/toolchain/gcc-4.9/arm-linux-androideabi/libphobos/libdruntime | |
− | + | make unittest | |
− | + | cd /tmp/ndk-/build/toolchain/gcc-4.9/arm-linux-androideabi/libphobos/src | |
− | + | make unittest | |
− | |||
− | |||
− | |||
− | |||
− | cd | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === Debugging help === |
− | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | adb push unittest /data/local/tmp | |
− | + | # gdbserver is in standard NDK builds | |
− | + | adb push prebuilt/android-arm/gdbserver/gdbserver /data/local/tmp | |
− | + | adb forward tcp:5039 tcp:5039 | |
− | + | adb shell | |
− | + | su | |
− | + | cd /data/local/tmp | |
− | + | ./unittest | |
− | + | ./gdbserver :5039 unittest | |
− | |||
− | |||
− | + | ./toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb unittest | |
+ | <gdb> target extended-remote :5039 | ||
+ | <gdb> continue | ||
− | + | # Usually android devices dont have hardware watchpoints, to disable: | |
− | + | <gdb> set can-use-hw-watchpoints 0 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= TODO = | = TODO = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* phobos | * phobos | ||
− | * | + | * shared libraries |
Revision as of 23:38, 28 March 2015
Contents
GDC on Android
Note: This tutorial should give you a usable GDC for Android. GDC on Android is not supported and especially phobos may need some updates to be usable.
Binaries
Not yet available
Building a toolchain with GDC for the Android NDK
Linux host
Install all packages required for building the NDK. Then:
mkdir workdir
cd workdir
git clone https://android.googlesource.com/platform/ndk
git clone https://android.googlesource.com/platform/development
mkdir src
mkdir dest
./ndk/build/tools/download-toolchain-sources.sh /home/build/workdir/src
./ndk/build/tools/gen-platforms.sh --minimal
git clone git@github.com:D-Programming-GDC/GDC.git
cd GDC
git checkout gdc-4.9
./setup-gcc.sh /home/build/workdir/src/gcc/gcc-4.9
cd ../
./ndk/build/tools/build-gcc.sh /home/build/workdir/src /home/build/workdir/dest arm-linux-androideabi-4.9 --verbose --try-64
Building unittests
cd /tmp/ndk-/build/toolchain/gcc-4.9/arm-linux-androideabi/libphobos/libdruntime
make unittest
cd /tmp/ndk-/build/toolchain/gcc-4.9/arm-linux-androideabi/libphobos/src
make unittest
Debugging help
adb push unittest /data/local/tmp
# gdbserver is in standard NDK builds
adb push prebuilt/android-arm/gdbserver/gdbserver /data/local/tmp
adb forward tcp:5039 tcp:5039
adb shell
su
cd /data/local/tmp
./unittest
./gdbserver :5039 unittest
./toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb unittest
<gdb> target extended-remote :5039
<gdb> continue
# Usually android devices dont have hardware watchpoints, to disable:
<gdb> set can-use-hw-watchpoints 0
TODO
- phobos
- shared libraries