libm error handling

Rich Felker dalias@aerifal.cx
Tue Apr 30 22:12:00 GMT 2013


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



More information about the Libc-alpha mailing list