public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* bootstrap/4037: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)
@ 2001-08-16  5:46 wolfgang.bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: wolfgang.bangerth @ 2001-08-16  5:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4037
>Category:       bootstrap
>Synopsis:       Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 16 05:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
Sun Solaris 2.7
>Description:
When trying to link any program to /opt/SUNWspro/lib/libsunmath.so,
gcc's C++ front end complains as follows:

examples/step-1> cat a.cc
int main () 
{};

examples/step-1> c++ a.cc -L/opt/SUNWspro/lib -lsunmath
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `pow@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `sinh@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `cosh@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `sqrt@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `tan@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `sin@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `cos@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `log@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `log10@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `atan2@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `tanh@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `copysign@SUNW_1.1'
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/../../../libstdc++.so: undefined reference to `exp@SUNW_1.1'
collect2: ld returned 1 exit status

examples/step-1> c++ -v
Reading specs from /home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/specs
Configured with: ../gcc/configure --prefix=/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss --with-gnu-ld --with-gnu-as --with-ld=/usr/local/bin/ld --with-as=/usr/local/bin/as
Thread model: posix
gcc version 3.0.1 20010814 (prerelease)


This used to work previously. libsunmath, by the way, is Sun's
fortran support library, so you need to link that in if you
want to link your C++ code with F77 code that was compiled
using Sun's Workshop f77 compiler.

Regards
  Wolfgang
>How-To-Repeat:
echo "int main () {};" > a.cc
c++ a.cc -L/opt/SUNWspro/lib -lsunmath
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: bootstrap/4037: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)
@ 2002-02-25  8:06 Wolfgang Bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-02-25  8:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR bootstrap/4037; it has been noted by GNATS.

From: Wolfgang Bangerth <wolfgang.bangerth@iwr.uni-heidelberg.de>
To: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: bootstrap/4037: Can't link C++ programs to Sun's libsunmath
 (regression vs. 2.95)
Date: Mon, 25 Feb 2002 16:58:19 +0100 (MET)

 > Synopsis: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: rodrigc
 > State-Changed-When: Sun Feb 24 07:32:10 2002
 > State-Changed-Why:
 >     Those symbols are not defined in libsunmath.so.
 >     
 >     nm libsunmath.so | grep cos
 >     
 >              U __cos 
 >     
 >     They are defined in libm.so, so you need to add:
 >     -libm -libsunmath
 >     
 >     to your link line.
 
 For whatever reason, I did not need to link with libm with gcc2.95. The
 problem has nevertheless gone away somehow, and I can again link as
 previously, i.e. without -lm and everything works. Thanks anyway,
 regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth          email: wolfgang.bangerth@iwr.uni-heidelberg.de
                              www: http://gaia.iwr.uni-heidelberg.de/~wolf
 
 


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

* Re: bootstrap/4037: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)
@ 2002-02-24  7:41 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-24  7:41 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wolfgang.bangerth

Synopsis: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95)

State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 24 07:32:10 2002
State-Changed-Why:
    Those symbols are not defined in libsunmath.so.
    
    nm libsunmath.so | grep cos
    
             U __cos 
    
    They are defined in libm.so, so you need to add:
    -libm -libsunmath
    
    to your link line.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4037


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

end of thread, other threads:[~2002-02-25 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-16  5:46 bootstrap/4037: Can't link C++ programs to Sun's libsunmath (regression vs. 2.95) wolfgang.bangerth
2002-02-24  7:41 rodrigc
2002-02-25  8:06 Wolfgang Bangerth

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