Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 155906 - ebuild of sys-libs/glibc forces -O2 which leads to strict aliasing troubles
Summary: ebuild of sys-libs/glibc forces -O2 which leads to strict aliasing troubles
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High trivial
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-21 18:21 UTC by alfwue
Modified: 2006-11-29 10:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alfwue 2006-11-21 18:21:36 UTC
The ebuild of glibc-2.4-r4 forces -O2 in CFLAGS, which leads to warnings like
"Derefencing type-punned pointer will break strict-aliasing rules"

If there realy is a need for forcing a minimum optimization of -O2, appending -fno-strict-aliasing to "ALLOWED_FLAGS" and as the last flag to the generated CFLAGS should stop the warnings.
Comment 1 SpanKY gentoo-dev 2006-11-26 08:24:29 UTC
these versions now force -fno-strict-aliasing globally (SuSE does this already for example) ... i'll put together a patch for glibc-2.5 that only uses -fno-strict-aliasing on the files actually affected ...
glibc-2.3.6-r5
glibc-2.4-r4
glibc-2.5
Comment 2 alfwue 2006-11-29 10:06:10 UTC
(In reply to comment #1)
I have just installed 2.4, thanks. 

Just one note: 
according to info gcc, a warning does mean, that gcc knows that those rules are or might be broken. No warning just means, that gcc doesn't know at all. 
So the only save way to use -fstrict-aliasing is that one is aware of those rules(gcc doesn't document them) and actually knows for every single line of source code, that they are not broken. I think, no one can be sure at all for ebuilds like glibc. They are far to big. So a general use of -fno-strict-aliasing is the only save way.