Android does not have pthread_rwlock*, npth wants them

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Tue Mar 6 00:01:08 CET 2012


On 02/25/2012 01:53 AM, Hans-Christoph Steiner wrote:
>
> More Android porting fun!  The good news is that I have working builds
> for the whole thing, but working in a limited way.  The build is also
> repeatable and even automated.  Once I get everything working, I'll also
> add in the gnupg tests to the automated builds:
>
> https://build.safermobile.org/job/gnupg-for-android/
>
> So now the problem at hand is more missing pthread symbols:
>
>   libnpth.so: undefined reference to `pthread_rwlock_rdlock'
>   libnpth.so: undefined reference to `pthread_rwlock_timedwrlock'
>   libnpth.so: undefined reference to `pthread_rwlock_timedrdlock'
>   libnpth.so: undefined reference to `pthread_rwlock_wrlock'
>   libnpth.so: undefined reference to `pthread_rwlock_trywrlock'
>   libnpth.so: undefined reference to `pthread_rwlock_tryrdlock'
>
> The attached patch to npth gave me a libnpth.so that made gpg-agent
> happy enough to run.  dirmngr still doesn't run because libldap.so also
> has the pthread_rwlock_* symbols, but I think I can solve that by using
> ./configure --without-threads in openldap.

I got the latest NDK and look what I found:

$ for f in  */arch-arm/usr/lib/libc.so; do grep -H pthread_rwlock_wrlock 
$f; done
Binary file android-14/arch-arm/usr/lib/libc.so matches
Binary file android-9/arch-arm/usr/lib/libc.so matches

Seems that since v9 the functions are available.  Which version are you 
using?  Can you confirm?

There is also a test for this in tests/build/pthread-rwlock-initializer

Thanks,
Marcus



More information about the Gnupg-devel mailing list