diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-12-15 19:37:21 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-12-15 19:37:21 +0000 |
commit | 5172d7b26624fd2219e6a68eee6237c899f8610a (patch) | |
tree | 6a6026772ff1d818d223684fb63e28229d7f9976 /src/Makefile.housekeeping | |
parent | 1d7974182e1e52a9296a0288c37f1002aaab8edb (diff) | |
download | ipxe-5172d7b26624fd2219e6a68eee6237c899f8610a.zip ipxe-5172d7b26624fd2219e6a68eee6237c899f8610a.tar.gz ipxe-5172d7b26624fd2219e6a68eee6237c899f8610a.tar.bz2 |
Autodetect whether or not we need to be using -fno-stack-protector.
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r-- | src/Makefile.housekeeping | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 3694402..1e97ee6 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -102,6 +102,14 @@ CFLAGS += $(OLDGAS) oldgas : @$(ECHO) $(oldgas) +# Some widespread patched versions of gcc include -fstack-protector by +# 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_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector') +CFLAGS += $(SP_FLAGS) + # compiler.h is needed for our linking and debugging system # CFLAGS += -include compiler.h |