]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
android: Re-enable optimization
authorKevin Cernekee <cernekee@gmail.com>
Mon, 12 Feb 2018 01:02:04 +0000 (17:02 -0800)
committerKevin Cernekee <cernekee@gmail.com>
Mon, 12 Feb 2018 03:39:14 +0000 (19:39 -0800)
The introduction of $(EXTRA_CFLAGS) in commit 00f0b80e4befe4
("android: Build ARM with -march=armv7-a") inadvertently overrode the
default "-O2 -g" CFLAGS.  Fixing this + enabling Thumb reduces the ARM
libopenconnect.so from ~3.5MB to ~1.9MB.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android/Makefile

index 414bf300d10614a9eb80d6acb5b641476dd30aa1..0d9e40559a857e281e49e59ed337e371935d06d6 100644 (file)
@@ -16,7 +16,7 @@ ARCH    := arm
 # You should be able to just 'make ARCH=x86' and it should DTRT.
 ifeq ($(ARCH),arm)
 TRIPLET := arm-linux-androideabi
-EXTRA_CFLAGS := -march=armv7-a
+EXTRA_CFLAGS := -march=armv7-a -mthumb
 endif
 ifeq ($(ARCH),x86)
 TRIPLET := i686-linux-android
@@ -27,7 +27,7 @@ TOPDIR := $(shell pwd)
 DESTDIR := $(TOPDIR)/$(TRIPLET)/out
 
 API_LEVEL := 14
-EXTRA_CFLAGS += -D__ANDROID_API__=$(API_LEVEL)
+EXTRA_CFLAGS += -D__ANDROID_API__=$(API_LEVEL) -O2
 
 TOOLCHAIN := $(TOPDIR)/$(TRIPLET)/toolchain
 TOOLCHAIN_BUILT := $(TOOLCHAIN)/.built