aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/gcc-dynamic-linker.patch
blob: 9b34664515d62b1c15b601a4bd34e19be97af293 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
Submitted By:            Kevin Day <thekevinday AT gmail DOT com>
Date:                    2008-12-19
Initial Package Version: 4.3.2
Upstream Status:         Not submitted
Description:             Why not just be able to define the prefix of the dynamic linker instead of hardcoding it..
This includes the --nostdinc patch as well, so think of this as a specs-3 patch
This also allows for specifying the dynamic-linker as well

diff -r -u gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
--- gcc-4.4.0.orig/gcc/Makefile.in	2009-06-06 09:15:56 -0500
+++ gcc-4.4.0/gcc/Makefile.in	2009-06-06 09:40:07 -0500
@@ -893,7 +893,7 @@
 # This is the variable actually used when we compile. If you change this,
 # you probably want to update BUILD_CFLAGS in configure.ac
 ALL_CFLAGS = $(T_CFLAGS) \
-  $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
+  $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ @NOSTDINC@
 
 # Likewise.  Put INCLUDES at the beginning: this way, if some autoconf macro
 # puts -I options in CPPFLAGS, our include files in the srcdir will always
@@ -1947,6 +1947,8 @@
   -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
   -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
+  -DDYNAMIC_LINKER_PREFIX=\"@DYNAMICLINKERPREFIX@\" \
+  -DDYNAMIC_LINKER=\"@DYNAMICLINKER@\" \
   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
   -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
   -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
diff -r -u gcc-4.4.0.orig/gcc/config/alpha/gnu.h gcc-4.4.0/gcc/config/alpha/gnu.h
--- gcc-4.4.0.orig/gcc/config/alpha/gnu.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/alpha/gnu.h	2009-06-06 09:40:29 -0500
@@ -11,7 +11,7 @@
     } while (0)
 
 #undef ELF_DYNAMIC_LINKER
-#define ELF_DYNAMIC_LINKER	"/lib/ld.so"
+#define ELF_DYNAMIC_LINKER	DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef	STARTFILE_SPEC
 #define STARTFILE_SPEC \
diff -r -u gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h gcc-4.4.0/gcc/config/alpha/linux-elf.h
--- gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/alpha/linux-elf.h	2009-06-06 09:40:07 -0500
@@ -27,8 +27,8 @@
 #define EXTRA_SPECS \
 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
 
-#define GLIBC_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define GLIBC_DYNAMIC_LINKER	DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKER   DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #if UCLIBC_DEFAULT
 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
 #else
diff -r -u gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h gcc-4.4.0/gcc/config/arm/linux-eabi.h
--- gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h	2009-06-06 09:16:10 -0500
+++ gcc-4.4.0/gcc/config/arm/linux-eabi.h	2009-06-06 09:40:07 -0500
@@ -61,7 +61,7 @@
 /* Use ld-linux.so.3 so that it will be possible to run "classic"
    GNU/Linux binaries on an EABI system.  */
 #undef  GLIBC_DYNAMIC_LINKER
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
    use the GNU/Linux version, not the generic BPABI version.  */
diff -r -u gcc-4.4.0.orig/gcc/config/arm/linux-elf.h gcc-4.4.0/gcc/config/arm/linux-elf.h
--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h	2009-06-06 09:16:10 -0500
+++ gcc-4.4.0/gcc/config/arm/linux-elf.h	2009-06-06 09:40:07 -0500
@@ -62,7 +62,7 @@
 
 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
    %{b} \
diff -r -u gcc-4.4.0.orig/gcc/config/bfin/linux.h gcc-4.4.0/gcc/config/bfin/linux.h
--- gcc-4.4.0.orig/gcc/config/bfin/linux.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/bfin/linux.h	2009-06-06 09:40:07 -0500
@@ -22,7 +22,7 @@
   %{shared:-G -Bdynamic} \
   %{!shared: %{!static: \
    %{rdynamic:-export-dynamic} \
-   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+   %{!dynamic-linker:-dynamic-linker DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER}} \
    %{static}} -init __init -fini __fini"
 
 #define MD_UNWIND_SUPPORT "config/bfin/linux-unwind.h"
diff -r -u gcc-4.4.0.orig/gcc/config/cris/linux.h gcc-4.4.0/gcc/config/cris/linux.h
--- gcc-4.4.0.orig/gcc/config/cris/linux.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/cris/linux.h	2009-06-06 09:40:07 -0500
@@ -103,7 +103,7 @@
 #undef CRIS_DEFAULT_CPU_VERSION
 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 /* We need an -rpath-link to ld.so.1, and presumably to each directory
    specified with -B.  */
diff -r -u gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
--- gcc-4.4.0.orig/gcc/config/freebsd-spec.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/freebsd-spec.h	2009-06-06 09:41:42 -0500
@@ -144,7 +144,7 @@
 #endif
 
 #if FBSD_MAJOR < 6
-#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
+#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #else
-#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
+#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #endif
diff -r -u gcc-4.4.0.orig/gcc/config/frv/linux.h gcc-4.4.0/gcc/config/frv/linux.h
--- gcc-4.4.0.orig/gcc/config/frv/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/frv/linux.h	2009-06-06 09:40:07 -0500
@@ -35,7 +35,7 @@
 #define ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef LINK_SPEC
 #define LINK_SPEC "\
diff -r -u gcc-4.4.0.orig/gcc/config/i386/linux.h gcc-4.4.0/gcc/config/i386/linux.h
--- gcc-4.4.0.orig/gcc/config/i386/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/i386/linux.h	2009-06-06 09:40:07 -0500
@@ -100,7 +100,7 @@
 
 /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
 #define LINK_EMULATION "elf_i386"
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef  ASM_SPEC
 #define ASM_SPEC \
diff -r -u gcc-4.4.0.orig/gcc/config/i386/linux64.h gcc-4.4.0/gcc/config/i386/linux64.h
--- gcc-4.4.0.orig/gcc/config/i386/linux64.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/i386/linux64.h	2009-06-06 09:40:07 -0500
@@ -58,8 +58,8 @@
    When the -shared link option is used a final link is not being
    done.  */
 
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+#define GLIBC_DYNAMIC_LINKER32 "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef ASM_SPEC
 #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
diff -r -u gcc-4.4.0.orig/gcc/config/ia64/linux.h gcc-4.4.0/gcc/config/ia64/linux.h
--- gcc-4.4.0.orig/gcc/config/ia64/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/ia64/linux.h	2009-06-06 09:40:07 -0500
@@ -37,7 +37,7 @@
 /* Define this for shared library support because it isn't in the main
    linux.h file.  */
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef LINK_SPEC
 #define LINK_SPEC "\
diff -r -u gcc-4.4.0.orig/gcc/config/knetbsd-gnu.h gcc-4.4.0/gcc/config/knetbsd-gnu.h
--- gcc-4.4.0.orig/gcc/config/knetbsd-gnu.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/knetbsd-gnu.h	2009-06-06 09:40:59 -0500
@@ -34,5 +34,5 @@
 
 #ifdef GLIBC_DYNAMIC_LINKER
 #undef GLIBC_DYNAMIC_LINKER
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER  DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #endif
diff -r -u gcc-4.4.0.orig/gcc/config/linux.h gcc-4.4.0/gcc/config/linux.h
--- gcc-4.4.0.orig/gcc/config/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/linux.h	2009-06-06 09:40:07 -0500
@@ -117,9 +117,9 @@
    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
    supporting both 32-bit and 64-bit compilation.  */
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #define LINUX_DYNAMIC_LINKER \
   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
 #define LINUX_DYNAMIC_LINKER32 \
@@ -135,3 +135,8 @@
 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
 
 #define TARGET_POSIX_IO
+
+#ifdef NOSTDINC
+#undef STANDARD_INCLUDE_DIR
+#define STANDARD_INCLUDE_DIR 0
+#endif
diff -r -u gcc-4.4.0.orig/gcc/config/m32r/linux.h gcc-4.4.0/gcc/config/m32r/linux.h
--- gcc-4.4.0.orig/gcc/config/m32r/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/m32r/linux.h	2009-06-06 09:40:07 -0500
@@ -58,7 +58,7 @@
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef	LINK_SPEC
 #if TARGET_LITTLE_ENDIAN
diff -r -u gcc-4.4.0.orig/gcc/config/m68k/linux.h gcc-4.4.0/gcc/config/m68k/linux.h
--- gcc-4.4.0.orig/gcc/config/m68k/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/m68k/linux.h	2009-06-06 09:40:07 -0500
@@ -84,7 +84,7 @@
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef LINK_SPEC
 #define LINK_SPEC "-m m68kelf %{shared} \
diff -r -u gcc-4.4.0.orig/gcc/config/mips/linux.h gcc-4.4.0/gcc/config/mips/linux.h
--- gcc-4.4.0.orig/gcc/config/mips/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/mips/linux.h	2009-06-06 09:40:07 -0500
@@ -64,7 +64,7 @@
 #undef MIPS_DEFAULT_GVALUE
 #define MIPS_DEFAULT_GVALUE 0
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 /* Borrowed from sparc/linux.h */
 #undef LINK_SPEC
diff -r -u gcc-4.4.0.orig/gcc/config/mips/linux64.h gcc-4.4.0/gcc/config/mips/linux64.h
--- gcc-4.4.0.orig/gcc/config/mips/linux64.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/mips/linux64.h	2009-06-06 09:40:07 -0500
@@ -35,10 +35,10 @@
 %{!shared: \
   %{profile:-lc_p} %{!profile:-lc}}"
 
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
+#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #define LINUX_DYNAMIC_LINKERN32 \
   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
 
diff -r -u gcc-4.4.0.orig/gcc/config/mn10300/linux.h gcc-4.4.0/gcc/config/mn10300/linux.h
--- gcc-4.4.0.orig/gcc/config/mn10300/linux.h	2009-06-06 09:16:11 -0500
+++ gcc-4.4.0/gcc/config/mn10300/linux.h	2009-06-06 09:40:07 -0500
@@ -32,7 +32,7 @@
 #undef  ASM_SPEC
 #define ASM_SPEC "%{Wa,*:%*}"
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef  LINK_SPEC
 #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
diff -r -u gcc-4.4.0.orig/gcc/config/rs6000/linux64.h gcc-4.4.0/gcc/config/rs6000/linux64.h
--- gcc-4.4.0.orig/gcc/config/rs6000/linux64.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/rs6000/linux64.h	2009-06-06 09:40:07 -0500
@@ -342,10 +342,10 @@
 #undef	LINK_OS_DEFAULT_SPEC
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
 
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 #if UCLIBC_DEFAULT
 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
 #else
diff -r -u gcc-4.4.0.orig/gcc/config/s390/linux.h gcc-4.4.0/gcc/config/s390/linux.h
--- gcc-4.4.0.orig/gcc/config/s390/linux.h	2009-06-06 09:16:10 -0500
+++ gcc-4.4.0/gcc/config/s390/linux.h	2009-06-06 09:40:07 -0500
@@ -72,8 +72,8 @@
 #define MULTILIB_DEFAULTS { "m31" }
 #endif
 
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
-#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
+#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef  LINK_SPEC
 #define LINK_SPEC \
diff -r -u gcc-4.4.0.orig/gcc/config/sh/linux.h gcc-4.4.0/gcc/config/sh/linux.h
--- gcc-4.4.0.orig/gcc/config/sh/linux.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/sh/linux.h	2009-06-06 09:40:07 -0500
@@ -47,7 +47,7 @@
 
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef SUBTARGET_LINK_EMUL_SUFFIX
 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
diff -r -u gcc-4.4.0.orig/gcc/config/sparc/linux.h gcc-4.4.0/gcc/config/sparc/linux.h
--- gcc-4.4.0.orig/gcc/config/sparc/linux.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/sparc/linux.h	2009-06-06 09:40:07 -0500
@@ -83,7 +83,7 @@
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef  LINK_SPEC
 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
diff -r -u gcc-4.4.0.orig/gcc/config/sparc/linux64.h gcc-4.4.0/gcc/config/sparc/linux64.h
--- gcc-4.4.0.orig/gcc/config/sparc/linux64.h	2009-06-06 09:16:15 -0500
+++ gcc-4.4.0/gcc/config/sparc/linux64.h	2009-06-06 09:40:07 -0500
@@ -109,8 +109,8 @@
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #ifdef SPARC_BI_ARCH
 
diff -r -u gcc-4.4.0.orig/gcc/config/xtensa/linux.h gcc-4.4.0/gcc/config/xtensa/linux.h
--- gcc-4.4.0.orig/gcc/config/xtensa/linux.h	2009-06-06 09:16:10 -0500
+++ gcc-4.4.0/gcc/config/xtensa/linux.h	2009-06-06 09:40:07 -0500
@@ -43,7 +43,7 @@
   %{mlongcalls:--longcalls} \
   %{mno-longcalls:--no-longcalls}"
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
 
 #undef LINK_SPEC
 #define LINK_SPEC \
diff -r -u gcc-4.4.0.orig/gcc/configure gcc-4.4.0/gcc/configure
--- gcc-4.4.0.orig/gcc/configure	2009-06-06 09:16:16 -0500
+++ gcc-4.4.0/gcc/configure	2009-06-06 09:40:07 -0500
@@ -1118,6 +1118,14 @@
   --with-gc={page,zone}   choose the garbage collection mechanism to use
                           with the compiler
   --with-system-zlib      use installed libz
+  --with-dynamic-linker=PATH
+                          specifies path to dynamic linker.
+                          example: "/lib/ld-linux.so.2", where this defines "ld-linux.so.2"
+  --with-dynamic-linker-prefix=PATH
+                          specifies path to dynamic linker.
+                          example: "/lib/ld-linux.so.2", where this defines "/lib"
+  --with-nostdinc         build gcc to ignore standard include directories.
+                          You will have to use --with-local-prefix with this option.
   --with-slibdir=DIR      shared libraries in DIR [LIBDIR]
   --with-datarootdir=DIR  Use DIR as the data root [PREFIX/share]
   --with-docdir=DIR       Install documentation in DIR [DATAROOTDIR]
@@ -5631,6 +5639,47 @@
 #define SIZEOF_INT $ac_cv_sizeof_int
 _ACEOF
 
+# Check whether --with-dynamic-linker was given.
+
+DYNAMICLINKER="ld-linux.so.2" ;
+if test "${with_dynamic_linker+set}" = set; then
+  withval="$with_dynamic_linker"
+  case "${withval}" in
+yes)    { { echo "$as_me:$LINENO: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&5
+echo "$as_me: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&2;}
+   { (exit 1); exit 1; }; } ;;
+no)     ;;
+*)     DYNAMICLINKER=$withval ;;
+esac
+fi;
+
+# Check whether --with-dynamic-linker-prefix= was given.
+
+DYNAMICLINKERPREFIX="/lib" ;
+if test "${with_dynamic_linker_prefix+set}" = set; then
+  withval="$with_dynamic_linker_prefix"
+  case "${withval}" in
+yes)    { { echo "$as_me:$LINENO: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&5
+echo "$as_me: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&2;}
+   { (exit 1); exit 1; }; } ;;
+no)     ;;
+*)     DYNAMICLINKERPREFIX=$withval ;;
+esac
+
+fi;
+
+# Check whether --with-nostdinc was given.
+
+if test "${with_nostdinc+set}" = set; then
+  withval="$with_nostdinc"
+  case "${withval}" in
+yes)   NOSTDINC="-DNOSTDINC" ;;
+no)    ;;
+*)     NOSTDINC="-DNOSTDINC" ;;
+esac
+fi;
+
+
 
 echo "$as_me:$LINENO: checking for long" >&5
 echo $ECHO_N "checking for long... $ECHO_C" >&6
@@ -25488,6 +25537,9 @@
 s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t
 s,@CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t
 s,@onestep@,$onestep,;t t
+s,@DYNAMICLINKER@,$DYNAMICLINKER,;t t
+s,@DYNAMICLINKERPREFIX@,$DYNAMICLINKERPREFIX,;t t
+s,@NOSTDINC@,$NOSTDINC,;t t
 s,@PKGVERSION@,$PKGVERSION,;t t
 s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
 s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t