[BusyBox] compile sh.c with uClibc broken
Andreas Neuhaus
andy at fasta.fh-dortmund.de
Wed Mar 14 22:07:04 UTC 2001
dear again...
>
../uClibc/extra/gcc-uClibc/gcc-uClibc-i386 -I- -Wall -Os -fomit-frame-pointe
> r -D_GNU_SOURCE -DBB_VE
>
='"0.50pre"' -DBB_BT='"2001.03.14-18:25+0000"' -DUSE_SYSTEM_PWD_GRP -I. -
> c sh.c -o sh.o
> sh.c: In function `expand_arguments':
> sh.c:1073: called object is not a function
> sh.c:1120: called object is not a function
> make: *** [sh.o] Error 1
ok, finally i found it...
sh.c uses an int named "index" in several functions, but uClibc/string.h
line 66 shows:
#define index strchr
whoops, of course that won't work... a fix would be either to rename all
variables "index" to something else, or to #undef index. i choose the second
method:
diff -u -r1.108 sh.c
--- sh.c 2001/03/14 19:33:45 1.108
+++ sh.c 2001/03/14 22:01:55
@@ -65,6 +65,11 @@
#include <unistd.h>
#include <getopt.h>
+// fix compile with uClibc (which does #define index strchr) -andy
+#ifdef index
+#undef index
+#endif
+
#undef BB_FEATURE_SH_WORDEXP
#if BB_FEATURE_SH_WORDEXP
regards,
andreas neuhaus
--
Life could be so much easier if we could just look at the source code...
.~.
/V\ Andreas Neuhaus, FaStA Informatik FH-Dortmund
// \\ Sonnenstr. 96, D-44139 Dortmund, Tel 0231/9112-734
/( )\ System-Administration FaStA FH-Dortmund
^^-^^
LINUX - Don't fear the penguin
More information about the busybox
mailing list