NetBSD Problem Report #45253

From martin@duskware.de  Sun Aug 14 20:12:24 2011
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 649CE63BE67
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 14 Aug 2011 20:12:24 +0000 (UTC)
Message-Id: <20110814201224.649CE63BE67@www.NetBSD.org>
Date: Sun, 14 Aug 2011 20:12:24 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: amd64 libgcc_eh.a broken
X-Send-Pr-Version: 3.95

>Number:         45253
>Category:       toolchain
>Synopsis:       amd64 libgcc_eh.a broken
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 14 20:15:00 +0000 2011
>Closed-Date:    Thu Sep 20 22:20:35 +0000 2012
>Last-Modified:  Thu Sep 20 22:20:35 +0000 2012
>Originator:     Martin Husemann
>Release:        NetBSD 5.99.55
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 5.99.55 NetBSD 5.99.55 (NIGHT-OWL) #41: Sun Aug 14 12:38:13 CEST 2011 martin@night-owl.duskware.de:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

After gcc 4.5 update, I started rebuilding lots of packages. One of the
failures is print/cups:

libtool: link: c++ -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib -pie -fPIE -Wall -Wno-format-y2k -fPIC -Os -g -o .libs/ppdc ppdc.o  -L/usr/pkgobj/print/cups/work/cups-1.4.6/cups/.libs -L/usr/pkgobj/print/cups/work/cups-1.4.6/cgi-bin -L/usr/pkgobj/print/cups/work/cups-1.4.6/cups -L/usr/pkgobj/print/cups/work/cups-1.4.6/filter -L/usr/pkgobj/print/cups/work/cups-1.4.6/ppdc -L/usr/pkgobj/print/cups/work/cups-1.4.6/scheduler -L/usr/pkgobj/print/cups/work/.buildlink/lib -L/usr/pkgobj/print/cups/work/.x11-buildlink/lib ../ppdc/.libs/libcupsppdc.so /usr/pkgobj/print/cups/work/cups-1.4.6/cups/.libs/libcups.so ../cups/.libs/libcups.so -lgssapi -lheimntlm -lkrb5 -lhx509 -lcom_err -lasn1 -lwind -lroken -lpthread -lz -lssl -lcrypto -ldns_sd -lm -lcrypt -Wl,-rpath -Wl,/usr/pkg/lib
ld: /usr/lib/libgcc_eh.a(unwind-dw2.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libgcc_eh.a: could not read symbols: Bad value

The R_X86_64_32S relocations in that library are:

00000000002a  00060000000b R_X86_64_32S      0000000000000000 .rodata + 0
000000000079  00070000000b R_X86_64_32S      0000000000000000 .rodata + 0
0000000002c0  00070000000b R_X86_64_32S      0000000000000000 .rodata + 68
0000000009b0  00070000000b R_X86_64_32S      0000000000000000 .rodata + 1e8
000000000af7  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000000cb2  00070000000b R_X86_64_32S      0000000000000000 .rodata + 960
000000000ce9  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000000d47  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000000ffe  00070000000b R_X86_64_32S      0000000000000000 .rodata + a08
000000001094  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
00000000113a  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
00000000115f  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000001199  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
00000000125e  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000001a38  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000001a56  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000001b3c  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
000000001b85  00040000000b R_X86_64_32S      0000000000000000 .bss + 0
0000000001ea  000a0000000b R_X86_64_32S      0000000000000000 .rodata + 0
000000000aca  00040000000b R_X86_64_32S      0000000000000000 .bss + 10
000000000aef  00040000000b R_X86_64_32S      0000000000000000 .bss + 10
000000001168  00040000000b R_X86_64_32S      0000000000000000 .bss + 20
000000001173  00040000000b R_X86_64_32S      0000000000000000 .bss + 28
000000001187  00040000000b R_X86_64_32S      0000000000000000 .bss + 20
00000000118e  00040000000b R_X86_64_32S      0000000000000000 .bss + 48
0000000011ad  00040000000b R_X86_64_32S      0000000000000000 .bss + 20

I'm not sure how any of those would qualify as "a local symbol".

And one of the pkgs I rebuild was libtool-base (just in case it matters).

>How-To-Repeat:
On a completely current amd64 system, try to build cups from pkgsrc-current
>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/45253: amd64 libgcc_eh.a broken
Date: Sun, 14 Aug 2011 22:35:42 +0000

 On Sun, Aug 14, 2011 at 08:15:00PM +0000, martin@NetBSD.org wrote:
  > ld: /usr/lib/libgcc_eh.a(unwind-dw2.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
  > /usr/lib/libgcc_eh.a: could not read symbols: Bad value
  > 
  > The R_X86_64_32S relocations in that library are:
  > [...]
  > 
  > I'm not sure how any of those would qualify as "a local symbol".

 As I recall in this context "a local symbol" means a .L12345-type
 symbol that no longer has a name in the object file's symbol table, so
 any of them could be.

 I guess libgcc_eh should be built with -fPIC if it's needed in .so
 images. And if it's not needed in .so images I expect this means the
 gcc specs are wrong.

 -- 
 David A. Holland
 dholland@netbsd.org

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: toolchain/45253: amd64 libgcc_eh.a broken
Date: Mon, 15 Aug 2011 11:11:55 +1000

 the gcc natively built libgcc_eh.a contains objects compiled with
 -fPIC for me, on amd64.  we don't do that for the in-tree libgcc_eh.a.
 (it doesn't use -DPIC.)  i'll need to look at what we need to do to
 properly do what gcc is doing.  i'm also curious about joerg's comment
 about what is missing from libgcc_s but libgcc_eh only uses ${LIB2_EH}
 sources, and libgcc_s also includes these.

 FWIW, the simple work around is to copy libgcc_eh_pic.a to libgcc_eh.a
 this at least makes print/cups build.


 .mrg.

From: matthew green <mrg@eterna.com.au>
To: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org, gnats-bugs@NetBSD.org
Cc: 
Subject: re: toolchain/45253: amd64 libgcc_eh.a broken
Date: Mon, 15 Aug 2011 11:52:51 +1000

 please try this patch.  i noticed that we're ignoring any configured
 -f or -m flags for libgcc.  some use -fPIC, some -fpic, some have
 additional flags, and alpha has -mieee as well.


 .mrg.


 Index: Makefile.inc
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/lib/libgcc/Makefile.inc,v
 retrieving revision 1.10
 diff -p -r1.10 Makefile.inc
 *** Makefile.inc	7 Jul 2011 01:27:47 -0000	1.10
 --- Makefile.inc	15 Aug 2011 01:51:27 -0000
 *************** GCCARCHXX=	${NETBSDSRCDIR}/external/gpl3
 *** 17,22 ****
 --- 17,23 ----
   GCPPFLAGS=	${G_LIBGCC2_CFLAGS} ${G_USE_COLLECT2} ${G_INCLUDES}
   CPPFLAGS+=	-I${.CURDIR} -I${GCCARCHLIBGCC}
   CPPFLAGS+=	-I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
 + CPPFLAGS+=	${GCPPFLAGS:M-f*:M-m*}
   CPPFLAGS+=	${G_EXTRA_HEADERS:M/*:H:u:S/^/-I/g}
   CPPFLAGS+=	-I${DIST} -I${DIST}/gcc/cp -I${DIST}/gcc/config -I${GCCARCHXX} -I.


From: David Laight <david@l8s.co.uk>
To: matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@NetBSD.org
Subject: Re: toolchain/45253: amd64 libgcc_eh.a broken
Date: Mon, 15 Aug 2011 08:21:53 +0100

 On Mon, Aug 15, 2011 at 11:52:51AM +1000, matthew green wrote:
 > 
 > please try this patch.  i noticed that we're ignoring any configured
 > -f or -m flags for libgcc.  some use -fPIC, some -fpic, some have
 > additional flags, and alpha has -mieee as well.
 ...
 > + CPPFLAGS+=	${GCPPFLAGS:M-f*:M-m*}

 Don't you need to specify the matches separately as:
 + CPPFLAGS+=	${GCPPFLAGS:M-m*}
 + CPPFLAGS+=	${GCPPFLAGS:M-f*}
 Otherwise they are applied in sequence - giving nothing.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: matthew green <mrg@eterna.com.au>
To: David Laight <david@l8s.co.uk>
Cc: gnats-bugs@NetBSD.org
Subject: re: toolchain/45253: amd64 libgcc_eh.a broken
Date: Mon, 15 Aug 2011 18:01:56 +1000

 > On Mon, Aug 15, 2011 at 11:52:51AM +1000, matthew green wrote:
 > > 
 > > please try this patch.  i noticed that we're ignoring any configured
 > > -f or -m flags for libgcc.  some use -fPIC, some -fpic, some have
 > > additional flags, and alpha has -mieee as well.
 > ...
 > > + CPPFLAGS+=	${GCPPFLAGS:M-f*:M-m*}
 > 
 > Don't you need to specify the matches separately as:
 > + CPPFLAGS+=	${GCPPFLAGS:M-m*}
 > + CPPFLAGS+=	${GCPPFLAGS:M-f*}
 > Otherwise they are applied in sequence - giving nothing.

 you're right.  thanks.

From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45253 CVS commit: src/external/gpl3/gcc/lib/libgcc
Date: Mon, 15 Aug 2011 18:31:20 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Mon Aug 15 18:31:20 UTC 2011

 Modified Files:
 	src/external/gpl3/gcc/lib/libgcc: Makefile.inc

 Log Message:
 also copy -m and -f flags from the GCC headers.

 fixes PR#45253.  (i'm going to leave that bug open for now because i
 want to re-work a bunch of the libgcc framework.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/lib/libgcc/Makefile.inc

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Thu, 20 Sep 2012 22:20:35 +0000
State-Changed-Why:
problem closed, and i'm not sure exactly what rework i was thinking about.


>Unformatted:

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.