Commit 0e9197f5 by Iain Sandoe

re PR driver/49371 (xgcc: error: unrecognized option '-pie' on *-apple-darwin*)


	PR driver/49371
	* config/darwin.c (darwin_override_options): Improve warning when
	mdynamic-no-pic is given together with fPIC/fpic, also warn when it
	is given with fpie/fPIE.
	* config/darwin.h (PIE_SPEC): New, (LINK_SPEC): Use PIE_SPEC.
	* config/darwin9.h (PIE_SPEC): New.

From-SVN: r175397
parent 53461199
2011-06-25 Iain Sandoe <iains@gcc.gnu.org>
PR driver/49371
* config/darwin.c (darwin_override_options): Improve warning when
mdynamic-no-pic is given together with fPIC/fpic, also warn when it
is given with fpie/fPIE.
* config/darwin.h (PIE_SPEC): New, (LINK_SPEC): Use PIE_SPEC.
* config/darwin9.h (PIE_SPEC): New.
2011-06-25  Basile Starynkevitch  <basile@starynkevitch.net> 2011-06-25  Basile Starynkevitch  <basile@starynkevitch.net>
......
...@@ -2932,7 +2932,9 @@ darwin_override_options (void) ...@@ -2932,7 +2932,9 @@ darwin_override_options (void)
if (MACHO_DYNAMIC_NO_PIC_P) if (MACHO_DYNAMIC_NO_PIC_P)
{ {
if (flag_pic) if (flag_pic)
warning (0, "-mdynamic-no-pic overrides -fpic or -fPIC"); warning_at (UNKNOWN_LOCATION, 0,
"%<-mdynamic-no-pic%> overrides %<-fpic%>, %<-fPIC%>,"
" %<-fpie%> or %<-fPIE%>");
flag_pic = 0; flag_pic = 0;
} }
else if (flag_pic == 1) else if (flag_pic == 1)
......
...@@ -226,6 +226,8 @@ extern GTY(()) int darwin_ms_struct; ...@@ -226,6 +226,8 @@ extern GTY(()) int darwin_ms_struct;
#define LINK_SYSROOT_SPEC "%{isysroot*:-syslibroot %*}" #define LINK_SYSROOT_SPEC "%{isysroot*:-syslibroot %*}"
#endif #endif
#define PIE_SPEC "%{fpie|pie|fPIE:}"
/* Please keep the random linker options in alphabetical order (modulo /* Please keep the random linker options in alphabetical order (modulo
'Z' and 'no' prefixes). Note that options taking arguments may appear 'Z' and 'no' prefixes). Note that options taking arguments may appear
multiple times on a command line with different arguments each time, multiple times on a command line with different arguments each time,
...@@ -290,7 +292,7 @@ extern GTY(()) int darwin_ms_struct; ...@@ -290,7 +292,7 @@ extern GTY(()) int darwin_ms_struct;
%:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \ %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
%:version-compare(< 10.5 mmacosx-version-min= suppress)}} \ %:version-compare(< 10.5 mmacosx-version-min= suppress)}} \
%{Zmultiplydefinedunused*:-multiply_defined_unused %*} \ %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
%{fpie:-pie} \ " PIE_SPEC " \
%{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \ %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
%{read_only_relocs} \ %{read_only_relocs} \
%{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \ %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \
......
...@@ -35,6 +35,12 @@ along with GCC; see the file COPYING3. If not see ...@@ -35,6 +35,12 @@ along with GCC; see the file COPYING3. If not see
/* Tell collect2 to run dsymutil for us as necessary. */ /* Tell collect2 to run dsymutil for us as necessary. */
#define COLLECT_RUN_DSYMUTIL 1 #define COLLECT_RUN_DSYMUTIL 1
#undef PIE_SPEC
#define PIE_SPEC \
"%{fpie|pie|fPIE: \
%{mdynamic-no-pic: %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
:-pie}}"
#undef ASM_OUTPUT_ALIGNED_COMMON #undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do { \ do { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment