add no PIE flags if the toolchain supports it --- com32/libutil/Makefile +++ com32/libutil/Makefile @@ -34,7 +34,8 @@ gcc_ok = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) \ + $(call gcc_ok,-nopie,) $(call gcc_ok,-fno-pie,) CC = gcc LD = ld -m elf_i386 --- com32/modules/Makefile +++ com32/modules/Makefile @@ -19,7 +19,8 @@ gcc_ok = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) \ + $(call gcc_ok,-nopie,) $(call gcc_ok,-fno-pie,) CC = gcc LD = ld -m elf_i386