On Sun, 2019 Nov 17 22:18-05:00, Bruno Haible wrote: > > > More specifically, to get a suitable pthreads interface, you need to > > #define _UNIX95_THREADS and _XOPEN_SOURCE=600. > > I'd suggest to add this to the recommended values of CC and CXX in > https://gitlab.com/ghwiki/gnow-how/wikis/Platforms/Configuration
For archive readers: There is a parallel thread discussing what bits of system knowledge should go into online docs, and which ones might be better integrated into the build framework. > > (This could perhaps be added to AC_USE_SYSTEM_EXTENSIONS for this > > system.) > > I'm not sure adding these flags in AC_USE_SYSTEM_EXTENSIONS or > gl_USE_SYSTEM_EXTENSIONS would work for all packages. For the > majority, probably yes, but for all of them? Not sure. I am wondering how inclusive "all" is meant to be. One could, in theory, have a package that wants/requires the alternate form of the pthreads API that z/OS provides. But such a package would only be usable on z/OS, and that is not a likely design decision for a GNU project. Would not most packages be suited by a build environment that provides the standard pthreads API, as well as others? The above feature macros are similar in spirit to _ALL_SOURCE / _GNU_SOURCE, in that way (i.e. "why wouldn't you want this?"). Admittedly, there may be some features that are blocked out by those. If this is occurring in my Gnulib test runs, and it is not producing an error/failure (e.g. tests skipped due to missing functionality), then I am not aware of it. The flags (and bug reports!) I've compiled have been driven primarily by the desire to allow Gnulib to build everything it wants to build---which presumably spans a broad enough array of functionality to cover the needs of most, if not all packages. > > I would thus suggest adding something like the following to > > lib/pthread.in.h: > > > > #if defined(__MVS__) && !defined(PTHREAD_RWLOCK_INITIALIZER) > > # define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP > > #endif > > Tell the package maintainers to import the gnulib module 'pthread- > rwlock'. It will deal with the missing PTHREAD_RWLOCK_INITIALIZER; > this issue occurs also on some older Solaris versions. If I omit that fragment, I get this build error: source='/tmp/testdir/gltests/test-pthread.c' object='test-pthread.o' libtool=no \ DEPDIR=.deps depmode=aix /bin/sh /tmp/testdir/build-aux/depcomp \ xlc-wrap -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I/tmp/testdir/gltests -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I/tmp/testdir/gltests -I.. -I/tmp/testdir/gltests/.. -I../gllib -I/tmp/testdir/gltests/../gllib -D_UNIX95_THREADS -D_XOPEN_SOURCE=600 -DNSIG=39 -qhaltonmsg=CCN3296 -g -q64 -qfloat=ieee -qlanglvl=extc99 -qenumsize=4 -c -o test-pthread.o /tmp/testdir/gltests/test-pthread.c ERROR CCN3221 /tmp/testdir/gltests/test-pthread.c:35 Initializer must be a valid constant expression. WARNING CCN3196 /tmp/testdir/gltests/test-pthread.c:56 Initialization between types "void*" and "unsigned long" is not allowed. CCN0793(I) Compilation failed for file /tmp/testdir/gltests/test-pthread.c. Object file not created. make[4]: *** [test-pthread.o] Error 12 I don't see "PTHREAD_RWLOCK_INITIALIZER_NP" anywhere in a clean Gnulib tree, so I'm not sure how this could already be addressed... --Daniel -- Daniel Richard G. || sk...@iskunk.org My ASCII-art .sig got a bad case of Times New Roman.