1 From 29411db7b6cf872e73b5560c46dd941f91e704cd Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Sat, 26 Jan 2013 14:13:12 -0500
4 Subject: [PATCH] buildsys: gen_bits_syscall_h: do not leave undefined SYS_xxx
7 If we end up doing '#undef __NR_xxx', we don't want to leave the
8 corresponding SYS_xxx symbol defined. So undef it too.
10 For example, with the ARM EABI layer, we have a bunch of legacy
11 syscalls that we define early on and then later undefine (such
12 as __NR_utime). But we left SYS_utime defined so code that tests
13 for that define before using it would be broken (since it'd be
14 defined to a non-existent symbol).
16 URL: https://bugs.gentoo.org/425006
17 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
19 extra/scripts/gen_bits_syscall_h.sh | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
22 diff --git a/extra/scripts/gen_bits_syscall_h.sh b/extra/scripts/gen_bits_syscall_h.sh
23 index f6353ba..fd141f0 100755
24 --- a/extra/scripts/gen_bits_syscall_h.sh
25 +++ b/extra/scripts/gen_bits_syscall_h.sh
26 @@ -40,7 +40,8 @@ $CC -E $INCLUDE_OPTS - |
27 sed -ne 's/^UCLIBC\(__ARM_NR_\|__NR_\)\([A-Za-z0-9_]*\) *\(.*\)/#undef \1\2\
29 #define SYS_\2 \1\2/gp' \
30 - -e 's/^UNDEFUCLIBC\(__ARM_NR_\|__NR_\)\([A-Za-z0-9_]*\).*/#undef \1\2/gp'
31 + -e 's/^UNDEFUCLIBC\(__ARM_NR_\|__NR_\)\([A-Za-z0-9_]*\).*/#undef \1\2\