From: Ben Pfaff Date: Sat, 26 Jan 2008 16:43:15 +0000 (+0000) Subject: Use -fno-stack-protector with GCC versions that support it, to fix a X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=996b4fdaf64de4e7aa1b1c738164f20dbe4ffed7;p=pintos-anon Use -fno-stack-protector with GCC versions that support it, to fix a linker error on platform on which -fstack-protector is default, such as recent versions of Ubuntu. --- diff --git a/src/Make.config b/src/Make.config index 16db6d5..841e910 100644 --- a/src/Make.config +++ b/src/Make.config @@ -39,6 +39,11 @@ ASFLAGS = -Wa,--gstabs LDFLAGS = DEPS = -MMD -MF $(@:.o=.d) +# Turn off -fstack-protector, which we don't support. +ifeq ($(strip $(shell echo | $(CC) -fno-stack-protector -E - > /dev/null 2>&1; echo $$?)),0) +CFLAGS += -fno-stack-protector +endif + %.o: %.c $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES) $(DEPS)