pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48775: devel/binutils: linker doesn't handle PIC properly; can't build lang/gcc-aux



>Number:         48775
>Category:       pkg
>Synopsis:       devel/binutils: linker doesn't handle PIC properly; can't 
>build lang/gcc-aux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 01 07:05:01 +0000 2014
>Originator:     John Marino
>Release:        NetBSD 6.1.4 - amd64
>Organization:
>Environment:
>Description:
The lang/gcc-aux package is the first gcc 4.9-based package in pkgsrc as far as 
I can tell.

I can't find this documented, but apparently gcc 4.9 requires a version of 
binutils newer than the version 2.21 that comes with NetBSD 6.  It builds fine 
with the base linker and assembler, and mostly seems to work, but while linking 
devel/gps, the linker completely malfunctions.

The theory that the culprit is the base binutils is supported by devel/gps 
building just fine on NetBSD 6.99 which has binutils 2.23 in base.

However, adding devel/binutils as a dependency as see in other gcc packages 
(e.g. lang/gcc47) results in lang/gcc-aux breaking during the build of 
libstdc++, specifically the c++98 convenience static library which is built 
with -fPIC.  During linking, an error occurs stating that the object file 
should have been produced with -fPIC.  logs clearly show that it was.

So my conclusion is that there is either something wrong with devel/binutils or 
something in base is preventing the linker from working correctly
>How-To-Repeat:
On NetBSD 6.1.4 (or any release of NetBSD 6 presumably)

"cd lang/gcc-aux && make" after applying the following patch: 

--- Makefile.orig       2014-05-01 06:39:48.000000000 +0000
+++ Makefile    2014-05-01 06:41:44.000000000 +0000
@@ -63,6 +63,7 @@
 .endif
 BOOTSTRAP_COMPILER=    ada-bootstrap.${GARCH}.netbsd.614.tar.bz2
 BLD_TARGET=            ${MACHINE_ARCH}-aux-netbsd${NELF}${NSUFF}
+MODERN_BINUTILS=       yes
 .endif

 .if ${OPSYS} == "SunOS"


Alternatively to skip modifying the makefile, use:
  cd lang/gcc-aux && make MODERN_BINUTILS=yes


Assuming the problem is reproducible, the build should break on the libstdc++ 
target, with specific complaints about the convenience library not being built 
with PIC.  Obviously this is false because lang/gcc-aux builds fine (with PIC) 
with the base linker and assembler.

devel/gps has been disabled on NetBSD 5 and 6 due to being unable to configure 
lang/gcc-aux to use ${PREFIX}/bin/gld
>Fix:



Home | Main Index | Thread Index | Old Index