Bug 740235 - `Optimized lrint and llrint for x86-64' breaks compilation with -D_GNU_SOURCE -std=c89 -O1
Summary: `Optimized lrint and llrint for x86-64' breaks compilation with -D_GNU_SOURCE...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 740886 (view as bug list)
Depends On:
Blocks: 730465
TreeView+ depends on / blocked
 
Reported: 2011-09-21 11:46 UTC by Petr Pisar
Modified: 2016-11-24 15:43 UTC (History)
13 users (show)

Fixed In Version: glibc-2.14.90-10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-02 18:13:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 520209 0 medium CLOSED Problem with math.h header in glibc-2.10.90-17 2021-02-22 00:41:40 UTC
Sourceware 13202 0 None None None Never

Description Petr Pisar 2011-09-21 11:46:32 UTC
While compiling perl in F17 I get following compiler error:

          CCCMD =  gcc -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -Wwrite-strings 
In file included from /usr/include/math.h:416:0,
                 from perl.h:3984,
                 from miniperlmain.c:40:
/usr/include/bits/mathinline.h: In function ‘lrintf’:
/usr/include/bits/mathinline.h:76:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘lrint’:
/usr/include/bits/mathinline.h:85:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘llrintf’:
/usr/include/bits/mathinline.h:94:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘llrint’:
/usr/include/bits/mathinline.h:101:26: error: expected ‘)’ before ‘:’ token


This exhibits since glibc-2.14.90-9.x86_64. Minimal reproducer is

$ cat test.c 
#include <math.h>
$ gcc -D_GNU_SOURCE -std=c89 -O1 -c test.c 
In file included from /usr/include/math.h:416:0,
                 from test.c:1:
/usr/include/bits/mathinline.h: In function ‘lrintf’:
/usr/include/bits/mathinline.h:76:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘lrint’:
/usr/include/bits/mathinline.h:85:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘llrintf’:
/usr/include/bits/mathinline.h:94:26: error: expected ‘)’ before ‘:’ token
/usr/include/bits/mathinline.h: In function ‘llrint’:
/usr/include/bits/mathinline.h:101:26: error: expected ‘)’ before ‘:’ token

on x86_64

Comment 1 Dominik 'Rathann' Mierzejewski 2011-09-23 19:47:16 UTC
*** Bug 740886 has been marked as a duplicate of this bug. ***

Comment 2 Dominik 'Rathann' Mierzejewski 2011-09-23 19:48:24 UTC
This happens on F-16, too and with -std=c99 as well (see that duplicate bug above).

Comment 3 Jason D. Clinton 2011-09-26 02:12:01 UTC
This is breaking the build of pycairo and pygobject.

Comment 4 nucleo 2011-09-27 16:27:58 UTC
I am not able to build digikam in Rawhide.
Can glibc-2.14.90-9 be untagged from f17 and f16-updates-testing until fix for this bug will be available?

Comment 5 Benjamin Bellec 2011-09-27 16:31:17 UTC
Same problem while compiling mesa.

Comment 6 Tom "spot" Callaway 2011-09-27 19:49:26 UTC
http://sources.redhat.com/bugzilla/show_bug.cgi?id=13202 is the upstream bug. H.J. says how to fix it, and it appears Andreas applied that fix into git for this 31 hours ago:

http://sourceware.org/git/?p=glibc.git;a=commit;h=bf972c9dfcda9f95e337c6d4586abcc3bdf46561

Hopefully a new glibc package is coming soon. I'm doing a glibc scratch build now to work around this temporarily in order to get chromium building again.

Comment 7 Tom "spot" Callaway 2011-09-27 21:18:23 UTC
Glibc scratch build with patch applied:
http://koji.fedoraproject.org/koji/taskinfo?taskID=3383250

Comment 8 Kevin Kofler 2011-09-28 00:54:56 UTC
Can the fix please be pushed to f17 and f16-override (i.e. a buildroot override for F16) ASAP? kdelibs fails due to failing CMake configury checks for math functions, which I guess are also due to this bug. Lots of stuff is failing to build. Why is such a showstopper open for a whole week?

Comment 9 Kevin Kofler 2011-09-28 00:59:25 UTC
I also suspect stuff might silently fall back to reduced or broken mathematical functionality due to such failing checks. In kdelibs, isnan doesn't get detected, which results in the KJS code trying to use _isnan from float.h, but our float.h has no such function. If it were trying to use some other bad stuff (e.g. the third alternative, which KJS would use if there's also no float.h and which is an !(a==a) comparison – is that a valid isnan in Fedora?), we wouldn't even notice the breakage. So I think we should treat ALL builds built with that glibc in the buildroot as poisoned.

Comment 10 Kevin Kofler 2011-09-28 01:06:54 UTC
> This happens on F-16, too

Only in updates-testing, which, thankfully, is NOT used to build Fedora packages. The offending package is NOT in the f16-build buildroot, which still has glibc-2.14.90-8. So a buildroot override is not needed as long as we don't let this broken build go out to stable.

But the Rawhide buildroot is affected.

Comment 11 Kevin Kofler 2011-09-28 01:09:34 UTC
And now I downkarma'd this glibc out of F16 updates-testing.

Comment 12 Mark McLoughlin 2011-09-28 11:16:14 UTC
Same problem compiling pycrypto. Downgrade to glibc-2.14.90-8.x86_64 and it works

Comment 13 Fedora Update System 2011-09-28 14:01:44 UTC
glibc-2.14.90-10 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/FEDORA-2011-12845

Comment 14 nucleo 2011-09-28 14:40:32 UTC
So is needed rebuild of packages built with glibc-2.14.90-9?

Comment 15 Tom "spot" Callaway 2011-09-28 15:03:44 UTC
(In reply to comment #14)
> So is needed rebuild of packages built with glibc-2.14.90-9?

Only in cases where a build in rawhide happened on a package that has a "fallback" mode if a math function is not found in glibc (this bug was causing any test of math functions to error out and fail, the same behavior that you'd see if the specific function was missing entirely). While these cases are probably not fatal, it does mean that the performance is not ideal.

It would be interesting to see a list of packages built against glibc-2.14.90-9, and probably not a bad idea to just rebuild them all against -10.

Comment 16 Fedora Update System 2011-09-28 18:52:37 UTC
Package glibc-2.14.90-10:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14.90-10'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.14.90-10
then log in and leave karma (feedback).

Comment 17 Fedora Update System 2011-10-02 18:12:57 UTC
glibc-2.14.90-10 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.