Android does not have pthread_rwlock*, npth wants them

Hans-Christoph Steiner hans at guardianproject.info
Tue Mar 6 05:13:10 CET 2012


On Mar 5, 2012, at 6:01 PM, Marcus Brinkmann wrote:

> 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

I thought I mentioned this in a follow-up email, my apologies if I did not.  I'm currently using android-9/2.3 and its working fine as is, so seemingly using pthread_rwlock_*.  Andrond 2.3 and above covers about 50% of the currently deployed Android devices, so it would be nice to be able to work without pthread_rwlock_*

.hc


----------------------------------------------------------------------------

                  ¡El pueblo unido jamás será vencido!





More information about the Gnupg-devel mailing list