The current stable GCC (4.4.4-r2) suffers from the following bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43869 (ms_abi -> sysv_abi passing float arguments incorrectly) Quoting the original description by Maarten Lankhorst: > Float arguments are passed incorrectly from a ms_abi function to > a sysv function, as can be witnessed by a simple testcase, which > fails on all optimizations. I don't think this is a regression, > as wine always failed on that testcase. This bug will break wine 64-bits (app-emulation/wine with win64 use flag enabled), as per the wine website (http://wiki.winehq.org/Wine64): > GCC 4.4 is affected by the gcc64 float bug, so compiling with it will > result in some broken code. GCC 4.5.1 should compile Wine correctly. The problem was fixed by upstream on their development trunk and back-ported to the GCC 4.5 branch, but 4.4 is still affected. Since GCC 4.4 is the stable branch on Gentoo, that means wine will be affected as well (and possibly other programs using the ms_abi). I will attach the testcase created by Maarten Lankhorst, as well as his patch that solves the problem. I have confirmed that stable gcc-4.4.4-r2 does fail the testcase on my system (amd64), with or without optimization.
Created attachment 260330 [details] Test case showing the problem $ gcc -o testcase testcase.c $ ./testcase $ echo $? 16 $ gcc --version gcc (Gentoo 4.4.4-r2 p1.2, pie-0.4.5) 4.4.4 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The test case should return 0 for success.
Created attachment 260331 [details, diff] Patch to fix the problem Patch made against upstream GCC trunk, revision 158676. Committed by upstream in revision 159755 with the following message: Author: ktietz Date: Sun May 23 06:52:32 2010 New Revision: 159755 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159755 Log: 2010-05-23 Naarten Lankhorst <mlankhorst@codeweavers.com> PR target/43869 * config/i386/i386.c: Make sure that the correct regparm is passed. Merged by upstream to 4.5 branch in revision 159756.
Forgot to mention... My proposal was for this to be backported into a new gcc-4.4.4-r3 or so, to replace the current stable version of gcc-4.4.4-r2. We shouldn't have stable GCC breaking other stable ebuilds.
Any progress on this? It'd be nice to be able to build wine.
This patch needs to be ported first.
Created attachment 264753 [details, diff] gcc-4.4.5-msabi.patch
http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.5/gentoo/41_all_4.4.5-msabi.patch?rev=1.1&view=markup Added to patchset.
Released in 4.4.5 p1.3.