NetBSD Problem Report #45541

From www@NetBSD.org  Sun Oct 30 07:25: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 A859163CD17
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 30 Oct 2011 07:25:10 +0000 (UTC)
Message-Id: <20111030072509.E035E63CAF6@www.NetBSD.org>
Date: Sun, 30 Oct 2011 07:25:09 +0000 (UTC)
From: ano@bestmx.ru
Reply-To: ano@bestmx.ru
To: gnats-bugs@NetBSD.org
Subject: devel/binutils: compile error with gcc-4.6.1
X-Send-Pr-Version: www-1.0

>Number:         45541
>Category:       pkg
>Synopsis:       devel/binutils: compile error with gcc-4.6.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 30 07:30:01 +0000 2011
>Closed-Date:    Tue Nov 01 20:49:06 +0000 2011
>Last-Modified:  Tue Nov 01 20:50:02 +0000 2011
>Originator:     Andrey N. Oktyabrski
>Release:        OpenIndiana 151a
>Organization:
>Environment:
$ uname -a
SunOS thinkpot 5.11 oi_151a i86pc i386 i86pc Solaris
$ isainfo 
amd64 i386
$ which gcc
/usr/bin/gcc
$ /usr/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.6/lib/gcc/i386-pc-solaris2.11/4.6.1/lto-wrapper
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.6.1/configure --prefix=/usr/gcc/4.6 --libdir=/usr/gcc/4.6/lib --libexecdir=/usr/gcc/4.6/lib --mandir=/usr/gcc/4.6/share/man --infodir=/usr/gcc/4.6/info --with-build-time-tools=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/opt/dtbld/bin/ld-wrapper --without-gnu-ld --enable-languages=c,c++,fortran,objc --enable-shared --disable-static --enable-decimal-float --with-gmp=/usr/gnu --with-mpfr=/usr/gnu --with-mpc=/usr/gnu --with-libiconv-prefix=/usr/gnu -enable-nls
Thread model: posix
gcc version 4.6.1 (GCC)
>Description:
gcc -DHAVE_CONFIG_H -I. -I.././bfd -I. -I. -I.././bfd -I.././bfd/../include -I.././bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c archive.c -o archive.o
archive.c: In function 'bfd_generic_archive_p':
archive.c:669:16: error: variable 'fail' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

...

gcc -DHAVE_CONFIG_H -I. -I.././bfd -I. -I. -I.././bfd -I.././bfd/../include -I.././bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c tekhex.c -o tekhex.o
tekhex.c: In function 'tekhex_write_object_contents':
tekhex.c:754:7: error: variable 'bytes_written' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

...

gcc -DHAVE_CONFIG_H -I. -I.././bfd -I. -I. -I.././bfd -I.././bfd/../include -I.././bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c dwarf2.c -o dwarf2.o
dwarf2.c: In function 'decode_line_info':
dwarf2.c:1120:11: error: variable 'basic_block' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

... and so on
>How-To-Repeat:
$ cd /usr/pkgsrc/devel/binutils
$ bmake
>Fix:
It seems this patch solves the problem, but I'm not sure - is it correct?

--- Makefile.orig       2011-10-30 10:21:03.905265125 +0300
+++ Makefile    2011-10-30 10:16:50.316983367 +0300
@@ -31,6 +31,8 @@
 BUILD_DEFS+=           GNU_PROGRAM_PREFIX
 BINUTILS_PREFIX=       ${PREFIX}/${MACHINE_GNU_PLATFORM}

+CONFIGURE_ARGS+=       --disable-werror
+
 PLIST_SRC=     ${PKGDIR}/PLIST.common
 PLIST_SRC+=    ${WRKDIR}/PLIST_DYNAMIC

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: cheusov@NetBSD.org
State-Changed-When: Tue, 01 Nov 2011 20:49:06 +0000
State-Changed-Why:
Commited. Thanks!


From: "Aleksey Cheusov" <cheusov@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45541 CVS commit: pkgsrc/devel/binutils
Date: Tue, 1 Nov 2011 20:47:08 +0000

 Module Name:	pkgsrc
 Committed By:	cheusov
 Date:		Tue Nov  1 20:47:07 UTC 2011

 Modified Files:
 	pkgsrc/devel/binutils: Makefile

 Log Message:
 Fix compilation failure with gcc-4.6 (PR 45541)


 To generate a diff of this commit:
 cvs rdiff -u -r1.40 -r1.41 pkgsrc/devel/binutils/Makefile

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.