gpgme on android report

Hans-Christoph Steiner hans at
Thu Feb 16 01:15:31 CET 2012

So now that I've gotten some test builds of gpg2 actually doing stuff on
Android, I thought it was a good time to test the next step: gpgme.  I
got close to a complete build, but there were issues with the final
linking.  Here's what I did to get as far as I did:

- cloned and worked out of master

- update config.sub and config.guess to latest version to get support
for arm-linux-androideabi host

- prefix=/data/local
 			./configure \
				--enable-maintainer-mode \
				--enable-static \
				--host=$(HOST) \
				--with-gnu-ld \
				--with-gpg-error-prefix=$(LOCAL) \
				--with-libassuan-prefix=$(LOCAL) \
				--with-gpg=$(prefix)/bin \
				--with-gpgsm=$(prefix)/bin \
				--with-gpgconf=$(prefix)/bin \
				--with-g13=$(prefix)/bin \
				--disable-gpg-test \
				--disable-gpgsm-test \
				--disable-gpgconf-test \
				--disable-g13-test \

- Android doesn't like SYS_gettid in src/ath.c.  I changed the __linux
macro to __gnu_linux__ and it built fine, but that's probably not the
best solution.  It seems SYS_gettid comes from gnu libc and Bionic libc
doesn't provide it.  Perhaps gettid() is what you want?  This thread
gives more detail:

- the build died looking for /usr/local/lib/, which is
odd since I told it to use $(LOCAL), which does not include /usr/local
in it at all.  I couldn't find where that was coming from.  I've also
noticed that in a lot of the gnupg build systems, it automatically
includes -L/usr/local/lib, which IMHO, is quite dangerous and mostly
unnecessary.  Most compilers will do -L/usr/local/lib automatically when
it makes sense, and in the case of Android's cross-compiler, having
-L/usr/local/lib could cause harm if someone had some gnupg libs there.
 Here's the full text of the error

libtool: link:
cru .libs/libgpgme.a  conversion.o get-env.o data.o data-fd.o
data-stream.o data-mem.o data-user.o data-compat.o signers.o
sig-notation.o wait.o wait-global.o wait-private.o wait-user.o
op-support.o encrypt.o encrypt-sign.o decrypt.o decrypt-verify.o
verify.o sign.o passphrase.o progress.o key.o keylist.o trust-item.o
trustlist.o import.o export.o genkey.o delete.o edit.o getauditlog.o
opassuan.o passwd.o engine.o engine-gpg.o status-table.o engine-gpgsm.o
assuan-support.o engine-assuan.o engine-gpgconf.o engine-g13.o
vfs-mount.o vfs-create.o gpgconf.o posix-util.o posix-sema.o posix-io.o
dirinfo.o debug.o gpgme.o version.o error.o ath.o stpcpy.o
libtool: link:
/bin/sed: can't read /usr/local/lib/ No such file or
libtool: link: `/usr/local/lib/' is not a valid libtool
make[3]: *** [] Error 1

More information about the Gnupg-devel mailing list