source: clfs-embedded/patches/binutils-2.17-uclibc-1.patch@ 3bb8e6a

Last change on this file since 3bb8e6a was 841271e, checked in by Jim Gifford <clfs@…>, 18 years ago

uClibc updates

  • Property mode set to 100644
File size: 9.4 KB
RevLine 
[841271e]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2006-11-13
3Initial Package Version: 2.17
4Origin: uClibc and Buildroot
5Upstream Status: uClibc Specific
6Description: Makes Binutils uClibc Friendly
7
8diff -Naur binutils-2.17.orig/bfd/configure binutils-2.17/bfd/configure
9--- binutils-2.17.orig/bfd/configure 2006-06-23 11:17:03.000000000 -0700
10+++ binutils-2.17/bfd/configure 2006-11-13 20:58:00.353290460 -0800
11@@ -3576,7 +3576,7 @@
12 ;;
13
14 # This must be Linux ELF.
15-linux-gnu*)
16+linux-gnu*|linux-uclibc*)
17 lt_cv_deplibs_check_method=pass_all
18 ;;
19
20diff -Naur binutils-2.17.orig/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
21--- binutils-2.17.orig/bfd/elf32-mips.c 2006-03-22 01:28:13.000000000 -0800
22+++ binutils-2.17/bfd/elf32-mips.c 2006-11-13 20:56:15.528689446 -0800
23@@ -1617,7 +1617,9 @@
24
25 /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
26 page sizes of up to that limit, so we need to respect it. */
27-#define ELF_MAXPAGESIZE 0x10000
28+/*#define ELF_MAXPAGESIZE 0x10000*/
29+/* Use 4K to shrink the elf header. NOT for general use! */
30+#define ELF_MAXPAGESIZE 0x1000
31 #define elf32_bed elf32_tradbed
32
33 /* Include the target file again for this target. */
34diff -Naur binutils-2.17.orig/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
35--- binutils-2.17.orig/bfd/elfn32-mips.c 2005-11-23 06:04:17.000000000 -0800
36+++ binutils-2.17/bfd/elfn32-mips.c 2006-11-13 20:56:15.528689446 -0800
37@@ -2402,7 +2402,9 @@
38
39 /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
40 page sizes of up to that limit, so we need to respect it. */
41-#define ELF_MAXPAGESIZE 0x10000
42+/*#define ELF_MAXPAGESIZE 0x10000*/
43+/* Use 4K to shrink the elf header. NOT for general use! */
44+#define ELF_MAXPAGESIZE 0x1000
45 #define elf32_bed elf32_tradbed
46
47 /* Include the target file again for this target. */
48diff -Naur binutils-2.17.orig/bfd/opncls.c binutils-2.17/bfd/opncls.c
49--- binutils-2.17.orig/bfd/opncls.c 2006-03-16 04:20:16.000000000 -0800
50+++ binutils-2.17/bfd/opncls.c 2006-11-13 20:58:19.424670543 -0800
51@@ -158,6 +158,13 @@
52 {
53 bfd *nbfd;
54 const bfd_target *target_vec;
55+ struct stat s;
56+
57+ if (stat (filename, &s) == 0)
58+ if (S_ISDIR(s.st_mode)) {
59+ bfd_set_error (bfd_error_file_not_recognized);
60+ return NULL;
61+ }
62
63 nbfd = _bfd_new_bfd ();
64 if (nbfd == NULL)
65diff -Naur binutils-2.17.orig/binutils/configure binutils-2.17/binutils/configure
66--- binutils-2.17.orig/binutils/configure 2006-04-06 14:49:29.000000000 -0700
67+++ binutils-2.17/binutils/configure 2006-11-13 20:58:00.357290330 -0800
68@@ -3411,7 +3411,7 @@
69 ;;
70
71 # This must be Linux ELF.
72-linux-gnu*)
73+linux-gnu*|linux-uclibc*)
74 lt_cv_deplibs_check_method=pass_all
75 ;;
76
77diff -Naur binutils-2.17.orig/configure binutils-2.17/configure
78--- binutils-2.17.orig/configure 2006-04-06 14:49:25.000000000 -0700
79+++ binutils-2.17/configure 2006-11-13 20:58:00.361290200 -0800
80@@ -1276,7 +1276,7 @@
81 am33_2.0-*-linux*)
82 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
83 ;;
84- sh-*-linux*)
85+ sh*-*-linux*)
86 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
87 ;;
88 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
89@@ -1305,7 +1305,7 @@
90 arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
91 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
92 ;;
93- arm*-*-linux-gnueabi)
94+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
95 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
96 noconfigdirs="$noconfigdirs target-libjava target-libobjc"
97 ;;
98@@ -1584,7 +1584,7 @@
99 romp-*-*)
100 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
101 ;;
102- sh-*-* | sh64-*-*)
103+ sh*-*-* | sh64-*-*)
104 case "${host}" in
105 i[3456789]86-*-vsta) ;; # don't add gprof back in
106 i[3456789]86-*-go32*) ;; # don't add gprof back in
107diff -Naur binutils-2.17.orig/configure.in binutils-2.17/configure.in
108--- binutils-2.17.orig/configure.in 2006-06-23 11:19:53.000000000 -0700
109+++ binutils-2.17/configure.in 2006-11-13 20:58:00.361290200 -0800
110@@ -468,7 +468,7 @@
111 am33_2.0-*-linux*)
112 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
113 ;;
114- sh-*-linux*)
115+ sh*-*-linux*)
116 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
117 ;;
118 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
119@@ -497,7 +497,7 @@
120 arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
121 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
122 ;;
123- arm*-*-linux-gnueabi)
124+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
125 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
126 noconfigdirs="$noconfigdirs target-libjava target-libobjc"
127 ;;
128@@ -776,7 +776,7 @@
129 romp-*-*)
130 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
131 ;;
132- sh-*-* | sh64-*-*)
133+ sh*-*-* | sh64-*-*)
134 case "${host}" in
135 i[[3456789]]86-*-vsta) ;; # don't add gprof back in
136 i[[3456789]]86-*-go32*) ;; # don't add gprof back in
137diff -Naur binutils-2.17.orig/gas/configure binutils-2.17/gas/configure
138--- binutils-2.17.orig/gas/configure 2006-04-06 14:49:31.000000000 -0700
139+++ binutils-2.17/gas/configure 2006-11-13 20:58:00.365290070 -0800
140@@ -3411,7 +3411,7 @@
141 ;;
142
143 # This must be Linux ELF.
144-linux-gnu*)
145+linux-gnu*|linux-uclibc*)
146 lt_cv_deplibs_check_method=pass_all
147 ;;
148
149diff -Naur binutils-2.17.orig/gprof/configure binutils-2.17/gprof/configure
150--- binutils-2.17.orig/gprof/configure 2006-04-06 14:49:33.000000000 -0700
151+++ binutils-2.17/gprof/configure 2006-11-13 20:58:00.369289940 -0800
152@@ -3414,6 +3414,11 @@
153 lt_cv_deplibs_check_method=pass_all
154 ;;
155
156+linux-uclibc*)
157+ lt_cv_deplibs_check_method=pass_all
158+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
159+ ;;
160+
161 netbsd* | knetbsd*-gnu)
162 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
163 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
164diff -Naur binutils-2.17.orig/ld/Makefile.am binutils-2.17/ld/Makefile.am
165--- binutils-2.17.orig/ld/Makefile.am 2006-06-02 21:45:50.000000000 -0700
166+++ binutils-2.17/ld/Makefile.am 2006-11-13 20:57:35.498097688 -0800
167@@ -20,7 +20,7 @@
168 # We put the scripts in the directory $(scriptdir)/ldscripts.
169 # We can't put the scripts in $(datadir) because the SEARCH_DIR
170 # directives need to be different for native and cross linkers.
171-scriptdir = $(tooldir)/lib
172+scriptdir = $(libdir)
173
174 EMUL = @EMUL@
175 EMULATION_OFILES = @EMULATION_OFILES@
176diff -Naur binutils-2.17.orig/ld/Makefile.in binutils-2.17/ld/Makefile.in
177--- binutils-2.17.orig/ld/Makefile.in 2006-06-02 21:45:50.000000000 -0700
178+++ binutils-2.17/ld/Makefile.in 2006-11-13 20:57:35.498097688 -0800
179@@ -269,7 +269,7 @@
180 # We put the scripts in the directory $(scriptdir)/ldscripts.
181 # We can't put the scripts in $(datadir) because the SEARCH_DIR
182 # directives need to be different for native and cross linkers.
183-scriptdir = $(tooldir)/lib
184+scriptdir = $(libdir)
185 BASEDIR = $(srcdir)/..
186 BFDDIR = $(BASEDIR)/bfd
187 INCDIR = $(BASEDIR)/include
188diff -Naur binutils-2.17.orig/ld/configure binutils-2.17/ld/configure
189--- binutils-2.17.orig/ld/configure 2006-04-11 03:36:26.000000000 -0700
190+++ binutils-2.17/ld/configure 2006-11-13 20:58:00.373289810 -0800
191@@ -3413,7 +3413,7 @@
192 ;;
193
194 # This must be Linux ELF.
195-linux-gnu*)
196+linux-gnu*|linux-uclibc*)
197 lt_cv_deplibs_check_method=pass_all
198 ;;
199
200diff -Naur binutils-2.17.orig/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
201--- binutils-2.17.orig/ld/emultempl/elf32.em 2006-06-12 06:05:04.000000000 -0700
202+++ binutils-2.17/ld/emultempl/elf32.em 2006-11-13 20:58:36.268122666 -0800
203@@ -970,6 +970,8 @@
204 && command_line.rpath == NULL)
205 {
206 lib_path = (const char *) getenv ("LD_RUN_PATH");
207+ if ((lib_path) && (strlen (lib_path) == 0))
208+ lib_path = NULL;
209 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
210 force))
211 break;
212@@ -1154,6 +1156,8 @@
213 rpath = command_line.rpath;
214 if (rpath == NULL)
215 rpath = (const char *) getenv ("LD_RUN_PATH");
216+ if ((rpath) && (strlen (rpath) == 0))
217+ rpath = NULL;
218 if (! (bfd_elf_size_dynamic_sections
219 (output_bfd, command_line.soname, rpath,
220 command_line.filter_shlib,
221diff -Naur binutils-2.17.orig/libtool.m4 binutils-2.17/libtool.m4
222--- binutils-2.17.orig/libtool.m4 2005-12-27 08:37:57.000000000 -0800
223+++ binutils-2.17/libtool.m4 2006-11-13 20:58:00.373289810 -0800
224@@ -739,7 +739,7 @@
225 ;;
226
227 # This must be Linux ELF.
228-linux-gnu*)
229+linux-gnu*|linux-uclibc*)
230 lt_cv_deplibs_check_method=pass_all
231 ;;
232
233diff -Naur binutils-2.17.orig/ltconfig binutils-2.17/ltconfig
234--- binutils-2.17.orig/ltconfig 2005-07-15 19:36:38.000000000 -0700
235+++ binutils-2.17/ltconfig 2006-11-13 20:58:00.373289810 -0800
236@@ -602,6 +602,7 @@
237
238 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
239 case $host_os in
240+linux-uclibc*) ;;
241 linux-gnu*) ;;
242 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
243 esac
244@@ -1247,7 +1248,7 @@
245 ;;
246
247 # This must be Linux ELF.
248-linux-gnu*)
249+linux-gnu*|linux-uclibc*)
250 version_type=linux
251 need_lib_prefix=no
252 need_version=no
253diff -Naur binutils-2.17.orig/opcodes/configure binutils-2.17/opcodes/configure
254--- binutils-2.17.orig/opcodes/configure 2006-02-17 06:36:28.000000000 -0800
255+++ binutils-2.17/opcodes/configure 2006-11-13 20:58:00.377289680 -0800
256@@ -3579,7 +3579,7 @@
257 ;;
258
259 # This must be Linux ELF.
260-linux-gnu*)
261+linux-gnu*|linux-uclibc*)
262 lt_cv_deplibs_check_method=pass_all
263 ;;
264
Note: See TracBrowser for help on using the repository browser.