From amjudge@dsg.cs.tcd.ie  Thu Mar 30 05:56:07 1995
Received: from longvalley.dsg.cs.tcd.ie (longvalley.dsg.cs.tcd.ie [134.226.36.37]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id FAA27383 for <FreeBSD-gnats-submit@freebsd.org>; Thu, 30 Mar 1995 05:56:00 -0800
Received: from hogthrob.dsg.cs.tcd.ie by longvalley.dsg.cs.tcd.ie id aa11318;
          30 Mar 95 14:55 BST
Received: (from amjudge@localhost) by hogthrob.dsg.cs.tcd.ie (8.6.11/8.6.9) id OAA07281; Thu, 30 Mar 1995 14:55:14 +0100
Message-Id: <199503301355.OAA07281@hogthrob.dsg.cs.tcd.ie>
Date: Thu, 30 Mar 1995 14:55:14 +0100
From: Alan Judge <amjudge@dsg.cs.tcd.ie>
Reply-To: amjudge@dsg.cs.tcd.ie
To: FreeBSD-gnats-submit@freebsd.org
Cc: amjudge@dsg.cs.tcd.ie, pftaylor@dsg.cs.tcd.ie
Subject: ld.so problem with -lg++ in 2.0-950322-SNAP
X-Send-Pr-Version: 3.2

>Number:         285
>Category:       gnu
>Synopsis:       ld.so problem with -lg++
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 30 06:00:01 1995
>Closed-Date:    Sat Apr 22 10:13:50 PDT 1995
>Last-Modified:
>Originator:     Alan Judge
>Release:        FreeBSD 2.1.0-Development i386 (2.0-950322-SNAP)
>Organization:
Trinity College Dublin
>Environment:

>Description:

	It doesn't appear possible to dynamically link any program with -lg++.
	
	This is new in 950322.  Everything works fine in 950210.

>How-To-Repeat:

	Given a small C++ program like:
extern "C" {
     extern int getpid();
     extern int printf(...);
}

main()
{
     int i = getpid();

     printf("%d\n", i);
}

$ gcc test.cc
$ ldd a.out
a.out:
        -lc.2 => /usr/lib/libc.so.2.0 (0x801a000)
$ a.out
7087
$ gcc test.cc -lg++
$ ldd a.out
a.out:
        -lg++.2 => /usr/lib/libg++.so.2.0 (0x801a000)
        -lc.2 => /usr/lib/libc.so.2.0 (0x807d000)
        -lcurses.2 => /usr/lib/libcurses.so.2.0 (0x80e1000)
        -ltermcap.2 => /usr/lib/libtermcap.so.2.0 (0x80ed000)
$ a.out
ld.so failed

	The program works fine with -static.


	In fact, any C or C++ program would appear to provoke the problem.

	Given:
main() {}
	You get the same problem:
$ gcc test.c
$ a.out
$ gcc test.c -lg++
$ a.out
ld.so failed

	Copying libg++.so and libcompat.so from a 950210 machine doesn't help,
	so I guess it must be some new problem in the linker/runtime loader.

>Fix:
	
	Unknown.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nate 
State-Changed-When: Sat Apr 22 10:13:50 PDT 1995 
State-Changed-Why:  
Fixed in revision 1.14 by backing out changes I had made to enforce command 
line order linkage. 
>Unformatted:



