public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/988] New: Cannot override libm's tan() while static linking
@ 2005-05-31 22:47 bergner at vnet dot ibm dot com
  2005-06-09 21:33 ` [Bug math/988] " bergner at vnet dot ibm dot com
  0 siblings, 1 reply; 2+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-05-31 22:47 UTC (permalink / raw)
  To: glibc-bugs

While compiling a simple test case that overrides libm's tan() (but not tanl()),
I get the linker error "multiple definition of tan" when static linking.  This
fails for both powerpc-linux and powerpc64-linux apps.

linux% cat tan.c 
double tan(double d) {return d;}
extern long double tanl(long double);

int main (void)
{
    return (int)tan(1.0) + (int)tanl((long double)1.0);
}

linux% gcc -static tan.c -lm
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib/libm.a(s_tan.o)(.text+0x48):
In function `tan':
../sysdeps/ieee754/dbl-64/s_tan.c:45: multiple definition of `tan'
/tmp/cczeeiYk.o(.text+0x0): first defined here
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../powerpc-suse-linux/bin/ld:
Warning: size of symbol `tan' changed from 40 in /tmp/cczeeiYk.o to 17444 in
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib/libm.a(s_tan.o)
collect2: ld returned 1 exit status

This seems to be a problem with tan not being a weak alias to __tan similar to
the other math routines.  A similar problem also afflicts atan/atanl.

This does work on x86-linux, where tan is a weak alias to __tan.

-- 
           Summary: Cannot override libm's tan() while static linking
           Product: glibc
           Version: 2.3.3
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: bergner at vnet dot ibm dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: powerpc-linux
  GCC host triplet: powerpc-linux
GCC target triplet: powerpc-linux


http://sources.redhat.com/bugzilla/show_bug.cgi?id=988

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/988] Cannot override libm's tan() while static linking
  2005-05-31 22:47 [Bug math/988] New: Cannot override libm's tan() while static linking bergner at vnet dot ibm dot com
@ 2005-06-09 21:33 ` bergner at vnet dot ibm dot com
  0 siblings, 0 replies; 2+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-06-09 21:33 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bergner at vnet dot ibm dot com  2005-06-09 21:33 -------
Must have hit the submit button one too many times.  Closing as a dup of 987.

*** This bug has been marked as a duplicate of 987 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://sources.redhat.com/bugzilla/show_bug.cgi?id=988

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2005-06-09 21:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-31 22:47 [Bug math/988] New: Cannot override libm's tan() while static linking bergner at vnet dot ibm dot com
2005-06-09 21:33 ` [Bug math/988] " bergner at vnet dot ibm dot com

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