Improving math function wrappers
Joseph Myers
joseph@codesourcery.com
Tue Apr 4 17:34:00 GMT 2017
On Tue, 4 Apr 2017, Szabolcs Nagy wrote:
> > Compilers for non-C languages without the concept of these functions
> > setting errno can of course default to -fno-math-errno by default (and
> > built-in no-errno functions that can be used with -fmath-errno is
> > otherwise enabled would also be desirable for fma, sqrt, etc.).
>
> then fortran can only use no-errno functions
> when those can be inlined, since extern calls
> use the standard libc symbols which set errno
> in glibc.
No, you should think of the implementation as a whole. The Fortran
compiler can know about what functions outside the standard are available
in the C libm, and so generate calls to such nonstandard functions where
appropriate. That can either be hardcoded information about functions in
particular glibc versions, or a system (e.g. file in the sysroot read by
the compiler) for glibc to communicate such information to the Fortran
compiler.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list