public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Sat, 26 Oct 2002 06:46:00 -0000	[thread overview]
Message-ID: <20021026134601.13240.qmail@sources.redhat.com> (raw)

The following reply was made to PR libstdc++/8197; it has been noted by GNATS.

From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
  nobody@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Sat, 26 Oct 2002 15:40:00 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8197
 
 Hi,
 
 I got some more information on this one and a patch that fixes the
 problem for me:
 
 std::sin(float)   fails
 std::sin(double)  works
 ::sin(float)      works
 std::sin(float) and Linking against libstc++.a works
 
 The problem seems to be that std::sin(float) is an inline function defined in
 cmath. This inline function uses __builtin_sinf which in turn generates
 a reference to a function sinf.
 This function even exists and is exported from stubs.o:
 
 turing# nm sparc-sun-solaris2.9/libstdc++-v3/libmath/stubs.o  |grep sinf
 00000714 T sinf
 
 However, in libstdc++.so the symbol sinf is private:
 
 turing# nm sparc-sun-solaris2.9/libstdc++-v3/src/.libs/libstdc++.so  |grep sinf
 00050c78 t sinf
 
 This is caused by using linker-map.gnu instead of the dummy linker map file.
 This patch fixes the problem for me. I'm fully aware that this is
 probably not the correct way to fix this but determining the correct way
 is currently beyond me:
 
 --- gcc-3.2/libstdc++-v3/config/linker-map.gnu.orig	Fri Oct 25 17:26:02 2002
 +++ gcc-3.2/libstdc++-v3/config/linker-map.gnu	Fri Oct 25 17:26:02 2002
 @@ -108,6 +108,40 @@
      # __gnu_cxx::_verbose_terminate_handler()
      _ZN9__gnu_cxx27__verbose_terminate_handlerEv;
  
 +    # stub functions from libmath
 +    sinf;
 +    sinl;
 +    sinhf;
 +    sinhl;
 +    cosf;
 +    cosl;
 +    coshf;
 +    coshl;
 +    tanf;
 +    tanl;
 +    tanhf;
 +    tanhl;
 +    atan2f;
 +    atan2l;
 +    expf;
 +    expl;
 +    hypotf;
 +    hypotl;
 +    hypot;
 +    logf;
 +    logl;
 +    log10f;
 +    log10l;
 +    powf;
 +    powl;
 +    sqrtf;
 +    sqrtl;
 +    copysignf;
 +    nan;
 +    __signbit;
 +    __signbitf;
 +    __signbitl;
 +
    local:
      *;
  };
 
 While we're at it: There is one more symbol, namely __new_handler that
 might have a similar problem. Should this be visible outside of
 libstdc++.so?
 
    regards  Christian
 
 -- 
 THAT'S ALL FOLKS!


             reply	other threads:[~2002-10-26 13:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-26  6:46 Christian Ehrhardt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-05  8:10 bkoz
2002-11-04 17:16 B. Kosnik
2002-11-02  8:26 Christian Ehrhardt
2002-11-01  9:44 bkoz
2002-10-28 10:26 Benjamin Kosnik
2002-10-27 14:36 Phil Edwards
2002-10-27 13:46 Gabriel Dos Reis
2002-10-11  7:26 ehrhardt

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=20021026134601.13240.qmail@sources.redhat.com \
    --to=ehrhardt@mathematik.uni-ulm.de \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).