summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown2008-10-01 20:05:39 +0200
committerMichael Brown2008-10-01 20:24:56 +0200
commit91802c6e85fb5153d397ca019a95632841999c1f (patch)
tree85cf62a8e24137ae6d5d175c7357d7ebbffd120f /src/Makefile.housekeeping
parent[compiler] Allow for selective disabling of debug levels at runtime (diff)
downloadipxe-91802c6e85fb5153d397ca019a95632841999c1f.tar.gz
ipxe-91802c6e85fb5153d397ca019a95632841999c1f.tar.xz
ipxe-91802c6e85fb5153d397ca019a95632841999c1f.zip
[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.
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 2db9f558..6a4d877d 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -112,7 +112,8 @@ oldgas :
# default, even when -ffreestanding is specified. We therefore need
# 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')
CFLAGS += $(SP_FLAGS)