|
@@ -138,6 +138,17 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
|
138
|
138
|
WORKAROUND_CFLAGS += $(SP_FLAGS)
|
139
|
139
|
endif
|
140
|
140
|
|
|
141
|
+# Some widespread patched versions of gcc include -fPIE -Wl,-pie by
|
|
142
|
+# default. Note that gcc will exit *successfully* if it fails to
|
|
143
|
+# recognise an option that starts with "no", so we have to test for
|
|
144
|
+# output on stderr instead of checking the exit status.
|
|
145
|
+#
|
|
146
|
+ifeq ($(CCTYPE),gcc)
|
|
147
|
+PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
|
|
148
|
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
|
|
149
|
+WORKAROUND_CFLAGS += $(PIE_FLAGS)
|
|
150
|
+endif
|
|
151
|
+
|
141
|
152
|
# gcc 4.4 generates .eh_frame sections by default, which distort the
|
142
|
153
|
# output of "size". Inhibit this.
|
143
|
154
|
#
|