public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
@ 2004-09-15 18:32 papadopo at shfj dot cea dot fr
  2004-09-15 18:37 ` [Bug libstdc++/17505] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-09-15 18:32 UTC (permalink / raw)
  To: gcc-bugs

Hi,

The following doesn't link on Solaris 8:
	$ cat > foo.cc
	#include <cmath>
	int main() {
	    float f = 0.0;
	    f = std::acos(f);
	}
	$ g++ foo.cc
/tmp/ccEWrnML.o(.gnu.linkonce.t._ZSt4acosf+0xc): In function `std::acos(float)':
: undefined reference to `acosf'
	$ 

While the following does link on the same Solaris 8:
	$ cat > foo.cc
	#include <cmath>
	int main() {
	    float f = 0.0;
	    f = ::acos(f);
	}
	$ g++ foo.cc
	$ 

This looks like a regression, I am able to reproduce the problem with gcc 3.4.2
and 3.4.1, but not gcc 3.3.4.

Maybe it is related to this paragraph in the release notes:
	Many C math library functions are now recognized
	as built-ins and optimized.

-- 
           Summary: <cmath> calls acosf(), ceilf(), and other functions
                    missing from system libraries
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: papadopo at shfj dot cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.8
  GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
@ 2004-09-15 18:37 ` pinskia at gcc dot gnu dot org
  2004-09-15 18:44 ` pcarlini at suse dot de
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-15 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-15 18:37 -------
hmm, something is wrong. libstdc++ should have included that function, why it does not I do not 
know.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
  2004-09-15 18:37 ` [Bug libstdc++/17505] " pinskia at gcc dot gnu dot org
@ 2004-09-15 18:44 ` pcarlini at suse dot de
  2004-09-15 19:33 ` gdr at integrable-solutions dot net
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-09-15 18:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-09-15 18:44 -------
I'm pretty sure it started with this commit:

2003-11-15  Roger Sayle  <roger@eyesopen.com>

	* include/c_std/std_cmath.h: Don't import C99's float transcendentals
	into the __gnu_cxx::__c99_binding namespace.
	(acos, asin, atan, atan2, ceil, cosh, exp, floor, fmod, frexp,
	ldexp, log, log10, modf, pow, sinh, tan, tanh): Implement using
	GCC's math builtins, i.e. __builtin_foo.
	* libmath/stubs.c (acosf, acosl, asinf, asinl, atanf, atanl,
	ceilf, ceill, floorf, floorl, fmodf, fmodl, frexpf, frexpl,
	ldexpf, ldexpl, modff, modfl): Provide stub implementations.

Roger, can you please have a look?
Thanks!

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |roger at eyesopen dot com
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
  2004-09-15 18:37 ` [Bug libstdc++/17505] " pinskia at gcc dot gnu dot org
  2004-09-15 18:44 ` pcarlini at suse dot de
@ 2004-09-15 19:33 ` gdr at integrable-solutions dot net
  2004-10-03  0:20 ` roger at eyesopen dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-09-15 19:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-09-15 19:33 -------
Subject: Re:  <cmath> calls acosf(), ceilf(), and other functions missing from system libraries

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| hmm, something is wrong. libstdc++ should have included that
| function, why it does not I do not know.


It is time for GCC to ship his versions of those functions in libgcc
-- usable by all other front-ends.  Sadly, a patch to that effect is
not appropriate for 3.4.x.

-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (2 preceding siblings ...)
  2004-09-15 19:33 ` gdr at integrable-solutions dot net
@ 2004-10-03  0:20 ` roger at eyesopen dot com
  2004-10-03  6:59 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: roger at eyesopen dot com @ 2004-10-03  0:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger at eyesopen dot com  2004-10-03 00:20 -------
My apologies for taking so long to analyse this problem.  My conclusions are
that this is some strange solaris shared library thing.

Adding "-static" to the command line resolves the problem.  Indeed, so it should
as we provide an implementation of "acosf" in libstdc++-3/libmath/stubs.o
[indeed my patch that added an implementation is mentioned in comment #2].

The problem appears to be weak symbols on Solaris?

nm objdir/sparc-sun-solaris2.8/libstdc++-v3/src/.libs/libstdc++.a | grep acos
         U acos
00000000 T acosf
00000028 T acosl

nm clean/sparc-sun-solaris2.8/libstdc++-v3/src/.libs/libstdc++.so | grep acos
         U acos@@SUNW_1.1
0009b9bc t acosf
0009b9e4 t acosl

So the symbols have global linkage in libstdc++.a but only local linkage in
libstdc++.so.  Does this ring a bell for anyone?


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (3 preceding siblings ...)
  2004-10-03  0:20 ` roger at eyesopen dot com
@ 2004-10-03  6:59 ` ebotcazou at gcc dot gnu dot org
  2004-10-03 18:53 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-10-03  6:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-10-03 06:59 -------
The symbols are properly exported if the compiler was configured to use the Sun
tools.  The symbols are indeed not exported if the compiler was configured to
use the GNU tools.  Declaring them in config/linker-map.gnu might have helped :-)

gax% nm libstdc++.a | grep cosf
00000000 T acosf
000002dc T cosf
gax% nm libstdc++.so | grep cosf
000a24cc t acosf
000a27a8 T cosf


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (4 preceding siblings ...)
  2004-10-03  6:59 ` ebotcazou at gcc dot gnu dot org
@ 2004-10-03 18:53 ` pinskia at gcc dot gnu dot org
  2004-10-04  7:22 ` papadopo at shfj dot cea dot fr
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-03 18:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-03 18:53 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00209.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (5 preceding siblings ...)
  2004-10-03 18:53 ` pinskia at gcc dot gnu dot org
@ 2004-10-04  7:22 ` papadopo at shfj dot cea dot fr
  2004-10-05  2:31 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-10-04  7:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From papadopo at shfj dot cea dot fr  2004-10-04 07:22 -------
Ah right, my compiler is configured to use the GNU tools.

-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (6 preceding siblings ...)
  2004-10-04  7:22 ` papadopo at shfj dot cea dot fr
@ 2004-10-05  2:31 ` cvs-commit at gcc dot gnu dot org
  2004-10-05  2:32 ` [Bug libstdc++/17505] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-05  2:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-05 02:30 -------
Subject: Bug 17505

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2004-10-05 02:30:49

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/config: linker-map.gnu 

Log message:
	PR libstdc++/17505
	* config/linker-map.gnu: Synchronize the current list of stub
	functions from libmath.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2680&r2=1.2681
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/linker-map.gnu.diff?cvsroot=gcc&r1=1.70&r2=1.71



-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] [3.4 Regression] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (7 preceding siblings ...)
  2004-10-05  2:31 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-05  2:32 ` pinskia at gcc dot gnu dot org
  2004-10-05  5:42 ` cvs-commit at gcc dot gnu dot org
  2004-10-05 11:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-05  2:32 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|<cmath> calls acosf(),      |[3.4 Regression] <cmath>
                   |ceilf(), and other functions|calls acosf(), ceilf(), and
                   |missing from system         |other functions missing from
                   |libraries                   |system libraries
   Target Milestone|---                         |3.4.3


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] [3.4 Regression] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (8 preceding siblings ...)
  2004-10-05  2:32 ` [Bug libstdc++/17505] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2004-10-05  5:42 ` cvs-commit at gcc dot gnu dot org
  2004-10-05 11:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-05  5:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-05 05:42 -------
Subject: Bug 17505

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	sayle@gcc.gnu.org	2004-10-05 05:42:33

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/config: linker-map.gnu 

Log message:
	PR libstdc++/17505
	* config/linker-map.gnu: Synchronize the current list of stub
	functions from libmath.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.183&r2=1.2224.2.184
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/linker-map.gnu.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.52.4.10&r2=1.52.4.11



-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/17505] [3.4 Regression] <cmath> calls acosf(), ceilf(), and other functions missing from system libraries
  2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
                   ` (9 preceding siblings ...)
  2004-10-05  5:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-05 11:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-05 11:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-05 11:24 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-10-05 11:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 18:32 [Bug c++/17505] New: <cmath> calls acosf(), ceilf(), and other functions missing from system libraries papadopo at shfj dot cea dot fr
2004-09-15 18:37 ` [Bug libstdc++/17505] " pinskia at gcc dot gnu dot org
2004-09-15 18:44 ` pcarlini at suse dot de
2004-09-15 19:33 ` gdr at integrable-solutions dot net
2004-10-03  0:20 ` roger at eyesopen dot com
2004-10-03  6:59 ` ebotcazou at gcc dot gnu dot org
2004-10-03 18:53 ` pinskia at gcc dot gnu dot org
2004-10-04  7:22 ` papadopo at shfj dot cea dot fr
2004-10-05  2:31 ` cvs-commit at gcc dot gnu dot org
2004-10-05  2:32 ` [Bug libstdc++/17505] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-10-05  5:42 ` cvs-commit at gcc dot gnu dot org
2004-10-05 11:24 ` pinskia at gcc dot gnu dot org

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).