projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f54d331
)
PR 47571 Fix bootstrap regression on alpha-dec-osf
author
Janne Blomqvist
<jb@gcc.gnu.org>
Fri, 15 Apr 2011 04:21:19 +0000
(07:21 +0300)
committer
Janne Blomqvist
<jb@gcc.gnu.org>
Fri, 15 Apr 2011 04:21:19 +0000
(07:21 +0300)
From-SVN: r172469
libgfortran/ChangeLog
patch
|
blob
|
history
libgfortran/acinclude.m4
patch
|
blob
|
history
libgfortran/config.h.in
patch
|
blob
|
history
libgfortran/configure
patch
|
blob
|
history
libgfortran/configure.ac
patch
|
blob
|
history
libgfortran/intrinsics/system_clock.c
patch
|
blob
|
history
diff --git
a/libgfortran/ChangeLog
b/libgfortran/ChangeLog
index 82c59bcd04f92d9ce9678dc8e802d91886b762ae..13b57eccd036613e4084a85bb40a7d05a85c89f1 100644
(file)
--- a/
libgfortran/ChangeLog
+++ b/
libgfortran/ChangeLog
@@
-1,3
+1,13
@@
+2011-04-15 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/47571
+ * configure: Regenerated.
+ * config.h.in: Regenerated.
+ * acinclude.m4: Add alpha*-dec-osf* to gthread blacklist.
+ * configure.ac: Use separate symbol for clock_gettime in librt.
+ * intrinsics/system_clock.c: Use weakrefs only when needed and
+ supported.
+
2011-04-12 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Use AC_TYPE_* to make sure we have (u)intptr_t,
2011-04-12 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Use AC_TYPE_* to make sure we have (u)intptr_t,
diff --git
a/libgfortran/acinclude.m4
b/libgfortran/acinclude.m4
index acd1d4dc81e605072bbe72c73a14cc75fedac43a..92e027177b5e89c22ce16fa76d6a2c053f17ad98 100644
(file)
--- a/
libgfortran/acinclude.m4
+++ b/
libgfortran/acinclude.m4
@@
-110,7
+110,7
@@
void foo (void);
[Define to 1 if the target supports #pragma weak])
fi
case "$host" in
[Define to 1 if the target supports #pragma weak])
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw*
| alpha*-dec-osf*
)
AC_DEFINE(GTHREAD_USE_WEAK, 0,
[Define to 0 if the target shouldn't use #pragma weak])
;;
AC_DEFINE(GTHREAD_USE_WEAK, 0,
[Define to 0 if the target shouldn't use #pragma weak])
;;
diff --git
a/libgfortran/config.h.in
b/libgfortran/config.h.in
index 76f1b2d3d1625063a1fc88b6d7a2551aebf8c47a..30da5fa7e214801111ce323cce139b40be8a73c4 100644
(file)
--- a/
libgfortran/config.h.in
+++ b/
libgfortran/config.h.in
@@
-210,6
+210,9
@@
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
+/* Define to 1 if you have the `clock_gettime' function in librt. */
+#undef HAVE_CLOCK_GETTIME_LIBRT
+
/* libm includes clog */
#undef HAVE_CLOG
/* libm includes clog */
#undef HAVE_CLOG
diff --git
a/libgfortran/configure
b/libgfortran/configure
index 393650ad97e2455971ebfb51c50a8aece411a7ea..833a0e1c6a7ee93e3e4ec8221649d9155e0efbab 100755
(executable)
--- a/
libgfortran/configure
+++ b/
libgfortran/configure
@@
-25375,10
+25375,11
@@
$as_echo "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h
fi
fi
-# At least for glibc, clock_gettime is in librt. But don't pull that
-# in if it still doesn't give us the function we want.
-# This test is copied from libgomp, and modified to not link in -lrt
-# as libgfortran calls clock_gettime via a weak reference.
+# At least for glibc and Tru64, clock_gettime is in librt. But don't
+# pull that in if it still doesn't give us the function we want. This
+# test is copied from libgomp, and modified to not link in -lrt as
+# libgfortran calls clock_gettime via a weak reference if it's found
+# in librt.
if test $ac_cv_func_clock_gettime = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
if test $ac_cv_func_clock_gettime = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
@@
-25421,7
+25422,7
@@
fi
$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
-$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+$as_echo "#define HAVE_CLOCK_GETTIME
_LIBRT
1" >>confdefs.h
fi
fi
@@
-25761,7
+25762,7
@@
$as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
fi
case "$host" in
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw*
| alpha*-dec-osf*
)
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
diff --git
a/libgfortran/configure.ac
b/libgfortran/configure.ac
index 8235c8835723fe34d5d55526d691e9316041e175..cf38fb024ea51e9bdf14f535348a4478b169c917 100644
(file)
--- a/
libgfortran/configure.ac
+++ b/
libgfortran/configure.ac
@@
-492,14
+492,15
@@
LIBGFOR_CHECK_FLOAT128
# Check for GNU libc feenableexcept
AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
# Check for GNU libc feenableexcept
AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
-# At least for glibc, clock_gettime is in librt. But don't pull that
-# in if it still doesn't give us the function we want.
-# This test is copied from libgomp, and modified to not link in -lrt
-# as libgfortran calls clock_gettime via a weak reference.
+# At least for glibc and Tru64, clock_gettime is in librt. But don't
+# pull that in if it still doesn't give us the function we want. This
+# test is copied from libgomp, and modified to not link in -lrt as
+# libgfortran calls clock_gettime via a weak reference if it's found
+# in librt.
if test $ac_cv_func_clock_gettime = no; then
AC_CHECK_LIB(rt, clock_gettime,
if test $ac_cv_func_clock_gettime = no; then
AC_CHECK_LIB(rt, clock_gettime,
- [AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
- [Define to 1 if you have the `clock_gettime' function.])])
+ [AC_DEFINE(HAVE_CLOCK_GETTIME
_LIBRT
, 1,
+ [Define to 1 if you have the `clock_gettime' function
in librt
.])])
fi
# Check for SysV fpsetmask
fi
# Check for SysV fpsetmask
diff --git
a/libgfortran/intrinsics/system_clock.c
b/libgfortran/intrinsics/system_clock.c
index 3a44dd9666b9b7b4769b88277dbe3b7d3a97a057..f4bac0777b37ba5738bd8f4c6adf7944263c6651 100644
(file)
--- a/
libgfortran/intrinsics/system_clock.c
+++ b/
libgfortran/intrinsics/system_clock.c
@@
-29,14
+29,16
@@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "time_1.h"
#include "time_1.h"
-#ifdef HAVE_CLOCK_GETTIME
+
/* POSIX states that CLOCK_REALTIME must be present if clock_gettime
is available, others are optional. */
/* POSIX states that CLOCK_REALTIME must be present if clock_gettime
is available, others are optional. */
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_LIBRT)
#ifdef CLOCK_MONOTONIC
#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
#else
#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
#endif
#ifdef CLOCK_MONOTONIC
#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
#else
#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
#endif
+#endif
/* Weakref trickery for clock_gettime(). On Glibc, clock_gettime()
requires us to link in librt, which also pulls in libpthread. In
/* Weakref trickery for clock_gettime(). On Glibc, clock_gettime()
requires us to link in librt, which also pulls in libpthread. In
@@
-50,15
+52,9
@@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define GTHREAD_USE_WEAK 1
#endif
#define GTHREAD_USE_WEAK 1
#endif
-#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
+#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
&& defined(HAVE_CLOCK_GETTIME_LIBRT)
static int weak_gettime (clockid_t, struct timespec *)
__attribute__((__weakref__("clock_gettime")));
static int weak_gettime (clockid_t, struct timespec *)
__attribute__((__weakref__("clock_gettime")));
-#else
-static inline int weak_gettime (clockid_t clk_id, struct timespec *res)
-{
- return clock_gettime (clk_id, res);
-}
-#endif
#endif
#endif
@@
-84,6
+80,13
@@
gf_gettime_mono (time_t * secs, long * nanosecs)
{
int err;
#ifdef HAVE_CLOCK_GETTIME
{
int err;
#ifdef HAVE_CLOCK_GETTIME
+ struct timespec ts;
+ err = clock_gettime (GF_CLOCK_MONOTONIC, &ts);
+ *secs = ts.tv_sec;
+ *nanosecs = ts.tv_nsec;
+ return err;
+#else
+#if defined(HAVE_CLOCK_GETTIME_LIBRT) && SUPPORTS_WEAK && GTHREAD_USE_WEAK
if (weak_gettime)
{
struct timespec ts;
if (weak_gettime)
{
struct timespec ts;
@@
-96,6
+99,7
@@
gf_gettime_mono (time_t * secs, long * nanosecs)
err = gf_gettime (secs, nanosecs);
*nanosecs *= 1000;
return err;
err = gf_gettime (secs, nanosecs);
*nanosecs *= 1000;
return err;
+#endif
}
extern void system_clock_4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *);
}
extern void system_clock_4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *);