patches/gcc/3.3.3/pr12010.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
     1 Adjusted for gcc-3.3-20040119
     2 
     3 See http://gcc.gnu.org/PR12010
     4 
     5 Without this patch, one gets both compile and link time errors in
     6 'make check' when configured for cross-compiling.
     7 
     8 In particular, 'make check' on a cross-compiler fails with
     9 
    10 /testsuite_flags: /testsuite_flags: No such file or directory
    11     while executing
    12 "exec sh ${odir_v3}/testsuite_flags --build-includes"
    13     (procedure "g++_include_flags" line 21)
    14     invoked from within
    15 "g++_include_flags [get_multilibs] "
    16     (procedure "g++_init" line 63)
    17     invoked from within
    18 "${tool}_init $test_file_name"
    19     (procedure "runtest" line 19)
    20 ...
    21 make[1]: [check-g++] Error 1 (ignored)
    22 
    23 --- gcc-3.3-20040119/gcc/testsuite/lib/g++.exp.orig	2004-01-25 17:56:24.000000000 -0800
    24 +++ gcc-3.3-20040119/gcc/testsuite/lib/g++.exp	2004-01-25 18:29:44.000000000 -0800
    25 @@ -72,6 +72,8 @@ proc g++_version { } {
    26  #
    27  proc g++_include_flags { paths } {
    28      global srcdir
    29 +    global objdir
    30 +    global target_triplet
    31      global HAVE_LIBSTDCXX_V3
    32      global TESTING_IN_BUILD_TREE
    33  
    34 @@ -90,6 +92,20 @@ proc g++_include_flags { paths } {
    35  
    36      if { ${HAVE_LIBSTDCXX_V3} } {
    37        set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
    38 +      if { $odir_v3 == "" } {
    39 +          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
    40 +          # first assume no multilibs
    41 +          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
    42 +      }
    43 +      if { $odir_v3 == "" } {
    44 +          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
    45 +          # assume multilib only one level deep
    46 +          set multisub [file tail $gccpath]
    47 +          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
    48 +      }
    49 +      if { $odir_v3 == "" } {
    50 +           error "Can't find libstdc++-v3"
    51 +      }
    52        append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
    53      } else {
    54        set odir_v2 [lookfor_file ${gccpath} libstdc++]
    55 
    56 --- gcc-3.3-20040119/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old	Sun Jul 13 10:42:01 2003
    57 +++ gcc-3.3-20040119/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp	Sun Jul 13 11:39:54 2003
    58 @@ -48,8 +48,23 @@
    59      global ld_library_path
    60      global original_ld_library_path
    61      global tool_root_dir
    62 +    global target_triplet
    63  
    64      set blddir [lookfor_file [get_multilibs] libstdc++-v3]
    65 +    if { $blddir == "" } {
    66 +        set multilibs [get_multilibs]
    67 +        # FIXME: assume multilib only one level deep
    68 +        set multisub [file tail $multilibs]
    69 +        verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
    70 +        set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
    71 +    }
    72 +    if { $blddir == "" } {
    73 +        verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
    74 +        set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
    75 +    }
    76 +    if { $blddir == "" } {
    77 +         error "Can't find libstdc++-v3"
    78 +    }
    79  
    80      # By default, we assume we want to run program images.
    81      global dg-do-what-default