mirror of https://github.com/ipxe/ipxe.git
[makefile] Fix -fno-stack-protector test on older versions of gcc
Some older versions of gcc don't complain about unknown compiler flags unless you ask them to actually compile; asking them to merely preprocess won't trigger the error. Fix the -fno-stack-protector test by making it attempt to compile an empty file, rather than preprocess an empty file.pull/1/head
parent
afe1323c76
commit
91802c6e85
|
@ -112,7 +112,8 @@ oldgas :
|
||||||
# default, even when -ffreestanding is specified. We therefore need
|
# default, even when -ffreestanding is specified. We therefore need
|
||||||
# to disable -fstack-protector if the compiler supports it.
|
# to disable -fstack-protector if the compiler supports it.
|
||||||
#
|
#
|
||||||
SP_TEST = $(CC) -fno-stack-protector -x c -E - < /dev/null >/dev/null 2>&1
|
SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
|
||||||
|
-o /dev/null >/dev/null 2>&1
|
||||||
SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
|
SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
|
||||||
CFLAGS += $(SP_FLAGS)
|
CFLAGS += $(SP_FLAGS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue