Skip to content

Commit

Permalink
build gpgv v1.4.18 from source, statically to get around PIE vs non-PIE
Browse files Browse the repository at this point in the history
If an executable is built fully statically, with no dynamic linking at all,
then the same binary will work on both PIE systems (android-21 and above),
and systems where PIE does not work (older than android-16).

closes #2 #2
  • Loading branch information
eighthave committed Jan 30, 2015
1 parent 9f18311 commit 47140c6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ proguard-project.txt
#
assets/busybox
assets/cdebootstrap.tar
assets/gpgv
external/cdebootstrap/cdebootstrap-static-0.*/
external/cdebootstrap/cdebootstrap.tar
external/debian-archive-keyring/debian-archive-keyring-201*/
Binary file removed assets/gpgv
Binary file not shown.
39 changes: 37 additions & 2 deletions external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ export TZ=UTC

.PHONY: all assets clean distclean

all: $(EXTERNAL_ROOT)/busybox/busybox
all: $(EXTERNAL_ROOT)/busybox/busybox $(EXTERNAL_ROOT)/gnupg/g10/gpgv
make -C $(EXTERNAL_ROOT)/cdebootstrap

assets: all
install $(EXTERNAL_ROOT)/busybox/busybox \
$(EXTERNAL_ROOT)/cdebootstrap/cdebootstrap.tar \
$(EXTERNAL_ROOT)/gnupg/g10/gpgv \
$(ASSETS)/


Expand All @@ -94,20 +95,54 @@ $(EXTERNAL_ROOT)/busybox/busybox: $(EXTERNAL_ROOT)/busybox/.config
echo "TIMESTAMP: $(TIMESTAMP)"
faketime -f $(TIMESTAMP) make -C $(EXTERNAL_ROOT)/busybox/


$(EXTERNAL_ROOT)/gnupg/configure: $(EXTERNAL_ROOT)/gnupg/configure.ac
cd $(EXTERNAL_ROOT)/gnupg && \
./autogen.sh --force

$(EXTERNAL_ROOT)/gnupg/Makefile: $(EXTERNAL_ROOT)/gnupg/configure
cd $(EXTERNAL_ROOT)/gnupg && \
SYSROOT=$(NDK_SYSROOT) \
AR="$(AR)" \
CC="$(CC)" \
LD="$(LD)" \
CFLAGS="$(ALL_CFLAGS)" \
LDFLAGS="$(ALL_LDFLAGS) -static" \
./configure \
--host=$(HOST) \
--disable-agent-support \
--disable-bzip2 \
--disable-card-support \
--disable-exec \
--disable-keyserver-helpers \
--disable-hkp \
--disable-ldap \
--disable-nls \
--disable-photo-viewers

$(EXTERNAL_ROOT)/gnupg/g10/gpgv: $(EXTERNAL_ROOT)/gnupg/Makefile
make -C $(EXTERNAL_ROOT)/gnupg/cipher
make -C $(EXTERNAL_ROOT)/gnupg/mpi
make -C $(EXTERNAL_ROOT)/gnupg/util
make -C $(EXTERNAL_ROOT)/gnupg/zlib
make -C $(EXTERNAL_ROOT)/gnupg/g10
$(STRIP) $(EXTERNAL_ROOT)/gnupg/g10/gpgv

# to re-download and verify that the .debs included in git match the official
# Debian ones
verify-debian-packages: clean
make -C $(EXTERNAL_ROOT)/debian-archive-keyring
-rm $(EXTERNAL_ROOT)/cdebootstrap/cdebootstrap-static*.deb
make -C $(EXTERNAL_ROOT)/cdebootstrap

clean:
clean:
rm -f -- $(EXTERNAL_ROOT)/busybox/.config
rm -f -- $(EXTERNAL_ROOT)/busybox/busybox
-cd $(EXTERNAL_ROOT)/busybox/ && \
patch -N -R -p1 --reject-file=- < ../003-mount-umount-fsck-df.patch
make -C $(EXTERNAL_ROOT)/busybox/ clean
make -C $(EXTERNAL_ROOT)/cdebootstrap/ clean
make -C $(EXTERNAL_ROOT)/gnupg/ clean
make -C $(EXTERNAL_ROOT)/debian-archive-keyring/ clean

distclean: clean
Expand Down

0 comments on commit 47140c6

Please sign in to comment.