summary refs log tree commit diff
path: root/pkgs/tools/misc/grub
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2017-01-05 12:53:43 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-01-05 12:53:43 +0200
commitbe2a2db0f157118a7578a26f17b6eae4aa0ba28b (patch)
treee3cfb23641417cdc2911096ee90d80de3a1117f9 /pkgs/tools/misc/grub
parent5d3563f80cbc24da6d903a7604a29b9831db2322 (diff)
downloadnixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar.gz
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar.bz2
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar.lz
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar.xz
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.tar.zst
nixpkgs-be2a2db0f157118a7578a26f17b6eae4aa0ba28b.zip
grub2: Workaround flex bug
I think the flex update in 6bded45883eb7f6ead12494917e1ecd92c3b4458
causes this failure, presumably due to upstream breakage:

````
gcc -DHAVE_CONFIG_H -I.  -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 -I./include -DGRUB_FILE=\"grub_script.yy.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/lib/minilzo -I./grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror  -fno-builtin -Wno-undef  -c -o libgrubmods_a-grub_script.yy.o `test -f 'grub_script.yy.c' || echo './'`grub_script.yy.c
./grub-core/script/yylex.l:34:0: error: "yyalloc" redefined [-Werror]
 #define yyalloc(size, scanner)   (grub_malloc((size)))
 ^
grub_script.yy.c:104:0: note: this is the location of the previous definition

 ^
./grub-core/script/yylex.l:35:0: error: "yyfree" redefined [-Werror]
 #define yyfree(ptr, scanner)   (grub_free((ptr)))
 ^
grub_script.yy.c:108:0: note: this is the location of the previous definition

 ^
./grub-core/script/yylex.l:36:0: error: "yyrealloc" redefined [-Werror]
 #define yyrealloc(ptr, size, scanner) (grub_realloc((ptr), (size)))
 ^
grub_script.yy.c:106:0: note: this is the location of the previous definition

 ^
cc1: all warnings being treated as errors
make[2]: *** [Makefile:7540: libgrubmods_a-grub_script.yy.o] Error 1
````

Work around it for now.
Diffstat (limited to 'pkgs/tools/misc/grub')
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index 15b1740638e..eef1ac47228 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -54,6 +54,9 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "all" ];
 
+  # Work around a bug in the generated flex lexer (upstream flex bug?)
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
   preConfigure =
     '' for i in "tests/util/"*.in
        do