NetBSD Problem Report #45140

From www@NetBSD.org  Wed Jul 13 15:27:10 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 74B2F63BEBD
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 13 Jul 2011 15:27:10 +0000 (UTC)
Message-Id: <20110713152708.EA2C563B904@www.NetBSD.org>
Date: Wed, 13 Jul 2011 15:27:08 +0000 (UTC)
From: eliedebrauwer@gmail.com
Reply-To: eliedebrauwer@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Toolchain construction fails with gcc 4.6.x as hostcc (-Werror=unused-variable)
X-Send-Pr-Version: www-1.0

>Number:         45140
>Category:       toolchain
>Synopsis:       Toolchain construction fails with gcc 4.6.x as hostcc (-Werror=unused-variable)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mrg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 13 15:30:00 +0000 2011
>Closed-Date:    Sat Aug 06 09:25:47 +0000 2011
>Last-Modified:  Mon Aug 08 08:25:01 +0000 2011
>Originator:     Elie De Brauwer
>Release:        5.99.55
>Organization:
>Environment:
Debian unstable with GCC 4.6.1

edb@lapedb:~/netbsd/src$ gcc -v      
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/i386-linux-gnu --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-1) 
edb@lapedb:~/netbsd/src$ uname -a 
Linux lapedb 2.6.39-2-686-pae #1 SMP Wed Jun 8 11:33:14 UTC 2011 i686 GNU/Linux

>Description:
Debian unstable is providing users with GCC 4.6.x, which adds several new error checks, this cause the build.sh to fail rather early (during toolchain construction). On a polite 

./build.sh -j2  -m i386 tools 

this fails with 

--- elf32-i386.lo ---
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H  -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I. -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/../include     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c -o elf32-i386.lo /home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/elf32-i386.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I. -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/../include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c /home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/elf32-i386.c -o elf32-i386.o
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/elf32-i386.c: In function 'elf_i386_relocate_section':
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/elf32-i386.c:2693:16: error: unused variable 'warned' [-Werror=unused-variable]
cc1: all warnings being treated as errors
*** [elf32-i386.lo] Error code 1

nbmake: stopped in /home/edb/netbsd/src/tools/binutils/obj/build/bfd
1 error


(Initially I was setting up a toolchain for evbarm which also failed with similar errors, but also in binutils/bfd:

--- aout32.lo ---
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H  -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I. -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/../include     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c -o aout32.lo /home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/aout32.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I. -I. -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/../include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c /home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/aout32.c -o aout32.o
--- cpu-arm.lo ---
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/cpu-arm.c: In function 'arm_check_note':
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/cpu-arm.c:231:17: error: variable 'type' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

*** [cpu-arm.lo] Error code 1

nbmake: stopped in /home/edb/netbsd/src/tools/binutils/obj/build/bfd
--- aout32.lo ---
In file included from /home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/aout32.c:24:0:
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/aoutx.h: In function 'aout_link_input_bfd':
/home/edb/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/aoutx.h:5228:17: error: variable 'sym_count' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
)

I tried fixing some of these, to find more of these guessing the problem is more fundamental, suggesting either a warning should be put up for too recent compiler, the binutils should be stepped, the appropriate warning suppression (for the new compilers) should be added or any of the above).

When I use an older compiler (even a 4.5, so it really smells like just a gcc 4.6 issue) everything seems to work.
>How-To-Repeat:

>Fix:
Workaround: use another gcc than 4.6
export HOST_CC=/usr/bin/gcc-4.5
export HOST_CXX=/usr/bin/g++-4.5

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: toolchain-manager->mrg
Responsible-Changed-By: mrg@NetBSD.org
Responsible-Changed-When: Thu, 04 Aug 2011 02:40:12 +0000
Responsible-Changed-Why:
i'm looking at this.


State-Changed-From-To: open->feedback
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Thu, 04 Aug 2011 02:40:12 +0000
State-Changed-Why:
i've disabled -Werror in the tools/binutils/ build for -current.  can
you please try with tools/binutils/Makefile version 1.20 and see if it
works now?  if not, please update with the failure output.  thanks!


From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45140 CVS commit: src/tools/binutils
Date: Thu, 4 Aug 2011 02:38:42 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Thu Aug  4 02:38:41 UTC 2011

 Modified Files:
 	src/tools/binutils: Makefile

 Log Message:
 add --disable-werror.  GCC 4.6 doesn't like some of the code here and
 rather than patching code to fix it (and one case isn't trivially fixable)
 simply turn off -Werror by default here.  should fix PR#45140.


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.20 src/tools/binutils/Makefile

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

State-Changed-From-To: feedback->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sat, 06 Aug 2011 09:25:47 +0000
State-Changed-Why:
this is fixed now.  thanks!


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/45140
Date: Mon, 8 Aug 2011 08:22:50 +0000

 (not sent to gnats; gnats mail should go to "gnats-bugs". mail to
 gnats or gnats-admin lands in the gnats admin mailbox instead of being
 filed; plus it arrives accompanied by tons of noise and spam so things
 are likely to get lost...)

    ------

 From: Elie De Brauwer <eliedebrauwer@gmail.com>
 To: gnats@netbsd.org
 Subject: Re: toolchain/45140
 Date: Fri, 05 Aug 2011 20:26:20 +0200

 I just updated to CVS head, and with my current gcc

 edb@lapedb:~/netbsd/src$ cc --version
 cc (Debian 4.6.1-4) 4.6.1
 Copyright (C) 2011 Free Software Foundation, Inc.

 edb@lapedb:~/netbsd/src$ cvs status tools/binutils/Makefile
 Warning: Permanently added 'anoncvs.netbsd.org' (RSA) to the list of
 known hosts.
 ===================================================================
 File: Makefile         	Status: Up-to-date

    Working revision:	1.20
    Repository revision:	1.20	/cvsroot/src/tools/binutils/Makefile,v



 The construction of the toolchain succeeds:

 ===> Tools built to
 /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686
 ===> build.sh ended:      Fri Aug  5 20:22:17 CEST 2011
 ===> Summary of results:
 	 build.sh command:    ./build.sh -j2 -m i386 tools
 	 build.sh started:    Fri Aug  5 20:16:08 CEST 2011
 	 NetBSD version:      5.99.55
 	 MACHINE:             i386
 	 MACHINE_ARCH:        i386
 	 Build platform:      Linux 2.6.39-2-686-pae i686
 	 HOST_SH:             /bin/sh
 	 /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake
 outdated (older than usr.bin/make/job.c), needs building.
 	 Bootstrapping nbmake
 	 TOOLDIR path:
 /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686
 	 DESTDIR path:        /home/edb/netbsd/src/obj/destdir.i386
 	 RELEASEDIR path:     /home/edb/netbsd/src/obj/releasedir
 	 Created /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake
 	 Updated makewrapper: /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake-i386
 	 Tools built to
 /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686
 	 build.sh ended:      Fri Aug  5 20:22:17 CEST 2011
 ===> .


 So the issue I spotted earlier is gone.

 Thanks
 E.
 -- 
 Elie De Brauwer

>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.