[haiku-development] GCC 4.6.2 optional package problem

  • From: Joseph Prostko <joe.prostko@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 8 Oct 2012 15:47:56 -0400

Hello, everyone!

I have been working on creating the GCC 2 and 4 optional packages for
R1A4, and have come upon an issue.  The GCC2 package built just fine,
but the GCC 4.6.2 package simply will not build without me
encountering a segfault/ICE about 40% into the build every time.  I
have tried the process multiple times, and have tried using both the
4.6.2 compiler and the 4.5.3 compiler as well, yet both bomb out with
the same Internal Compiler Error during the process, generally on the
file gcc/c-parser.c.

After trial-and-error (binary searching the buildtools), plus me
stumbling upon this post by Oliver, it became obvious that the
configure option of --enable-frame-pointer introduced in btrev43028 is
causing the issue on x86.

//www.freelists.org/post/haiku-development/The-r1alpha4-branch,62

I used "strings" on the 4.6.2 x86_64 package made by Alex, and it
compiled fine with "--enable-frame-pointer".  On x86 though, it simply
won't build with this option.  In GCC 4.6,"-fomit-frame-pointer" is
turned on by default for -O optimization or higher, so by adding
"--enable-frame-pointer" to configure, basically
"-fno-omit-frame-pointer" is turned on during the build, which is the
pre-4.6 behavior.

For the heck of it, I applied the GCC-provided patches for upgrading
pristine GCC 4.6.2 to GCC 4.6.3 (core and g++) to the sources in our
repository and started a build.  It makes it all the way to the end,
and all seem well after some quick testing.  In other words, I can
make a native GCC 4.6.3 build just fine, but not GCC 4.6.2.

I have tried applying some patches here and there (differences between
4.6.2 and 4.6.3) to try to get it to build, but haven't found what the
culprit is just yet.  By Googling around, I can't seem to find
anything definitive about this regression, so it doesn't seem to be
widespread.  I suppose I can go through the aforementioned patch files
(likely "core") and maybe hunt down the culprit, but I'm not sure that
is a good approach to fix this issue.

I think there are two options, currently:

1.) Compile 4.6.2 without the --enable-frame-pointer option
2.) Make the upgrade to 4.6.3 which apparently overcame this regression

I'm guessing that option 1 will be preferred, seeing as we generally
don't like to make version upgrades this close to a release.

Any opinions?

I did notice that Korli managed to get 4.6.2 to build in the past for
x86 with --enable-frame-pointer, but even when I built older Haiku
revisions (back in 4.5.3 era), I still got the same ICE as I'm getting
currently.  I'm not sure what he did to get it building back then, but
I surely can't build it natively no matter what Haiku revisions I have
tried.

- joe

PS: In the meantime I'll keep trying things on my end, but there's no
guarantees I'll find anything.  We also want to release a week from
now, so time is getting tight, obviously.

Other related posts: