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]

[patch] fix libssp on darwin


Two part patch here. The first fixes -fstack-protector-all to link in the ssp libraries, the second links in the files at all on darwin. Probably fairly obvious, but I'll ask for confirmation.

Tested on ppc-darwin with ssp enabled, make all and building a couple of small programs. Currently having issues bootstrapping with the support turned on by default due to the changes jakub made when pulling libssp out into it's own directory and --enable-bootstrap not working :(

OK?

-eric

2005-08-03 Eric Christopher <echristo@apple.com>

        * gcc.c (LINK_SSP_SPEC): Add fstack-protector-all.
        * config/darwin.h (LINK_COMMAND_SPEC): Add link_ssp
        spec.


Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.468
diff -u -p -w -r1.468 gcc.c
--- gcc.c 25 Jul 2005 19:41:58 -0000 1.468
+++ gcc.c 3 Aug 2005 21:52:45 -0000
@@ -674,7 +674,7 @@ proper position among the other output f
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector:}"
#else
-#define LINK_SSP_SPEC "%{fstack-protector:-lssp_nonshared -lssp }"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:- lssp_nonshared -lssp }"
#endif
#endif
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.125
diff -u -p -w -r1.125 darwin.h
--- config/darwin.h 13 Jul 2005 16:28:16 -0000 1.125
+++ config/darwin.h 3 Aug 2005 21:52:46 -0000
@@ -207,7 +207,7 @@ Boston, MA 02110-1301, USA. */
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
%{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
%{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate| coverage:-lgcov} \
- %{!nostdlib:%{!nodefaultlibs:%G %L}} \
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
/* Please keep the random linker options in alphabetical order (modulo



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