gpgme on android report

Hans-Christoph Steiner hans at guardianproject.info
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
  LOCAL=$(CWD)$(prefix)
 			./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 \
				--prefix=$(prefix)


- 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:
http://comments.gmane.org/gmane.comp.handhelds.android.ndk/9592


- the build died looking for /usr/local/lib/libgpg-error.la, 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:
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
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:
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ranlib
.libs/libgpgme.a
/bin/sed: can't read /usr/local/lib/libgpg-error.la: No such file or
directory
libtool: link: `/usr/local/lib/libgpg-error.la' is not a valid libtool
archive
make[3]: *** [libgpgme.la] Error 1



More information about the Gnupg-devel mailing list