[haiku-development] Re: Segmentation fault building jam on FreeBSD 9.0

  • From: Joseph Prostko <joe.prostko@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 13 Aug 2012 16:02:16 -0400

On Mon, Aug 13, 2012 at 3:20 PM, Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Mon, Aug 13, 2012 at 3:17 PM, John Scipione <jscipione@xxxxxxxxx> wrote:
>> Building jam is not a problem on OS X which also uses GCC 4.2.1. I
>> suppose the Apple forked gcc might have backported this particular
>> strict aliasing fix. Is this problem new to FreeBSD 9.0 or was it also
>> a problem on 8.x?

Yes, it's possible that Apple did backport the fix, as from the
reading I did, the GCC folks had no interest in applying the fix to
4.2.x for whatever reason at the time.  As such, it's highly likely
the FreeBSD guys just ended up with the GCC build with the regression
still in it.

> It's not a new problem.

Yeah, I recall asking Rene about this a long time ago when I first
started playing around with FreeBSD.  I think I was using 8.2 back
then, but regardless, it has been a problem for quite some time.  I
think I just resorted to the "jamming" method instead of using gmake,
as that was convenient at the time.  I don't think I experimented with
playing with optimization changes back then, quite honestly.  Now that
it's confirmed that " -fno-strict-aliasing" being added to the CFLAGS
line will fix the issue, I think that's the best way to handle this
particular issue.  Another option would be changing the -O3 to -O (aka
-O1), but doing that you would lose 30 optimizations from -O2 and -O3,
compared to just one optimization.

We actually disable strict aliasing (and value range propagation) in
our BulidSetup <http://cgit.haiku-os.org/haiku/tree/build/jam/BuildSetup#n128>
for what are other reasons, but seeing that currently all of Haiku is
built without strict aliasing for GCC4, I think just universally
turning off the strict aliasing optimization for building jam is more
than acceptable.

I can't push the change myself until probably tomorrow sometime, as
I'm away from a computer with Linux or BSD, but if anybody else wants
to make the quick change, feel free.

- joe

Other related posts: