[BusyBox 0000414]: Incorrect include ordering can lead to build failure

bugs at busybox.net bugs at busybox.net
Tue Sep 6 13:35:55 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=414 
====================================================================== 
Reported By:                des
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   414
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             09-06-2005 04:36 PDT
Last Modified:              09-06-2005 06:35 PDT
====================================================================== 
Summary:                    Incorrect include ordering can lead to build failure
Description: 
Note: actual version is 1.01, which isn't listed in the "Product Version"
pull-down menu in the bug tracking system

busybox.h includes config.h before anything else.

config.h defines or undefines various CONFIG_FOO macros depending on which
parts of BusyBox are to be built.

Some of these macros conflict with similarly-named macros defined in
<linux/autoconf.h> which is pulled in indirectly by <limits.h> and / or
<sys/param.h> near the bottom of busybox.h.

This can lead to a build failure in applets.c.  Let's say you want to
build busybox without the sysctl applet, so config.h contains #undef
CONFIG_SYSCTL.

applets.c includes busybox.h
busybox.h includes config.h -> #undef CONFIG_SYSCTL
busybox.h defines PROTOTYPES and includes applets.h
busybox.h includes <sys/param.h> -> #define CONFIG_SYSCTL 1
applets.c defines MAKE_USAGE and includes applets.h
applets.c undefines PROTOTYPES and MAKE_USAGE and includes applets.h to
generate the applets[] array
applets[] references an undeclared and undefined sysctl_main() -> BOOM

====================================================================== 

---------------------------------------------------------------------- 
 des - 09-06-05 06:35  
---------------------------------------------------------------------- 
This only occurs on systems running Linux 2.6.13, where <asm/param.h> pulls
in <linux/config.h> unconditionally.  Older Linux systems are unaffected. 
This is arguably a Linux issue, not a BusyBox issue... 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-06-05 04:36  des            New Issue                                    
09-06-05 04:36  des            Status                   new => assigned     
09-06-05 04:36  des            Assigned To               => BusyBox         
09-06-05 04:36  des            File Added: applets.diff                     
09-06-05 04:38  des            Issue Monitored: des                         
09-06-05 06:35  des            Note Added: 0000493                          
======================================================================




More information about the busybox-cvs mailing list