Issue and Steps to Reproduce
I had to do some kludgy things to get it to compile and I'm looking for suggestions for my build script and procedure.
System: Ubuntu 18.04.3 LTS (bionic)
-
followed steps in INSTALL.md for building on Ubuntu. Built succeeded as described.
-
followed steps for cross-compiling for Android. Build succeeded only after some changes to the procedure described in INSTALL.md.
-
Installed and tested qemu-user with these steps:
$ apt-get install qemu binfmt-support qemu-user-static
$ update-binfmts --display | grep arm
qemu-arm (enabled)
qemu-armeb (enabled)
- Downloaded and unzipped Linux 64-bit (x86) | android-ndk-r21-linux-x86_64.zip in ~/src/android-ndk-r21..
5) Kludge needed for cdump-enumstr to build:
$ cp ./ccan_compat.h ./ccan/ccan_compat.h
- Run the following script: android_helper.sh
#!/bin/sh
make clean
ANDROID_NDK=$HOME/src/android-ndk-r21
HOST_TAG=linux-x86_64
ANDROID_PREFIX=${ANDROID_NDK}/toolchains/llvm/prebuilt/${HOST_TAG}
export PATH=$PATH:${ANDROID_PREFIX}/bin
# Change next line depending on target device arch
target_host=arm-linux-androideabi
export AR=$target_host-ar
export AS=$target_host-clang
export CC=$target_host-clang
export CXX=$target_host-clang++
export LD=$target_host-ld
export STRIP=$target_host-strip
# Two makefile targets should not be cross-compiled so we specify a native CC:
make CC=clang clean ccan/tools/configurator/configurator
make clean -C external/jsmn \
&& make -C external/jsmn
# KLUDGE:
ranlib external/libjsmn.a
make clean -C ccan/ccan/cdump/tools \
&& make -C ccan/ccan/cdump/tools
ANDROID_VERSION=28
# QUESTION: we define MAKE_HOST as armv7a for libwally.. why?
target_host2=armv7a-linux-androideabi${ANDROID_VERSION}
BUILD=x86_64 \
MAKE_HOST=$target_host2 \
make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-androideabi-clang -static"
# KLUDGE: call ranlib and rerun make
ranlib external/libjsmn.a
BUILD=x86_64 \
MAKE_HOST=$target_host2 \
make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-androideabi-clang -static"
-
Without the kludges above, cdump-enumstr fails to build because libjsmn.a has no index.
-
There should be a note in INSTALL.md that warns that it's impossible to cross-compile clightning (directly) on OSX because there is no way to install qemu-user-static.
Issue and Steps to Reproduce
I had to do some kludgy things to get it to compile and I'm looking for suggestions for my build script and procedure.
System: Ubuntu 18.04.3 LTS (bionic)
followed steps in INSTALL.md for building on Ubuntu. Built succeeded as described.
followed steps for cross-compiling for Android. Build succeeded only after some changes to the procedure described in INSTALL.md.
Installed and tested qemu-user with these steps:
5) Kludge needed for cdump-enumstr to build:
$ cp ./ccan_compat.h ./ccan/ccan_compat.hWithout the kludges above, cdump-enumstr fails to build because libjsmn.a has no index.
There should be a note in INSTALL.md that warns that it's impossible to cross-compile clightning (directly) on OSX because there is no way to install qemu-user-static.