Page MenuHome GnuPG

Build failure of gnupg2 with uclibc-ng
Testing, NormalPublic

Description

Build of gnupg2 in version 2.4.5 (with npth) fails since https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=commitdiff;h=02ce6b2d27f91ed6285e4e92d99c21bcc7823c9b because
busy_wait_for is only defined if !HAVE_PTHREAD_MUTEX_TIMEDLOCK. However, busy_wait_for is conditionally used if !HAVE_PTHREAD_MUTEX_TIMEDLOCK, but also if:

I don't know how to properly fix this issue (without reverting the commit).

Event Timeline

gniibe triaged this task as Normal priority.

Could you show us the build log of nPth, please?

gniibe changed the task status from Open to Testing.Tue, May 7, 8:10 AM

Build is still failing even with this commit, here is an extract of npth log:

checking for pthread_mutex_timedlock... yes
checking for pthread_rwlock_rdlock... yes
checking for pthread_rwlock_wrlock... yes
checking for pthread_rwlock_timedrdlock... no
checking for pthread_rwlock_timedwrlock... no
checking for pthread_rwlock_tryrdlock... yes
checking for pthread_rwlock_trywrlock... yes

[...]

make[3] : on entre dans le répertoire « /home/fabrice/buildroot/output/build/libnpth-1.7/src »
/bin/bash ../libtool  --tag=CC   --mode=compile /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I..   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O0 -g0  -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -c -o npth.lo npth.c
/bin/bash ../libtool  --tag=CC   --mode=compile /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I..   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O0 -g0  -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -c -o npth-sigev.lo npth-sigev.c
libtool: compile:  /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -c npth-sigev.c  -fPIC -DPIC -o .libs/npth-sigev.o
libtool: compile:  /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -c npth.c  -fPIC -DPIC -o .libs/npth.o
npth.c: In function 'npth_rwlock_timedrdlock':
npth.c:428:9: warning: implicit declaration of function 'busy_wait_for' [-Wimplicit-function-declaration]
  428 |   err = busy_wait_for ((trylock_func_t) pthread_rwlock_tryrdlock, rwlock,
      |         ^~~~~~~~~~~~~

The issue is the same than before: busy_wait_for is called but undefined.

Thank you for testing. Now, I can see the exact reason by your npth log.
Pushed another change: rPTH75c68399ef3b: Fix previous commit.

Thanks, I confirm that this new commit is fixing the issue.