patches/gcc/3.4.6/100-uclibc-conf.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Mon Apr 16 15:25:36 2012 +0200 (2012-04-16)
changeset 2941 13e40098fffc
permissions -rw-r--r--
cc/gcc: update Linaro GCC revisions to 2012.04

Update Linaro GCC with the latest available revisions.

The 4.7 revision is also released, but the infrastructure is not yet ready for
it in CT-NG.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
     1 diff -durN gcc-3.4.6.orig/boehm-gc/configure gcc-3.4.6/boehm-gc/configure
     2 --- gcc-3.4.6.orig/boehm-gc/configure	2006-03-06 04:55:49.000000000 +0100
     3 +++ gcc-3.4.6/boehm-gc/configure	2007-08-15 22:49:47.000000000 +0200
     4 @@ -1947,6 +1947,11 @@
     5    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
     6    ;;
     7  
     8 +linux-uclibc*)
     9 +  lt_cv_deplibs_check_method=pass_all
    10 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
    11 +  ;;
    12 +
    13  netbsd*)
    14    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
    15      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
    16 diff -durN gcc-3.4.6.orig/boehm-gc/ltconfig gcc-3.4.6/boehm-gc/ltconfig
    17 --- gcc-3.4.6.orig/boehm-gc/ltconfig	2002-11-20 16:59:07.000000000 +0100
    18 +++ gcc-3.4.6/boehm-gc/ltconfig	2007-08-15 22:49:47.000000000 +0200
    19 @@ -1981,6 +1981,23 @@
    20    fi
    21    ;;
    22  
    23 +linux-uclibc*)
    24 +  version_type=linux
    25 +  need_lib_prefix=no
    26 +  need_version=no
    27 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    28 +  soname_spec='${libname}${release}.so$major'
    29 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
    30 +  shlibpath_var=LD_LIBRARY_PATH
    31 +  shlibpath_overrides_runpath=no
    32 +  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
    33 +  file_magic_cmd=/usr/bin/file
    34 +  file_magic_test_file=`echo /lib/libuClibc-*.so`
    35 +
    36 +  # Assume using the uClibc dynamic linker.
    37 +  dynamic_linker="uClibc ld.so"
    38 +  ;;
    39 +
    40  netbsd*)
    41    version_type=sunos
    42    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
    43 diff -durN gcc-3.4.6.orig/gcc/config/alpha/linux-elf.h gcc-3.4.6/gcc/config/alpha/linux-elf.h
    44 --- gcc-3.4.6.orig/gcc/config/alpha/linux-elf.h	2003-09-27 06:48:30.000000000 +0200
    45 +++ gcc-3.4.6/gcc/config/alpha/linux-elf.h	2007-08-15 22:49:47.000000000 +0200
    46 @@ -27,7 +27,11 @@
    47  #define SUBTARGET_EXTRA_SPECS \
    48  { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
    49  
    50 +#ifdef USE_UCLIBC
    51 +#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
    52 +#else
    53  #define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
    54 +#endif
    55  
    56  #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
    57    %{O*:-O3} %{!O*:-O1}						\
    58 diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
    59 --- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2004-01-31 07:18:40.000000000 +0100
    60 +++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 22:49:47.000000000 +0200
    61 @@ -80,6 +80,11 @@
    62  #define ENDFILE_SPEC \
    63    "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
    64  
    65 +#ifdef USE_UCLIBC
    66 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
    67 +#else
    68 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
    69 +#endif
    70  #undef  LINK_SPEC
    71  #define LINK_SPEC "%{h*} %{version:-v} \
    72     %{b} %{Wl,*:%*} \
    73 @@ -87,7 +92,7 @@
    74     %{shared:-shared} \
    75     %{symbolic:-Bsymbolic} \
    76     %{rdynamic:-export-dynamic} \
    77 -   %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
    78 +   %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
    79     -X \
    80     %{mbig-endian:-EB}" \
    81     SUBTARGET_EXTRA_LINK_SPEC
    82 diff -durN gcc-3.4.6.orig/gcc/config/cris/linux.h gcc-3.4.6/gcc/config/cris/linux.h
    83 --- gcc-3.4.6.orig/gcc/config/cris/linux.h	2003-11-29 04:08:13.000000000 +0100
    84 +++ gcc-3.4.6/gcc/config/cris/linux.h	2007-08-15 22:49:47.000000000 +0200
    85 @@ -79,6 +79,25 @@
    86  #undef CRIS_DEFAULT_CPU_VERSION
    87  #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
    88  
    89 +#ifdef USE_UCLIBC
    90 +
    91 +#undef CRIS_SUBTARGET_VERSION
    92 +#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
    93 +
    94 +#undef CRIS_LINK_SUBTARGET_SPEC
    95 +#define CRIS_LINK_SUBTARGET_SPEC \
    96 + "-mcrislinux\
    97 +  -rpath-link include/asm/../..%s\
    98 +  %{shared} %{static}\
    99 +  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
   100 +  %{!shared: \
   101 +    %{!static: \
   102 +      %{rdynamic:-export-dynamic} \
   103 +      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
   104 +  %{!r:%{O2|O3: --gc-sections}}"
   105 +
   106 +#else  /* USE_UCLIBC */
   107 +
   108  #undef CRIS_SUBTARGET_VERSION
   109  #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
   110  
   111 @@ -93,6 +112,8 @@
   112    %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
   113    %{!r:%{O2|O3: --gc-sections}}"
   114  
   115 +#endif  /* USE_UCLIBC */
   116 +
   117  
   118  /* Node: Run-time Target */
   119  
   120 diff -durN gcc-3.4.6.orig/gcc/config/i386/linux64.h gcc-3.4.6/gcc/config/i386/linux64.h
   121 --- gcc-3.4.6.orig/gcc/config/i386/linux64.h	2003-11-29 04:08:13.000000000 +0100
   122 +++ gcc-3.4.6/gcc/config/i386/linux64.h	2007-08-15 22:49:47.000000000 +0200
   123 @@ -54,14 +54,21 @@
   124     When the -shared link option is used a final link is not being
   125     done.  */
   126  
   127 +#ifdef USE_UCLIBC
   128 +#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   129 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
   130 +#else
   131 +#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   132 +#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
   133 +#endif
   134  #undef	LINK_SPEC
   135  #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
   136    %{shared:-shared} \
   137    %{!shared: \
   138      %{!static: \
   139        %{rdynamic:-export-dynamic} \
   140 -      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   141 -      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
   142 +      %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
   143 +      %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
   144      %{static:-static}}"
   145  
   146  #define MULTILIB_DEFAULTS { "m64" }
   147 diff -durN gcc-3.4.6.orig/gcc/config/i386/linux.h gcc-3.4.6/gcc/config/i386/linux.h
   148 --- gcc-3.4.6.orig/gcc/config/i386/linux.h	2003-11-29 04:08:13.000000000 +0100
   149 +++ gcc-3.4.6/gcc/config/i386/linux.h	2007-08-15 22:49:47.000000000 +0200
   150 @@ -110,22 +110,21 @@
   151  
   152  #undef	LINK_SPEC
   153  #ifdef USE_GNULIBC_1
   154 -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
   155 -  %{!shared: \
   156 -    %{!ibcs: \
   157 -      %{!static: \
   158 -	%{rdynamic:-export-dynamic} \
   159 -	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
   160 -	%{static:-static}}}"
   161 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.1"
   162  #else
   163 +#ifdef USE_UCLIBC
   164 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   165 +#else
   166 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   167 +#endif
   168 +#endif
   169  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
   170    %{!shared: \
   171      %{!ibcs: \
   172        %{!static: \
   173  	%{rdynamic:-export-dynamic} \
   174 -	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   175 +	%{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   176  	%{static:-static}}}"
   177 -#endif
   178  
   179  /* A C statement (sans semicolon) to output to the stdio stream
   180     FILE the assembler definition of uninitialized global DECL named
   181 diff -durN gcc-3.4.6.orig/gcc/config/ia64/linux.h gcc-3.4.6/gcc/config/ia64/linux.h
   182 --- gcc-3.4.6.orig/gcc/config/ia64/linux.h	2004-02-07 08:56:17.000000000 +0100
   183 +++ gcc-3.4.6/gcc/config/ia64/linux.h	2007-08-15 22:49:47.000000000 +0200
   184 @@ -37,13 +37,18 @@
   185  /* Define this for shared library support because it isn't in the main
   186     linux.h file.  */
   187  
   188 +#ifdef USE_UCLIBC
   189 +#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
   190 +#else
   191 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
   192 +#endif
   193  #undef LINK_SPEC
   194  #define LINK_SPEC "\
   195    %{shared:-shared} \
   196    %{!shared: \
   197      %{!static: \
   198        %{rdynamic:-export-dynamic} \
   199 -      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
   200 +      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   201        %{static:-static}}"
   202  
   203  
   204 diff -durN gcc-3.4.6.orig/gcc/config/m68k/linux.h gcc-3.4.6/gcc/config/m68k/linux.h
   205 --- gcc-3.4.6.orig/gcc/config/m68k/linux.h	2003-11-29 04:08:13.000000000 +0100
   206 +++ gcc-3.4.6/gcc/config/m68k/linux.h	2007-08-15 22:49:47.000000000 +0200
   207 @@ -131,12 +131,17 @@
   208  
   209  /* If ELF is the default format, we should not use /lib/elf.  */
   210  
   211 +#ifdef USE_UCLIBC
   212 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   213 +#else
   214 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   215 +#endif
   216  #undef	LINK_SPEC
   217  #define LINK_SPEC "-m m68kelf %{shared} \
   218    %{!shared: \
   219      %{!static: \
   220        %{rdynamic:-export-dynamic} \
   221 -      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
   222 +      %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   223      %{static}}"
   224  
   225  /* For compatibility with linux/a.out */
   226 diff -durN gcc-3.4.6.orig/gcc/config/mips/linux.h gcc-3.4.6/gcc/config/mips/linux.h
   227 --- gcc-3.4.6.orig/gcc/config/mips/linux.h	2004-06-16 03:42:25.000000000 +0200
   228 +++ gcc-3.4.6/gcc/config/mips/linux.h	2007-08-15 22:49:47.000000000 +0200
   229 @@ -109,6 +109,11 @@
   230  
   231  /* Borrowed from sparc/linux.h */
   232  #undef LINK_SPEC
   233 +#ifdef USE_UCLIBC
   234 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   235 +#else
   236 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   237 +#endif
   238  #define LINK_SPEC \
   239   "%(endian_spec) \
   240    %{shared:-shared} \
   241 @@ -116,7 +121,7 @@
   242      %{!ibcs: \
   243        %{!static: \
   244          %{rdynamic:-export-dynamic} \
   245 -        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
   246 +        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   247          %{static:-static}}}"
   248  
   249  #undef SUBTARGET_ASM_SPEC
   250 diff -durN gcc-3.4.6.orig/gcc/config/pa/pa-linux.h gcc-3.4.6/gcc/config/pa/pa-linux.h
   251 --- gcc-3.4.6.orig/gcc/config/pa/pa-linux.h	2003-11-29 04:08:13.000000000 +0100
   252 +++ gcc-3.4.6/gcc/config/pa/pa-linux.h	2007-08-15 22:49:47.000000000 +0200
   253 @@ -77,13 +77,18 @@
   254  /* Define this for shared library support because it isn't in the main
   255     linux.h file.  */
   256  
   257 +#ifdef USE_UCLIBC
   258 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   259 +#else
   260 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   261 +#endif
   262  #undef LINK_SPEC
   263  #define LINK_SPEC "\
   264    %{shared:-shared} \
   265    %{!shared: \
   266      %{!static: \
   267        %{rdynamic:-export-dynamic} \
   268 -      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
   269 +      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   270        %{static:-static}}"
   271  
   272  /* glibc's profiling functions don't need gcc to allocate counters.  */
   273 diff -durN gcc-3.4.6.orig/gcc/config/rs6000/linux.h gcc-3.4.6/gcc/config/rs6000/linux.h
   274 --- gcc-3.4.6.orig/gcc/config/rs6000/linux.h	2005-03-17 11:41:18.000000000 +0100
   275 +++ gcc-3.4.6/gcc/config/rs6000/linux.h	2007-08-15 22:49:47.000000000 +0200
   276 @@ -69,7 +69,11 @@
   277  #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
   278  
   279  #undef	LINK_OS_DEFAULT_SPEC
   280 +#ifdef USE_UCLIBC
   281 +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
   282 +#else
   283  #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
   284 +#endif
   285  
   286  #define LINK_GCC_C_SEQUENCE_SPEC \
   287    "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
   288 diff -durN gcc-3.4.6.orig/gcc/config/rs6000/sysv4.h gcc-3.4.6/gcc/config/rs6000/sysv4.h
   289 --- gcc-3.4.6.orig/gcc/config/rs6000/sysv4.h	2005-10-30 00:35:37.000000000 +0200
   290 +++ gcc-3.4.6/gcc/config/rs6000/sysv4.h	2007-08-15 22:49:47.000000000 +0200
   291 @@ -949,6 +949,7 @@
   292    mcall-linux  : %(link_os_linux)       ; \
   293    mcall-gnu    : %(link_os_gnu)         ; \
   294    mcall-netbsd : %(link_os_netbsd)      ; \
   295 +  mcall-linux-uclibc : %(link_os_linux_uclibc); \
   296    mcall-openbsd: %(link_os_openbsd)     ; \
   297                 : %(link_os_default)     }"
   298  
   299 @@ -1127,6 +1128,10 @@
   300    %{rdynamic:-export-dynamic} \
   301    %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
   302  
   303 +#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
   304 +  %{rdynamic:-export-dynamic} \
   305 +  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
   306 +
   307  #if defined(HAVE_LD_EH_FRAME_HDR)
   308  # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
   309  #endif
   310 @@ -1293,6 +1298,7 @@
   311    { "link_os_sim",		LINK_OS_SIM_SPEC },			\
   312    { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
   313    { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
   314 +  { "link_os_linux_uclibc",	LINK_OS_LINUX_UCLIBC_SPEC },		\
   315    { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
   316    { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
   317    { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
   318 diff -durN gcc-3.4.6.orig/gcc/config/s390/linux.h gcc-3.4.6/gcc/config/s390/linux.h
   319 --- gcc-3.4.6.orig/gcc/config/s390/linux.h	2003-11-29 04:08:13.000000000 +0100
   320 +++ gcc-3.4.6/gcc/config/s390/linux.h	2007-08-15 22:49:47.000000000 +0200
   321 @@ -77,6 +77,13 @@
   322  #define MULTILIB_DEFAULTS { "m31" }
   323  #endif
   324  
   325 +#ifdef USE_UCLIBC
   326 +#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   327 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
   328 +#else
   329 +#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
   330 +#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
   331 +#endif
   332  #undef  LINK_SPEC
   333  #define LINK_SPEC \
   334    "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
   335 @@ -86,8 +93,8 @@
   336        %{!static: \
   337  	%{rdynamic:-export-dynamic} \
   338  	%{!dynamic-linker: \
   339 -          %{m31:-dynamic-linker /lib/ld.so.1} \
   340 -          %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
   341 +          %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
   342 +          %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
   343  
   344  
   345  #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
   346 diff -durN gcc-3.4.6.orig/gcc/config/sh/linux.h gcc-3.4.6/gcc/config/sh/linux.h
   347 --- gcc-3.4.6.orig/gcc/config/sh/linux.h	2004-01-12 03:29:13.000000000 +0100
   348 +++ gcc-3.4.6/gcc/config/sh/linux.h	2007-08-15 22:49:47.000000000 +0200
   349 @@ -73,11 +73,16 @@
   350  #undef SUBTARGET_LINK_EMUL_SUFFIX
   351  #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
   352  #undef SUBTARGET_LINK_SPEC
   353 +#ifdef USE_UCLIBC
   354 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   355 +#else
   356 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   357 +#endif
   358  #define SUBTARGET_LINK_SPEC \
   359    "%{shared:-shared} \
   360     %{!static: \
   361       %{rdynamic:-export-dynamic} \
   362 -     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   363 +     %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   364     %{static:-static}"
   365  
   366  #undef LIB_SPEC
   367 diff -durN gcc-3.4.6.orig/gcc/config/sparc/linux64.h gcc-3.4.6/gcc/config/sparc/linux64.h
   368 --- gcc-3.4.6.orig/gcc/config/sparc/linux64.h	2004-06-06 05:55:17.000000000 +0200
   369 +++ gcc-3.4.6/gcc/config/sparc/linux64.h	2007-08-15 22:49:47.000000000 +0200
   370 @@ -167,12 +167,17 @@
   371    { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
   372    { "link_arch",	 LINK_ARCH_SPEC },
   373      
   374 +#ifdef USE_UCLIBC
   375 +#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
   376 +#else
   377 +#define ELF_DYNAMIC_LINKER  "/lib/ld-linux.so.2"
   378 +#endif
   379  #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
   380    %{!shared: \
   381      %{!ibcs: \
   382        %{!static: \
   383          %{rdynamic:-export-dynamic} \
   384 -        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   385 +        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   386          %{static:-static}}} \
   387  "
   388  
   389 diff -durN gcc-3.4.6.orig/gcc/config/sparc/linux.h gcc-3.4.6/gcc/config/sparc/linux.h
   390 --- gcc-3.4.6.orig/gcc/config/sparc/linux.h	2004-06-06 05:55:17.000000000 +0200
   391 +++ gcc-3.4.6/gcc/config/sparc/linux.h	2007-08-15 22:49:47.000000000 +0200
   392 @@ -162,13 +162,18 @@
   393          %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
   394          %{static:-static}}}"
   395  #else
   396 +#ifdef USE_UCLIBC
   397 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   398 +#else
   399 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   400 +#endif
   401  #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
   402    %{!mno-relax:%{!r:-relax}} \
   403    %{!shared: \
   404      %{!ibcs: \
   405        %{!static: \
   406          %{rdynamic:-export-dynamic} \
   407 -        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   408 +        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   409          %{static:-static}}}"
   410  #endif
   411  
   412 diff -durN gcc-3.4.6.orig/gcc/config/t-linux-uclibc gcc-3.4.6/gcc/config/t-linux-uclibc
   413 --- gcc-3.4.6.orig/gcc/config/t-linux-uclibc	1970-01-01 01:00:00.000000000 +0100
   414 +++ gcc-3.4.6/gcc/config/t-linux-uclibc	2007-08-15 22:49:47.000000000 +0200
   415 @@ -0,0 +1,5 @@
   416 +# Remove glibc specific files added in t-linux
   417 +SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
   418 +
   419 +# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
   420 +LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
   421 diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
   422 --- gcc-3.4.6.orig/gcc/config.gcc	2005-07-19 23:08:48.000000000 +0200
   423 +++ gcc-3.4.6/gcc/config.gcc	2007-08-15 22:49:47.000000000 +0200
   424 @@ -2322,6 +2322,12 @@
   425  	;;
   426  esac
   427  
   428 +# Rather than hook into each target, just do it after all the linux
   429 +# targets have been processed
   430 +case ${target} in
   431 +*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
   432 +esac
   433 +
   434  # Support for --with-cpu and related options (and a few unrelated options,
   435  # too).
   436  case ${with_cpu} in
   437 diff -durN gcc-3.4.6.orig/libtool.m4 gcc-3.4.6/libtool.m4
   438 --- gcc-3.4.6.orig/libtool.m4	2004-05-18 11:09:14.000000000 +0200
   439 +++ gcc-3.4.6/libtool.m4	2007-08-15 22:49:47.000000000 +0200
   440 @@ -689,6 +689,11 @@
   441    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   442    ;;
   443  
   444 +linux-uclibc*)
   445 +  lt_cv_deplibs_check_method=pass_all
   446 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   447 +  ;;
   448 +
   449  netbsd*)
   450    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   451      [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   452 diff -durN gcc-3.4.6.orig/ltconfig gcc-3.4.6/ltconfig
   453 --- gcc-3.4.6.orig/ltconfig	2004-03-05 22:05:41.000000000 +0100
   454 +++ gcc-3.4.6/ltconfig	2007-08-15 22:49:47.000000000 +0200
   455 @@ -602,6 +602,7 @@
   456  
   457  # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   458  case $host_os in
   459 +linux-uclibc*) ;;
   460  linux-gnu*) ;;
   461  linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   462  esac
   463 @@ -1262,6 +1263,24 @@
   464    dynamic_linker='GNU/Linux ld.so'
   465    ;;
   466  
   467 +linux-uclibc*)
   468 +  version_type=linux
   469 +  need_lib_prefix=no
   470 +  need_version=no
   471 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   472 +  soname_spec='${libname}${release}.so$major'
   473 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   474 +  shlibpath_var=LD_LIBRARY_PATH
   475 +  shlibpath_overrides_runpath=no
   476 +  # This implies no fast_install, which is unacceptable.
   477 +  # Some rework will be needed to allow for fast_install
   478 +  # before this can be enabled.
   479 +  # Note: copied from linux-gnu, and may not be appropriate.
   480 +  hardcode_into_libs=yes
   481 +  # Assume using the uClibc dynamic linker.
   482 +  dynamic_linker="uClibc ld.so"
   483 +  ;;
   484 +
   485  netbsd*)
   486    need_lib_prefix=no
   487    need_version=no
   488 diff -durN gcc-3.4.6.orig/null gcc-3.4.6/null
   489 --- gcc-3.4.6.orig/null	1970-01-01 01:00:00.000000000 +0100
   490 +++ gcc-3.4.6/null	2007-08-15 22:49:47.000000000 +0200
   491 @@ -0,0 +1 @@
   492 +~/dev