From a47328a2beadfa7ab70802444f0aabac82ede1b9 Mon Sep 17 00:00:00 2001 From: Magnus Granberg Date: Sun, 8 Apr 2012 14:33:17 +0200 Subject: Update 4.6 and 4.7 --- gcc-4.5.0/piepatch/15_all_gcc45-pr52194.patch | 61 +++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gcc-4.5.0/piepatch/15_all_gcc45-pr52194.patch (limited to 'gcc-4.5.0') diff --git a/gcc-4.5.0/piepatch/15_all_gcc45-pr52194.patch b/gcc-4.5.0/piepatch/15_all_gcc45-pr52194.patch new file mode 100644 index 0000000..4b7b4ae --- /dev/null +++ b/gcc-4.5.0/piepatch/15_all_gcc45-pr52194.patch @@ -0,0 +1,61 @@ +2012-02-11 Magnus Granberg + + PR52194 + * gcc/c-pch.c (c_common_valid_pch) check for + Pax and RANDMMAP. + +--- a/gcc/c-pch.c 2011-08-28 22:14:46.000000000 +0200 ++++ b/gcc/c-pch.c 2012-02-11 17:10:23.158018580 +0100 +@@ -36,6 +36,10 @@ along with GCC; see the file COPYING3. + #include "opts.h" + #include "timevar.h" + ++#define FILE_BUFFER 256 ++#define LINE_BUFFER 1024 ++#define WORD_BUFFER 1024 ++ + /* This is a list of flag variables that must match exactly, and their + names for the error message. The possible values for *flag_var must + fit in a 'signed char'. */ +@@ -240,6 +244,11 @@ c_common_valid_pch (cpp_reader *pfile, c + char ident[IDENT_LENGTH + 16]; + const char *pch_ident; + struct c_pch_validity v; ++ FILE *f; ++ char file[FILE_BUFFER]; ++ char line[LINE_BUFFER]; ++ char word[WORD_BUFFER]; ++ char value[WORD_BUFFER]; + + /* Perform a quick test of whether this is a valid + precompiled header for the current language. */ +@@ -351,6 +360,29 @@ c_common_valid_pch (cpp_reader *pfile, c + } + } + ++ /* FIXME: On PaX enabled kernel with RANDMMAP enabled we can't use ++ PCH. #PR52194 */ ++ ++ f = fopen ("/proc/self/status", "r"); ++ if (f != NULL) ++ { ++ memset(file, 0, FILE_BUFFER); ++ while( fgets(line, LINE_BUFFER, f) ) ++ { ++ sscanf(line, "%s %s", word, value); ++ if(!strcmp(word, "PaX:")) ++ { ++ if(value[3] == 'R') ++ { ++ cpp_error (pfile, CPP_DL_WARNING, "%s can't be used \ ++ with PaX enabled kernel with RANDMMAP \ ++ enabled.", name); ++ return 2; ++ } ++ } ++ } ++ } ++ + /* Check the preprocessor macros are the same as when the PCH was + generated. */ + -- cgit v1.2.3-65-gdbad