NetBSD Problem Report #48630
From www@NetBSD.org Sun Mar 2 13:38:21 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 7DF0CA62E0
for <gnats-bugs@gnats.NetBSD.org>; Sun, 2 Mar 2014 13:38:21 +0000 (UTC)
Message-Id: <20140302133819.C5FD0A64AE@mollari.NetBSD.org>
Date: Sun, 2 Mar 2014 13:38:19 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
X-Send-Pr-Version: www-1.0
>Number: 48630
>Category: toolchain
>Synopsis: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: toolchain-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 02 13:40:00 +0000 2014
>Closed-Date: Sat Apr 26 04:15:54 +0000 2014
>Last-Modified: Sun Mar 06 09:40:01 +0000 2016
>Originator: John D. Baker
>Release: NetBSD/sparc-6.99.33 (src), NetBSD/i386-5.2_STABLE (host)
>Organization:
>Environment:
NetBSD verthandi.technoskunk.fur 5.2_STABLE NetBSD 5.2_STABLE (VERTHANDI) #13: Wed Dec 18 05:44:53 CST 2013 sysop@verthandi.technoskunk.fur:/d0/build/netbsd-5/obj/i386/sys/arch/i386/compile/VERTHANDI i386
>Description:
Following addition of sun4v support, building sparc{,64} sun4u kernels
fail on my NetBSD/i386-5.2_STABLE build host as follows (for sparc):
[...]
# compile GENERIC_SUN4U/locore.o
/d0/build/current/tools/i386/bin/sparc--netbsdelf-gcc -Wa,-Av8plusa -x assembler-with-cpp -D_LOCORE -Wa,--fatal-warnings --sysroot=/d0/build/current/DEST/sparc -Dsparc64 -D__sparc64__ -m32 -Wa,-Av8plusa -mcpu=ultrasparc -I. -I/x/current/src/sys/../common/include -I/x/current/src/sys/arch -I/x/current/src/sys -nostdinc -DDIAGNOSTIC -DMAXUSERS=64 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/x/current/src/sys/lib/libkern/../../../common/lib/libc/quad -I/x/current/src/sys/lib/libkern/../../../common/lib/libc/string -I/x/current/src/sys/lib/libkern/../../../common/lib/libc/arch/sparc/string -I/x/current/src/sys/external/bsd/ipf -I/x/current/src/sys/external/isc/atheros_hal/dist -I/x/current/src/sys/external/isc/atheros_hal/ic -c /x/current/src/sys/arch/sparc64/sparc64/locore.s
/x/current/src/sys/arch/sparc64/sparc64/locore.s: Assembler messages:
/x/current/src/sys/arch/sparc64/sparc64/locore.s:5958: Error: bignum invalid
*** [locore.o] Error code 1
nbmake[2]: stopped in /d0/build/current/obj/sparc/sys/arch/sparc/compile/GENERIC_SUN4U
1 error
nbmake[2]: stopped in /d0/build/current/obj/sparc/sys/arch/sparc/compile/GENERIC_SUN4U
*** [kern-GENERIC_SUN4U] Error code 2
nbmake[1]: stopped in /x/current/src/etc
1 error
nbmake[1]: stopped in /x/current/src/etc
*** [release] Error code 2
nbmake: stopped in /x/current/src
1 error
nbmake: stopped in /x/current/src
ERROR: Failed to make release
*** BUILD ABORTED ***
The line about which the assembler complains:
5958 sethi %hh(A_SUN4V_TLB_TSB_LOCK), %g5
A sparc64 build is in progress, but I expect kernels to fail in the
same way.
The builds are being done starting with completely empty (nonesistent)
$TOOLDIR, $OBJDIR, $DESTDIR $RELEASEDIR.
As the nightly builds are succeeding and the autobuild hosts are
running NetBSD/amd64-6.1.x, I would assume that tools are being mis-
configured on a NetBSD-5 host.
My 'build.sh' command line:
./build.sh -U -m sparc -T /d0/build/current/tools/i386 \
-O /d0/build/current/obj/sparc -D /d0/build/current/DEST/sparc \
-R /d0/build/current/REL -X ../xsrc -x -u -j 2 tools release
>How-To-Repeat:
Using NetBSD-5 host system, attempt to build 6.99.33 sources for sparc
or sparc64 targets.
>Fix:
>Release-Note:
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: palle@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
Date: Sun, 2 Mar 2014 14:56:08 +0100
On Sun, Mar 02, 2014 at 01:40:00PM +0000, jdbaker@mylinuxisp.com wrote:
> As the nightly builds are succeeding and the autobuild hosts are
> running NetBSD/amd64-6.1.x, I would assume that tools are being mis-
> configured on a NetBSD-5 host.
This is a nice one. The problem is not netbsd-6 as build host vs. netbsd-5,
but a 64bit build host vs. a 32bit one.
Gennassym creates the constant in question as:
assym.h:#define A_SUN4V_TLB_TSB_LOCK 1152921504606846976
while the original definition is:
pte.h:#define SUN4V_TLB_TSB_LOCK 0x1000000000000000UL
I don't remember right now wether there was some special asm syntax to make
gas on 32bit hosts understand 64bit constants (this all sounds like a
gas bug to me).
Martin
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, jdbaker@mylinuxisp.com
Cc:
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
Date: Sun, 2 Mar 2014 09:48:45 -0500
On Mar 2, 2:00pm, martin@duskware.de (Martin Husemann) wrote:
-- Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build fai
| The following reply was made to PR toolchain/48630; it has been noted by GNATS.
|
| From: Martin Husemann <martin@duskware.de>
| To: gnats-bugs@NetBSD.org
| Cc: palle@NetBSD.org
| Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
| Date: Sun, 2 Mar 2014 14:56:08 +0100
|
| On Sun, Mar 02, 2014 at 01:40:00PM +0000, jdbaker@mylinuxisp.com wrote:
| > As the nightly builds are succeeding and the autobuild hosts are
| > running NetBSD/amd64-6.1.x, I would assume that tools are being mis-
| > configured on a NetBSD-5 host.
|
| This is a nice one. The problem is not netbsd-6 as build host vs. netbsd-5,
| but a 64bit build host vs. a 32bit one.
|
| Gennassym creates the constant in question as:
|
| assym.h:#define A_SUN4V_TLB_TSB_LOCK 1152921504606846976
|
| while the original definition is:
|
| pte.h:#define SUN4V_TLB_TSB_LOCK 0x1000000000000000UL
|
|
| I don't remember right now wether there was some special asm syntax to make
| gas on 32bit hosts understand 64bit constants (this all sounds like a
| gas bug to me).
On 32 bits you need ull...
christos
From: Martin Husemann <martin@duskware.de>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
Date: Sun, 2 Mar 2014 16:17:15 +0100
On Sun, Mar 02, 2014 at 09:48:45AM -0500, Christos Zoulas wrote:
> On 32 bits you need ull...
In the genassym output...
But: I can not reproduce the problem.
I tried sparc64--netbsd-as -32 --warn test.s on this file:
sethi %hh(0x1000000000000000ULL), %o2
sethi %hh(1152921504606846976), %o1
ret
on a 32 bit host, and it creates proper object code without any warning.
Now I'm a bit puzzzled.
Martin
From: Takeshi Nakayama <tn@catvmics.ne.jp>
To: gnats-bugs@NetBSD.org, martin@duskware.de
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, jdbaker@mylinuxisp.com
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build
failure on netbsd-5/i386 host
Date: Mon, 03 Mar 2014 00:44:41 +0900 (JST)
>>> Martin Husemann <martin@duskware.de> wrote
> But: I can not reproduce the problem.
>
> I tried sparc64--netbsd-as -32 --warn test.s on this file:
>
> sethi %hh(0x1000000000000000ULL), %o2
> sethi %hh(1152921504606846976), %o1
> ret
>
> on a 32 bit host, and it creates proper object code without any warning.
>
> Now I'm a bit puzzzled.
Try 32-bit only toolchain (sparc--netbsdelf-as), it causes "bignum
invalid" error.
-- Takeshi Nakayama
From: Martin Husemann <martin@duskware.de>
To: Takeshi Nakayama <tn@catvmics.ne.jp>
Cc: gnats-bugs@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
Date: Sun, 2 Mar 2014 17:01:34 +0100
On Mon, Mar 03, 2014 at 12:44:41AM +0900, Takeshi Nakayama wrote:
> Try 32-bit only toolchain (sparc--netbsdelf-as), it causes "bignum
> invalid" error.
Ah yes, it does - and for both notations.
Martin
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, jdbaker@mylinuxisp.com
Subject: re: toolchain/48630: sun4v support causes sparc/sparc64 build failure on netbsd-5/i386 host
Date: Mon, 03 Mar 2014 13:18:12 +1100
> But: I can not reproduce the problem.
>
> I tried sparc64--netbsd-as -32 --warn test.s on this file:
>
> sethi %hh(0x1000000000000000ULL), %o2
> sethi %hh(1152921504606846976), %o1
> ret
>
> on a 32 bit host, and it creates proper object code without any warning.
>
> Now I'm a bit puzzzled.
it requires both a 32bit-host *and* building 32 bit sparc64 kernels.
eg, build.sh -m sparc kernel=GENERIC_SUN4U on an i386. with that
i get the same problem:
/usr/src/sys/arch/sparc64/sparc64/locore.s: Assembler messages:
/usr/src/sys/arch/sparc64/sparc64/locore.s:5958: Error: bignum invalid
5958 sethi %hh(A_SUN4V_TLB_TSB_LOCK), %g5
i agree with martin earlier in the thread -- binutils problem.
.mrg.
From: Takeshi Nakayama <tn@catvmics.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, jdbaker@mylinuxisp.com
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build
failure on netbsd-5/i386 host
Date: Sat, 08 Mar 2014 23:02:42 +0900 (JST)
>>> matthew green <mrg@eterna.com.au> wrote
> it requires both a 32bit-host *and* building 32 bit sparc64 kernels.
> eg, build.sh -m sparc kernel=GENERIC_SUN4U on an i386. with that
> i get the same problem:
>
> /usr/src/sys/arch/sparc64/sparc64/locore.s: Assembler messages:
> /usr/src/sys/arch/sparc64/sparc64/locore.s:5958: Error: bignum invalid
>
> 5958 sethi %hh(A_SUN4V_TLB_TSB_LOCK), %g5
>
> i agree with martin earlier in the thread -- binutils problem.
After tracing the binutils source around gas from the error
message, it was found that 32-bit toolchains on 32-bit host cannot
handle 64-bit integer by default configuration (see bfd/bfd-in.h
and integer_constant() in gas/expr.c).
It requires to specify --enable-64-bit-bfd to bfd/configure or add
a hint as below to enable 64-bit integer handling.
So I would like to apply this patch, comment?
-- Takeshi Nakayama
Index: bfd/config.bfd
===================================================================
RCS file: /cvsroot/src/external/gpl3/binutils/dist/bfd/config.bfd,v
retrieving revision 1.10
diff -u -d -r1.10 config.bfd
--- bfd/config.bfd 24 Dec 2013 15:06:39 -0000 1.10
+++ bfd/config.bfd 8 Mar 2014 13:41:20 -0000
@@ -1460,6 +1460,7 @@
sparc-*-netbsdelf*)
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs="sparcnetbsd_vec sunos_big_vec"
+ want64=true
;;
sparc-*-netbsd*)
targ_defvec=sparcnetbsd_vec
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: Takeshi Nakayama <tn@catvmics.ne.jp>
Cc: gnats-bugs@NetBSD.org, toolchain-manager@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure
on netbsd-5/i386 host
Date: Sat, 8 Mar 2014 19:49:17 -0600 (CST)
On Sat, 8 Mar 2014, Takeshi Nakayama wrote:
> It requires to specify --enable-64-bit-bfd to bfd/configure or add
> a hint as below to enable 64-bit integer handling.
>
> So I would like to apply this patch, comment?
I made this change and subsequent release build succeeded. My sparc
kernels, etc. appear to work just fine. I don't currently have any
sun4u machines operational.
Thanks.
--
|/"\ 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: Takeshi Nakayama <tn@catvmics.ne.jp>
To: jdbaker@mylinuxisp.com
Cc: gnats-bugs@NetBSD.org, toolchain-manager@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build
failure on netbsd-5/i386 host
Date: Sun, 09 Mar 2014 22:24:05 +0900 (JST)
>>> "John D. Baker" <jdbaker@mylinuxisp.com> wrote
> On Sat, 8 Mar 2014, Takeshi Nakayama wrote:
>
> > It requires to specify --enable-64-bit-bfd to bfd/configure or add
> > a hint as below to enable 64-bit integer handling.
> >
> > So I would like to apply this patch, comment?
>
> I made this change and subsequent release build succeeded. My sparc
> kernels, etc. appear to work just fine. I don't currently have any
> sun4u machines operational.
>
> Thanks.
Thank you for your confirmation.
I will commit the patch if there are no objection.
-- Takeshi Nakayama
From: Palle Lyckegaard <palle@lyckegaard.dk>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org, palle@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure
on netbsd-5/i386 host
Date: Sun, 9 Mar 2014 14:47:18 +0000 (UTC)
On Sun, 2 Mar 2014, Martin Husemann wrote:
> This is a nice one. The problem is not netbsd-6 as build host vs. netbsd-5,
> but a 64bit build host vs. a 32bit one.
>
> Gennassym creates the constant in question as:
>
> assym.h:#define A_SUN4V_TLB_TSB_LOCK 1152921504606846976
>
> while the original definition is:
>
> pte.h:#define SUN4V_TLB_TSB_LOCK 0x1000000000000000UL
>
>
> I don't remember right now wether there was some special asm syntax to make
> gas on 32bit hosts understand 64bit constants (this all sounds like a
> gas bug to me).
>
> Martin
>
Since the SUN4V support is still incomplete a workaround could be to
disable the SUN4V support in the GENERIC_SUN4U config file:
Index: sys/arch/sparc/conf/GENERIC_SUN4U
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/conf/GENERIC_SUN4U,v
retrieving revision 1.1
diff -u -r1.1 GENERIC_SUN4U
--- sys/arch/sparc/conf/GENERIC_SUN4U 4 Mar 2001 10:12:56 -0000
1.1
+++ sys/arch/sparc/conf/GENERIC_SUN4U 9 Mar 2014 14:18:34 -0000
@@ -3,3 +3,4 @@
# Build a 32-bit `sparc64' kernel, that is compatible with our userland.
include "arch/sparc64/conf/GENERIC32"
+no options SUN4V
/Palle
From: Palle Lyckegaard <palle@lyckegaard.dk>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org, palle@NetBSD.org
Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure
on netbsd-5/i386 host
Date: Sun, 9 Mar 2014 15:02:20 +0000 (UTC)
nevermind - I just realized that the issue apparently has been solved...
:-)
On Sun, 9 Mar 2014, Palle Lyckegaard wrote:
> Date: Sun, 9 Mar 2014 14:47:18
> From: Palle Lyckegaard <palle@lyckegaard.dk>
> To: Martin Husemann <martin@duskware.de>
> Cc: gnats-bugs@NetBSD.org, palle@NetBSD.org
> Subject: Re: toolchain/48630: sun4v support causes sparc/sparc64 build failure
> on netbsd-5/i386 host
>
> On Sun, 2 Mar 2014, Martin Husemann wrote:
>
>> This is a nice one. The problem is not netbsd-6 as build host vs. netbsd-5,
>> but a 64bit build host vs. a 32bit one.
>>
>> Gennassym creates the constant in question as:
>>
>> assym.h:#define A_SUN4V_TLB_TSB_LOCK 1152921504606846976
>>
>> while the original definition is:
>>
>> pte.h:#define SUN4V_TLB_TSB_LOCK 0x1000000000000000UL
>>
>>
>> I don't remember right now wether there was some special asm syntax to make
>> gas on 32bit hosts understand 64bit constants (this all sounds like a
>> gas bug to me).
>>
>> Martin
>>
>
> Since the SUN4V support is still incomplete a workaround could be to disable
> the SUN4V support in the GENERIC_SUN4U config file:
>
> Index: sys/arch/sparc/conf/GENERIC_SUN4U
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/sparc/conf/GENERIC_SUN4U,v
> retrieving revision 1.1
> diff -u -r1.1 GENERIC_SUN4U
> --- sys/arch/sparc/conf/GENERIC_SUN4U 4 Mar 2001 10:12:56 -0000 1.1
> +++ sys/arch/sparc/conf/GENERIC_SUN4U 9 Mar 2014 14:18:34 -0000
> @@ -3,3 +3,4 @@
> # Build a 32-bit `sparc64' kernel, that is compatible with our userland.
>
> include "arch/sparc64/conf/GENERIC32"
> +no options SUN4V
>
>
> /Palle
>
From: "Takeshi Nakayama" <nakayama@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48630 CVS commit: src/external/gpl3/binutils/dist/bfd
Date: Mon, 10 Mar 2014 12:01:19 +0000
Module Name: src
Committed By: nakayama
Date: Mon Mar 10 12:01:19 UTC 2014
Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd
Log Message:
Enable 64-bit integer handling for gas even on 32-bit host since
sparc64 kernel now uses 64-bit constant with %hh operator.
Fix for PR toolchain/48630.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/binutils/dist/bfd/config.bfd
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Takeshi Nakayama" <nakayama@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48630 CVS commit: src/external/gpl3/binutils/lib/libbfd/arch/sparc
Date: Mon, 10 Mar 2014 12:02:36 +0000
Module Name: src
Committed By: nakayama
Date: Mon Mar 10 12:02:36 UTC 2014
Modified Files:
src/external/gpl3/binutils/lib/libbfd/arch/sparc: bfd.h defs.mk
Log Message:
Regenerate for sparc's want64=true change.
Native toolchain fix for PR toolchain/48630.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk
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: dholland@NetBSD.org
State-Changed-When: Sat, 26 Apr 2014 04:15:54 +0000
State-Changed-Why:
fixed
From: "Takeshi Nakayama" <nakayama@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48630 CVS commit: src/external/gpl3/binutils
Date: Sun, 6 Mar 2016 09:38:08 +0000
Module Name: src
Committed By: nakayama
Date: Sun Mar 6 09:38:08 UTC 2016
Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd
src/external/gpl3/binutils/lib/libbfd/arch/sparc: bfd.h defs.mk
Log Message:
Reapply following changes to binutils 2.26 to fix PR toolchain/48630.
http://mail-index.netbsd.org/source-changes/2014/03/10/msg052578.html
http://mail-index.netbsd.org/source-changes/2014/03/10/msg052579.html
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/binutils/dist/bfd/config.bfd
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(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.