This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Building libstdc++ with current glibc, NULL and pthread.h
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, libc-alpha at sourceware dot org
- Date: Fri, 9 Mar 2012 18:16:06 +0000 (UTC)
- Subject: Re: Building libstdc++ with current glibc, NULL and pthread.h
- References: <Pine.LNX.4.64.1203082242380.18868@digraph.polyomino.org.uk>
The answer from the Austin Group list was that the POSIX requirement
*does* mean all symbols from time.h are to be defined by pthread.h and
it's a bug in the change history that it refers to allowing rather
than requiring the symbols to be made visible. Thus, I propose this
patch to make pthread.h define all symbols from time.h again, so that
NULL is defined and libstdc++ can build again. (Given that the POSIX
change resulted from an interpretation request I think we don't need
to make this conditional on the version of POSIX selected but can
treat the omission of this requirement / permission as a defect in
older POSIX versions.)
Tested x86_64.
2012-03-09 Joseph Myers <joseph@codesourcery.com>
* sysdeps/pthread/pthread.h (__need_clockid_t, __need_timespec):
Do not define before including <time.h>.
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 0d33cbd..bd97e85 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -21,10 +21,6 @@
#include <features.h>
#include <endian.h>
#include <sched.h>
-#ifdef __USE_XOPEN2K
-# define __need_clockid_t
-#endif
-#define __need_timespec
#include <time.h>
#include <bits/pthreadtypes.h>
--
Joseph S. Myers
joseph@codesourcery.com