http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49371
--- Comment #16 from Iain Sandoe <iains at gcc dot gnu.org> 2011-06-12 19:01:51 UTC --- (In reply to comment #15) > I have bootstrapped gcc on x86_64-apple-darwin10.7.0 with the patch in comment > #14 and the tests for gcc and tls.exp pass without unexpected failure. I just > noticed the following oddity: > > [macbook] f90/bug% gfc -m64 -fpie -mdynamic-no-pic pr49331.f90 > gfc: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' > [macbook] f90/bug% gfc -m32 -fpie -mdynamic-no-pic pr49331.f90 > f951: warning: '-mdynamic-no-pic' overrides '-fpic', '-fPIC', '-fpie', '-fPIE' > or '-pie' [enabled by default] > gfc: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' > [macbook] f90/bug% gcc47 -m64 -fpie -mdynamic-no-pic backtrace.c > gcc47: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' > [macbook] f90/bug% gcc47 -m32 -fpie -mdynamic-no-pic backtrace.c > cc1: warning: '-mdynamic-no-pic' overrides '-fpic', '-fPIC', '-fpie', '-fPIE' > or '-pie' [enabled by default] > gcc47: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' Those are correct - the options conflict [i.e. you can't have -pie and -mdynamic-no-pic at the same time]. > Is it expected that the warning appears with -m32, but not with -m64? I also > got Yes, I guess so on x86, mdynamic-no-pic has no effect for m64 (x86) ... ... I need to check what happens for m64 powerpc (but suspect it still applies). > [macbook] f90/bug% gcc47 -m32 -fno-PIC -pie backtrace.c > ld: cannot link -pie: -mdynamic-no-pic codegen found in _myfunc3 from > /var/tmp//cccDWsse.o > collect2: error: ld returned 1 exit status Hmm. That is an uncaught conflict, I think .. IIRC, pie requires position independent code.. so something's not 100% right... (perhaps there should be an error from cc1 in that case). thanks, as always for the checking - - don't know when/if I'll get a chance to look further at this .. so anyone else is welcome to take my patchlet forward ...