You may aware or not that there is a nice optimization (more effective
if you have some registers to spare) based on how you access memory
thought variables. Since it wasn't that effective and didn't break
anything it is enabled since -O2.

Problem: recent gcc are doing some quite smart tricks with aliasing and
as result they will break in subtle way your code if you use
strict-aliasing rules optimization on type puns.

Quick solution: enforce -fno-strict-aliasing as global cflag.

Side effect: you may lose a bit in performance, but better safe than
sorry: the first package showing issues was openssl[1] mismatching
hashes, guess how discovered that and how (hint: ssh was refusing logins...)

Long term solution:
1- check your new package for aliasing compliance, and if you have time
fix it in the code or in the makefile, if you haven't append
-fno-strict-aliasing to the cflags and maybe send a notice about it upstream

2- append -fno-strict-aliasing to every source known to have such issue.

I'll do 2 on all packages in the tree showing the issue if you think is
ok, arches not yet affected will be in the future.

lu

[1]http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14725


-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero

-- 
gentoo-dev@gentoo.org mailing list

Reply via email to