NetBSD-Bugs archive

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

toolchain/45140: Toolchain construction fails with gcc 4.6.x as hostcc (-Werror=unused-variable)



>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:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 13 15:30:00 +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



Home | Main Index | Thread Index | Old Index