patches/glibc/2.7/250-sh-chop-linux-version.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Oct 22 20:50:10 2008 +0000 (2008-10-22)
changeset 962 2ba4393e0441
permissions -rw-r--r--
Make Super-H finally compile a complete (C-only) toolchain:
- new, un-tested patches
- an sh4 sample to work on, and to try to reproduce later.

/trunk/patches/glibc/2.7/250-sh-chop-linux-version.patch | 49 49 0 0 ++
/trunk/patches/glibc/2.7/240-sh-lowlevellock-asm.patch | 56 56 0 0 +++
/trunk/patches/glibc/2.7/270-sh-fix-procfs.patch | 11 11 0 0 +
/trunk/patches/glibc/2.7/280-sh-fix-kernel-heders-location.patch | 23 23 0 0 +
/trunk/patches/glibc/2.7/260-sh-syscall-error-path.patch | 26 26 0 0 +
/trunk/samples/sh4-unknown-linux-gnu/crosstool.config | 311 311 0 0 ++++++++++++++
/trunk/samples/sh4-unknown-linux-gnu/reported.by | 3 3 0 0 +
7 files changed, 479 insertions(+)
     1 --- glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h.orig	2007-09-15 23:54:08.000000000 +0100
     2 +++ glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h	2008-08-20 09:26:26.000000000 +0100
     3 @@ -83,6 +83,10 @@
     4    int parts;
     5    char *cp;
     6    struct utsname uts;
     7 +  int dotsfound = 0;
     8 +  int versionindex = 0;
     9 +  char *choppoint;
    10 +
    11  
    12    /* Try the uname system call.  */
    13    if (__uname (&uts))
    14 @@ -102,8 +106,34 @@
    15    else
    16      buf = uts.release;
    17  
    18 +  /* We are only interested in the first three kernel numbers, so */
    19 +  /* chop off anything past that: */
    20 +
    21 +  choppoint = buf;
    22 +  while (1)
    23 +    {
    24 +      versionindex++;
    25 +      if (versionindex == 63) break;
    26 +      if (*choppoint == '.') dotsfound++;
    27 +      choppoint++;
    28 +      if (dotsfound == 2)
    29 +      {
    30 +        if (*choppoint == '0' || *choppoint == '1'
    31 +          || *choppoint == '2' || *choppoint == '3'
    32 +          || *choppoint == '4' || *choppoint == '5'
    33 +          || *choppoint == '6' || *choppoint == '7'
    34 +          || *choppoint == '8' || *choppoint == '9')
    35 +          continue;
    36 +        else
    37 +          {
    38 +            *choppoint = 0;
    39 +            break;
    40 +          }
    41 +      }
    42 +    }
    43 +
    44    /* Now convert it into a number.  The string consists of at most
    45 -     three parts.  */
    46 +     three parts.  Now it does, anyway.  ;-)  */
    47    version = 0;
    48    parts = 0;
    49    cp = buf;