This is change in bison 3 (removed some deprecated functionality), this hit mesa some time ago:
https://bugs.freedesktop.org/show_bug.cgi?id=67354
I managed to get it co compile by patching two files:
[dk@sirius glslang]$ svn diff
Index: glslang/MachineIndependent/Scan.cpp
===================================================================
--- glslang/MachineIndependent/Scan.cpp (revision 25716)
+++ glslang/MachineIndependent/Scan.cpp (working copy)
@@ -42,8 +42,8 @@
#include "../Include/Types.h"
#include "SymbolTable.h"
+#include "ParseHelper.h"
#include "glslang_tab.cpp.h"
-#include "ParseHelper.h"
#include "ScanContext.h"
#include "Scan.h"
Index: glslang/MachineIndependent/glslang.y
===================================================================
--- glslang/MachineIndependent/glslang.y (revision 25716)
+++ glslang/MachineIndependent/glslang.y (working copy)
@@ -97,15 +97,21 @@
%{
+
#define YYPARSE_PARAM voidParseContext
#define parseContext (*(TParseContext*)voidParseContext)
#define YYLEX_PARAM parseContext
-#define yyerror(msg) parseContext.parserError(msg)
+#define yyerror(ctx, msg) ctx->parserError(msg)
+
+
extern int yylex(YYSTYPE*, TParseContext&);
%}
+%parse-param {glslang::TParseContext* voidParseContext}
+%lex-param {parseContext}
+
%pure_parser // enable thread safety
%expect 1 // One shift reduce conflict because of if | else
but it blows up during linking with undefined ref to yyparse(void*) :
../glslang/MachineIndependent/libglslang.a(ParseHelper.cpp.o): In function `glslang::TParseContext::parseShaderStrings(glslang::TPpContext&, glslang::TInputScanner&, bool)':
ParseHelper.cpp:(.text+0x7ef): undefined reference to `yyparse(void*)'
collect2: error: ld returned 1 exit status
StandAlone/CMakeFiles/glslangValidator.dir/build.make:93: recipe for target 'StandAlone/glslangValidator' failed
make[2]: *** [StandAlone/glslangValidator] Error 1
CMakeFiles/Makefile2:332: recipe for target 'StandAlone/CMakeFiles/glslangValidator.dir/all' failed
make[1]: *** [StandAlone/CMakeFiles/glslangValidator.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2
./BuildLinuxCMake.sh: line 7: ./StandAlone/glslangValidator: No such file or directory
~/glslang
yyparse is present in compiled object code:
[dk@sirius glslang.dir]$ objdump -t -C gen_glslang_tab.cpp.o | grep yyparse
0000000000000137 g F .text 000000000000d5a7 yyparse(glslang::TParseContext*)
but with wrong type
edit: OK, managed to build it with following patches:
[dk@sirius glslang]$ svn diff
Index: glslang/MachineIndependent/ParseHelper.cpp
===================================================================
--- glslang/MachineIndependent/ParseHelper.cpp (revision 25716)
+++ glslang/MachineIndependent/ParseHelper.cpp (working copy)
@@ -43,7 +43,7 @@
#include "preprocessor/PpContext.h"
-extern int yyparse(void*);
+extern int yyparse(glslang::TParseContext*);
namespace glslang {
@@ -143,7 +143,7 @@
{
currentScanner = &input;
ppContext.setInput(input, versionWillBeError);
- yyparse((void*)this);
+ yyparse(this);
finalErrorCheck();
return numErrors == 0;
Index: glslang/MachineIndependent/Scan.cpp
===================================================================
--- glslang/MachineIndependent/Scan.cpp (revision 25716)
+++ glslang/MachineIndependent/Scan.cpp (working copy)
@@ -42,8 +42,8 @@
#include "../Include/Types.h"
#include "SymbolTable.h"
+#include "ParseHelper.h"
#include "glslang_tab.cpp.h"
-#include "ParseHelper.h"
#include "ScanContext.h"
#include "Scan.h"
Index: glslang/MachineIndependent/glslang.y
===================================================================
--- glslang/MachineIndependent/glslang.y (revision 25716)
+++ glslang/MachineIndependent/glslang.y (working copy)
@@ -97,15 +97,21 @@
%{
+
#define YYPARSE_PARAM voidParseContext
#define parseContext (*(TParseContext*)voidParseContext)
#define YYLEX_PARAM parseContext
-#define yyerror(msg) parseContext.parserError(msg)
+#define yyerror(ctx, msg) ctx->parserError(msg)
+
+
extern int yylex(YYSTYPE*, TParseContext&);
%}
+%parse-param {glslang::TParseContext* voidParseContext}
+%lex-param {parseContext}
+
%pure_parser // enable thread safety
%expect 1 // One shift reduce conflict because of if | else