npth finds pthread_mutex_timedlock() which android does not have

Hans-Christoph Steiner hans at guardianproject.info
Sat Mar 10 04:52:48 CET 2012



On 03/09/2012 10:34 PM, Hans-Christoph Steiner wrote:
> 
> 
> On 03/09/2012 01:14 PM, Marcus Brinkmann wrote:
>> On 02/20/2012 09:07 PM, Hans-Christoph Steiner wrote:
>>> Apparently, Android's NDK defines pthread_mutex_timedlock() in the
>>> headers but then does not implement it.  And it seems they aren't close
>>> to implementing it:
>>> http://code.google.com/p/android/issues/detail?id=2138
>>
>> Hi,
>>
>> together with the previous changes, the latest version
>>
>> cbb52bd5ada02bbd914869f4540221831358d077
>>
>> should resolve all rwlock issues on all android platforms up to 14.
> 
> I just ran a build that includes the latest gnupg and npth from git, and
> it builds fine on android-7/2.1:
> 
> https://build.safermobile.org/job/gnupg-for-android/48/
> 
> Unfortunately, they didn't include the regex functions in android-7, so
> this will only run on android-8/2.2.  We'll have to include the regex C
> files in this project in order to support < android-8/2.2.
> 
> I think with including regex, we should be able to get gnupg running on
> even older platforms, like 1.6 so you have have gnupg on your old B&N
> Nook. ;)

Oops I spoke too soon:

# gpg-agent
link_image[1995]: failed to link gpg-agent
CANNOT LINK EXECUTABLE
# dirmngr
link_image[1995]: failed to link dirmngr
CANNOT LINK EXECUTABLE

Unfortunately, the Android linker doesn't give you much info, but you
can get more info using ld.  I copied all of the android-2.2 .so files
into /tmp and did this:

$ arm-linux-androideabi-ld --rpath=/tmp libnpth.so
arm-linux-androideabi-ld: warning: cannot find entry symbol _start;
defaulting to 00008248
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'

.hc



More information about the Gnupg-devel mailing list