[BusyBox 0000058]: Compiling ash.c with DEBUG defined generates link error

bugs at busybox.net bugs at busybox.net
Thu Jan 26 10:09:57 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=58 
====================================================================== 
Reported By:                k1mgy
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   58
Category:                   Other
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     closed
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             01-24-2005 14:04 PST
Last Modified:              01-26-2006 02:09 PST
====================================================================== 
Summary:                    Compiling ash.c with DEBUG defined generates link
error
Description: 
ash.c has an accomodation to allow a debug output so that issues can be
investigated.  I'm experiencing some frustration with this build - a
single carraige return line feed sent via any telnet session (either
microsoft's telnet terminal or via putty) results in what appears to be an
extra return or linefeed or both.  To login, sending a keyboard-generated
chr 010 works, but this is not a reasonable solution.

Therefore I want to debug ash to see what's happening.

ash.c allows you to define DEBUG=1 (or DEBUG=2) at the top of the source
(or via the makefile).  This then establishes the code necessary to
provide a debug output.

ash.c contians the following:

#ifdef DEBUG
const char *bb_applet_name = "debug stuff usage";
int main(int argc, char **argv)
{
	return ash_main(argc, argv);
}
#endif

So with DEBUG defined, the following error is generated during compile:


/home/dev/axis/devboard_82/apps/busybox/shell/ash.c:64:1: warning:
"_GNU_SOURCE" redefined
/home/dev/axis/devboard_82/apps/busybox/shell/ash.c:1:1: warning: this is
the location of the previous definition
/home/dev/axis/devboard_82/apps/busybox/shell/ash.c:11263: warning:
`showtree' defined but not used
/home/dev/axis/devboard_82/apps/busybox/shell/ash.c:11469: warning:
`trputc' defined but not used


And this is the error during the link phase:

busybox/shell/shell.a(ash.o): warning: definition of `bb_applet_name'
overriding common
busybox/applets/applets.a(busybox.o): warning: common is here
busybox/shell/shell.a(ash.o): In function `main':
ash.o(.text+0xa82a): multiple definition of `main'
busybox/applets/applets.a(busybox.o)(.text+0x0): first defined here
/usr/local/cris/lib/gcc-lib/cris-axis-linux-gnu/3.2.1/../../../../cris-axis-linux-gnu/bin/ld:
Warning: size of symbol `main' changed from 94 to 6 in
busybox/shell/shell.a(ash.o)
collect2: ld returned 1 exit status
make: *** [busybox] Error 1


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

---------------------------------------------------------------------- 
 vodz - 09-19-05 05:03  
---------------------------------------------------------------------- 
DEBUG ash compiled snadalone only as

$ cd shell
$ cc -DDEBUG -I../include ash.c cmdedit.o ../libbb/libbb.a

Its works 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-24-05 14:04  k1mgy          New Issue                                    
03-16-05 12:27  andersen       Assigned To              andersen => BusyBox 
09-19-05 05:03  vodz           Note Added: 0000554                          
01-26-06 02:09  vodz           Status                   assigned => closed  
01-26-06 02:09  vodz           Resolution               open => no change
required
======================================================================




More information about the busybox-cvs mailing list