patches/binutils/2.15/binutils-2.15-psignal.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 20 13:48:26 2007 +0000 (2007-05-20)
changeset 112 ea15433daba0
permissions -rw-r--r--
Ah! I finally have a progress bar that doesn't stall the build!
- pipe size in Linux is only 8*512=4096 bytes
- pipe size is not setable
- when the feeding process spits out data faster than the eating
process can read it, then the feeding process stalls after 4KiB
of data sent to the pipe
- for us, the progress bar would spawn a sub-shell every line,
and the sub-shell would in turn spawn a 'date' command.
Which was sloooww as hell, and would cause some kind of a
starvation: the pipe was full most of the time, and the
feeding process was stalled all this time.

Now, we use internal variables and a little hack based onan offset
to determine the elapsed time. Much faster this way, but still
CPU-intensive.
yann@1
     1
Make psignal prototype in libiberty match that in glibc.
yann@1
     2
yann@1
     3
Fixes:
yann@1
     4
yann@1
     5
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
yann@1
     6
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
yann@1
     7
/usr/include/signal.h:131: prototype declaration
yann@1
     8
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
yann@1
     9
/usr/include/signal.h:131: prototype declaration
yann@1
    10
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
yann@1
    11
mprotect... make[1]: *** [strsignal.o] Error 1
yann@1
    12
make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
yann@1
    13
make: *** [all-libiberty] Error 2
yann@1
    14
yann@1
    15
when building on red hat 7.1
yann@1
    16
though it's a bit of a mystery why libiberty's psignal is being compiled at
yann@1
    17
all, since red hat 7.1's glibc supports psignal (hence the error message)
yann@1
    18
yann@1
    19
--- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
yann@1
    20
+++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
yann@1
    21
@@ -544,7 +544,7 @@
yann@1
    22
 
yann@1
    23
 /*
yann@1
    24
 
yann@1
    25
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
yann@1
    26
+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
yann@1
    27
 
yann@1
    28
 Print @var{message} to the standard error, followed by a colon,
yann@1
    29
 followed by the description of the signal specified by @var{signo},
yann@1
    30
@@ -557,9 +557,7 @@
yann@1
    31
 #ifndef HAVE_PSIGNAL
yann@1
    32
 
yann@1
    33
 void
yann@1
    34
-psignal (signo, message)
yann@1
    35
-  unsigned signo;
yann@1
    36
-  char *message;
yann@1
    37
+psignal (int signo, const char *message)
yann@1
    38
 {
yann@1
    39
   if (signal_names == NULL)
yann@1
    40
     {