QT ebuild throws out $CFLAGS and uses -O2. There is absolutely no problem with using opt. cflags when building QT. Have done it manually for ages. Need to have ebuild modify the makefile to replace -O2 with $CFLAGS before the make.
*** Bug 13213 has been marked as a duplicate of this bug. ***
Created attachment 7014 [details, diff] Patch for qt-3.1.1.ebuild This patch fixes the problem in the qt-3.1.1 ebuild. It is very easy to put this in other ebuilds, though. The problem is that the qt build system (qmake) only uses the flags set in qmake.conf. This patch edits qmake.conf to put in the user's CFLAGS. This patch does not break the alpha fix right above it.
I've tried this before in the qt 3.0x, gcc 3.1 era and had all kinds of wierd problems. Therefore I abandoned this line of work then. I agree that it's time to try again, but it will have to wait 1) for the current freeze to end and 2) for me to come back to heavy-duty Gentoo work (Jan 24th). And even then it'll have low-sih piority. But I do intend to work on it at some point. Because of the nature of the problems I had last time (ex: OOM when compiling on some PPCs, and other bugs that only show up in similarly rare configurations), I'll want to test this very thoroughly before putting it even in ~. Cf. bug #1571 for one of the previous attempts to get this to work.
Well, about time we tested this again... Added a masked qt-3.1.2-r2 ebuild with this patch that does this. You can test at will.
Patch has been applied, in 3.1.2-r2 and -r3. Seems to work well so far.
*** Bug 23029 has been marked as a duplicate of this bug. ***
This bug is now closed for some time, but qt-3.1.2-r4 still doesn't respect CFLAGS. What's the (real) status of this bug?