[BusyBox] Cross Compile: PATH_MAX undeclared

Steve Merrifield steve at labyrinth.net.au
Thu Nov 22 03:39:03 UTC 2001


Kam Lee wrote:
> 
> I'm using gcc-2.95.3, glibc 2.2.3, basically I use Erik Mouw's cross-2.95.3.
> 
> Below are the output:
> arm-linux-gcc -Wall -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE  -DBB_VE
> R='"0.51"' -DBB_BT='"2001.11.20-02:54+0000"' -DUSE_SYSTEM_PWD_GRP  -Ilibbb -
> c libbb/xgetcwd.c -o libbb/xgetcwd.o
> libbb/xgetcwd.c: In function `xgetcwd':
> libbb/xgetcwd.c:30: `PATH_MAX' undeclared (first use in this function)
> libbb/xgetcwd.c:30: (Each undeclared identifier is reported only once
> libbb/xgetcwd.c:30: for each function it appears in.)
> libbb/xgetcwd.c:27: warning: `path_max' might be used uninitialized in this
> function
> make: *** [libbb/xgetcwd.o] Error 1
> 


I've come across a similar thing, but with mount.c and umount.c
 
arm-linux-gcc -Wall -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE  
-DBB_VER='"0.60.2.pre"' -DBB_BT='"2001.11.22-09:51+0000"'
-DUSE_SYSTEM_PWD_GRP  
-I. -c mount.c -o mount.o
mount.c: In function `mount_main':
mount.c:381: `PATH_MAX' undeclared (first use in this function)
mount.c:381: (Each undeclared identifier is reported only once
mount.c:381: for each function it appears in.)
make: *** [mount.o] Error 1
 
In my toolset (RPMs from netwinder), PATH_MAX is defined in:
arm-linux/sys-include/linux/limits.h:
#define PATH_MAX        4095
 
But the source is only including <limits.h>
Adding <linux/limits.h> fixes the problem :)
 
steve





More information about the busybox mailing list