Bläddra i källkod

Autodetect whether or not we need to be using -fno-stack-protector.

tags/v0.9.3
Michael Brown 16 år sedan
förälder
incheckning
5172d7b266
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8
    0
      src/Makefile.housekeeping

+ 8
- 0
src/Makefile.housekeeping Visa fil

102
 oldgas :
102
 oldgas :
103
 	@$(ECHO) $(oldgas)
103
 	@$(ECHO) $(oldgas)
104
 
104
 
105
+# Some widespread patched versions of gcc include -fstack-protector by
106
+# default, even when -ffreestanding is specified.  We therefore need
107
+# to disable -fstack-protector if the compiler supports it.
108
+#
109
+SP_TEST = $(CC) -fno-stack-protector -x c -E - < /dev/null >/dev/null 2>&1
110
+SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
111
+CFLAGS	+= $(SP_FLAGS)
112
+
105
 # compiler.h is needed for our linking and debugging system
113
 # compiler.h is needed for our linking and debugging system
106
 #
114
 #
107
 CFLAGS	+= -include compiler.h
115
 CFLAGS	+= -include compiler.h

Laddar…
Avbryt
Spara