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

bugs at busybox.net bugs at busybox.net
Mon Sep 19 12:03:33 UTC 2005

A NOTE has been added to this issue. 
Reported By:                k1mgy
Assigned To:                BusyBox
Project:                    BusyBox
Issue ID:                   58
Category:                   Other
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     assigned
Date Submitted:             01-24-2005 14:04 PST
Last Modified:              09-19-2005 05:03 PDT
Summary:                    Compiling ash.c with DEBUG defined generates link
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);

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
Warning: size of symbol `main' changed from 94 to 6 in
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                          

More information about the busybox-cvs mailing list