Message ID | 20111203152523.GA9331@bromo.med.uc.edu |
---|---|
State | New |
Headers | show |
On Dec 3, 2011, at 7:25 AM, Jack Howarth wrote: > FSF gcc currently doesn't handle -fno-pie and friends properly under Lion. > The darwin11 linker now defaults to -pie > Okay for gcc trunk and backports to gcc-4_5-branch/gcc-4_6-branch? Ok.
On Sat, Dec 03, 2011 at 10:45:18PM -0800, Mike Stump wrote: > On Dec 3, 2011, at 7:25 AM, Jack Howarth wrote: > > FSF gcc currently doesn't handle -fno-pie and friends properly under Lion. > > The darwin11 linker now defaults to -pie > > > Okay for gcc trunk and backports to gcc-4_5-branch/gcc-4_6-branch? > > Ok. Mike, Thanks for the commit. This leaves us with the boehm-gc testsuite failures... FAIL: boehm-gc.c/gctest.c -O2 execution test FAIL: boehm-gc.c/leak_test.c -O2 execution test FAIL: boehm-gc.c/thread_leak_test.c -O2 execution test FAIL: boehm-gc.lib/staticrootstest.c -O2 execution test at -m32/-m64 on x86_64-apple-darwin11 due to the -pie linker default. Iain had wanted to leave these in place to encourage boehm-gc to be fixed but I doubt that is a realistic goal in the near/middle term. Perhaps we could patch boehm-gc/testsuite/lib/boehm-gc.exp to pass -fno-pie on darwin (now that it is functional)? Jack
On Dec 4, 2011, at 9:09 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote: > On Sat, Dec 03, 2011 at 10:45:18PM -0800, Mike Stump wrote: >> On Dec 3, 2011, at 7:25 AM, Jack Howarth wrote: >>> FSF gcc currently doesn't handle -fno-pie and friends properly under Lion. >>> The darwin11 linker now defaults to -pie >> >>> Okay for gcc trunk and backports to gcc-4_5-branch/gcc-4_6-branch? >> >> Ok. > > Mike, > Thanks for the commit. This leaves us with the boehm-gc testsuite failures... > > FAIL: boehm-gc.c/gctest.c -O2 execution test > FAIL: boehm-gc.c/leak_test.c -O2 execution test > FAIL: boehm-gc.c/thread_leak_test.c -O2 execution test > FAIL: boehm-gc.lib/staticrootstest.c -O2 execution test > > at -m32/-m64 on x86_64-apple-darwin11 due to the -pie linker default. Iain had wanted > to leave these in place to encourage boehm-gc to be fixed but I doubt that is a realistic > goal in the near/middle term. Perhaps we could patch boehm-gc/testsuite/lib/boehm-gc.exp > to pass -fno-pie on darwin (now that it is functional)? I think we should just find a way to add -fno-pie... Are there any flags that are added because we are doing gc that we can key off of?
Index: gcc/testsuite/gcc.dg/darwin-segaddr.c =================================================================== --- gcc/testsuite/gcc.dg/darwin-segaddr.c (revision 181953) +++ gcc/testsuite/gcc.dg/darwin-segaddr.c (working copy) @@ -1,7 +1,7 @@ /* Check that -segaddr gets through and works. */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-options "-O0 -segaddr __TEST 0x200000" { target { *-*-darwin* && { ! lp64 } } } } */ -/* { dg-options "-O0 -segaddr __TEST 0x110000000" { target { *-*-darwin* && lp64 } } } */ +/* { dg-options "-O0 -segaddr __TEST 0x200000 -fno-pie" { target { *-*-darwin* && { ! lp64 } } } } */ +/* { dg-options "-O0 -segaddr __TEST 0x110000000 -fno-pie" { target { *-*-darwin* && lp64 } } } */ extern void abort (); Index: gcc/config/darwin10.h =================================================================== --- gcc/config/darwin10.h (revision 181953) +++ gcc/config/darwin10.h (working copy) @@ -26,7 +26,9 @@ along with GCC; see the file COPYING3. #define LINK_GCC_C_SEQUENCE_SPEC \ "%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \ %{!static:%{!static-libgcc: \ - %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } %G %L" + %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \ + %{fno-pic|fno-PIC|fno-pie|fno-PIE|fapple-kext|mkernel|static|mdynamic-no-pic: \ + %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %L" #undef DEF_MIN_OSX_VERSION #define DEF_MIN_OSX_VERSION "10.6"