NetBSD Problem Report #50767

From ryo_on@yk.rim.or.jp  Thu Feb  4 05:20:07 2016
Return-Path: <ryo_on@yk.rim.or.jp>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 76E837A215
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  4 Feb 2016 05:20:07 +0000 (UTC)
Message-Id: <20160204052002.AA13920027824@mail.SiriusCloud.jp>
Date: Thu, 04 Feb 2016 14:20:07 +0900
From: ryoon@NetBSD.org
Reply-To: ryoon@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: Build failure of pkgsrc/www/firefox with binutils 2.26 from NetBSD/amd64 current
X-Send-Pr-Version: 3.95

>Number:         50767
>Category:       pkg
>Synopsis:       Build failure of pkgsrc/www/firefox with binutils 2.26 from NetBSD/amd64 current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 04 05:25:00 +0000 2016
>Closed-Date:    
>Last-Modified:  Tue Aug 16 12:22:04 +0000 2016
>Originator:     Ryo ONODERA
>Release:        NetBSD 7.99.26
>Organization:

>Environment:


System: NetBSD brownie 7.99.26 NetBSD 7.99.26 (DTRACE7) #0: Wed Feb 3 05:53:03 JST 2016 ryo_on@brownie:/usr/world/7.99/amd64/obj/sys/arch/amd64/compile/DTRACE7 amd64
Architecture: x86_64
Machine: amd64
>Description:
www/firefox build fails as follows:

    INPUT("../../gfx/skia/Unified_cpp_gfx_skia7.o")
    INPUT("../../gfx/skia/Unified_cpp_gfx_skia8.o")
    INPUT("../../gfx/skia/Unified_cpp_gfx_skia9.o")
    INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")

ld: ../../xpcom/components/nsComponentManager.o: relocation R_X86_64_PC32 against protected symbol `end_kPStaticModules_NSModule' can not be used when making a shared object
ld: final link failed: Bad value
/usr/tmp/pkgsrc/www/firefox/work/firefox-44.0/config/rules.mk:827: recipe for target 'libxul.so' failed
gmake[3]: *** [libxul.so] Error 1

$ ld -v
GNU ld (NetBSD Binutils nb1) 2.26.20160125

With older ld from NetBSD base, it builds successfully.

>How-To-Repeat:
On NetBSD/amd64 current of yesterday:
$ cd /usr/pkgsrc/www/firefox
$ make

>Fix:

I have no idea.

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with binutils 2.26 from NetBSD/amd64 current
Date: Thu, 4 Feb 2016 16:45:24 -0500

 On Feb 4,  5:25am, ryoon@NetBSD.org (ryoon@NetBSD.org) wrote:
 -- Subject: toolchain/50767: Build failure of pkgsrc/www/firefox with binutil

 https://bugzilla.mozilla.org/show_bug.cgi?id=1141729

 christos

From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with
 binutils 2.26 from NetBSD/amd64 current
Date: Fri, 5 Feb 2016 00:07:29 +0100

 On Thu, Feb 04, 2016 at 09:50:01PM +0000, Christos Zoulas wrote:
 > The following reply was made to PR toolchain/50767; it has been noted by GNATS.
 > 
 > From: christos@zoulas.com (Christos Zoulas)
 > To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org, 
 > 	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Cc: 
 > Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with binutils 2.26 from NetBSD/amd64 current
 > Date: Thu, 4 Feb 2016 16:45:24 -0500
 > 
 >  On Feb 4,  5:25am, ryoon@NetBSD.org (ryoon@NetBSD.org) wrote:
 >  -- Subject: toolchain/50767: Build failure of pkgsrc/www/firefox with binutil
 >  
 >  https://bugzilla.mozilla.org/show_bug.cgi?id=1141729

 But that one supposedly disappeared with firefox-36.0.4, a long time ago.
  Thomas

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with binutils
 2.26 from NetBSD/amd64 current
Date: Fri, 19 Feb 2016 15:40:48 -0600 (CST)

 For reference, also on i386-current:

 NetBSD verthandi 7.99.26 NetBSD 7.99.26 (VERTHANDI) #1: Fri Feb 12 22:16:21 CST 2016  sysop@verthandi.technoskunk.fur:/d0/build/nbsd-tst/obj/i386/sys/arch/i386/compile/VERTHANDI i386

 [...]
 ld: ../../xpcom/components/nsComponentManager.o: relocation R_386_GOTOFF against protected data `start_kPStaticModules_NSModule' can not be used when making a shared object
 ld: final link failed: Bad value
 /d0/build/pkgsrc/www/firefox/work/firefox-43.0/config/rules.mk:827: recipe for target 'libxul.so' failed
 gmake[3]: *** [libxul.so] Error 1
 gmake[3]: Leaving directory '/d0/build/pkgsrc/www/firefox/work/build/toolkit/library'
 /d0/build/pkgsrc/www/firefox/work/firefox-43.0/config/recurse.mk:71: recipe for target 'toolkit/library/target' failed
 gmake[2]: *** [toolkit/library/target] Error 2
 gmake[2]: Leaving directory '/d0/build/pkgsrc/www/firefox/work/build'
 /d0/build/pkgsrc/www/firefox/work/firefox-43.0/config/recurse.mk:32: recipe for target 'compile' failed
 gmake[1]: *** [compile] Error 2
 gmake[1]: Leaving directory '/d0/build/pkgsrc/www/firefox/work/build'
 /d0/build/pkgsrc/www/firefox/work/firefox-43.0/config/rules.mk:549: recipe for target 'all' failed
 gmake: *** [all] Error 2
 *** Error code 2

 Stop.
 make[1]: stopped in /x/pkgsrc/www/firefox
 *** Error code 1

 Stop.
 make: stopped in /x/pkgsrc/www/firefox

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/50767: Build failure of pkgsrc/www/firefox with binutils
 2.26 from NetBSD/amd64 current
Date: Fri, 19 Feb 2016 21:58:01 +0000

 The following may be a fix. Gonna take me a while to confirm by building
 it twice...
 https://bugzilla.mozilla.org/show_bug.cgi?id=1246416

 CONFIGURE_ARGS+=	--disable-elf-hack

 elf hack is here:
 http://mxr.mozilla.org/mozilla-release/source/build/unix/elfhack/elfhack.cpp#318

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/50767: Build failure of pkgsrc/www/firefox with binutils
Date: Fri, 19 Feb 2016 23:09:16 +0000

 I can't reproduce this issue. Is it still relevant?

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with
 binutils 2.26 from NetBSD/amd64 current
Date: Sat, 20 Feb 2016 00:13:26 +0000

 Hi, I can't reproduce this currently. Is this still relevant?

 Following fixes this package (most likely):
 https://bugzilla.mozilla.org/show_bug.cgi?id=1246416

 CONFIGURE_ARGS+=	--disable-elf-hack

 Relevant code:
 http://mxr.mozilla.org/mozilla-release/source/build/unix/elfhack/elfhack.cpp#318

From: Ryo ONODERA <ryo_on@yk.rim.or.jp>
To: gnats-bugs@NetBSD.org, coypu@SDF.ORG
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with
 binutils 2.26 from NetBSD/amd64 current
Date: Sun, 21 Feb 2016 12:33:37 +0900 (JST)

 Hi,

 I have added pkgsrc/www/firefox/patches/patch-xpcom_components_Module.h
 to fix the build.

 I do not have successful www/firefox build with --disable-elf-hack
 without pkgsrc/www/firefox/patches/patch-xpcom_components_Module.h.

 From: coypu@SDF.ORG, Date: Sat, 20 Feb 2016 00:15:01 +0000 (UTC)

 > The following reply was made to PR toolchain/50767; it has been noted by GNATS.
 > 
 > From: coypu@SDF.ORG
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with
 >  binutils 2.26 from NetBSD/amd64 current
 > Date: Sat, 20 Feb 2016 00:13:26 +0000
 > 
 >  Hi, I can't reproduce this currently. Is this still relevant?
 >  
 >  Following fixes this package (most likely):
 >  https://bugzilla.mozilla.org/show_bug.cgi?id=1246416
 >  
 >  CONFIGURE_ARGS+=	--disable-elf-hack
 >  
 >  Relevant code:
 >  http://mxr.mozilla.org/mozilla-release/source/build/unix/elfhack/elfhack.cpp#318
 >  

 --
 Ryo ONODERA // ryo_on@yk.rim.or.jp
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/50767: Build failure of pkgsrc/www/firefox with binutils
 2.26 from NetBSD/amd64 current
Date: Sun, 21 Feb 2016 21:32:26 -0600 (CST)

 With firefox 43.0 (pkgsrc-2015Q4),

   CONFIGURE_ARGS+= --disable-elf-hack

 did not help.

 Updating firefox (and nss, nspr) to HEAD (and without above CONFIGURE_ARGS
 modification) builds just fine on i386-7.99.26 (binutils 2.26).

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50767
Date: Sat, 18 Jun 2016 14:54:34 +0200

 The problem is back again with firefox 47 on head-LLVM amd64.
 This patch makes it work. I'm not sure if there is a better way.
 (it was suggested on IRC that it maybe should use visibility hidden.)

 --- ../firefox.orig/patches/patch-toolkit_library_libxul.mk	1970-01-01 01:00:00.000000000 +0100
 +++ ./patches/patch-toolkit_library_libxul.mk	2016-06-18 14:37:23.125665064 +0200
 @@ -0,0 +1,16 @@
 +$NetBSD$
 +
 +Can't do relocation against extern protected symbol.
 +pkg/50767
 +
 +--- toolkit/library/libxul.mk.orig	2016-06-18 12:32:59.901404958 +0000
 ++++ toolkit/library/libxul.mk
 +@@ -55,7 +55,7 @@ endif
 + ifdef _MSC_VER
 + get_first_and_last = dumpbin -exports $1 | grep _NSModule@@ | sort -k 3 | sed -n 's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p'
 + else
 +-get_first_and_last = $(TOOLCHAIN_PREFIX)nm -g $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
 ++get_first_and_last = $(TOOLCHAIN_PREFIX)nm $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
 + endif
 + 
 + LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0
 diff -bruN -x CVS ../firefox.orig/patches/patch-xpcom_components_Module.h ./patches/patch-xpcom_components_Module.h
 --- ../firefox.orig/patches/patch-xpcom_components_Module.h	1970-01-01 01:00:00.000000000 +0100
 +++ ./patches/patch-xpcom_components_Module.h	2016-06-18 14:37:26.581726776 +0200
 @@ -0,0 +1,16 @@
 +$NetBSD$
 +
 +Can't do relocation against extern protected symbol.
 +pkg/50767
 +
 +--- xpcom/components/Module.h.orig	2016-06-01 04:11:44.000000000 +0000
 ++++ xpcom/components/Module.h
 +@@ -125,7 +125,7 @@ struct Module
 + #    define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport)
 + #  elif defined(__GNUC__)
 + #    if defined(__ELF__)
 +-#      define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("protected")))
 ++#      define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("visible")))
 + #    elif defined(__MACH__)
 + #      define NSMODULE_SECTION __attribute__((section("__DATA, .kPStaticModules"), visibility("default")))
 + #    elif defined (_WIN32)

State-Changed-From-To: open->feedback
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Tue, 16 Aug 2016 12:22:04 +0000
State-Changed-Why:
firefox in pkgsrc-current should be fixed now. Please test?


>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.