http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49371
Iain Sandoe <iains at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24496|0 |1 is obsolete| | --- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> 2011-06-12 14:47:27 UTC --- Created attachment 24501 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24501 refined version that mentions pie in compiler warnings, and removes the pie option for ld when mdynamic-no-pic is given this adds a couple of minor improvements: a. the compiler will now mention pie as well as pic when warning about incompatibility with -mdynamic-no-pic. b. the pie option will no longer be passed to collect2 if -mdynamic-no-pic is given. this produces: $ ./gcc/xgcc -Bgcc /GCC/tests/hello.c -o hc -fpie -mdynamic-no-pic cc1: warning: ‘-mdynamic-no-pic’ overrides ‘-fpic’, ‘-fPIC’, ‘-fpie’, ‘-fPIE’ or ‘-pie’ [enabled by default] xgcc: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' or $ ./gcc/gfortran -Bgcc -B powerpc-apple-darwin9/libgfortran -L powerpc-apple-darwin9/libgfortran/.libs/ ../tests/helloi.F90 -o hi -mdynamic-no-pic -fpie f951: warning: ‘-mdynamic-no-pic’ overrides ‘-fpic’, ‘-fPIC’, ‘-fpie’, ‘-fPIE’ or ‘-pie’ [enabled by default] gfortran: note: '-mdynamic-no-pic' overides '-pie', '-fpie' or '-fPIE' IMO this is better than a line1:0 warning and at least mentions the pie option. As far as the second info - this is related to the ld phase (I suppose we could mention ld specifically, but it seemed to start getting unwieldy). We need the second 'info', since it protects against pie + mdynamic-no-pic on link-only lines.