BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000414 [BusyBox] Other minor always 09-06-05 04:36 09-06-05 14:50
Reporter des View Status public  
Assigned To BusyBox
Priority normal Resolution duplicate  
Status closed   Product Version 1.00
Summary 0000414: 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
Additional Information The attached patch

 1) reorders includes in busybox.h to avoid the issue described above
 2) moves #include <features.h> to the top of busybox.h (it has to be at the top to correctly affect visibility of identifiers declared by other headers)
 3) makes a few adjustments to applets.h to simplify its usage
 4) removes a few #undefs made redundant by 3) from applets.c
Attached Files  applets.diff [^] (2,655 bytes) 09-06-05 04:36

- Relationships

- Notes
(0000493)
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...
 
(0000494)
vapier
09-06-05 14:50

dupe of Bug 316
 

- 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
09-06-05 14:50 vapier Status assigned => closed
09-06-05 14:50 vapier Note Added: 0000494
09-06-05 14:50 vapier Resolution open => duplicate


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker