Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2000 13:18:40 +0000
From:      Anatoly Vorobey <mellon@pobox.com>
To:        Martin Cracauer <cracauer@cons.org>
Cc:        bugs@freebsd.org
Subject:   Re: bin/18104: missing include file in sh(1)
Message-ID:  <20000420131840.A1964@happy.checkpoint.com>
In-Reply-To: <20000420120542.B14071@cons.org>; from cracauer@cons.org on Thu, Apr 20, 2000 at 12:05:42PM %2B0200
References:  <200004200400.VAA88954@freefall.freebsd.org> <20000420120542.B14071@cons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 20, 2000 at 12:05:42PM +0200, Martin Cracauer wrote:
> >  I've goofed here, in fact; sh(1) still won't build with DEBUG since --
> >  get that! -- the function trace() defined in show.c conflicts with 
> >  trace() in lib_trace.o of libtermcap.a of ncurses fame.
> >  
> >  I've renamed the sh function, and retested everything. When build with
> >  DEBUG_FLAGS=-DDEBUG=2 , it'll create a file 'trace' in the current 
> >  directory and will write tons of good info there. Would someone please
> >  review/commit?
> 
> For me, it builds and writes to ./trace even without renaming
> trace(). 
> 
> It appears that the ncurses trace() hijacks your sh-internal trace
> where it should not and does not for me. 

Yes, this is apparently what happens, but I have no idea why.

> I'm also not sure why you
> refer to DEBUG_FLAGS, maybe you use a non-standard build structure?

Presumably you build debug by uncommenting the corresponding line in
the Makefile, while I ``export DEBUG_FLAGS="-DDEBUG=2 -g" '' and
just make afterwards; <bsd.prog.mk> does the rest.

> What does 
>   nm -A *.o | grep trace
> show in your build directory?

cd.o:         U trace
error.o:         U trace
eval.o:         U trace
exec.o:         U trace
expand.o:         U trace
jobs.o:         U trace
main.o:         U opentrace
main.o:         U trace
parser.o:         U trace
show.o:00000b34 T opentrace
show.o:000007d0 T trace
show.o:00000004 C tracefile
trap.o:         U trace

Here's also the make error:

cc -O -pipe -DSHELL -I. -I/usr/src/bin/sh -g -DDEBUG=2 -Wall -Wformat    -static -o sh alias.o arith.o arith_lex.o cd.o echo.o error.o eval.o exec.o expand.o histedit.o input.o jobs.o mail.o main.o memalloc.o miscbltin.o mystring.o options.o output.o parser.o printf.o redir.o show.o trap.o var.o builtins.o init.o nodes.o syntax.o  -ll -ledit -ltermcap
/usr/lib/libtermcap.a(lib_trace.o): In function `trace':
lib_trace.o(.text+0x0): multiple definition of `trace'
show.o:/usr/src/bin/sh/show.c:310: first defined here
/usr/libexec/elf/ld: Warning: size of symbol `trace' changed from 75 to 5 in lib_trace.o
*** Error code 1

Stop in /usr/src/bin/sh.

My environment is completely normal CURRENT tree cvsupped and updated
daily. 

-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000420131840.A1964>