r725 - trunk/gcc

archaic at linuxfromscratch.org archaic at linuxfromscratch.org
Mon Dec 13 20:24:50 PST 2004


Author: archaic
Date: 2004-12-13 21:24:50 -0700 (Mon, 13 Dec 2004)
New Revision: 725

Removed:
   trunk/gcc/gcc-3.4-piespecs_x86-1.patch
   trunk/gcc/gcc-3.4-sspspecs-1.patch
Log:
Removed some obsolete patches per Robert.

Deleted: trunk/gcc/gcc-3.4-piespecs_x86-1.patch
===================================================================
--- trunk/gcc/gcc-3.4-piespecs_x86-1.patch	2004-12-10 06:11:35 UTC (rev 724)
+++ trunk/gcc/gcc-3.4-piespecs_x86-1.patch	2004-12-14 04:24:50 UTC (rev 725)
@@ -1,336 +0,0 @@
-Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
-Date: 2004-10-17
-Initial Package Version: 3.4
-Upstream Status: Not submitted - Task specific
-Origin: gcc-3.3-autopie_x86-1.patch
-Description: This patch will enable gcc -pie by default for x86, as well
-as ld -z relro and ld -z now.
-
-Also see:
-http://www.linuxfromscratch.org/hlfs/
-
-diff -Naur gcc-3.4.2.orig/gcc/config/i386/linux.h gcc-3.4.2.piespecs/gcc/config/i386/linux.h
---- gcc-3.4.2.orig/gcc/config/i386/linux.h	2003-11-29 03:08:10.000000000 +0000
-+++ gcc-3.4.2.piespecs/gcc/config/i386/linux.h	2004-10-17 05:33:17.029248104 +0000
-@@ -85,12 +85,20 @@
- #undef CPP_SPEC
- #ifdef USE_GNULIBC_1
- #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
-+#elif defined HAVE_LD_PIE
-+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} \
-+  %{!D__KERNEL__:%{!static:%{!no-pie:%{!DPIC:-D__PIC__ -DPIC}}}}"
- #else
- #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
- #endif
- 
- #undef CC1_SPEC
-+#if defined HAVE_LD_PIE
-+#define CC1_SPEC "%(cc1_cpu) %{profile:-p} \
-+  %{!D__KERNEL__:%{!static:%{!no-pie:%{!DPIC: -fPIC}}}}"
-+#else
- #define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
-+#endif
- 
- /* Provide a LINK_SPEC appropriate for Linux.  Here we provide support
-    for the special GCC options -static and -shared, which allow us to
-diff -Naur gcc-3.4.2.orig/gcc/config/linux.h gcc-3.4.2.piespecs/gcc/config/linux.h
---- gcc-3.4.2.orig/gcc/config/linux.h	2003-11-29 03:08:10.000000000 +0000
-+++ gcc-3.4.2.piespecs/gcc/config/linux.h	2004-10-17 05:33:17.032247648 +0000
-@@ -48,8 +48,10 @@
-    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
- #elif defined HAVE_LD_PIE
- #define STARTFILE_SPEC \
--  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
--   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-+  "%{!shared: %{pg|p|profile:gcrt1.o%s;!no-pie:%{!static:%{!D__KERNEL__:Scrt1.o%s}}}} \
-+   %{static|no-pie:crt1.o%s}  crti.o%s %{static:crtbeginT.o%s} \
-+   %{!no-pie:%{!static:%{!D__KERNEL__:crtbeginS.o%s}}} \
-+   %{!static:%{!shared:%{no-pie:crtbegin.o%s}}}"
- #else
- #define STARTFILE_SPEC \
-   "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
-@@ -63,8 +65,14 @@
-    GNU/Linux "finalizer" file, `crtn.o'.  */
- 
- #undef	ENDFILE_SPEC
-+#if defined HAVE_LD_PIE
-+#define ENDFILE_SPEC \
-+  "%{!no-pie:%{!static:%{!D__KERNEL__:crtendS.o%s}}} \
-+   %{static|no-pie|D__KERNEL__:crtend.o%s} crtn.o%s"
-+#else
- #define ENDFILE_SPEC \
-   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
-+#endif
- 
- /* This is for -profile to use -lc_p instead of -lc.  */
- #ifndef CC1_SPEC
-diff -Naur gcc-3.4.2.orig/gcc/gcc-3.4.2-generic_i686-specs_chap5-pass2 gcc-3.4.2.piespecs/gcc/gcc-3.4.2-generic_i686-specs_chap5-pass2
---- gcc-3.4.2.orig/gcc/gcc-3.4.2-generic_i686-specs_chap5-pass2	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-3.4.2.piespecs/gcc/gcc-3.4.2-generic_i686-specs_chap5-pass2	2004-10-17 05:33:17.035247192 +0000
-@@ -0,0 +1,124 @@
-+*asm:
-+%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
-+
-+*asm_debug:
-+%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-+
-+*asm_final:
-+
-+
-+*asm_options:
-+%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-+
-+*invoke_as:
-+%{!S:-o %|.s |
-+ as %(asm_options) %|.s %A }
-+
-+*cpp:
-+%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
-+
-+*cpp_options:
-+%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}
-+
-+*cpp_debug_options:
-+%{d*}
-+
-+*cpp_unique_options:
-+%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-+
-+*trad_capable_cpp:
-+cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-+
-+*cc1:
-+%(cc1_cpu) %{profile:-p}
-+
-+*cc1_options:
-+%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}
-+
-+*cc1plus:
-+
-+
-+*link_gcc_c_sequence:
-+%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-+
-+*endfile:
-+%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s
-+
-+*link:
-+%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static: 	%{rdynamic:-export-dynamic} 	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} 	%{static:-static}}}
-+
-+*lib:
-+%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}
-+
-+*libgcc:
-+%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s%M --no-as-needed}%{shared-libgcc:-lgcc_s%M%{!shared: -lgcc}}}}
-+
-+*startfile:
-+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}
-+
-+*switches_need_spaces:
-+
-+
-+*cross_compile:
-+0
-+
-+*version:
-+3.4.2
-+
-+*multilib:
-+. ;
-+
-+*multilib_defaults:
-+
-+
-+*multilib_extra:
-+
-+
-+*multilib_matches:
-+
-+
-+*multilib_exclusions:
-+
-+
-+*multilib_options:
-+
-+
-+*linker:
-+collect2
-+
-+*link_libgcc:
-+%D
-+
-+*md_exec_prefix:
-+
-+
-+*md_startfile_prefix:
-+
-+
-+*md_startfile_prefix_1:
-+
-+
-+*startfile_prefix_spec:
-+
-+
-+*sysroot_suffix_spec:
-+
-+
-+*sysroot_hdrs_suffix_spec:
-+
-+
-+*cc1_cpu:
-+%{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.
-+} %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead.
-+} %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead.
-+} %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead.
-+} %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
-+}} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead.
-+} %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead.
-+} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.
-+} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.
-+}
-+
-+*link_command:
-+%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}    %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-+
-diff -Naur gcc-3.4.2.orig/gcc/gcc-3.4.2-generic_i686-specs_chap6 gcc-3.4.2.piespecs/gcc/gcc-3.4.2-generic_i686-specs_chap6
---- gcc-3.4.2.orig/gcc/gcc-3.4.2-generic_i686-specs_chap6	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-3.4.2.piespecs/gcc/gcc-3.4.2-generic_i686-specs_chap6	2004-10-17 05:35:11.465851096 +0000
-@@ -0,0 +1,124 @@
-+*asm:
-+%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
-+
-+*asm_debug:
-+%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-+
-+*asm_final:
-+
-+
-+*asm_options:
-+%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-+
-+*invoke_as:
-+%{!S:-o %|.s |
-+ as %(asm_options) %|.s %A }
-+
-+*cpp:
-+%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
-+
-+*cpp_options:
-+%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}
-+
-+*cpp_debug_options:
-+%{d*}
-+
-+*cpp_unique_options:
-+%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-+
-+*trad_capable_cpp:
-+cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-+
-+*cc1:
-+%(cc1_cpu) %{profile:-p}
-+
-+*cc1_options:
-+%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}
-+
-+*cc1plus:
-+
-+
-+*link_gcc_c_sequence:
-+%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-+
-+*endfile:
-+%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s
-+
-+*link:
-+%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static: 	%{rdynamic:-export-dynamic} 	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} 	%{static:-static}}}
-+
-+*lib:
-+%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}
-+
-+*libgcc:
-+%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s%M --no-as-needed}%{shared-libgcc:-lgcc_s%M%{!shared: -lgcc}}}}
-+
-+*startfile:
-+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}
-+
-+*switches_need_spaces:
-+
-+
-+*cross_compile:
-+0
-+
-+*version:
-+3.4.2
-+
-+*multilib:
-+. ;
-+
-+*multilib_defaults:
-+
-+
-+*multilib_extra:
-+
-+
-+*multilib_matches:
-+
-+
-+*multilib_exclusions:
-+
-+
-+*multilib_options:
-+
-+
-+*linker:
-+collect2
-+
-+*link_libgcc:
-+%D
-+
-+*md_exec_prefix:
-+
-+
-+*md_startfile_prefix:
-+
-+
-+*md_startfile_prefix_1:
-+
-+
-+*startfile_prefix_spec:
-+
-+
-+*sysroot_suffix_spec:
-+
-+
-+*sysroot_hdrs_suffix_spec:
-+
-+
-+*cc1_cpu:
-+%{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.
-+} %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead.
-+} %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead.
-+} %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead.
-+} %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
-+}} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead.
-+} %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead.
-+} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.
-+} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.
-+}
-+
-+*link_command:
-+%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}    %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-+
-diff -Naur gcc-3.4.2.orig/gcc/gcc.c gcc-3.4.2.piespecs/gcc/gcc.c
---- gcc-3.4.2.orig/gcc/gcc.c	2004-04-18 23:45:11.000000000 +0000
-+++ gcc-3.4.2.piespecs/gcc/gcc.c	2004-10-17 05:33:17.111235640 +0000
-@@ -660,7 +660,9 @@
- 
- #ifndef LINK_PIE_SPEC
- #ifdef HAVE_LD_PIE
--#define LINK_PIE_SPEC "%{pie:-pie} "
-+#define LINK_PIE_SPEC "%{!no-pie:%{!static:%{!D__KERNEL__:%{!A:%{!i:%{!r:%{!Bstatic: \
-+  %{!shared: -pie %{!no-now: -z now} %{!no-relro: -z relro} }}}}}}}} %{no-pie:} \
-+  %{no-now:} %{no-relro:}"
- #else
- #define LINK_PIE_SPEC "%{pie:} "
- #endif

Deleted: trunk/gcc/gcc-3.4-sspspecs-1.patch
===================================================================
--- trunk/gcc/gcc-3.4-sspspecs-1.patch	2004-12-10 06:11:35 UTC (rev 724)
+++ trunk/gcc/gcc-3.4-sspspecs-1.patch	2004-12-14 04:24:50 UTC (rev 725)
@@ -1,114 +0,0 @@
-Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
-Date: 2004-08-29
-Initial Package Version: 3.4
-Upstream Status: Rejected Upstream
-Origin: Based on gcc-3.3.2-pie-ssp.patch by Alexander Gabert
-Description: See description in the sspspecs.h hunk below the copyright.
-This patch will also work on gcc-2.95.3 with fuzz
-
-diff -Naur gcc-3.4.1.orig/gcc/gcc.c gcc-3.4.1.sspspecs/gcc/gcc.c
---- gcc-3.4.1.orig/gcc/gcc.c	2004-04-18 23:45:11.000000000 +0000
-+++ gcc-3.4.1.sspspecs/gcc/gcc.c	2004-08-30 01:57:15.000000000 +0000
-@@ -574,6 +574,7 @@
- 
- /* config.h can define CC1_SPEC to provide extra args to cc1 and cc1plus
-    or extra switch-translations.  */
-+#include "sspspecs.h"
- #ifndef CC1_SPEC
- #define CC1_SPEC ""
- #endif
-diff -Naur gcc-3.4.1.orig/gcc/sspspecs.h gcc-3.4.1.sspspecs/gcc/sspspecs.h
---- gcc-3.4.1.orig/gcc/sspspecs.h	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-3.4.1.sspspecs/gcc/sspspecs.h	2004-08-30 01:57:15.000000000 +0000
-@@ -0,0 +1,91 @@
-+/* Adds spec for RTL buffer overflow protection function
-+Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-+1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify it under
-+the terms of the GNU General Public License as published by the Free
-+Software Foundation; either version 2, or (at your option) any later
-+version.
-+
-+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-+WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GCC; see the file COPYING.  If not, write to the Free
-+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-+02111-1307, USA. */
-+
-+/* Based on http://dev.gentoo.org/~pappy/gentoo-projects/\
-+hardened-gcc/gentoo/distrib/3.3.2.2/noarch/gcc-3.3.2-pie-ssp.patch
-+thanks to Alexander Gabert and Hardened Gentoo. Modified for just
-+SSP, and for addition compatability with NetBSD. This patch adds
-+default specs for -fstack-protector-all with filters so libs should
-+build normaly. This patch does not have SSP functions, get those from
-+http://www.research.ibm.com/trl/projects/security/ssp/
-+Workgroup at hlfs-dev at linuxfromscratch.org
-+Website at http://www.linuxfromscratch.org/hlfs/ */
-+/* ashes */
-+
-+/* Hopefully this define will prevent this header from being looped.
-+	It gets endif'd at the bottom */
-+#ifndef SSP_SPEC_H
-+#define SSP_SPEC_H
-+
-+/* FreeBSD and OpenBSD targets are untested but should work.
-+	Please report error or success to the workgroup mailing list. */
-+#ifdef __FreeBSD__
-+#define SSP_KERNEL_EXCLUDE "D_KERNEL"
-+#endif
-+#ifdef __NetBSD__
-+#define SSP_KERNEL_EXCLUDE "D_KERNEL"
-+#endif
-+#ifdef __OpenBSD__
-+#define SSP_KERNEL_EXCLUDE "D_KERNEL"
-+#endif
-+#ifdef __linux__
-+#define SSP_KERNEL_EXCLUDE "D__KERNEL__"
-+#endif
-+
-+/* Fail if none of the above match. */
-+#ifndef SSP_KERNEL_EXCLUDE
-+ #error "FAILED in sspspecs.h: Unknown target system - Hackme"
-+#endif
-+
-+/* Setup macro. */
-+#ifndef NSPEC
-+#define NSPEC(a,b) "%{!"a": "b"} "
-+#endif
-+
-+/* These are the exclusion flags wrapped in the above macro. */
-+#ifndef STD_SSP_EXCLUDE
-+#define STD_SSP_EXCLUDE(flag)			\
-+	NSPEC(SSP_KERNEL_EXCLUDE,				\
-+	NSPEC("DIN_GCC",					\
-+	NSPEC("DIN_LIBGCC",					\
-+	NSPEC("DIN_LIBGCC2",				\
-+	NSPEC("nostartfiles",				\
-+	NSPEC("nostdinc",				\
-+	NSPEC("nostdlib",					\
-+	NSPEC("nodefaultlibs",				\
-+	NSPEC("fno-stack-protector",		\
-+	NSPEC("fno-stack-protector-all",	\
-+	flag								\
-+	))))))))))
-+#endif
-+
-+/* -fforce-addr has been heavily tested by Gentoo and should be safe. */
-+#ifndef CC1_SSP
-+#define CC1_SSP	"-fstack-protector-all -fforce-addr"
-+#endif
-+
-+/* Setup our new spec string with exclusion flags, and prepend the original spec. */
-+static char cc1_spec_string[] = CC1_SPEC STD_SSP_EXCLUDE(CC1_SSP);
-+/* Redefine cc1 specs. */
-+#undef CC1_SPEC
-+#define CC1_SPEC (cc1_spec_string)
-+
-+#endif /* End of SSP_SPEC_H */




More information about the patches mailing list