[klibc] klibc/ash doesn't compile

Goffredo Baroncelli kreijack at tiscalinet.it
Thu Jan 27 12:10:13 PST 2005


on my system the klibc/ash ( 0.197 ) doesn't compile:

[ghigo at therra ash]$ pwd
[ghigo at therra ash]$ make
gcc -Wp,-MD,.arith_lex.d -mregparm=3 -DREGPARM=3 -march=i386 -Os -g 
-falign-functions=0 -falign-jumps=0 -falign-loops=0  -nostdinc -iwithprefix 
include -D__KLIBC__ -DBITSIZE=32 -I../include/arch/i386 -I../include/bits32 
-I../include -I../linux/include -I../linux/include2 -I../linux/include 
-DSHELL -DJOBS=0  -I.   -c -o arith_lex.o arith_lex.c
arith_lex.l: In function `yylex':
arith_lex.l:66: error: `ARITH_NUM' undeclared (first use in this function)
arith_lex.l:66: error: (Each undeclared identifier is reported only once
arith_lex.l:66: error: for each function it appears in.)
arith_lex.l:69: error: `ARITH_LPAREN' undeclared (first use in this function)
arith_lex.l:70: error: `ARITH_RPAREN' undeclared (first use in this function)
arith_lex.l:71: error: `ARITH_OR' undeclared (first use in this function)

the patch below solves the problem:

[ghigo at therra klibc]$ diff -Naur klibc-0.197/ash/Makefile.orig 
--- klibc-0.197/ash/Makefile.orig       Thu Jan 27 20:46:53 2005
+++ klibc-0.197/ash/Makefile    Thu Jan 27 20:47:05 2005
@@ -143,7 +143,7 @@
        mv lex.yy.c $@

 arith.h: arith.c
-       sed -n '/^#define ARITH/p' $< > $@
+       sed -n '/^#define[[:space:]]*ARITH/p' $< > $@

        rm -f core $(CLEANFILES) $(OBJS) .*.d *.g

The problema was an unmatched tab between the '#define' and the 'ARITH_xxxx' 
macro. But I don't know if the syntax [:space:] is supported on all system 
where the klib should compile.


gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack at inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9

More information about the klibc mailing list