NetBSD-Users archive

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

Re: using gcc -w



On Fri, Mar 13, 2015 at 09:27:47AM +0000, Patrick Welche wrote:
> Part of the point of build.sh is to build the compiler of the same
> vintage as the rest of the code. I am getting stuck trying to build
> ancient versions of NetBSD because the -current gcc compiler emits
> so many warnings which are treated as fatal that the old tools fail
> to build. "build.sh tools" ends up failing on silly things like:
> 
> --- elf.lo ---
> /bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H  -I. -I/usr/src/loc
> al/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I. -I. -I/us
> r/src/local/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd -I/u
> sr/src/local/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/../
> include     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -c -o e
> lf.lo /usr/src/local/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist
> /bfd/elf.c
> 
> /usr/src/local/netbsd/src/tools/binutils/../../external/gpl3/binutils/dist/bfd/elf.c:4853:22: error: variable 'i_phdrp' set but not used [-Werror=unused-but-set-variable]
>    Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
> 
> I have tried things like
> 
> NOGCCERROR=yes
> NO_WERROR=-Wno-error
> COPTS+=-w
> CFLAGS+=-w
> CXXFLAGS+=-w
> CC=gcc -w
> CXX=g++ -w
> 
> in /etc/mk.conf, all to no avail.
> 
> If I change things in src/external/gpl3/binutils, I would have to change
> them after every cvs update -D'back-in-time'.
> 
> Is there a way of getting past the "clean the environment" defences and
> suppress warnings (given that this ends up with libtool)?

After a suggestion from Christos

diff --git a/tools/binutils/Makefile b/tools/binutils/Makefile
index 45c6208..c7961d3 100644
--- a/tools/binutils/Makefile
+++ b/tools/binutils/Makefile
@@ -5,7 +5,8 @@
 MODULE=                binutils
 
 CONFIGURE_ARGS=        --target=${MACHINE_GNU_PLATFORM} --disable-nls \
-               --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
+               --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
+               --disable-werror
 
 MAKE_ARGS=     MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
 

made it possible to build 5.99.5, so in a way "solved"


Cheers,

Patrick


Home | Main Index | Thread Index | Old Index