[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-4.8] ipxe: update to newer commit



On 10/11/2016 10:54 AM, Ian Jackson wrote:
> Boris Ostrovsky writes ("Re: [Xen-devel] [PATCH for-4.8] ipxe: update to 
> newer commit"):
>> We could but what if an old compiler doesn't support that option?
>> Although it looks like -Wno-<option>, which is what we'd use, may be OK:
>>
>> ostr@workbase> gcc foo.c
>> ostr@workbase> gcc -Wfoo foo.c
>> gcc: error: unrecognized command line option ‘-Wfoo’; did you mean ‘-Wno-’?
>> ostr@workbase> gcc -Wno-foo foo.c
>> ostr@workbase>
> Many many years ago I filed a bug asking the gcc folks to make
>  -Wno-some-random-warning-option-that-gcc-does-not-know-about
> not be an error.
>
> That was eventually done.  I'm not sure exactly when the change was
> made.  Does gcc -Wno-foo work properly on all the gcc's we care about ?
>
>>>> Another interesting new warning that is fatal with -Werror is
>>>>     if(a)
>>>>         foo();
>>>>         bar();
>>>>
>>>> gcc warns that bar() is indented and maybe braces are needed.
>>> Do we actually have cases like this ?  Are they real bugs ?
>> Yes we have (for example igb_phy.c change in the patch that I sent) and
>> no, they don't look like bugs.
> I guess we can disable that warning too then.
>
>>>> BTW, another option for backporting may be removing -Werror. If we know
>>>> we are not changing sources then we might consider this.
>>> Perhaps we could disable warnings more selectively.
>> I scanned the changes again and at least one appears to be fixing a
>> legitimate bug (buffer overrun). There is an upstream patch for that,
>> which is essentially what I have there, but not as a separate patch.
> I don't think a buffer overflow in ipxe is any kind of problem.  The
> _whole purpose_ of ipxe is to take unauthenticated data from the
> network and unconditionally execute it...


How about this then:

diff --git a/tools/firmware/etherboot/Makefile
b/tools/firmware/etherboot/Makefile
index a0578d2..49d5c27 100644
--- a/tools/firmware/etherboot/Makefile
+++ 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:
        if ! $(FETCHER) _$T $(IPXE_TARBALL_URL); then \
@@ -45,7 +53,7 @@ $D/src/arch/i386/Makefile: $T Config
        cat Config >>$@
 
 $D/src/bin/NIC: $D/src/arch/i386/Makefile
-       $(MAKE) -C $D/src bin/NIC
+       $(MAKE) EXTRA_CFLAGS="$(IPXE_CFLAGS)" -C $D/src bin/NIC
 
 .PHONY: clean
 clean:



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.