Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on Ubuntu/Debian with NDK 16 #2

Closed
stoically opened this issue Dec 13, 2017 · 2 comments
Closed

Can't build on Ubuntu/Debian with NDK 16 #2

stoically opened this issue Dec 13, 2017 · 2 comments

Comments

@stoically
Copy link

Hi,

thanks for your work on orbot/tor-android!

Tested on Ubuntu 16.04.3 LTS (4.4.0-103-generic x86_x64) and Debian 9 (4.9.0-4-amd64 x86_64)
Android Studio Version: 3.0.1
Android NDK Version: 16.1.4479499
Android SDK Platform Tools Version: 27.0.0
Android SDK Tools: 26.1.1
Installed APIs: 16, 23, 27
Installed packages: ant autotools-dev automake autogen autoconf libtool gettext-base autopoint

When running APP_ABI=armeabi make -C external or APP_ABI=x86 make -C external compiling of xz fails with the error

ISO C99... unsupported
configure: error: No C99 compiler was found.

When removing lzma (xz) it will fail while compiling zstd with the error

In file included from common/entropy_common.c:38:0:
common/mem.h:22:37: fatal error: string.h: No such file or directory
 #include <string.h>     /* memcpy */

When removing zstd it will fail while compiling openssl with the error

In file included from cryptlib.c:117:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
 # include <stdlib.h>

I was able to get xz, zstd and openssl to compile correctly by making my own NDK toolchains

$ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=android-16 --install-dir=./external/android-16-arch-arm-toolchain --arch=arm
$ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=android-16 --install-dir=./external/android-16-arch-x86-toolchain --arch=x86

and instructing the Makefile to use them by replacing

NDK_SYSROOT=[..]

with

NDK_TOOLCHAIN_CUSTOM=$(EXTERNAL_ROOT)/android-$(NDK_PLATFORM_LEVEL)-arch-$(NDK_ABI)-toolchain
NDK_SYSROOT=$(NDK_TOOLCHAIN_CUSTOM)/sysroot

and

NDK_TOOLCHAIN_BASE=[..]

with

NDK_TOOLCHAIN_BASE=$(NDK_TOOLCHAIN_CUSTOM)

However then configuring of Tor fails with the error

checking for libevent directory... configure: WARNING: Could not find a linkable libevent.  If you have it installed somewhere unusual, you can specify an explicit path using --with-libevent-dir

The external/lib directory exists and contains the libevent.a file. I'm not sure how to debug this further so any help would be appreciated. If I can provide more informations please let me know.

Best regards

@stoically stoically changed the title Can't build on Ubuntu/Debian Can't build on Ubuntu/Debian with NDK 16 Dec 13, 2017
@stoically
Copy link
Author

So I checked the Issues over at n8fr8/orbot and saw that orbot relies on ndk 10e. Tried building again with ndk 10e and it works just fine.

Maybe it would be nice to have a hint somewhere pointing that out in the BUILDING file? Anyway, it's solved for me so I'm closing this.

@goapunk
Copy link
Contributor

goapunk commented Jan 29, 2018

Sorry for the hassle. I agree it should be indicated in BUILD. @n8fr8 is there any special reason why you don't use the lastest ndk ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants