public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/47571] [4.6 Regression] undefined reference to clock_gettime in Linux build of 02/01/2011
Date: Tue, 08 Mar 2011 09:35:00 -0000	[thread overview]
Message-ID: <bug-47571-4-NLqQKJ8kKj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47571-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47571

--- Comment #28 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-08 09:34:36 UTC ---
(In reply to comment #26)
> Tru64 UNIX doesn't support weak undefined symbols, which seems to be
> what weakrefs are.

Hmm, I think it is going to be difficult. What we want to have:

a) If libc has clock_gettime, use it unconditionally
b) If librt has clock_gettime and weak refs are supported, use it if
   available
c) If librt has it, but no weak refs are supported, don't use it.
d) If it not available at all, don't use it.

(b) and (d) work; also (a) works - albeit with a warning. Now one needs to
support (c). I think the best would be to set (effectively) HAVE_CLOCK_GETTIME
to false.

One possibility would be to replace:

#ifdef HAVE_CLOCK_GETTIME
#  ifdef SUPPORTS_WEAK
     ...
#  else

by

#if define(HAVE_CLOCK_GETTIME) && define(SUPPORTS_WEAK)

That would exclude platforms, where libc supports clock_gettime but which do
not have weak refs. Another possibility is a link-time check which does not
work well for some cross-compilations.

What do you think?


  parent reply	other threads:[~2011-03-08  9:35 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 14:24 [Bug fortran/47571] New: " michael.a.richmond at nasa dot gov
2011-02-01 14:56 ` [Bug fortran/47571] [4.6 Regression] " burnus at gcc dot gnu.org
2011-02-01 15:08 ` jb at gcc dot gnu.org
2011-02-01 15:14 ` jakub at gcc dot gnu.org
2011-02-01 15:27 ` michael.a.richmond at nasa dot gov
2011-02-01 15:30 ` burnus at gcc dot gnu.org
2011-02-01 15:51 ` jb at gcc dot gnu.org
2011-02-01 16:03 ` jb at gcc dot gnu.org
2011-02-01 16:08 ` burnus at gcc dot gnu.org
2011-02-01 16:13 ` jakub at gcc dot gnu.org
2011-02-01 16:19 ` michael.a.richmond at nasa dot gov
2011-02-01 16:20 ` jb at gcc dot gnu.org
2011-02-01 16:27 ` burnus at gcc dot gnu.org
2011-02-01 21:18 ` jb at gcc dot gnu.org
2011-02-01 21:28 ` jb at gcc dot gnu.org
2011-02-02  8:48 ` jb at gcc dot gnu.org
2011-02-03  0:44 ` danglin at gcc dot gnu.org
2011-02-03  7:38 ` burnus at gcc dot gnu.org
2011-02-03  9:54 ` jb at gcc dot gnu.org
2011-02-03 12:48 ` jb at gcc dot gnu.org
2011-02-03 15:33 ` dave at hiauly1 dot hia.nrc.ca
2011-02-04 14:42 ` dave at hiauly1 dot hia.nrc.ca
2011-02-05 16:22 ` jb at gcc dot gnu.org
2011-02-07 18:40 ` jb at gcc dot gnu.org
2011-03-07 14:54 ` ro at gcc dot gnu.org
2011-03-07 14:56 ` jakub at gcc dot gnu.org
2011-03-07 16:08 ` burnus at gcc dot gnu.org
2011-03-07 16:20 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-07 18:00 ` dave at hiauly1 dot hia.nrc.ca
2011-03-08  9:35 ` burnus at gcc dot gnu.org [this message]
2011-03-08 22:39 ` jb at gcc dot gnu.org
2011-03-09  0:10 ` dave at hiauly1 dot hia.nrc.ca
2011-03-11 16:45 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-14 11:34 ` jb at gcc dot gnu.org
2011-03-14 11:42 ` jakub at gcc dot gnu.org
2011-03-14 11:43 ` jb at gcc dot gnu.org
2011-03-14 11:50 ` jb at gcc dot gnu.org
2011-03-14 12:08 ` jakub at gcc dot gnu.org
2011-03-15 16:24 ` [Bug fortran/47571] [4.6/4.7 " ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-15 17:05 ` jb at gcc dot gnu.org
2011-03-15 17:16 ` jakub at gcc dot gnu.org
2011-03-15 17:53 ` jb at gcc dot gnu.org
2011-03-15 20:44 ` jb at gcc dot gnu.org
2011-03-16 12:03 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-17 13:30 ` ro at gcc dot gnu.org
2011-03-17 13:31 ` [Bug fortran/47571] [4.7 " ro at gcc dot gnu.org
2011-03-21 15:05 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-21 17:08 ` jakub at gcc dot gnu.org
2011-03-21 17:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-22 14:18 ` blomqvist.janne at gmail dot com
2011-03-23 13:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-03-25 19:59 ` jakub at gcc dot gnu.org
2011-04-11 20:24 ` jb at gcc dot gnu.org
2011-04-15  4:21 ` jb at gcc dot gnu.org
2011-04-18 11:59 ` burnus at gcc dot gnu.org
2011-04-18 12:09 ` jb at gcc dot gnu.org
2011-04-18 14:10 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-04-18 15:51 ` jb at gcc dot gnu.org
2011-04-18 15:59 ` jb at gcc dot gnu.org
2015-08-31 14:03 ` fxcoudert at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47571-4-NLqQKJ8kKj@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).