diff options
author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2010-09-03 10:41:09 -0700 |
---|---|---|
committer | Saul Wold <Saul.Wold@intel.com> | 2010-09-08 16:36:52 -0700 |
commit | 75b90f1d6de833c9d0d5dcc7ebcb60fee2d26188 (patch) | |
tree | 65cc1604544686de911fb7f712a8abe4a666610d /meta/recipes-devtools/binutils | |
parent | 3e7db72216472050366c3059219660dea057e80b (diff) | |
download | poky-75b90f1d6de833c9d0d5dcc7ebcb60fee2d26188.tar.gz |
binutils: add binutils_poison.patch
and also correct the license field in the recipe
This fixes [BUGID #245]
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Diffstat (limited to 'meta/recipes-devtools/binutils')
5 files changed, 218 insertions, 4 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch new file mode 100644 index 0000000000..aefd3c3727 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch | |||
@@ -0,0 +1,213 @@ | |||
1 | This patch is recived from Mark Hatle | ||
2 | |||
3 | purpose: warn for uses of system directories when cross linking | ||
4 | |||
5 | Signed-Off-By: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 | ||
8 | |||
9 | 2008-07-02 Joseph Myers <joseph@codesourcery.com> | ||
10 | |||
11 | ld/ | ||
12 | * ld.h (args_type): Add error_poison_system_directories. | ||
13 | * ld.texinfo (--error-poison-system-directories): Document. | ||
14 | * ldfile.c (ldfile_add_library_path): Check | ||
15 | command_line.error_poison_system_directories. | ||
16 | * ldmain.c (main): Initialize | ||
17 | command_line.error_poison_system_directories. | ||
18 | * lexsup.c (enum option_values): Add | ||
19 | OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. | ||
20 | (ld_options): Add --error-poison-system-directories. | ||
21 | (parse_args): Handle new option. | ||
22 | |||
23 | 2007-06-13 Joseph Myers <joseph@codesourcery.com> | ||
24 | |||
25 | ld/ | ||
26 | * config.in: Regenerate. | ||
27 | * ld.h (args_type): Add poison_system_directories. | ||
28 | * ld.texinfo (--no-poison-system-directories): Document. | ||
29 | * ldfile.c (ldfile_add_library_path): Check | ||
30 | command_line.poison_system_directories. | ||
31 | * ldmain.c (main): Initialize | ||
32 | command_line.poison_system_directories. | ||
33 | * lexsup.c (enum option_values): Add | ||
34 | OPTION_NO_POISON_SYSTEM_DIRECTORIES. | ||
35 | (ld_options): Add --no-poison-system-directories. | ||
36 | (parse_args): Handle new option. | ||
37 | |||
38 | 2007-04-20 Joseph Myers <joseph@codesourcery.com> | ||
39 | |||
40 | Merge from Sourcery G++ binutils 2.17: | ||
41 | |||
42 | 2007-03-20 Joseph Myers <joseph@codesourcery.com> | ||
43 | Based on patch by Mark Hatle <mark.hatle@windriver.com>. | ||
44 | ld/ | ||
45 | * configure.in (--enable-poison-system-directories): New option. | ||
46 | * configure, config.in: Regenerate. | ||
47 | * ldfile.c (ldfile_add_library_path): If | ||
48 | ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, | ||
49 | /usr/lib, /usr/local/lib or /usr/X11R6/lib. | ||
50 | |||
51 | Index: binutils-2.20.1/ld/config.in | ||
52 | =================================================================== | ||
53 | --- binutils-2.20.1.orig/ld/config.in | ||
54 | +++ binutils-2.20.1/ld/config.in | ||
55 | @@ -4,6 +4,9 @@ | ||
56 | language is requested. */ | ||
57 | #undef ENABLE_NLS | ||
58 | |||
59 | +/* Define to warn for use of native system library directories */ | ||
60 | +#undef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
61 | + | ||
62 | /* Additional extension a shared object might have. */ | ||
63 | #undef EXTRA_SHLIB_EXTENSION | ||
64 | |||
65 | Index: binutils-2.20.1/ld/configure.in | ||
66 | =================================================================== | ||
67 | --- binutils-2.20.1.orig/ld/configure.in | ||
68 | +++ binutils-2.20.1/ld/configure.in | ||
69 | @@ -69,6 +69,16 @@ AC_SUBST(use_sysroot) | ||
70 | AC_SUBST(TARGET_SYSTEM_ROOT) | ||
71 | AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) | ||
72 | |||
73 | +AC_ARG_ENABLE([poison-system-directories], | ||
74 | + AS_HELP_STRING([--enable-poison-system-directories], | ||
75 | + [warn for use of native system library directories]),, | ||
76 | + [enable_poison_system_directories=no]) | ||
77 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
78 | + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], | ||
79 | + [1], | ||
80 | + [Define to warn for use of native system library directories]) | ||
81 | +fi | ||
82 | + | ||
83 | AC_ARG_ENABLE([got], | ||
84 | AS_HELP_STRING([--enable-got=<type>], | ||
85 | [GOT handling scheme (target, single, negative, multigot)]), | ||
86 | Index: binutils-2.20.1/ld/ld.h | ||
87 | =================================================================== | ||
88 | --- binutils-2.20.1.orig/ld/ld.h | ||
89 | +++ binutils-2.20.1/ld/ld.h | ||
90 | @@ -176,6 +176,14 @@ typedef struct { | ||
91 | input files. */ | ||
92 | bfd_boolean accept_unknown_input_arch; | ||
93 | |||
94 | + /* If TRUE (the default) warn for uses of system directories when | ||
95 | + cross linking. */ | ||
96 | + bfd_boolean poison_system_directories; | ||
97 | + | ||
98 | + /* If TRUE (default FALSE) give an error for uses of system | ||
99 | + directories when cross linking instead of a warning. */ | ||
100 | + bfd_boolean error_poison_system_directories; | ||
101 | + | ||
102 | /* Big or little endian as set on command line. */ | ||
103 | enum endian_enum endian; | ||
104 | |||
105 | Index: binutils-2.20.1/ld/ld.texinfo | ||
106 | =================================================================== | ||
107 | --- binutils-2.20.1.orig/ld/ld.texinfo | ||
108 | +++ binutils-2.20.1/ld/ld.texinfo | ||
109 | @@ -2084,6 +2084,18 @@ string identifying the original linked f | ||
110 | |||
111 | Passing @code{none} for @var{style} disables the setting from any | ||
112 | @code{--build-id} options earlier on the command line. | ||
113 | + | ||
114 | +@kindex --no-poison-system-directories | ||
115 | +@item --no-poison-system-directories | ||
116 | +Do not warn for @option{-L} options using system directories such as | ||
117 | +@file{/usr/lib} when cross linking. This option is intended for use | ||
118 | +in chroot environments when such directories contain the correct | ||
119 | +libraries for the target system rather than the host. | ||
120 | + | ||
121 | +@kindex --error-poison-system-directories | ||
122 | +@item --error-poison-system-directories | ||
123 | +Give an error instead of a warning for @option{-L} options using | ||
124 | +system directories when cross linking. | ||
125 | @end table | ||
126 | |||
127 | @c man end | ||
128 | Index: binutils-2.20.1/ld/ldfile.c | ||
129 | =================================================================== | ||
130 | --- binutils-2.20.1.orig/ld/ldfile.c | ||
131 | +++ binutils-2.20.1/ld/ldfile.c | ||
132 | @@ -120,6 +120,23 @@ ldfile_add_library_path (const char *nam | ||
133 | { | ||
134 | new_dirs->name = xstrdup (name); | ||
135 | new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE); | ||
136 | + | ||
137 | +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
138 | + if (command_line.poison_system_directories | ||
139 | + && ((!strncmp (name, "/lib", 4)) | ||
140 | + || (!strncmp (name, "/usr/lib", 8)) | ||
141 | + || (!strncmp (name, "/usr/local/lib", 14)) | ||
142 | + || (!strncmp (name, "/usr/X11R6/lib", 14)))) | ||
143 | + { | ||
144 | + if (command_line.error_poison_system_directories) | ||
145 | + einfo (_("%X%P: error: library search path \"%s\" is unsafe for " | ||
146 | + "cross-compilation\n"), name); | ||
147 | + else | ||
148 | + einfo (_("%P: warning: library search path \"%s\" is unsafe for " | ||
149 | + "cross-compilation\n"), name); | ||
150 | + } | ||
151 | +#endif | ||
152 | + | ||
153 | } | ||
154 | } | ||
155 | |||
156 | Index: binutils-2.20.1/ld/ldmain.c | ||
157 | =================================================================== | ||
158 | --- binutils-2.20.1.orig/ld/ldmain.c | ||
159 | +++ binutils-2.20.1/ld/ldmain.c | ||
160 | @@ -252,6 +252,8 @@ main (int argc, char **argv) | ||
161 | command_line.warn_mismatch = TRUE; | ||
162 | command_line.warn_search_mismatch = TRUE; | ||
163 | command_line.check_section_addresses = -1; | ||
164 | + command_line.poison_system_directories = TRUE; | ||
165 | + command_line.error_poison_system_directories = FALSE; | ||
166 | |||
167 | /* We initialize DEMANGLING based on the environment variable | ||
168 | COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the | ||
169 | Index: binutils-2.20.1/ld/lexsup.c | ||
170 | =================================================================== | ||
171 | --- binutils-2.20.1.orig/ld/lexsup.c | ||
172 | +++ binutils-2.20.1/ld/lexsup.c | ||
173 | @@ -166,7 +166,9 @@ enum option_values | ||
174 | OPTION_WARN_SHARED_TEXTREL, | ||
175 | OPTION_WARN_ALTERNATE_EM, | ||
176 | OPTION_REDUCE_MEMORY_OVERHEADS, | ||
177 | - OPTION_DEFAULT_SCRIPT | ||
178 | + OPTION_DEFAULT_SCRIPT, | ||
179 | + OPTION_NO_POISON_SYSTEM_DIRECTORIES, | ||
180 | + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES | ||
181 | }; | ||
182 | |||
183 | /* The long options. This structure is used for both the option | ||
184 | @@ -575,6 +577,14 @@ static const struct ld_option ld_options | ||
185 | TWO_DASHES }, | ||
186 | { {"wrap", required_argument, NULL, OPTION_WRAP}, | ||
187 | '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, | ||
188 | + { {"no-poison-system-directories", no_argument, NULL, | ||
189 | + OPTION_NO_POISON_SYSTEM_DIRECTORIES}, | ||
190 | + '\0', NULL, N_("Do not warn for -L options using system directories"), | ||
191 | + TWO_DASHES }, | ||
192 | + { {"error-poison-system-directories", no_argument, NULL, | ||
193 | + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, | ||
194 | + '\0', NULL, N_("Give an error for -L options using system directories"), | ||
195 | + TWO_DASHES }, | ||
196 | }; | ||
197 | |||
198 | #define OPTION_COUNT ARRAY_SIZE (ld_options) | ||
199 | @@ -1480,6 +1490,14 @@ parse_args (unsigned argc, char **argv) | ||
200 | einfo (_("%P%X: --hash-size needs a numeric argument\n")); | ||
201 | } | ||
202 | break; | ||
203 | + | ||
204 | + case OPTION_NO_POISON_SYSTEM_DIRECTORIES: | ||
205 | + command_line.poison_system_directories = FALSE; | ||
206 | + break; | ||
207 | + | ||
208 | + case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: | ||
209 | + command_line.error_poison_system_directories = TRUE; | ||
210 | + break; | ||
211 | } | ||
212 | } | ||
213 | |||
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb index f4a7a0e619..631be4fe7f 100644 --- a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb +++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb | |||
@@ -1,3 +1,3 @@ | |||
1 | require binutils_${PV}.bb | 1 | require binutils_${PV}.bb |
2 | require binutils-cross-canadian.inc | 2 | require binutils-cross-canadian.inc |
3 | PR = "r4" | 3 | PR = "r5" |
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb index f3bc5bfc22..88627f87be 100644 --- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb +++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb | |||
@@ -4,7 +4,7 @@ inherit crosssdk | |||
4 | 4 | ||
5 | PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk" | 5 | PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk" |
6 | 6 | ||
7 | PR = "r3" | 7 | PR = "r4" |
8 | 8 | ||
9 | do_configure_prepend () { | 9 | do_configure_prepend () { |
10 | sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt | 10 | sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt |
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 7a352b5d3b..501c1be1ec 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc | |||
@@ -2,7 +2,7 @@ DESCRIPTION = "A GNU collection of binary utilities" | |||
2 | HOMEPAGE = "http://www.gnu.org/software/binutils/" | 2 | HOMEPAGE = "http://www.gnu.org/software/binutils/" |
3 | BUGTRACKER = "http://sourceware.org/bugzilla/" | 3 | BUGTRACKER = "http://sourceware.org/bugzilla/" |
4 | SECTION = "devel" | 4 | SECTION = "devel" |
5 | LICENSE = "GPLv2" | 5 | LICENSE = "GPLv3" |
6 | 6 | ||
7 | DEPENDS = "flex-native bison-native" | 7 | DEPENDS = "flex-native bison-native" |
8 | 8 | ||
diff --git a/meta/recipes-devtools/binutils/binutils_2.20.1.bb b/meta/recipes-devtools/binutils/binutils_2.20.1.bb index d5cd985cca..2a1012852e 100644 --- a/meta/recipes-devtools/binutils/binutils_2.20.1.bb +++ b/meta/recipes-devtools/binutils/binutils_2.20.1.bb | |||
@@ -1,6 +1,6 @@ | |||
1 | require binutils.inc | 1 | require binutils.inc |
2 | 2 | ||
3 | PR = "r2" | 3 | PR = "r3" |
4 | 4 | ||
5 | LIC_FILES_CHKSUM="\ | 5 | LIC_FILES_CHKSUM="\ |
6 | file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\ | 6 | file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\ |
@@ -27,6 +27,7 @@ SRC_URI = "\ | |||
27 | file://binutils-mips-pie.patch \ | 27 | file://binutils-mips-pie.patch \ |
28 | file://binutils-libtool.patch \ | 28 | file://binutils-libtool.patch \ |
29 | file://libiberty_path_fix.patch \ | 29 | file://libiberty_path_fix.patch \ |
30 | file://binutils-poison.patch \ | ||
30 | " | 31 | " |
31 | 32 | ||
32 | # powerpc patches | 33 | # powerpc patches |