From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13307 invoked by alias); 26 Oct 2002 13:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13254 invoked by uid 71); 26 Oct 2002 13:46:01 -0000 Date: Sat, 26 Oct 2002 06:46:00 -0000 Message-ID: <20021026134601.13240.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Christian Ehrhardt" Subject: Re: libstdc++/8197: std::sin(float) causes undefined reference to sinf Reply-To: "Christian Ehrhardt" X-SW-Source: 2002-10/txt/msg01079.txt.bz2 List-Id: The following reply was made to PR libstdc++/8197; it has been noted by GNATS. From: "Christian Ehrhardt" 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!