Bug 4009

Summary: [PATCH][SINGLE APPLET] libbb/appletlib.c:805: error: `ether' undeclared (first use in this function)
Product: Busybox Reporter: d33tah
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs
Priority: P5    
Version: 1.18.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:
Attachments: build-log.txt build-log-V=1.txt config fix_singleapplet.patch

Description d33tah 2011-07-27 16:59:42 UTC
Created attachment 3511 [details]
build-log.txt build-log-V=1.txt config fix_singleapplet.patch

I recently tried to build etherwake as single applet build and I noticed it's impossible due to a compiler error I put in the bug summary box. I did some research and noticed it's probably because the SINGLE_APPLET_MAIN macro contains a hyphen, which - for some reason - the compiler treats as the end of the macro value. I removed the hyphens in all occurrences of 'ether-wake' in the source code and busybox managed to build with this applet only.

I tested it on Debian Squeeze with both mips-linux-gcc 3.4.2 and native GCC 4.4.5. Further information available if needed. I attach a .tar.gz file containing build logs both with and without V=1 on, the .config file I used for testing purposes and my quick-and-dirty patch allowing to compile etherwake in single-applet mode. Note it can also affect other binaries with hyphens in its names, such as nbd-client, modprobe-small, modutils-24, add-remove-shell and split-include. The list might differ, I found these names using a linux command:

find | grep '\.c$' | sed  's/console-tools/consoletools/g' | sed 's/util-linux/utillinux/g' |   grep -