]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/uclibc/uclibc-0.9.28/thumb-sysnum-h.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / uclibc / uclibc-0.9.28 / thumb-sysnum-h.patch
1 --- uClibc-0.9.28/extra/scripts/gen_bits_syscall_h.sh.orig      2005-09-18 02:20:04.441119651 -0700
2 +++ uClibc-0.9.28/extra/scripts/gen_bits_syscall_h.sh   2005-09-18 03:17:58.287715035 -0700
3 @@ -11,6 +11,37 @@
4  UNISTD_H_PATH=$TOPDIR/include/asm/unistd.h
5  INCLUDE_OPTS="-I$TOPDIR/include"
6  
7 +# This test is added to avoid mangling the (variable) syscall base value on
8 +# ARM
9 +if echo "#if defined __arm__ || defined __thumb__
10 +xyzzy
11 +#endif" | $CC -E $INCLUDE_OPTS - | grep xyzzy >/dev/null
12 +then
13 +       echo '/* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */
14 +#ifndef _BITS_SYSNUM_H
15 +#define _BITS_SYSNUM_H
16 +
17 +#ifndef _SYSCALL_H
18 +# error "Never use <bits/sysnum.h> directly; include <sys/syscall.h> instead."
19 +#endif'
20 +       # arm case, assume unistd.h conforms to the one in 2.6.x, if not
21 +       # go into a corner and sulk (fix this script)  The sed rune below
22 +       # expects items of the form UCLIBC_foo at the start of the line
23 +       # for each syscall number, the arm syscalls all start with lower
24 +       # case alpha and the all-important __NR_SYSCALL_BASE does not...
25 +       sed -n -e '/__sys2/Q' -e '/^[   ]*#include/,${
26 +               s/^[    ]*#include.*$//
27 +               h
28 +               s/^[    ]*#define[      ]*__NR_\([a-z][A-Za-z0-9_]*\)[  ]*\(.*\)[       ]*$/#undef __NR_\1\
29 +#define SYS_\1 __NR_\1/p
30 +               g
31 +               p
32 +               }' $UNISTD_H_PATH
33 +       # i.e. this relies on the __sys2 definition coming after the last
34 +       # sys number define (and #include preceding all useful definitions)
35 +       echo '#endif'
36 +else
37 +# non-arm case
38  ( echo "#include \"$UNISTD_H_PATH\"" ;
39    $CC -E -dN $INCLUDE_OPTS $UNISTD_H_PATH | # needed to strip out any kernel-internal defines
40    sed -ne 's/^[ ]*#define[ ]*__NR_\([A-Za-z0-9_]*\).*/UCLIBC_\1 __NR_\1/gp'
41 @@ -29,3 +60,4 @@
42    echo ;
43    echo "#endif" ;
44  )
45 +fi