0001-bisonflex-Fix-build-on-machines-with-modern-flex.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From e7e341b7ba6fa9fb875718e8740b03c2041278e8 Mon Sep 17 00:00:00 2001
  2. From: Neal Frager <neal.frager@amd.com>
  3. Date: Mon, 2 Jun 2025 12:09:13 +0100
  4. Subject: [PATCH] bisonflex: Fix build on machines with modern flex
  5. With bootgen 2025.1, the directory structure was re-done. In the process of
  6. doing this, the source files in the bisonflex directory lost the fix below
  7. which had been applied on an earlier version of bootgen:
  8. Bootgen embeds an old version of flex, but uses the system include syntax
  9. (#include <>) to reference it, causing conflicts on systems with the
  10. development headers for a modern flex version installed, leading to build
  11. issues like:
  12. ../bisonflex/bif.yy.cpp: In member function 'virtual int BIF::FlexScanner::yylex()':
  13. ../bisonflex/bif.yy.cpp:1608:18: error: no match for 'operator=' (operand types are 'std::istream' {aka 'std::basic_istream'} and 'std::istream*' {aka 'std::basic_istream*'})
  14. Fix it by using normal local #include statements by:
  15. sed -i 's/<FlexLexer.h>/"FlexLexer.h"/g' *
  16. Upstream: submitted to AMD internal jira process
  17. Signed-off-by: Neal Frager <neal.frager@amd.com>
  18. ---
  19. bisonflex/bif.yy.cpp | 2 +-
  20. bisonflex/cmdoptions.yy.cpp | 2 +-
  21. bisonflex/reginit.yy.cpp | 2 +-
  22. 3 files changed, 3 insertions(+), 3 deletions(-)
  23. diff --git a/bisonflex/bif.yy.cpp b/bisonflex/bif.yy.cpp
  24. index 8d4d364..35f0aa5 100755
  25. --- a/bisonflex/bif.yy.cpp
  26. +++ b/bisonflex/bif.yy.cpp
  27. @@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
  28. #define yytext_ptr yytext
  29. -#include <FlexLexer.h>
  30. +#include "FlexLexer.h"
  31. int yyFlexLexer::yywrap() { return 1; }
  32. int yyFlexLexer::yylex()
  33. diff --git a/bisonflex/cmdoptions.yy.cpp b/bisonflex/cmdoptions.yy.cpp
  34. index 661d7f3..a76ac81 100755
  35. --- a/bisonflex/cmdoptions.yy.cpp
  36. +++ b/bisonflex/cmdoptions.yy.cpp
  37. @@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
  38. #define yytext_ptr yytext
  39. -#include <FlexLexer.h>
  40. +#include "FlexLexer.h"
  41. int yyFlexLexer::yywrap() { return 1; }
  42. int yyFlexLexer::yylex()
  43. diff --git a/bisonflex/reginit.yy.cpp b/bisonflex/reginit.yy.cpp
  44. index d830734..dede473 100755
  45. --- a/bisonflex/reginit.yy.cpp
  46. +++ b/bisonflex/reginit.yy.cpp
  47. @@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
  48. #define yytext_ptr yytext
  49. -#include <FlexLexer.h>
  50. +#include "FlexLexer.h"
  51. int yyFlexLexer::yywrap() { return 1; }
  52. int yyFlexLexer::yylex()
  53. --
  54. 2.25.1