From 87edea9ce61914e057dc391be6219097ced9876c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Sun, 29 Oct 2017 22:35:54 -0400 Subject: [PATCH 1/2] Disable Zstandard for now. Because of bug #90 the current build process will be broken for people who have Zstandard headers available on their host system. For people who do not have the headers available the build system will silently ignore the `--enable-zstd` and build Tor without support for it. See: https://github.com/n8fr8/orbot/issues/90 --- external/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/Makefile b/external/Makefile index 2e8c29fd..ea62aa95 100644 --- a/external/Makefile +++ b/external/Makefile @@ -208,7 +208,7 @@ tor/Makefile: tor/configure --enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \ --enable-static-openssl --with-openssl-dir=$(EXTERNAL_ROOT) \ --disable-linker-hardening --disable-gcc-hardening --disable-tool-name-check \ - --disable-lzma --enable-zstd + --disable-lzma --disable-zstd tor-build-stamp: tor/Makefile $(MAKE) -C tor all-am From d591cdb0df2b1d4689579bc10de25af4df550e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Sun, 29 Oct 2017 22:56:52 -0400 Subject: [PATCH 2/2] Don't strip binaries when doing a debug build. This patch allows the developer to build the external binaries with DEBUG=1 which ensures that the final binaries are not stripped from any debug symbols. This makes the binaries useful together with Google's simpleperf profiler for Android. --- external/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/external/Makefile b/external/Makefile index ea62aa95..3d05250b 100644 --- a/external/Makefile +++ b/external/Makefile @@ -11,6 +11,11 @@ export ac_cv_func_setpgrp_void=yes EXTERNAL_ROOT := $(shell pwd) +DEBUG ?= 0 + +# No-op command. +NOOP = true + # Android now has 64-bit and 32-bit versions of the NDK for GNU/Linux. We # assume that the build platform uses the appropriate version, otherwise the # user building this will have to manually set NDK_PROCESSOR or NDK_TOOLCHAIN. @@ -71,8 +76,12 @@ CPP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-cpp --sysroot=$(NDK_SYSROOT) LD := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ld AR := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ar RANLIB := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ranlib -STRIP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-strip \ - --strip-unneeded -R .note -R .comment --strip-debug + +ifeq ($(DEBUG), 1) + STRIP := $(NOOP) +else + STRIP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-strip --strip-unneeded -R .note -R .comment --strip-debug +endif CFLAGS = -DANDROID $(TARGET_CFLAGS) $(PIEFLAGS)