[klibc] arm: fix trashing of callee-saved registers in thumb setjmp()

fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634890
(although dynamically-linked binaries seem to have another bug)

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] arm: unbreak armhf shared binaries (those with thumb)

The linker command was wrong.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] arm: remove unused variable 

MCONFIG containing a no longer recognised gcc flag.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] include: [sys/time.h] fix for Linux 3.5.1

From 3.5.1, <linux/time.h> does not even define FD_ZERO etc.

With Linux 3.5.1, 'make test' fails with:

  usr/klibc/tests/select.c: In function ‘main’:
  usr/klibc/tests/select.c:31:14: error: ‘FD_SETSIZE’ undeclared (first use in this function)
  usr/klibc/tests/select.c:31:14: note: each undeclared identifier is reported only once for each function it appears in

This is due to Linux commit 8ded2bbc1845e19c771eb55209aab166ef011243.
Handle it by making sure that FD_SETSIZE is defined.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] Avoid overflow for very long variable name

Otherwise, this:
  $ perl -le 'print "v"x(2**31+1) ."=1"' | dash
provokes integer overflow:

  (gdb) bt
  #0  doformat (dest=0x61d580, f=0x416a08 "%s: %d: %s: ", ap=0x7fffffffd308)
      at output.c:310
  #1  0x00000000004128c1 in outfmt (file=0x61d580, fmt=0x416a08 "%s: %d: %s: ")
      at output.c:257
  #2  0x000000000040382e in exvwarning2 (msg=0x417339 "Out of space",
      ap=0x7fffffffd468) at error.c:125
  #3  0x000000000040387e in exverror (cond=1, msg=0x417339 "Out of space",
      ap=0x7fffffffd468) at error.c:156
  #4  0x0000000000403938 in sh_error (msg=0x417339 "Out of space") at error.c:172
  #5  0x000000000040c970 in ckmalloc (nbytes=18446744071562067984)
      at memalloc.c:57
  #6  0x000000000040ca78 in stalloc (nbytes=18446744071562067972)
      at memalloc.c:132
  #7  0x000000000040ece9 in grabstackblock (len=18446744071562067972)
      at memalloc.h:67
  #8  0x00000000004106b5 in readtoken1 (firstc=118, syntax=0x419522 "",
      eofmark=0x0, striptabs=0) at parser.c:1040
  #9  0x00000000004101a4 in xxreadtoken () at parser.c:826
  #10 0x000000000040fe1d in readtoken () at parser.c:697
  #11 0x000000000040edcc in parsecmd (interact=0) at parser.c:145
  #12 0x000000000040c679 in cmdloop (top=1) at main.c:224
  #13 0x000000000040c603 in main (argc=2, argv=0x7fffffffd9f8) at main.c:178

  #8  0x00000000004106b5 in readtoken1 (firstc=118, syntax=0x419522 "",
      eofmark=0x0, striptabs=0) at parser.c:1040
  1040    grabstackblock(len);
  (gdb) p len
  $30 = -2147483644

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] [BUILTIN] Add support for ulimit -r

I recently found myself in need to have dash support 'ulimit -r' to
set maximum realtime priority. Attached is a patch that adds the
parameter to the builtin ulimit command and updates the manpage.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] dash: resync with latest git

Signed-off-by: maximilian attems <max@stro.at>
[klibc] [PATCH] fix ARM longjmp with zero 'val'.

We need to set the condition codes on the ARM.  The previous version was
using a left over condition code from the caller.  Also, use conditional
execution to eliminate branch and reduce size.

Signed-off-by: Bill Pringlemeir <bpringle@sympatico.ca>
Signed-off-by: maximilian attems <max@stro.at>
[klibc] 2.0.2 released, next version is 2.0.3