[PATCH] Only build libm with -fno-math-errno

Zack Weinberg zackw@panix.com
Sat Dec 22 20:49:00 GMT 2018


On Sat, Dec 22, 2018 at 12:16 PM Aurelien Jarno <aurelien@aurel32.net> wrote:
>
> Commit 1294b1892e ("Add support for sqrt asm redirects") added the
> -fno-math-errno flag to build most of the glibc in order to enable GCC
> to inline math function. This allows GCC to optimize-out saving and
> restoring errno around function calls. In turn this causes strerror to
> set errno value to ENOMEM in case of an invalid error number and memory
> allocation error, which is not allowed by POSIX.

LGTM, except please mention GCC bug #88576 in the commit message.
Hopefully we'll be able to turn -fno-math-errno back on for libc when
that's fixed.

zw



More information about the Libc-alpha mailing list