public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-10-11 7:26 ehrhardt
0 siblings, 0 replies; 9+ messages in thread
From: ehrhardt @ 2002-10-11 7:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 8197
>Category: libstdc++
>Synopsis: std::sin(float) causes undefined reference to sinf
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 11 07:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Christian Ehrhardt
>Release: gcc-3.2
>Organization:
>Environment:
Sun sparc Solaris 9, GNU-ld 2.13+elf patch from cvs
gcc passed all but a few test from make check
>Description:
Compiling a very simple Program using std::sin(float)
causes linker errors (undefined reference to sinf).
See below for details.
>How-To-Repeat:
theseus$ cat m.cc
#include <cmath>
int main () {
float a; std::sin(a);
}
theseus$ g++ -Wall m.cc
/tmp/ccOiTTC3.o: In function `std::sin(float)':
/tmp/ccOiTTC3.o(.gnu.linkonce.t._ZSt3sinf+0xc): undefined reference to `sinf'
collect2: ld returned 1 exit status
theseus$
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-11-05 8:10 bkoz
0 siblings, 0 replies; 9+ messages in thread
From: bkoz @ 2002-11-05 8:10 UTC (permalink / raw)
To: bkoz, ehrhardt, gcc-bugs, gcc-prs
Synopsis: std::sin(float) causes undefined reference to sinf
State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Tue Nov 5 08:10:59 2002
State-Changed-Why:
Fixed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8197
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-11-04 17:16 B. Kosnik
0 siblings, 0 replies; 9+ messages in thread
From: B. Kosnik @ 2002-11-04 17:16 UTC (permalink / raw)
To: bkoz; +Cc: gcc-prs
The following reply was made to PR libstdc++/8197; it has been noted by GNATS.
From: "B. Kosnik" <bkoz@nabi.net>
To: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
Cc: bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Mon, 4 Nov 2002 19:11:18 -0600
>Thanks. I checked out latest CVS last night and this problem is fixed in
>gcc version 3.3 20021101 (experimental). Technically this is a regression
>from 2.95.3. __builtin_sinf didn't work there, either but the cmath
>header didn't use __builtin_sinf.
this is on the branch now. thanks for your help
-benjamin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-11-02 8:26 Christian Ehrhardt
0 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2002-11-02 8:26 UTC (permalink / raw)
To: bkoz; +Cc: gcc-prs
The following reply was made to PR libstdc++/8197; it has been noted by GNATS.
From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Sat, 2 Nov 2002 17:23:31 +0100
On Fri, Nov 01, 2002 at 05:44:03PM -0000, bkoz@gcc.gnu.org wrote:
> Synopsis: std::sin(float) causes undefined reference to sinf
>
> Responsible-Changed-From-To: unassigned->bkoz
> Responsible-Changed-By: bkoz
> Responsible-Changed-When: Fri Nov 1 09:44:03 2002
> Responsible-Changed-Why:
> Mine.
> State-Changed-From-To: open->feedback
> State-Changed-By: bkoz
> State-Changed-When: Fri Nov 1 09:44:03 2002
> State-Changed-Why:
> Applied (slightly modified) patch.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8197
Thanks. I checked out latest CVS last night and this problem is fixed in
gcc version 3.3 20021101 (experimental). Technically this is a regression
from 2.95.3. __builtin_sinf didn't work there, either but the cmath
header didn't use __builtin_sinf.
regards Christian
--
THAT'S ALL FOLKS!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-11-01 9:44 bkoz
0 siblings, 0 replies; 9+ messages in thread
From: bkoz @ 2002-11-01 9:44 UTC (permalink / raw)
To: bkoz, ehrhardt, gcc-bugs, gcc-prs, nobody
Synopsis: std::sin(float) causes undefined reference to sinf
Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Fri Nov 1 09:44:03 2002
Responsible-Changed-Why:
Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Fri Nov 1 09:44:03 2002
State-Changed-Why:
Applied (slightly modified) patch.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8197
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-10-28 10:26 Benjamin Kosnik
0 siblings, 0 replies; 9+ messages in thread
From: Benjamin Kosnik @ 2002-10-28 10:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/8197; it has been noted by GNATS.
From: Benjamin Kosnik <bkoz@redhat.com>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: ehrhardt@mathematik.uni-ulm.de, gcc-gnats@gcc.gnu.org,
libstdc++@gcc.gnu.org
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Mon, 28 Oct 2002 10:21:41 -0800
>| 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:
Phil answered this.
There is no reason not to export this, or add new symbols to export in a
new interface (GLIBCPP_3.2.1). You might try editing config/link-map.gnu.
-benjamin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-10-27 14:36 Phil Edwards
0 siblings, 0 replies; 9+ messages in thread
From: Phil Edwards @ 2002-10-27 14:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/8197; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>, gcc-gnats@gcc.gnu.org,
libstdc++@gcc.gnu.org
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: Sun, 27 Oct 2002 17:34:02 -0500
Answering because I happen to have just checked my mail:
On Sun, Oct 27, 2002 at 11:41:47PM +0100, Gabriel Dos Reis wrote:
> Do we have infrastructure to export symbols based on target
> configurations?
We need to, but we don't yet.
> If not, does telling linker-map.gnu to export
> non-existing symbols an error?
No, it's no problem. See for example the multiple entries for size_t:
only one of them will actually be used, depending on the architecture.
> If not, is it documented to work as
> "expected"?
Probably not documented, but anything marked as exported that doesn't
exist in the final library is just ignored. That is, the symbols may
be exported, but they aren't expected. :-)
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-10-27 13:46 Gabriel Dos Reis
0 siblings, 0 replies; 9+ messages in thread
From: Gabriel Dos Reis @ 2002-10-27 13:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/8197; it has been noted by GNATS.
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
Cc: gcc-gnats@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
Date: 27 Oct 2002 23:41:47 +0100
"Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de> writes:
| I got some more information on this one and a patch that fixes the
| problem for me:
Thanks for reporting more info on this issue.
[...]
| 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:
Benjamin,
Do we have infrastructure to export symbols based on target
configurations? If not, does telling linker-map.gnu to export
non-existing symbols an error? If not, is it documented to work as
"expected"?
Thanks,
-- Gaby
PS: I just realized I asked more questions that could provide any hints.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf
@ 2002-10-26 6:46 Christian Ehrhardt
0 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2002-10-26 6:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
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!
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-11-05 16:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 7:26 libstdc++/8197: std::sin(float) causes undefined reference to sinf ehrhardt
2002-10-26 6:46 Christian Ehrhardt
2002-10-27 13:46 Gabriel Dos Reis
2002-10-27 14:36 Phil Edwards
2002-10-28 10:26 Benjamin Kosnik
2002-11-01 9:44 bkoz
2002-11-02 8:26 Christian Ehrhardt
2002-11-04 17:16 B. Kosnik
2002-11-05 8:10 bkoz
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).