diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2015-08-31 10:37:30 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2015-08-31 10:37:30 +0000 |
commit | e78549932d92690dd277938fac358c039a5d210d (patch) | |
tree | 8abc0ef2b196b276af26f60460040f32e81575d8 /libgfortran/acinclude.m4 | |
parent | 4ba00e9dba4d8e2113d3347532fe9aff2a293625 (diff) | |
download | gcc-e78549932d92690dd277938fac358c039a5d210d.zip gcc-e78549932d92690dd277938fac358c039a5d210d.tar.gz gcc-e78549932d92690dd277938fac358c039a5d210d.tar.bz2 |
re PR fortran/47571 (undefined reference to clock_gettime in Linux build of 02/01/2011)
PR libfortran/47571
* acinclude.m4 (LIBGFOR_GTHREAD_WEAK): Remove.
(LIBGFOR_CHECK_WEAKREF): New test.
* configure.ac: Call LIBGFOR_CHECK_WEAKREF instead of
LIBGFOR_GTHREAD_WEAK.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/system_clock.c: Use SUPPORTS_WEAKREF instead of
SUPPORTS_WEAK and GTHREAD_USE_WEAK.
From-SVN: r227335
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r-- | libgfortran/acinclude.m4 | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index a0975a9..fab29e4 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -69,27 +69,21 @@ if (foovar > 10) return __sync_add_and_fetch (&foovar, -1);]])], [Define to 1 if the target supports __sync_fetch_and_add]) fi]) -dnl Check for pragma weak. -AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [ - AC_CACHE_CHECK([whether pragma weak works], - libgfor_cv_have_pragma_weak, [ - gfor_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wunknown-pragmas" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -void foo (void); -#pragma weak foo -]], [[if (foo) foo ();]])], - libgfor_cv_have_pragma_weak=yes, libgfor_cv_have_pragma_weak=no)]) - if test $libgfor_cv_have_pragma_weak = yes; then - AC_DEFINE(SUPPORTS_WEAK, 1, - [Define to 1 if the target supports #pragma weak]) - fi - case "$host" in - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) - AC_DEFINE(GTHREAD_USE_WEAK, 0, - [Define to 0 if the target shouldn't use #pragma weak]) - ;; - esac]) +dnl Check whether target effectively supports weakref +AC_DEFUN([LIBGFOR_CHECK_WEAKREF], [ + AC_CACHE_CHECK([whether the target supports weakref], + libgfor_cv_have_weakref, [ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wunknown-pragmas -Werror" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +static int mytoto (int) __attribute__((__weakref__("toto"))); +]], [[return (mytoto != 0);]])], + libgfor_cv_have_weakref=yes, libgfor_cv_have_weakref=no) + CFLAGS="$save_CFLAGS"]) + if test $libgfor_cv_have_weakref = yes; then + AC_DEFINE(SUPPORTS_WEAKREF, 1, + [Define to 1 if the target supports weakref]) + fi]) dnl Check whether target can unlink a file still open. AC_DEFUN([LIBGFOR_CHECK_UNLINK_OPEN_FILE], [ |