[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] Error compiling Busybox with "route" enabled - workaround
From:       Jonathan Sevy <J.Sevy () flarion ! com>
Date:       2003-02-20 17:12:02
[Download RAW message or body]

I saw a couple of posts relating to a problem I also had in compiling
Busybox, and thought I'd pass on what seems to be the underlying problem,
and a solution. 

The problem arose when I attempted to compile Busybox for an ARM Linux
platform, with "route" enabled, using an existing arm-linux-gcc 2.95.3
cross-compilation toolchain. When "route" was enabled the compilation
failed, blasting tons of warnings and an eventual error; without "route"
enabled, all went without a hitch. 

The problem: the include statement
  #include <net/route.h>
in the file dhcpd.h was causing the file route.h from the Linux kernel
includes to be included, instead of the desired route.h from the standard
system (C-lib) includes. The problem is in the particular compiler used,
which was built to search the Linux kernel include path _before_ the
standard system include path. (You can determine the path search order by
adding a "-v" flag to the gcc command - i.e., running
  arm-linux-gcc -v whatever.c
will report the include paths searched, and in which order.) 

A solution is to explicitly pass an include directive to the compiler for
the standard system path, which will cause the system route.h file to be
found before the kernel route.h file. I added the following line in the
Busybox Makefile:
  CROSS_CFLAGS+=-I/usr/local/arm/2.95.3/arm-linux/include
Enabling "route" after this change resulted in a happy compilation.

Just wanted to hopefully save some other folks who might be using the same
arm-linux-gcc compiler from some aggravation! (I ran into the same problem
when trying to build the dhcpd distribution, which is when I finally
stumbled on the solution.) 

HTH,
  \
  Jon
  



 Jonathan Sevy
 Flarion Technologies Inc.
 Bedminster, NJ 07921 
 
****************************************************************************
*******************************************
This email may contain confidential and privileged material for the sole use
of the intended recipient.
Any review or distribution by others is strictly prohibited.  If you are not
the intended recipient please
contact the sender and delete all copies.
****************************************************************************
*******************************************


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic