/[gentoo]/src/patchsets/gcc/4.6.0/gentoo/10_all_default-fortify-source.patch
Gentoo

Contents of /src/patchsets/gcc/4.6.0/gentoo/10_all_default-fortify-source.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download) (as text)
Wed Jan 13 05:01:46 2016 UTC (4 years, 6 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
File MIME type: text/x-diff
FILE REMOVED
stop enabling -D_FORTIFY_SOURCE by default in older versions for compatibility and simplicity -- these are really only used for old builds now and cross-compiling

1 Enable -D_FORTIFY_SOURCE=2 by default
2
3
4 --- a/gcc/doc/invoke.texi
5 +++ b/gcc/doc/invoke.texi
6 @@ -5973,6 +5973,11 @@ also turns on the following optimization flags:
7 Please note the warning under @option{-fgcse} about
8 invoking @option{-O2} on programs that use computed gotos.
9
10 +NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is
11 +activated when @option{-O} is set to 2 or higher. This enables additional
12 +compile-time and run-time checks for several libc functions. To disable,
13 +specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}.
14 +
15 @item -O3
16 @opindex O3
17 Optimize yet more. @option{-O3} turns on all optimizations specified
18 --- a/gcc/gcc.c
19 +++ b/gcc/gcc.c
20 @@ -741,6 +741,7 @@ static const char *cpp_unique_options =
21 %{H} %C %{D*&U*&A*} %{i*} %Z %i\
22 %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
23 %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
24 + %{!U_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:-D_FORTIFY_SOURCE=2}}}\
25 %{E|M|MM:%W{o*}}";
26
27 /* This contains cpp options which are common with cc1_options and are passed

  ViewVC Help
Powered by ViewVC 1.1.20