Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

Android does not have pthread_rwlock*, npth wants them

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


hans at guardianproject

Feb 24, 2012, 4:53 PM

Post #1 of 6 (567 views)
Permalink
Android does not have pthread_rwlock*, npth wants them

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.

.hc
Attachments: npth-android-fixes.patch (2.55 KB)


hans at guardianproject

Feb 25, 2012, 9:28 AM

Post #2 of 6 (519 views)
Permalink
Re: Android does not have pthread_rwlock*, npth wants them [In reply to]

Here's my update on this:

It seems that in 2.1.0-git, dirmngr cannot work without npth's pthread_rwlock_* functionality, so I am skipping dirmngr for now. If I #ifdef out the pthread_rwlock_* stuff in npth, then I can get gpg-agent to build and run. And openldap builds fine using ./configure --without-threads.

Next up for me is getting the gnupg/tests running as part of the automated builds.

.hc

On Feb 24, 2012, at 7:53 PM, 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.
>
> .hc
> <npth-android-fixes.patch>


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

I hate it when they say, "He gave his life for his country." Nobody gives their life for anything. We steal the lives of these kids. -Admiral Gene LeRocque


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


marcus.brinkmann at ruhr-uni-bochum

Mar 5, 2012, 3:01 PM

Post #3 of 6 (509 views)
Permalink
Re: Android does not have pthread_rwlock*, npth wants them [In reply to]

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

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


hans at guardianproject

Mar 5, 2012, 8:13 PM

Post #4 of 6 (500 views)
Permalink
Re: Android does not have pthread_rwlock*, npth wants them [In reply to]

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!



_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


marcus.brinkmann at ruhr-uni-bochum

Mar 7, 2012, 10:06 AM

Post #5 of 6 (506 views)
Permalink
Re: Android does not have pthread_rwlock*, npth wants them [In reply to]

On 03/06/2012 05:13 AM, Hans-Christoph Steiner wrote:
> 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_*

I might have missed it earlier. I have the Android NDK set up now. How
far do you think we have to go back in the API level to cover all
interesting devices?

Thanks,
Marcus


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


hans at guardianproject

Mar 7, 2012, 10:22 AM

Post #6 of 6 (500 views)
Permalink
Re: Android does not have pthread_rwlock*, npth wants them [In reply to]

On Mar 7, 2012, at 1:06 PM, Marcus Brinkmann wrote:

> On 03/06/2012 05:13 AM, Hans-Christoph Steiner wrote:
>> 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_*
>
> I might have missed it earlier. I have the Android NDK set up now. How far do you think we have to go back in the API level to cover all interesting devices?

Depends who are you are specifically targeting. Here's the data from the Google Marketplace:
http://developer.android.com/resources/dashboard/platform-versions.html

Covering android-7/2.1 would give you 98.8% of the official Google phones that have Marketplace. Only Google branded phones have the Google Marketplace in them. For 3rd party ROMs, the Google Marketplace is an extra install. My guess is 3rd party ROM users are more up-to-date than Google users.

There are also many very cheap Android devices that are not official Google devices, so they won't count in those statistics. Then there are devices like the Nook and the new Amazon Kindle which are widespread, based on Android, but not official Google devices. The old Nooks are 1.6.

.hc

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

If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of everyone, and the receiver cannot dispossess himself of it. - Thomas Jefferson



_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.