b/tools/firmware/etherboot/Makefile
@@ -24,8 +24,16 @@ ROMS = $(addprefix $D/src/bin/, $(addsuffix .rom,
$(ETHERBOOT_NICS)))
.PHONY: all
all: $(ROMS)
+# GCC v6 may be too strict with its warnings.
+GCCVERSIONGT6 = $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 6)
+ifeq ($(GCCVERSIONGT6),1)
+IPXE_CFLAGS = -Wno-nonnull-compare -Wno-unused-const-variable \
+ -Wno-misleading-indentation \
+ -Wno-shift-negative-value -Wno-array-bounds
+endif
+
%.rom: $D/src/arch/i386/Makefile
- $(MAKE) -C $D/src bin/$(*F).rom
+ $(MAKE) EXTRA_CFLAGS="$(IPXE_CFLAGS)" -C $D/src bin/$(*F).rom
$T: