After setting STAGE1_CFLAGS=-O0: Index: gcc-4.4.4-r1.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.4.4-r1.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -u -B -r1.1 -r1.2 --- gcc-4.4.4-r1.ebuild 19 Jun 2010 01:53:09 -0000 1.1 +++ gcc-4.4.4-r1.ebuild 28 Jun 2010 11:32:42 -0000 1.2 @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.4.4-r1.ebuild,v 1.1 2010/06/19 01:53:09 zorry Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.4.4-r1.ebuild,v 1.2 2010/06/28 11:32:42 jer Exp $ PATCH_VER="1.0" UCLIBC_VER="1.0" @@ -24,7 +24,7 @@ DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking" LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2" -KEYWORDS="~alpha ~amd64 ~arm -hppa ~ia64 ~mips ~ppc ~ppc64 ~sh -sparc ~x86 ~x86-fbsd" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh -sparc ~x86 ~x86-fbsd" RDEPEND=">=sys-libs/zlib-1.1.4 >=sys-devel/gcc-config-1.4 @@ -86,4 +86,6 @@ ewarn "Graphite support is still experimental and unstable." ewarn "Any bugs resulting from the use of Graphite will not be fixed." fi + + use hppa && STAGE1_CFLAGS="-O0" } =sys-devel/gcc-4.4.4-r1 is behaving quite nicely so far. It should fix a lot of long standing bugs as well.
i would prefer something in toolchain.eclass for the STAGE flags issue. and some real documentation as to why it is being used.
Created attachment 237291 [details, diff] toolchain.eclass patch (In reply to comment #1) > i would prefer something in toolchain.eclass for the STAGE flags issue. Like that? > and some real documentation as to why it is being used. http://marc.info/?l=linux-parisc&m=127566828005125&w=4 and onward.
Index: toolchain.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v retrieving revision 1.434 diff -u -r1.434 toolchain.eclass --- toolchain.eclass 5 Jul 2010 22:25:09 -0000 1.434 +++ toolchain.eclass 7 Jul 2010 17:07:06 -0000 @@ -1482,7 +1482,7 @@ # See bug #79852 STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} else - STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"} + STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O0"} fi if is_crosscompile; then
Maybe not seriously, but it does seem like it would fix a bunch of other problems. Do you remember why we use -O1 in the first place?
(In reply to comment #4) > Maybe not seriously, but it does seem like it would fix a bunch of other > problems. You propose to change it for all arches? I think that's something for gentoo-dev@ - please don't hijack this bug report. :)
Sorry, I didn't mean to hijack anything. I just think this is an example of the kind of bugs we sometimes run into when we don't follow upstream recommendations. Maybe we should take the opportunity to prevent it in the future, for everyone - not just add more workarounds. See also http://gcc.gnu.org/PR13632 http://gcc.gnu.org/PR23158 http://gcc.gnu.org/PR42775
(In reply to comment #6) > Sorry, I didn't mean to hijack anything. I just think this is an example of > the kind of bugs we sometimes run into when we don't follow upstream > recommendations. Maybe we should take the opportunity to prevent it in the > future, for everyone - not just add more workarounds. I agree. Anyone disagree on making the change in the eclass? If not, I'll make that change and I want to have 4.4.4-r1 marked stable.
see bug #283041
May I suggest (you could refer to bug #283041 too, of course): Index: toolchain.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v retrieving revision 1.436 diff -u -B -r1.436 toolchain.eclass --- toolchain.eclass 22 Jul 2010 01:26:33 -0000 1.436 +++ toolchain.eclass 29 Jul 2010 16:36:04 -0000 @@ -1489,7 +1489,8 @@ # See bug #79852 STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} else - STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"} + # See bug #326539 + STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O0"} fi if is_crosscompile; then And when is this going to happen?
I'd rather just not set it at all. http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/toolchain.eclass?r1=1.436&r2=1.437 I'll drop the workaround in 4.4.4-r1.
I'd like to state that the workaround is mandatory. gcc-4.4.4-r1 fails to bootstrap without it ... Can we at least keep it in the ebuild for just this version ?
(In reply to comment #11) > I'd like to state that the workaround is mandatory. > gcc-4.4.4-r1 fails to bootstrap without it ... > > > Can we at least keep it in the ebuild for just this version ? > What he means is that gcc-4.4 only works on hppa if STAGE1_CFLAGS="-O0". At the moment it will use ${CFLAGS}, and if ${CFLAGS} has something different than -O0, it will fail.
Ok, why is it using CFLAGS?
Created attachment 240963 [details] toolchain.eclass.diff Let's go all the way then. Please give this a try.
(In reply to comment #13) > Ok, why is it using CFLAGS? > Ok, i was wrong on my comment :) It doesn't use any CFLAGS at all.
Then we don't need the second patch? Guy, does it actually fail now (have you tried)? Because as far as I can tell the only way it would is if you're building a cross-compiler on an hppa host.
Ok I think I've missunderstood what has been done on this bug. As far as I understand from jer's explanation, now it's not being set at all and thus use gcc's default. I'll give it a try. Please give me some time (a day or two) for testing and I'll back to you.
I've been able to build gcc and rebuild it with itself -> bug fixed ! Thanks
Err gcc isn't stable yet. Reopening.
01 Aug 2010; Ryan Hill <dirtyepic@gentoo.org> gcc-4.4.4-r1.ebuild: Drop hppa STAGE1_CFLAGS hack (bug #326539). It wasn't a hack as such (only if you think toolchain.eclass needed to be fixed instead) and we still need it. What is now in the tree: Index: toolchain.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v retrieving revision 1.437 retrieving revision 1.436 diff -u -B -r1.437 -r1.436 --- toolchain.eclass 1 Aug 2010 03:00:36 -0000 1.437 +++ toolchain.eclass 22 Jul 2010 01:26:33 -0000 1.436 @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.437 2010/08/01 03:00:36 dirtyepic Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.436 2010/07/22 01:26:33 dirtyepic Exp $ # # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> @@ -1488,6 +1488,8 @@ elif [[ $(gcc-version) == "3.4" && ${GCC_BRANCH_VER} == "3.4" ]] && gcc-specs-ssp ; then # See bug #79852 STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} + else + STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"} fi if is_crosscompile; then still breaks on HPPA when someone erroneously sets STAGE1_CFLAGS optimisation to something other than -O0, which we cannot (easily) check (through `emerge --info') and which we probably now need to start warning against in big fat red capitals in the HPPA install guide.
Why would they set STAGE1_CFLAGS in the first place? And how is that different than every other env variable that can mess up their system, or every other arch that setting STAGE1_CFLAGS breaks? We're not going to force STAGE1_CFLAGS, or any other variable that is covered in the upstream install documentation. They're override-able by design. And we're not adding special cases for HPPA. That was the whole point of this exercise. You can always check STAGE1_CFLAGS by looking at the build log.
Never mind.