patches/strace/4.5.18/170-no_cachectl.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
yann@1045
     1
This patch is needed on newer uclibc becuase the uclibc header generation
yann@1045
     2
mechanism generates the sysnum.h properly NR_cacheflush is defined for ARM
yann@1045
     3
but there is no cachectl.h file which is exported to userspace. Strace 
yann@1045
     4
assumes that if SYS_cacheflush is defined than it icludes asm/cachectl.h
yann@1045
     5
which breaks the build for ARM now.
yann@1045
     6
yann@1045
     7
This patch adds a check for ARM architecture.
yann@1045
     8
yann@1045
     9
-Khem
yann@1045
    10
yann@1045
    11
Here is error
yann@1045
    12
yann@1045
    13
| if ccache arm-angstrom-linux-uclibcgnueabi-gcc -march=armv5te -mtune=arm926ej-s -DHAVE_CONFIG_H -I. -I. -I. -Ilinux/arm -I./linux/arm -Ilinux -I./linux  -isystem/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/staging/arm-angstrom-linux-uclibcgnueabi/usr/include -Wall -isystem/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/staging/arm-angstrom-linux-uclibcgnueabi/usr/include -fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -MT term.o -MD -MP -MF ".deps/term.Tpo" -c -o term.o term.c; \
yann@1045
    14
|   then mv -f ".deps/term.Tpo" ".deps/term.Po"; else rm -f ".deps/term.Tpo"; exit 1; fi
yann@1045
    15
| system.c:69:26: error: asm/cachectl.h: No such file or directory
yann@1045
    16
| make[1]: *** [system.o] Error 1
yann@1045
    17
| make[1]: *** Waiting for unfinished jobs....
yann@1045
    18
| signal.c: In function 'sys_sigreturn':
yann@1045
    19
| signal.c:1221: warning: passing argument 4 of 'ptrace' makes integer from pointer without a cast
yann@1045
    20
| make[1]: Leaving directory `/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/work/armv5te-angstrom-linux-uclibcgnueabi/strace-4.5.14-r5/strace-4.5.14'
yann@1045
    21
| make: *** [all] Error 2
yann@1045
    22
| FATAL: oe_runmake failed
yann@1045
    23
yann@1045
    24
Index: strace-4.5.14/system.c
yann@1045
    25
===================================================================
yann@1045
    26
--- strace-4.5.14.orig/system.c 2008-05-15 20:23:16.000000000 -0700
yann@1045
    27
+++ strace-4.5.14/system.c  2008-05-15 20:24:03.000000000 -0700
yann@1045
    28
@@ -65,7 +65,7 @@
yann@1045
    29
 #include <linux/capability.h>
yann@1045
    30
 #endif
yann@1045
    31
 
yann@1045
    32
-#ifdef SYS_cacheflush
yann@1045
    33
+#if defined SYS_cacheflush && !defined ARM
yann@1045
    34
 #include <asm/cachectl.h>
yann@1045
    35
 #endif