Is libc C99 compliant?
Steve Kargl
sgk at troutmask.apl.washington.edu
Thu Jan 31 16:50:28 UTC 2019
On Thu, Jan 31, 2019 at 09:32:11AM -0700, Warner Losh wrote:
> On Wed, Jan 30, 2019 at 11:33 PM Steve Kargl <
> sgk at troutmask.apl.washington.edu> wrote:
>
> > Should/can TARGET_LIBC_HAS_FUNCTION be updated to at least
> > default_libc_has_function? More importantly now that libm
> > contains sincos[fl], should FreeBSD gcc config file be updated
> > to use
> >
> > bool
> > bsd_libc_has_function (enum function_class fn_class)
> > {
> > if (fn_class == function_c94
> > || fn_class == function_c99_misc
> > || fn_class == function_c99_math_complex
> > || fn_class == function_sincos)
> > return true;
> >
> > return false;
> > }
>
> On its surface, this seems sane to me. what does this control? And is this
> for our ancient 4.2 or current gcc...
>
AFAICT, it controls the use of C99 compliant functions as builtins.
Unfortunately and I should have remembered, FreeBSD's C runtime
libraries (ie libc+libm) are not C99 compliant. The problem (for me)
is that function_c99_math_complex indicates that libm includes
a complete set of C99 complex math function, which of course
it doesn't. Testing with GCC trunk gives
1 default_libc_has_function (C99 compliant libc+libm)
2 no_c99_libc_has_function (FreeBSD current setting)
1 2
=== gcc Summary ===
# of expected passes 134923 134887
# of unexpected failures 171 207 <-- This is good.
# of unexpected successes 27 27
# of expected failures 550 550
# of unresolved testcases 14 14
# of unsupported tests 2222 2222
=== g++ Summary ===
# of expected passes 124009 124009
# of unexpected failures 41 41
# of expected failures 548 548
# of unsupported tests 5585 5585
=== gfortran Summary ===
# of expected passes 48992 48993
# of unexpected failures 2 1 <-- This is bad.
# of expected failures 130 130
# of unsupported tests 88 88
To fix the "This is bad" requires improvements to libm. The one
individual, who spent 15+ years trying to improve libm, was forced
to hand in his commit bit due to the fiasco of jenkins spamming
the -current and -stable mailing lists. Mysteriously, a month or
so after that individual stopped contributed to libm, jenkins
stopped spamming the mailing list.
--
Steve
More information about the freebsd-standards
mailing list