Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Autodetect whether or not we need to be using -fno-stack-protector.
  • Loading branch information
Michael Brown committed Dec 15, 2007
1 parent 1d79741 commit 5172d7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Makefile.housekeeping
Expand Up @@ -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
Expand Down

0 comments on commit 5172d7b

Please sign in to comment.