[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gl_MATHFUNC broken with gcc -O1 -flto
From: |
Tiziano Müller |
Subject: |
gl_MATHFUNC broken with gcc -O1 -flto |
Date: |
Mon, 25 Jan 2016 12:51:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
Hi everyone
When trying to build gettext-tools with LTO enabled and at least -O1 I
encountered that gl_MATHFUNC (from mathfunc.m4) returns that 'pow' can
be used without having to link to libm (and therefore all other math
functions as well). Unfortunately this is only true for certain cases,
but the way log10 is used in the portions of gnulib embedded in
gettext-tools is not one of them, resulting in a "undefined reference"
during linkage.
As it seems, the log10 usability test (log10.m4) gets it right: by
defining at least one variable as volatile the compiler won't use any
builtin functions for this test and correctly throw an error "undefined
reference".
Another option would be to add -fno-builtin to CFLAGS for this test, but
I have no idea how portable that would be.
Best regards,
Tiziano
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gl_MATHFUNC broken with gcc -O1 -flto,
Tiziano Müller <=