[syslinux] [PATCH] Fix gpxe compilation when gcc is patched to compile by default with -fPIE -Wl, -pie

Gilles Espinasse g.esp at free.fr
Tue Mar 29 05:12:31 PDT 2011


Signed-off-by: Gilles Espinasse <g.esp at free.fr>
---
 gpxe/src/Makefile.housekeeping |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gpxe/src/Makefile.housekeeping b/gpxe/src/Makefile.housekeeping
index 1f5e115..d49416e 100644
--- a/gpxe/src/Makefile.housekeeping
+++ b/gpxe/src/Makefile.housekeeping
@@ -134,6 +134,16 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
 CFLAGS	+= $(SP_FLAGS)
 endif
 
+# Some widespread patched versions of gcc include -fPIE -Wl,-pie by
+# default. gpxe does not support pie code in get_cpuinfo.
+#
+ifeq ($(CCTYPE),gcc)
+PIE_TEST = $(CC) -fno-PIE -nopie -x c -c /dev/null \
+		-o /dev/null >/dev/null 2>&1
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+CFLAGS	+= $(PIE_FLAGS)
+endif
+
 # gcc 4.4 generates .eh_frame sections by default, which distort the
 # output of "size".  Inhibit this.
 #
-- 
1.7.3.4




More information about the Syslinux mailing list