This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pass -fpie to the Darwin linker


Pretty obvious.  I added the testcase because there doesn't seem to be
any test that involves linking a PIE executable.

Bootstrapped and tested on powerpc-darwin8.  I also checked that GCC
does try to pass -pie to the linker.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwin-5238485.patch==================
2007-06-01  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_SPEC): Pass -fpie through to the linker.

Index: testsuite/ChangeLog
2007-06-01  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/pie-link.c: New test.

Index: config/darwin.h
===================================================================
--- config/darwin.h	(revision 125212)
+++ config/darwin.h	(working copy)
@@ -307,6 +307,7 @@
      %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
      %:version-compare(< 10.5 mmacosx-version-min= suppress)}} \
    %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
+   %{fpie:-pie} \
    %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
    %{read_only_relocs} \
    %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \
Index: testsuite/gcc.dg/pie-link.c
===================================================================
--- testsuite/gcc.dg/pie-link.c	(revision 0)
+++ testsuite/gcc.dg/pie-link.c	(revision 0)
@@ -0,0 +1,7 @@
+/* { dg-do link { target *-*-darwin[912]* *-*-linux* } } */
+/* { dg-options "-fpie" } */
+
+int main(void)
+{
+  return 0;
+}
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]