After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 377066 - Build failure on GNU/Hurd
Build failure on GNU/Hurd
Status: RESOLVED FIXED
Product: gamin
Classification: Other
Component: general
unspecified
Other GNU Hurd
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-11-19 17:37 UTC by Michael Banck
Modified: 2006-11-20 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (398 bytes, patch)
2006-11-19 17:38 UTC, Michael Banck
none Details | Review

Description Michael Banck 2006-11-19 17:37:09 UTC
Building gamin fails on GNU/Hurd:

/bin/sh ../libtool --mode=compile --tag=CC cc -DHAVE_CONFIG_H -I. -I/build/buildd/gamin-0.1.7/./libgamin -I..  -I.. -I/build/buildd/gamin-0.1.7/./lib -DBINDIR=\""/usr/lib/gamin"\" -DBUILDDIR=\"".."\" -DGAM_DEBUG_ENABLED    -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -g  -c -o gam_data.lo /build/buildd/gamin-0.1.7/./libgamin/gam_data.c
 cc -DHAVE_CONFIG_H -I. -I/build/buildd/gamin-0.1.7/./libgamin -I.. -I.. -I/build/buildd/gamin-0.1.7/./lib -DBINDIR=\"/usr/lib/gamin\" -DBUILDDIR=\"..\" -DGAM_DEBUG_ENABLED -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -g -c /build/buildd/gamin-0.1.7/./libgamin/gam_data.c  -fPIC -DPIC -o .libs/gam_data.o
/build/buildd/gamin-0.1.7/./libgamin/gam_data.c:32:14: warning: extra tokens at end of #ifdef directive
/build/buildd/gamin-0.1.7/./libgamin/gam_data.c: In function 'gamin_data_new':
/build/buildd/gamin-0.1.7/./libgamin/gam_data.c:475: error: 'PTHREAD_MUTEX_RECURSIVE_NP' undeclared (first use in this function)
/build/buildd/gamin-0.1.7/./libgamin/gam_data.c:475: error: (Each undeclared identifier is reported only once
/build/buildd/gamin-0.1.7/./libgamin/gam_data.c:475: error: for each function it appears in.)
make[3]: *** [gam_data.lo] Error 1


This is due to:

#ifdef __GLIBC__
        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
#else
        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#endif


which is clearly wrong, as GNU/Hurd is glibc-based, but does not define PTHREAD_MUTEX_RECURSIVE_NP.  In order to have PTHREAD_MUTEX_RECURSIVE available on GNU/Linux, at least __USE_UNIX98 needs to be defined, see <pthread.h>. 

Relying on some non-portable (_NP) macros looks wrong to me here, but maybe the check could be modified to first check for the availability of PTHREAD_MUTEX_RECURSIVE_NP and only use PTHREAD_MUTEX_RECURSIVE if it is not present.
Comment 1 Michael Banck 2006-11-19 17:38:14 UTC
Created attachment 76850 [details] [review]
proposed patch
Comment 2 Daniel Veillard 2006-11-20 16:58:13 UTC
PTHREAD_MUTEX_RECURSIVE_NP being an enum value, that patch just doesn't 
compile on Linux. So I switched to 

#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP)

I'm afraid it's not perfect but this should be better.
Applied to CVS.

  thanks,

Daniel