[PATCH] use -fno-pie on darwin in boehm-gc.exp

Jack Howarth howarth@bromo.med.uc.edu
Fri Dec 9 15:04:00 GMT 2011


On Fri, Dec 09, 2011 at 02:09:54PM +0000, Iain Sandoe wrote:
>
> On 8 Dec 2011, at 20:55, Iain Sandoe wrote:
>> ... but, I'll bow out at this juncture -
>
> OK, I lied :-)
>
> The boehm-gc tests pass for m32 and m64 with "-fpie/-fPIE" on both x86  
> Darwin9 (XC3.1.4) and x86_64 Darwin10 (XC3.2.5);
> I'm building with XC3.2.6 to check that too.
>
> So I think you need to debug what is actually failing on Darwin11.
>
> Iain

Iain,
   I did a bit of experimentation with Xcode 4.2 on 10.6.8 and 10.7.2 with the
failing gctest test case.

1) On 10.6.8 using Xcode 4.2 and a previous gcc trunk build, if I do a 'make clean'
in /sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin10.8.0/boehm-gc
after editing the Makefile there to have...

CFLAGS = -g -O2 -Wl,-pie

and then manually rebuild the gctest case with the same flags, it runs fine on darwin10
but segfaults on darwin11. Interestingly, I can get it to run without crashing on darwin11
if I run it within gdb.

2) On 10.7.2 using Xcode 4.2 and a previous gcc trunk build, if I do a 'make clean' in
/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/boehm-gc
after editing the Makefile there to have...

CFLAGS = -g -O2 -mmacosx-version-min=10.6 -Wl,-pie

and then manually rebuild the gctest case with the same flags, the resulting binary still crashes
on darwin11 but runs fine on darwin10. FYI, I also copied libgcjgc.1.dylib from the appropriate
build and set DYLD_LIBRARY_PATH as required in each case.
    I am assuming these observations suggest that we are seeing a new bug in the darwin11 unwinder.
I'll open a radar for this tonight with a standalone test case based on gctest that the darwin
linker developer can walk through the darwin11 unwinder.
            Jack



More information about the Gcc-patches mailing list