--- scripts/Makefile.lib
+++ scripts/Makefile.lib
@@ -202,7 +202,7 @@
$(call if_changed,bison)
quiet_cmd_bison_h = YACC $@
- cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $<
+ cmd_bison_h = $(YACC) -o/dev/null -d -t -l $< && mv y.tab.h $@
$(obj)/%.tab.h: $(src)/%.y FORCE
$(call if_changed,bison_h)
--- scripts/genksyms/Makefile
+++ scripts/genksyms/Makefile
@@ -15,14 +15,14 @@
ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
- cmd_bison_no_warn = $(YACC) --version >/dev/null; \
+ cmd_bison_no_warn = $(YACC) -V >/dev/null; \
$(cmd_bison) 2>/dev/null
$(obj)/parse.tab.c: $(src)/parse.y FORCE
$(call if_changed,bison_no_warn)
quiet_cmd_bison_h_no_warn = $(quiet_cmd_bison_h)
- cmd_bison_h_no_warn = $(YACC) --version >/dev/null; \
+ cmd_bison_h_no_warn = $(YACC) -V >/dev/null; \
$(cmd_bison_h) 2>/dev/null
$(obj)/parse.tab.h: $(src)/parse.y FORCE
--- scripts/genksyms/lex.l
+++ scripts/genksyms/lex.l
@@ -30,6 +30,7 @@
#include "genksyms.h"
#include "parse.tab.h"
+extern YYSTYPE yylval;
/* We've got a two-level lexer here. We let flex do basic tokenization
and then we categorize those basic tokens in the second stage. */
The last hunk is because without it an error about yylval being undeclared occurs, I don't know much about yacc or lex so I'd think there's probably a more proper fix to that issue, but that in regards to --defines, the replacement I used there is rather hacky, and I doubt it'd get accepted upstream, but if byacc supported --defines there could probably be upstream support for building the kernel with byacc as YACC instead of solely working with bison.