This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: libm error handling
- From: Rich Felker <dalias at aerifal dot cx>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 30 Apr 2013 14:15:44 -0400
- Subject: Re: libm error handling
- References: <Pine dot LNX dot 4 dot 64 dot 1304301628510 dot 21969 at digraph dot polyomino dot org dot uk>
I'm glad to see an effort to clean up this historical mess.
On Tue, Apr 30, 2013 at 04:30:43PM +0000, Joseph S. Myers wrote:
> As far as I can tell, POSIX only reserves the identifier signgam
> with external linkage when math.h is included with _XOPEN_SOURCE
> defined appropriately to enable XSI extensions, not otherwise (there
> is a long list of symbols with external linkage that are always
> reserved, and it does not include signgam). So I think the
> following should work for a fix: the lgamma symbol versions
> presently in use are made into compat symbol versions, for existing
> binaries where lgamma is expected to set signgam (except for
> _ISOC_). The new version of the lgamma symbol does not set signgam,
> while a separate __lgamma_xsi function is defined that does set
> signgam, and is used when math.h is included with appropriate
> feature test macros defined.
This should not be necessary. signgam should simply be a weak alias
for __signgam or similar, and lgamma should only write to __signgam.
However, some serious black magic may be needed with symbol versioning
to keep old binaries happy...
Rich