diff options
| author | Koen Kooi <koen@dominion.thruhere.net> | 2010-11-02 22:03:58 +0100 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2010-11-02 22:12:02 +0100 |
| commit | be10a6b1321f250b1034c7d9d0a8ef18b296eef1 (patch) | |
| tree | 9249025cbfbfbee4cc430d62b27f75301dd4dfde /recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch | |
| parent | 93b28937ac67ba46d65f55637e42552e224aa7e2 (diff) | |
| download | meta-openembedded-be10a6b1321f250b1034c7d9d0a8ef18b296eef1.tar.gz | |
angstrom-layers: meta-openembedded: replace poky gcc 4.5 sources with OE ones
This needs further investigation, but for now we can get the tested sources into the poky gcc harness
Signed-off-by: Koen Kooi <k-kooi@ti.com>
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch')
| -rw-r--r-- | recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch | 201 |
1 files changed, 201 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch b/recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch new file mode 100644 index 0000000000..04043ff0b7 --- /dev/null +++ b/recipes-devtools/gcc/gcc-4.5/gcc-poison-system-directories.patch | |||
| @@ -0,0 +1,201 @@ | |||
| 1 | gcc/ | ||
| 2 | 2008-07-02 Joseph Myers <joseph@codesourcery.com> | ||
| 3 | * c-incpath.c: Include toplev.h. | ||
| 4 | (merge_include_chains): Use warning instead of cpp_error for | ||
| 5 | system directory poisoning diagnostic. | ||
| 6 | * Makefile.in (c-incpath.o): Depend on toplev.h. | ||
| 7 | * gcc.c (LINK_COMMAND_SPEC): Pass | ||
| 8 | --error-poison-system-directories if | ||
| 9 | -Werror=poison-system-directories. | ||
| 10 | |||
| 11 | 2007-06-13 Joseph Myers <joseph@codesourcery.com> | ||
| 12 | * common.opt (--Wno-poison-system-directories): New. | ||
| 13 | * doc/invoke.texi (-Wno-poison-system-directories): Document. | ||
| 14 | * c-incpath.c: Include flags.h. | ||
| 15 | (merge_include_chains): Check flag_poison_system_directories. | ||
| 16 | * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories | ||
| 17 | to linker if -Wno-poison-system-directories. | ||
| 18 | * Makefile.in (c-incpath.o): Depend on $(FLAGS_H). | ||
| 19 | |||
| 20 | 2007-03-20 Daniel Jacobowitz <dan@codesourcery.com> | ||
| 21 | Joseph Myers <joseph@codesourcery.com> | ||
| 22 | * configure.ac (--enable-poison-system-directories): New option. | ||
| 23 | * configure, config.in: Regenerate. | ||
| 24 | * c-incpath.c (merge_include_chains): If | ||
| 25 | ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of | ||
| 26 | /usr/include, /usr/local/include or /usr/X11R6/include. | ||
| 27 | |||
| 28 | Index: gcc-4.5.0/gcc/common.opt | ||
| 29 | =================================================================== | ||
| 30 | --- gcc-4.5.0.orig/gcc/common.opt 2010-03-17 20:01:09.000000000 -0700 | ||
| 31 | +++ gcc-4.5.0/gcc/common.opt 2010-06-25 11:35:39.965383734 -0700 | ||
| 32 | @@ -152,6 +152,10 @@ | ||
| 33 | Common Var(warn_padded) Warning | ||
| 34 | Warn when padding is required to align structure members | ||
| 35 | |||
| 36 | +Wpoison-system-directories | ||
| 37 | +Common Var(flag_poison_system_directories) Init(1) Warning | ||
| 38 | +Warn for -I and -L options using system directories if cross compiling | ||
| 39 | + | ||
| 40 | Wshadow | ||
| 41 | Common Var(warn_shadow) Warning | ||
| 42 | Warn when one local variable shadows another | ||
| 43 | Index: gcc-4.5.0/gcc/config.in | ||
| 44 | =================================================================== | ||
| 45 | --- gcc-4.5.0.orig/gcc/config.in 2010-04-14 02:30:07.000000000 -0700 | ||
| 46 | +++ gcc-4.5.0/gcc/config.in 2010-06-25 11:35:39.969383588 -0700 | ||
| 47 | @@ -132,6 +132,12 @@ | ||
| 48 | #endif | ||
| 49 | |||
| 50 | |||
| 51 | +/* Define to warn for use of native system header directories */ | ||
| 52 | +#ifndef USED_FOR_TARGET | ||
| 53 | +#undef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
| 54 | +#endif | ||
| 55 | + | ||
| 56 | + | ||
| 57 | /* Define if you want all operations on RTL (the basic data structure of the | ||
| 58 | optimizer and back end) to be checked for dynamic type safety at runtime. | ||
| 59 | This is quite expensive. */ | ||
| 60 | Index: gcc-4.5.0/gcc/configure.ac | ||
| 61 | =================================================================== | ||
| 62 | --- gcc-4.5.0.orig/gcc/configure.ac 2010-06-25 11:34:01.433382161 -0700 | ||
| 63 | +++ gcc-4.5.0/gcc/configure.ac 2010-06-25 11:35:39.969383588 -0700 | ||
| 64 | @@ -4276,6 +4276,16 @@ | ||
| 65 | fi) | ||
| 66 | AC_SUBST(slibdir) | ||
| 67 | |||
| 68 | +AC_ARG_ENABLE([poison-system-directories], | ||
| 69 | + AS_HELP_STRING([--enable-poison-system-directories], | ||
| 70 | + [warn for use of native system header directories]),, | ||
| 71 | + [enable_poison_system_directories=no]) | ||
| 72 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
| 73 | + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], | ||
| 74 | + [1], | ||
| 75 | + [Define to warn for use of native system header directories]) | ||
| 76 | +fi | ||
| 77 | + | ||
| 78 | # Substitute configuration variables | ||
| 79 | AC_SUBST(subdirs) | ||
| 80 | AC_SUBST(srcdir) | ||
| 81 | Index: gcc-4.5.0/gcc/doc/invoke.texi | ||
| 82 | =================================================================== | ||
| 83 | --- gcc-4.5.0.orig/gcc/doc/invoke.texi 2010-04-06 07:02:22.000000000 -0700 | ||
| 84 | +++ gcc-4.5.0/gcc/doc/invoke.texi 2010-06-25 11:35:39.992666345 -0700 | ||
| 85 | @@ -252,6 +252,7 @@ | ||
| 86 | -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol | ||
| 87 | -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol | ||
| 88 | -Wpointer-arith -Wno-pointer-to-int-cast @gol | ||
| 89 | +-Wno-poison-system-directories @gol | ||
| 90 | -Wredundant-decls @gol | ||
| 91 | -Wreturn-type -Wsequence-point -Wshadow @gol | ||
| 92 | -Wsign-compare -Wsign-conversion -Wstack-protector @gol | ||
| 93 | @@ -3603,6 +3604,14 @@ | ||
| 94 | option will @emph{not} warn about unknown pragmas in system | ||
| 95 | headers---for that, @option{-Wunknown-pragmas} must also be used. | ||
| 96 | |||
| 97 | +@item -Wno-poison-system-directories | ||
| 98 | +@opindex Wno-poison-system-directories | ||
| 99 | +Do not warn for @option{-I} or @option{-L} options using system | ||
| 100 | +directories such as @file{/usr/include} when cross compiling. This | ||
| 101 | +option is intended for use in chroot environments when such | ||
| 102 | +directories contain the correct headers and libraries for the target | ||
| 103 | +system rather than the host. | ||
| 104 | + | ||
| 105 | @item -Wfloat-equal | ||
| 106 | @opindex Wfloat-equal | ||
| 107 | @opindex Wno-float-equal | ||
| 108 | Index: gcc-4.5.0/gcc/gcc.c | ||
| 109 | =================================================================== | ||
| 110 | --- gcc-4.5.0.orig/gcc/gcc.c 2010-02-11 04:23:08.000000000 -0800 | ||
| 111 | +++ gcc-4.5.0/gcc/gcc.c 2010-06-25 11:35:40.009381858 -0700 | ||
| 112 | @@ -792,6 +792,8 @@ | ||
| 113 | %{flto} %{fwhopr} %l " LINK_PIE_SPEC \ | ||
| 114 | "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ | ||
| 115 | %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ | ||
| 116 | + %{Wno-poison-system-directories:--no-poison-system-directories}\ | ||
| 117 | + %{Werror=poison-system-directories:--error-poison-system-directories}\ | ||
| 118 | %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ | ||
| 119 | %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ | ||
| 120 | %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\ | ||
| 121 | Index: gcc-4.5.0/gcc/incpath.c | ||
| 122 | =================================================================== | ||
| 123 | --- gcc-4.5.0.orig/gcc/incpath.c 2009-11-25 02:55:54.000000000 -0800 | ||
| 124 | +++ gcc-4.5.0/gcc/incpath.c 2010-06-25 11:35:40.017209818 -0700 | ||
| 125 | @@ -353,6 +353,24 @@ | ||
| 126 | } | ||
| 127 | fprintf (stderr, _("End of search list.\n")); | ||
| 128 | } | ||
| 129 | + | ||
| 130 | +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
| 131 | + if (flag_poison_system_directories) | ||
| 132 | + { | ||
| 133 | + struct cpp_dir *p; | ||
| 134 | + | ||
| 135 | + for (p = heads[QUOTE]; p; p = p->next) | ||
| 136 | + { | ||
| 137 | + if ((!strncmp (p->name, "/usr/include", 12)) | ||
| 138 | + || (!strncmp (p->name, "/usr/local/include", 18)) | ||
| 139 | + || (!strncmp (p->name, "/usr/X11R6/include", 18))) | ||
| 140 | + warning (OPT_Wpoison_system_directories, | ||
| 141 | + "include location \"%s\" is unsafe for " | ||
| 142 | + "cross-compilation", | ||
| 143 | + p->name); | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | +#endif | ||
| 147 | } | ||
| 148 | |||
| 149 | /* Use given -I paths for #include "..." but not #include <...>, and | ||
| 150 | diff -ur gcc-4.5.0.orig/gcc/Makefile.in gcc-4.5.0/gcc/Makefile.in | ||
| 151 | --- gcc-4.5.0.orig/gcc/Makefile.in 2010-09-29 17:13:49.164088845 -0500 | ||
| 152 | +++ gcc-4.5.0/gcc/Makefile.in 2010-09-29 18:48:19.300178501 -0500 | ||
| 153 | @@ -1965,7 +1965,7 @@ | ||
| 154 | |||
| 155 | incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ | ||
| 156 | intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ | ||
| 157 | - $(MACHMODE_H) | ||
| 158 | + $(MACHMODE_H) $(FLAGS_H) toplev.h | ||
| 159 | |||
| 160 | c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ | ||
| 161 | $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \ | ||
| 162 | diff -ur gcc-4.5.0.orig/gcc/configure gcc-4.5.0/gcc/configure | ||
| 163 | --- gcc-4.5.0.orig/gcc/configure 2010-09-29 14:58:31.702054881 -0500 | ||
| 164 | +++ gcc-4.5.0/gcc/configure 2010-09-29 18:46:31.486068500 -0500 | ||
| 165 | @@ -913,6 +913,7 @@ | ||
| 166 | enable_maintainer_mode | ||
| 167 | enable_version_specific_runtime_libs | ||
| 168 | with_slibdir | ||
| 169 | +enable_poison_system_directories | ||
| 170 | enable_plugin | ||
| 171 | enable_target_optspace | ||
| 172 | ' | ||
| 173 | @@ -1621,6 +1622,8 @@ | ||
| 174 | --enable-version-specific-runtime-libs | ||
| 175 | specify that runtime libraries should be | ||
| 176 | installed in a compiler-specific directory | ||
| 177 | + --enable-poison-system-directories | ||
| 178 | + warn for use of native system header directories | ||
| 179 | --enable-plugin enable plugin support | ||
| 180 | |||
| 181 | Optional Packages: | ||
| 182 | @@ -25339,6 +25377,19 @@ | ||
| 183 | |||
| 184 | |||
| 185 | |||
| 186 | +# Check whether --enable-poison-system-directories was given. | ||
| 187 | +if test "${enable_poison_system_directories+set}" = set; then : | ||
| 188 | + enableval=$enable_poison_system_directories; | ||
| 189 | +else | ||
| 190 | + enable_poison_system_directories=no | ||
| 191 | +fi | ||
| 192 | + | ||
| 193 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
| 194 | + | ||
| 195 | +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h | ||
| 196 | + | ||
| 197 | +fi | ||
| 198 | + | ||
| 199 | # Substitute configuration variables | ||
| 200 | |||
| 201 | |||
