[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 13:16:16 -0400

On Sun, Aug 12, 2012 at 8:04 PM, Joseph Prostko <joe.prostko@xxxxxxxxx> wrote:
> On Sun, Aug 12, 2012 at 7:49 PM, Matt Madia <mattmadia@xxxxxxxxx> wrote:

>> Changing the optimization levels was for FreeBSD 9.0 Release  (i386 generic).

> Really?  I'm downloading PC-BSD 9.1 Beta 1 i386 now, and will play
> around with it tomorrow maybe.  John claimed it didn't work with the
> optimization changes to the Makefile you suggested, so I suppose is
> possible it is something specific to his setup.
>
> I'll report back with what I find.

Okay, I installed PC-BSD 9.1 Beta 1, which also has GCC 4,2,1 20070831
[FreeBSD].  After some experimentation, I found the culprit.
Basically, -fstrict-aliasing is the cause of the segfault.  Changing
the CFLAGS line to "-O3 -fno-strict-aliasing" makes it work fine.
Should we commit that change to apply to all platforms, or check if
it's FreeBSD, and then turn off the strict aliasing optimization in
that case?  I suspect the problem only occurs with this older GCC4
version found on FreeBSD, and the problem may well go away in the
future.

- joe

Other related posts: