This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47571] [4.6 Regression] undefined reference to clock_gettime in Linux build of 02/01/2011
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2011 12:08:24 +0000
- Subject: [Bug fortran/47571] [4.6 Regression] undefined reference to clock_gettime in Linux build of 02/01/2011
- Auto-submitted: auto-generated
- References: <bug-47571-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47571
--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-14 12:07:54 UTC ---
CLOCK_REALTIME should be available, at least on POSIX compliant systems, but
must it be defined as preprocessor macro?
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html
talks about manifest constants, not macros. So it wouldn't surprise me if it
was defined in an enum rather than using #define.
Alternatively to those undefs would be to do
#ifdef CLOCK_MONOTONIC
#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
#else
#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
#endif
and just keep using GF_CLOCK_MONOTONIC only in code guarded with
HAVE_CLOCK_GETTIME or HAVE_CLOCK_GETTIME_LIBRT, or
#ifdef CLOCK_MONOTONIC
#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
#elif defined (HAVE_CLOCK_GETTIME) || defined (HAVE_CLOCK_GETTIME_LIBRT)
#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
#endif
if you prefer that.