Binutils builds broken with -Werror

Nick Clifton nickc@redhat.com
Mon Mar 21 12:08:00 GMT 2005


Hi Daniel,

> We need to either disable -Werror for generated files, or accomodate
> different versions of flex/bison more flexibly.  I recommend the former...

*sigh*  Yes you are right.   What do you think of the following patch ? 
  It works for me, but my makefile-fu is not the greatest so there might 
be a better way of expressing what we want.

This patch is for the binutils subdirectory.  I have a similar patch for 
the ld subdirectory and a simpler one for the gas subdirectory as that 
only has one generated source file.  If there are no objections to this 
method then I will apply the patches tomorrow.

Cheers
   Nick

Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.55
diff -c -3 -p -r1.55 Makefile.am
*** binutils/Makefile.am	22 Feb 2005 12:57:26 -0000	1.55
--- binutils/Makefile.am	21 Mar 2005 08:27:56 -0000
*************** GENERATED_CFILES = \
*** 101,106 ****
--- 101,113 ----
   	arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
   	defparse.c deflex.c nlmheader.c rcparse.c rclex.c

+ # Disable -Werror, if it has been enabled, when building generated C 
source
+ # files since old versions of bison & yacc will produce working code which
+ # contain compile time warnings.
+ GENERATED_OFILES := $(GENERATED_CFILES:.c=.o)
+ $(GENERATED_OFILES):
+ 	$(COMPILE) -c `basename $@ .o`.c -Wno-error
+
   DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
   WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c



More information about the Binutils mailing list