From owner-freebsd-bugs Thu Apr 20 20:51:59 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 7AADD37B736 for ; Thu, 20 Apr 2000 20:51:54 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id NAA04297; Fri, 21 Apr 2000 13:51:30 +1000 Date: Fri, 21 Apr 2000 13:51:26 +1000 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Anatoly Vorobey Cc: Martin Cracauer , bugs@FreeBSD.ORG Subject: Re: bin/18104: missing include file in sh(1) In-Reply-To: <20000420131840.A1964@happy.checkpoint.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, 20 Apr 2000, Anatoly Vorobey wrote: > 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. This seems to be just another bug in ncurses. > > 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. This is because the linker doesn't detect multiply defined symbols except in the -static case. It is possible to override a symbol in a library if the object containing the symbol is not referenced, although this is rarely what is wanted (overriding libcurses's trace() with sh's trace() would break tracing in libcurses). E.g., the following program "successfully" overrides the library malloc() if it doesn't reference the library free(): main() { #ifdef BROKEN free(); #endif } malloc() { } When BROKEN is defined, "cc -static" detects the problem, but plain cc doesn't. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message