NetBSD Problem Report #402

From gnats  Mon Aug  8 11:58:37 1994
Received: from uwm.edu (uwm.edu [129.89.6.2]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with SMTP id LAA00776 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Mon, 8 Aug 1994 11:58:35 -0700
Message-Id: <199408081859.NAA03627@enigma.cs.uwm.edu>
Date: Mon, 8 Aug 1994 13:59:29 -0500
From: James Jegers <jimj@enigma.cs.uwm.edu>
Reply-To: jimj@enigma.cs.uwm.edu
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: dynamic ld can't figure out what functions it needs
X-Send-Pr-Version: 3.2

>Number:         402
>Category:       bin
>Synopsis:       dynamic ld can't figure out what functions it needs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pk
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 08 12:05:09 +0000 1994
>Closed-Date:    Wed Oct 31 20:25:53 +0000 2001
>Last-Modified:  Wed Oct 31 20:25:53 +0000 2001
>Originator:     James Jegers
>Release:        
>Organization:
"	"
>Environment:

System: NetBSD enigma.cs.uwm.edu 1.0 beta ENIGMA#1 i386


>Description:

      The linker doesn't figure out all of the libraries to link in
      when compiling in the dynamic form.  A static link, it will complain
      about unresolved functions.  (I have only seen this problem with
      the curses library).
>How-To-Repeat:


%m %/-> more i.c
#include <curses.h>

main()
{
   initscr();
}

%m %/-> cc i.c -lcurses
%m %/-> a.out
ld.so: Undefined symbol "_tgetent" called from a.out:/usr/lib/libcurses.so.2.0 at 0x1002226c

%m %/-> cc -static i.c -lcurses
setterm.o: Undefined symbol `_tgetent' referenced from text segment
setterm.o: Undefined symbol `_tgetnum' referenced from text segment
....
refresh.o: Undefined symbol `_tputs' referenced from text segment
refresh.o: More undefined symbol _tputs refs follow
cr_put.o: Undefined symbol `_tgoto' referenced from text segment

%m %/-> cc i.c -lcurses -ltermcap
%m %/-> a.out
%m %/-> cc -static i.c -lcurses -ltermcap
%m %/-> a.out
%m %/-> 

   Similar things happen when compiling with the c++ compiler, once the 
   curses.h header file is fixed for __BEGIN_DECLS, __END_DECLS.

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: pk 
State-Changed-When: Tue Aug 9 05:51:26 PDT 1994 
State-Changed-Why:  
Known bug, even listed in the man-page (ld(1)) 


Responsible-Changed-From-To: gnats-admin->pk 
Responsible-Changed-By: pk 
Responsible-Changed-When: Tue Aug 9 05:51:26 PDT 1994 
Responsible-Changed-Why:  
I'll have to fix it sometime. 

Xref: PR678 - which describes the same problem.

As of NetBSD-1.3, Jason Thorpe worked around this bug by making
gcc use -fno-function-cse when building shared libraries. Still
needs to be fixed.

Date: Sat, 13 Feb 1999 17:31:51 +0100
From: "Heiko W.Rupp" <hwr@pilhuhn.de>
To: pk@netbsd.org
Cc: gnats-bugs@netbsd.org
Subject: Re: PR bin/402

 Hi,

 just as a hint

 I just checked this on my -current and the original problem seems
 gone, while this is still in on my 1.3. system.

  Heiko
State-Changed-From-To: suspended->feedback 
State-Changed-By: jdolecek 
State-Changed-When: Fri Oct 12 11:17:05 PDT 2001 
State-Changed-Why:  
This seems to work well with ELF toolchain and worked well with i386 a.out 
toolchain too. Perhaps it's time to close this? 
State-Changed-From-To: feedback->closed 
State-Changed-By: jdolecek 
State-Changed-When: Wed Oct 31 12:25:08 PST 2001 
State-Changed-Why:  
No longer present. Thanks for report. 
>Unformatted:
 Additional info: this problem is present in the version of ld(1) used
 on `a.out' platforms.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.