diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch')
| -rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch | 223 |
1 files changed, 0 insertions, 223 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch deleted file mode 100644 index a44e86ca4f..0000000000 --- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch +++ /dev/null | |||
| @@ -1,223 +0,0 @@ | |||
| 1 | Upstream-Status: Inappropriate [distribution: codesourcery] | ||
| 2 | |||
| 3 | gcc/ | ||
| 4 | 2008-07-02 Joseph Myers <joseph@codesourcery.com> | ||
| 5 | * c-incpath.c: Include toplev.h. | ||
| 6 | (merge_include_chains): Use warning instead of cpp_error for | ||
| 7 | system directory poisoning diagnostic. | ||
| 8 | * Makefile.in (c-incpath.o): Depend on toplev.h. | ||
| 9 | * gcc.c (LINK_COMMAND_SPEC): Pass | ||
| 10 | --error-poison-system-directories if | ||
| 11 | -Werror=poison-system-directories. | ||
| 12 | |||
| 13 | 2007-06-13 Joseph Myers <joseph@codesourcery.com> | ||
| 14 | * common.opt (--Wno-poison-system-directories): New. | ||
| 15 | * doc/invoke.texi (-Wno-poison-system-directories): Document. | ||
| 16 | * c-incpath.c: Include flags.h. | ||
| 17 | (merge_include_chains): Check flag_poison_system_directories. | ||
| 18 | * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories | ||
| 19 | to linker if -Wno-poison-system-directories. | ||
| 20 | * Makefile.in (c-incpath.o): Depend on $(FLAGS_H). | ||
| 21 | |||
| 22 | 2007-03-20 Daniel Jacobowitz <dan@codesourcery.com> | ||
| 23 | Joseph Myers <joseph@codesourcery.com> | ||
| 24 | * configure.ac (--enable-poison-system-directories): New option. | ||
| 25 | * configure, config.in: Regenerate. | ||
| 26 | * c-incpath.c (merge_include_chains): If | ||
| 27 | ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of | ||
| 28 | /usr/include, /usr/local/include or /usr/X11R6/include. | ||
| 29 | |||
| 30 | Index: gcc-4_6-branch/gcc/common.opt | ||
| 31 | =================================================================== | ||
| 32 | --- gcc-4_6-branch.orig/gcc/common.opt 2012-03-03 01:03:17.000000000 -0800 | ||
| 33 | +++ gcc-4_6-branch/gcc/common.opt 2012-03-04 09:24:54.410624483 -0800 | ||
| 34 | @@ -567,6 +567,10 @@ | ||
| 35 | Common Var(warn_padded) Warning | ||
| 36 | Warn when padding is required to align structure members | ||
| 37 | |||
| 38 | +Wpoison-system-directories | ||
| 39 | +Common Var(flag_poison_system_directories) Init(1) Warning | ||
| 40 | +Warn for -I and -L options using system directories if cross compiling | ||
| 41 | + | ||
| 42 | Wshadow | ||
| 43 | Common Var(warn_shadow) Warning | ||
| 44 | Warn when one local variable shadows another | ||
| 45 | Index: gcc-4_6-branch/gcc/config.in | ||
| 46 | =================================================================== | ||
| 47 | --- gcc-4_6-branch.orig/gcc/config.in 2012-03-03 01:03:17.000000000 -0800 | ||
| 48 | +++ gcc-4_6-branch/gcc/config.in 2012-03-04 09:24:54.410624483 -0800 | ||
| 49 | @@ -144,6 +144,12 @@ | ||
| 50 | #endif | ||
| 51 | |||
| 52 | |||
| 53 | +/* Define to warn for use of native system header directories */ | ||
| 54 | +#ifndef USED_FOR_TARGET | ||
| 55 | +#undef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
| 56 | +#endif | ||
| 57 | + | ||
| 58 | + | ||
| 59 | /* Define if you want all operations on RTL (the basic data structure of the | ||
| 60 | optimizer and back end) to be checked for dynamic type safety at runtime. | ||
| 61 | This is quite expensive. */ | ||
| 62 | Index: gcc-4_6-branch/gcc/configure.ac | ||
| 63 | =================================================================== | ||
| 64 | --- gcc-4_6-branch.orig/gcc/configure.ac 2012-03-04 09:22:07.000000000 -0800 | ||
| 65 | +++ gcc-4_6-branch/gcc/configure.ac 2012-03-04 09:24:54.410624483 -0800 | ||
| 66 | @@ -4692,6 +4692,16 @@ | ||
| 67 | fi) | ||
| 68 | AC_SUBST(slibdir) | ||
| 69 | |||
| 70 | +AC_ARG_ENABLE([poison-system-directories], | ||
| 71 | + AS_HELP_STRING([--enable-poison-system-directories], | ||
| 72 | + [warn for use of native system header directories]),, | ||
| 73 | + [enable_poison_system_directories=no]) | ||
| 74 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
| 75 | + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], | ||
| 76 | + [1], | ||
| 77 | + [Define to warn for use of native system header directories]) | ||
| 78 | +fi | ||
| 79 | + | ||
| 80 | # Substitute configuration variables | ||
| 81 | AC_SUBST(subdirs) | ||
| 82 | AC_SUBST(srcdir) | ||
| 83 | Index: gcc-4_6-branch/gcc/doc/invoke.texi | ||
| 84 | =================================================================== | ||
| 85 | --- gcc-4_6-branch.orig/gcc/doc/invoke.texi 2012-03-03 00:46:39.000000000 -0800 | ||
| 86 | +++ gcc-4_6-branch/gcc/doc/invoke.texi 2012-03-04 09:24:54.414624482 -0800 | ||
| 87 | @@ -257,6 +257,7 @@ | ||
| 88 | -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol | ||
| 89 | -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol | ||
| 90 | -Wpointer-arith -Wno-pointer-to-int-cast @gol | ||
| 91 | +-Wno-poison-system-directories @gol | ||
| 92 | -Wredundant-decls @gol | ||
| 93 | -Wreturn-type -Wsequence-point -Wshadow @gol | ||
| 94 | -Wsign-compare -Wsign-conversion -Wstack-protector @gol | ||
| 95 | @@ -3782,6 +3783,14 @@ | ||
| 96 | for most targets, it is made up of code and thus requires the stack | ||
| 97 | to be made executable in order for the program to work properly. | ||
| 98 | |||
| 99 | +@item -Wno-poison-system-directories | ||
| 100 | +@opindex Wno-poison-system-directories | ||
| 101 | +Do not warn for @option{-I} or @option{-L} options using system | ||
| 102 | +directories such as @file{/usr/include} when cross compiling. This | ||
| 103 | +option is intended for use in chroot environments when such | ||
| 104 | +directories contain the correct headers and libraries for the target | ||
| 105 | +system rather than the host. | ||
| 106 | + | ||
| 107 | @item -Wfloat-equal | ||
| 108 | @opindex Wfloat-equal | ||
| 109 | @opindex Wno-float-equal | ||
| 110 | Index: gcc-4_6-branch/gcc/gcc.c | ||
| 111 | =================================================================== | ||
| 112 | --- gcc-4_6-branch.orig/gcc/gcc.c 2012-03-03 01:03:17.000000000 -0800 | ||
| 113 | +++ gcc-4_6-branch/gcc/gcc.c 2012-03-04 09:24:54.418624482 -0800 | ||
| 114 | @@ -659,6 +659,8 @@ | ||
| 115 | %{flto} %{flto=*} %l " LINK_PIE_SPEC \ | ||
| 116 | "%X %{o*} %{e*} %{N} %{n} %{r}\ | ||
| 117 | %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\ | ||
| 118 | + %{Wno-poison-system-directories:--no-poison-system-directories}\ | ||
| 119 | + %{Werror=poison-system-directories:--error-poison-system-directories}\ | ||
| 120 | %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ | ||
| 121 | %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ | ||
| 122 | %(mflib) " STACK_SPLIT_SPEC "\ | ||
| 123 | Index: gcc-4_6-branch/gcc/incpath.c | ||
| 124 | =================================================================== | ||
| 125 | --- gcc-4_6-branch.orig/gcc/incpath.c 2012-03-03 01:03:17.000000000 -0800 | ||
| 126 | +++ gcc-4_6-branch/gcc/incpath.c 2012-03-04 09:24:54.418624482 -0800 | ||
| 127 | @@ -353,6 +353,24 @@ | ||
| 128 | } | ||
| 129 | fprintf (stderr, _("End of search list.\n")); | ||
| 130 | } | ||
| 131 | + | ||
| 132 | +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
| 133 | + if (flag_poison_system_directories) | ||
| 134 | + { | ||
| 135 | + struct cpp_dir *p; | ||
| 136 | + | ||
| 137 | + for (p = heads[QUOTE]; p; p = p->next) | ||
| 138 | + { | ||
| 139 | + if ((!strncmp (p->name, "/usr/include", 12)) | ||
| 140 | + || (!strncmp (p->name, "/usr/local/include", 18)) | ||
| 141 | + || (!strncmp (p->name, "/usr/X11R6/include", 18))) | ||
| 142 | + warning (OPT_Wpoison_system_directories, | ||
| 143 | + "include location \"%s\" is unsafe for " | ||
| 144 | + "cross-compilation", | ||
| 145 | + p->name); | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | +#endif | ||
| 149 | } | ||
| 150 | |||
| 151 | /* Use given -I paths for #include "..." but not #include <...>, and | ||
| 152 | Index: gcc-4_6-branch/gcc/Makefile.in | ||
| 153 | =================================================================== | ||
| 154 | --- gcc-4_6-branch.orig/gcc/Makefile.in 2012-03-04 09:22:05.000000000 -0800 | ||
| 155 | +++ gcc-4_6-branch/gcc/Makefile.in 2012-03-04 09:24:54.418624482 -0800 | ||
| 156 | @@ -2179,7 +2179,7 @@ | ||
| 157 | |||
| 158 | incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ | ||
| 159 | intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ | ||
| 160 | - $(MACHMODE_H) | ||
| 161 | + $(MACHMODE_H) $(FLAGS_H) toplev.h | ||
| 162 | |||
| 163 | prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ | ||
| 164 | Makefile $(BASEVER) | ||
| 165 | Index: gcc-4_6-branch/gcc/configure | ||
| 166 | =================================================================== | ||
| 167 | --- gcc-4_6-branch.orig/gcc/configure 2012-03-04 09:22:07.000000000 -0800 | ||
| 168 | +++ gcc-4_6-branch/gcc/configure 2012-03-04 09:25:31.502626277 -0800 | ||
| 169 | @@ -912,6 +912,7 @@ | ||
| 170 | enable_maintainer_mode | ||
| 171 | enable_version_specific_runtime_libs | ||
| 172 | with_slibdir | ||
| 173 | +enable_poison_system_directories | ||
| 174 | enable_plugin | ||
| 175 | enable_libquadmath_support | ||
| 176 | ' | ||
| 177 | @@ -1623,6 +1624,8 @@ | ||
| 178 | --enable-version-specific-runtime-libs | ||
| 179 | specify that runtime libraries should be | ||
| 180 | installed in a compiler-specific directory | ||
| 181 | + --enable-poison-system-directories | ||
| 182 | + warn for use of native system header directories | ||
| 183 | --enable-plugin enable plugin support | ||
| 184 | --disable-libquadmath-support | ||
| 185 | disable libquadmath support for Fortran | ||
| 186 | @@ -17498,7 +17501,7 @@ | ||
| 187 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
| 188 | lt_status=$lt_dlunknown | ||
| 189 | cat > conftest.$ac_ext <<_LT_EOF | ||
| 190 | -#line 17501 "configure" | ||
| 191 | +#line 17504 "configure" | ||
| 192 | #include "confdefs.h" | ||
| 193 | |||
| 194 | #if HAVE_DLFCN_H | ||
| 195 | @@ -17604,7 +17607,7 @@ | ||
| 196 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
| 197 | lt_status=$lt_dlunknown | ||
| 198 | cat > conftest.$ac_ext <<_LT_EOF | ||
| 199 | -#line 17607 "configure" | ||
| 200 | +#line 17610 "configure" | ||
| 201 | #include "confdefs.h" | ||
| 202 | |||
| 203 | #if HAVE_DLFCN_H | ||
| 204 | @@ -26125,6 +26128,19 @@ | ||
| 205 | |||
| 206 | |||
| 207 | |||
| 208 | +# Check whether --enable-poison-system-directories was given. | ||
| 209 | +if test "${enable_poison_system_directories+set}" = set; then : | ||
| 210 | + enableval=$enable_poison_system_directories; | ||
| 211 | +else | ||
| 212 | + enable_poison_system_directories=no | ||
| 213 | +fi | ||
| 214 | + | ||
| 215 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
| 216 | + | ||
| 217 | +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h | ||
| 218 | + | ||
| 219 | +fi | ||
| 220 | + | ||
| 221 | # Substitute configuration variables | ||
| 222 | |||
| 223 | |||
