From dm@home.dinoex.sub.de  Mon Mar 10 11:19:55 2003
Return-Path: <dm@home.dinoex.sub.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1574637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Mar 2003 11:19:55 -0800 (PST)
Received: from net2.dinoex.sub.org (net2.dinoex.sub.org [212.184.201.182])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2698843F75
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Mar 2003 11:19:51 -0800 (PST)
	(envelope-from dm@home.dinoex.sub.de)
Received: from home.dinoex.sub.de (home [217.6.200.196])
	by net2.dinoex.sub.org (8.12.8/8.12.8) with ESMTP id h2AJJbmo023025
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Mar 2003 20:19:38 +0100 (CET)
	(envelope-from dm@home.dinoex.sub.de)
Received: (from dm@localhost)
	by home.dinoex.sub.de (8.12.7/8.12.7/Submit) id h2AJM0IG050615;
	Mon, 10 Mar 2003 20:22:00 +0100 (CET)
	(envelope-from dm)
Message-Id: <200303101922.h2AJM0IG050615@home.dinoex.sub.de>
Date: Mon, 10 Mar 2003 20:22:00 +0100 (CET)
From: dirk.meyer@dinoex.sub.org
Reply-To: dirk.meyer@dinoex.sub.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         49081
>Category:       ia64
>Synopsis:       @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gerald
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 10 11:20:08 PST 2003
>Closed-Date:    Sun Mar 16 16:05:26 PST 2003
>Last-Modified:  Wed Apr 16 08:54:33 PDT 2003
>Originator:     Dirk Meyer
>Release:        FreeBSD 5.0-CURRENT ia64
>Organization:
privat
>Environment:

	FreeBSD 5.0-CURRENT ia64

>Description:

	libobjc cant be linked to applications.

>How-To-Repeat:

e.G. Build ports/lang/gnustep-base
http://bento.freebsd.org/errorlogs/ia64-5-latest/gnustep-base-1.5.2.log

[...]
 Compiling file GSSSLHandle.m ...
 Linking bundle SSL ...
/usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_alloc
/usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_copy
/usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_dispose
gmake[2]: *** [SSL.bundle/ia64/freebsd/gnu-gnu-gnu/SSL] Error 1
gmake[1]: *** [SSL.all.bundle.variables] Error 2
gmake[1]: Leaving directory `/tmp/a/ports/lang/gnustep-base/work/gnustep-base-1.5.2/SSL'
gmake: *** [internal-all] Error 2
*** Error code 2

>Fix:

change complilation options ...
	see PR# ia64/38678

>Release-Note:
>Audit-Trail:

From: Marcel Moolenaar <marcel@xcllnt.net>
To: dirk.meyer@dinoex.sub.org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
Date: Mon, 10 Mar 2003 13:48:30 -0800

 On Mon, Mar 10, 2003 at 08:22:00PM +0100, dirk.meyer@dinoex.sub.org wrote:
 > 
 > >Number:         49081
 > >Category:       ia64
 > >Synopsis:       @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
 [snip]
 >  Linking bundle SSL ...
 > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_alloc
 > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_copy
 > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_dispose
 > gmake[2]: *** [SSL.bundle/ia64/freebsd/gnu-gnu-gnu/SSL] Error 1
 > gmake[1]: *** [SSL.all.bundle.variables] Error 2
 > gmake[1]: Leaving directory `/tmp/a/ports/lang/gnustep-base/work/gnustep-base-1.5.2/SSL'
 > gmake: *** [internal-all] Error 2
 > *** Error code 2
 > 
 > >Fix:
 > 
 > change complilation options ...
 > 	see PR# ia64/38678
 
 Which ompilation options?
 
 -- 
  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

From: Arun Sharma <arun.sharma@intel.com>
To: Marcel Moolenaar <marcel@xcllnt.net>
Cc: freebsd-ia64@FreeBSD.ORG, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
Date: 10 Mar 2003 14:53:25 -0800

 Marcel Moolenaar <marcel@xcllnt.net> writes:
 
 >  >  Linking bundle SSL ...
 >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_alloc
 >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_copy
 >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_dispose
 
 It seems to be by design:
 
 # pwd
 /usr/src/gnu/lib/libobjc
 # grep NOPIC Makefile
 NOPIC=  works but method lookup slowdown is significant
 
         -Arun
 

From: Marcel Moolenaar <marcel@xcllnt.net>
To: Arun Sharma <arun.sharma@intel.com>
Cc: freebsd-ia64@FreeBSD.ORG, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
Date: Mon, 10 Mar 2003 15:13:26 -0800

 On Mon, Mar 10, 2003 at 02:53:25PM -0800, Arun Sharma wrote:
 > Marcel Moolenaar <marcel@xcllnt.net> writes:
 > 
 > >  >  Linking bundle SSL ...
 > >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_alloc
 > >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_copy
 > >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_dispose
 > 
 > It seems to be by design:
 > 
 > # pwd
 > /usr/src/gnu/lib/libobjc
 > # grep NOPIC Makefile
 > NOPIC=  works but method lookup slowdown is significant
 > 
 
 Yes, hence my question. We cannot easily change this without affecting
 other platforms (assuming for a moment we're not going to create an
 ia64 specific kludge -- not gratuitously that is). At this time the
 port is broken for all platforms, because of the fundamental flaw of
 linking in non-PIC code in a shared library. The fact that it happens
 to work on some architectures does not mean it's not broken. So, either
 we change the way we build libobjc.a, or we provide a libobjc_pic.a
 just like we do for libc.a, or we create a libobjc.so. For the last two
 cases the port has to be changed. For the first case it pessimizes the
 library (performance-wise) for the complete (or fully archive) programs.
 
 I think the best solution is to build libobjc.a with -fpic.
 
 -- 
  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: FreeBSD-gnats-submit@FreeBSD.ORG,
	marcel@xcllnt.net (Marcel Moolenaar)
Cc:  
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol
	in /usr/lib/libobjc.a
Date: Tue, 11 Mar 2003 05:05:40 +0100

 Marcel Moolenaar schrieb:,
 
 > > change complilation options ...
 > > 	see PR# ia64/38678
 > 
 > Which ompilation options?
 
 you fixed a similar problem:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=38678
 
 State-Changed-By: marcel
 State-Changed-When: Wed Oct 23 20:58:12 PDT 2002
 State-Changed-Why: 
 The problem with the @gprel relocation was related to the fact
 that we compiled with short data and without -fpic. As a result,
 the compiler assumed it could create @gprel relocations to access
 data objects placed in the short data (.sdata or .sbss) sections.
 The fix is to disable short data for kernel builds (including
 modules).
 
 a) can libobj.a build without "short data"
 
 b) or need the application build without "short data" ?
 
 I found only a "--disable-short-wchar" option ...
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]

From: Marcel Moolenaar <marcel@xcllnt.net>
To: Dirk Meyer <dirk.meyer@dinoex.sub.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
Date: Mon, 10 Mar 2003 20:29:15 -0800

 On Tue, Mar 11, 2003 at 05:05:40AM +0100, Dirk Meyer wrote:
 > Marcel Moolenaar schrieb:,
 > 
 > > > change complilation options ...
 > > > 	see PR# ia64/38678
 > > 
 > > Which ompilation options?
 > 
 > you fixed a similar problem:
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=38678
 > 
 > State-Changed-By: marcel
 > State-Changed-When: Wed Oct 23 20:58:12 PDT 2002
 > State-Changed-Why: 
 > The problem with the @gprel relocation was related to the fact
 > that we compiled with short data and without -fpic. As a result,
 > the compiler assumed it could create @gprel relocations to access
 > data objects placed in the short data (.sdata or .sbss) sections.
 > The fix is to disable short data for kernel builds (including
 > modules).
 > 
 > a) can libobj.a build without "short data"
 > b) or need the application build without "short data" ?
 
 To solve this problem: b' :-)
 
 b') build the shared library that links against libobjc without
     "short data".
 
 It's a hack because not using short data pessimizes access sequences
 and thus reduces performance.
 
 > I found only a "--disable-short-wchar" option ...
 
 ... which is unrelated :-)
 
 The best solution is to build libobjc.so. I did that and it solved
 the problem, but exposed another one. If we don't want libobjc.so,
 we have to build libobjc.a with PIC, which terribly failed on i386
 so that we have to make it ia64 specific to start with (even though
 it's theoretically required on all architectures).
 
 -- 
  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net
State-Changed-From-To: open->closed 
State-Changed-By: marcel 
State-Changed-When: Sun Mar 16 16:04:14 PST 2003 
State-Changed-Why:  
Compile libobjc.a with PIC 

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

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ia64/49081: @gprel relocation against dynamic symbol
	in /usr/lib/libobjc.a
Date: Wed, 16 Apr 2003 17:16:51 +0200

 I run into problems on alpha and sparc too.
 The problem is not ia64 specific, as I first assumed.
 
 /usr/libexec/elf/ld: /usr/local/lib/gcc-lib/alpha-portbld-freebsd4.8/3.2.2/libobjc.a(class.o): gp-relative relocation against dynamic symbol _objc_lookup_class
 
 I need the libobjc.so which I get from the gcc32 ports instead.
 So the "-PIC" part can be removed safely.
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
Responsible-Changed-From-To: freebsd-ia64->gerald 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Wed Apr 16 08:53:32 PDT 2003 
Responsible-Changed-Why:  
The port maintainer will probably want to know about this and maybe 
keep tabs on it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=49081 
>Unformatted:
