From pete@twisted.org.uk  Sun Sep 12 17:39:03 2004
Return-Path: <pete@twisted.org.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AB6A916A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 17:39:03 +0000 (GMT)
Received: from smtp-out1.blueyonder.co.uk (smtp-out1.blueyonder.co.uk [195.188.213.4])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CDD1943D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 17:39:02 +0000 (GMT)
	(envelope-from pete@twisted.org.uk)
Received: from skerry.twisted.org.uk ([82.35.80.30]) by smtp-out1.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713);
	 Sun, 12 Sep 2004 18:39:26 +0100
Received: from [192.168.4.2] (helo=frenic.drayhouse)
	by skerry.twisted.org.uk with esmtp (Exim 4.42 (FreeBSD))
	id 1C6YJZ-000Juh-C6
	for FreeBSD-gnats-submit@freebsd.org; Sun, 12 Sep 2004 18:39:01 +0100
Received: from pete by frenic.drayhouse with local (Exim 4.42 (FreeBSD))
	id 1C6YJZ-0000H0-59
	for FreeBSD-gnats-submit@freebsd.org; Sun, 12 Sep 2004 18:39:01 +0100
Message-Id: <E1C6YJZ-0000H0-59@frenic.drayhouse>
Date: Sun, 12 Sep 2004 18:39:01 +0100
From: Pete French <pete@twisted.org.uk>
Reply-To: Pete French <pete@twisted.org.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: static libraries cannot be linked when building shared libraries
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71674
>Category:       amd64
>Synopsis:       static libraries cannot be linked when building shared libraries
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 17:40:28 GMT 2004
>Closed-Date:    Mon Nov 29 23:53:59 GMT 2004
>Last-Modified:  Tue Nov 30 07:30:23 GMT 2004
>Originator:     Pete French
>Release:        FreeBSD 5.3-BETA4 amd64
>Organization:
>Environment:
System: FreeBSD frenic.drayhouse 5.3-BETA4 FreeBSD 5.3-BETA4 #0: Sun Sep 12 18:04:01 BST 2004 pete@frenic.drayhouse:/usr/obj/usr/src/sys/FRENIC amd64


>Description:
	The supplied /usr/lib/libobjc.a has been compiled in such a
	way that trying to link when making a shared library gives
	the following error:

	/usr/bin/ld: /usr/lib/libobjc.a(Protocol.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libobjc.a: could not read symbols: Bad value

	This did not happen on pre BETA versions. I am unsure as to whether
	the linker has changed or what. This may apply to all the static
	libraries in /usr/lib though! I have tried with libz.a and libufs.a
	with the same error.


>How-To-Repeat:
	In this instance I was trying to build the GNUstep base libraries.
	But trying to make a very simple shared library, linking against
	static libraries in /usr/lib, will show it up.

>Fix:
	Preseumably fix buildworld so that static libraries are compiled
	with -fPIC ? This also applies to static libraries built from
	ports.
>Release-Note:
>Audit-Trail:

From: Peter Wemm <peter@wemm.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: amd64/71674
Date: Wed, 29 Sep 2004 16:34:03 -0700

 This is actually "as designed".  You are not supposed to link a .a file 
 into a .so file.  i386 lets you get away with it, but on amd64 it is 
 fatal.
 
 However.. it looks like we don't have a libobjc.so anymore.  This 
 probably explains your problem...
 -- 
 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
 "All of this is for nothing if we don't go to the stars" - JMS/B5
State-Changed-From-To: open->analyzed 
State-Changed-By: obrien 
State-Changed-When: Mon Nov 1 16:41:30 GMT 2004 
State-Changed-Why:  
The reasoning for the issue has been determined. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71674 
State-Changed-From-To: analyzed->closed 
State-Changed-By: peter 
State-Changed-When: Mon Nov 29 23:51:58 GMT 2004 
State-Changed-Why:  
Committed in 6.x some time ago, and now fixed in RELENG_5 as well. 
The bogus disabling of libobjc.so was reverted for amd64.  The reasons 
for doing it were probably only relevant to i386 back in 1998. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71674 

From: Pascal Hofstee <caelian@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org, pete@twisted.org.uk
Cc:  
Subject: Re: amd64/71674: static libraries cannot be linked when building shared libraries
Date: Mon, 29 Nov 2004 21:37:40 -0800

 As i am occasionally toying around with GNUstep as well ... and
 noticed that originally the FreeBSD ports-version of GNUstep
 essentially required an actual libobjc.so (and hence required to build
 a gcc-3.3.5 iirc and get its libobjc.so from there) .... i have since
 noticed that it is indeed possible to build GNUstep on FreeBSD/i386
 using just our static libobjc.a
 
 I am wondering though if there is any specific reason for Not
 reverting this "bogus" disabling of libobjc.so for i386 as well ?
 
 i recall reading somewhere that certain elements of the Objective-C
 runtime would require a dynamic libobjc ... though i don't recall
 where i read this at the moment ... and it seems not to really impact
 GNUstep's functioning.
 
 But if there is no real reason (besides apprently so called
 performance impact .. which i hope may have been improved on since
 1998) ... i would definately appreciate this change reverted on i386
 as well ... (if only for consistency's sake concerning the libraries
 provided by the base system between different FreeBSD architectures)
 
 With kind regards,
   Pascal Hofstee
>Unformatted:
