From 65e8c5192803c4739a51bc8d11ddcacb66f1f100 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Sat, 19 Dec 2009 15:16:08 +0000 Subject: [PATCH] user_only: compile everything with -fpie We really need compile _all_ sources for user target with -fpie when use --enable-user-pie. It's regression introduced by commit add16157d72454. Signed-off-by: Kirill A. Shutemov Cc: Blue Swirl Signed-off-by: Juan Quintela [blauwirbel@gmail.com: combined 299060a0 and 58faa1a6 to avoid breakage] Signed-off-by: Blue Swirl --- Makefile.user | 7 ++++++- configure | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile.user b/Makefile.user index 907e74bd9ee..7daedeff6d8 100644 --- a/Makefile.user +++ b/Makefile.user @@ -2,10 +2,15 @@ include ../config-host.mak include $(SRC_PATH)/rules.mak +-include config.mak .PHONY: all -VPATH=$(SRC_PATH) +# Do not take %.o from $(SRC_PATH), only %.c and %.h +# All %.o for user targets should be built with -fpie, when +# configured with --enable-user-pie, so we don't want to +# take %.o from $(SRC_PATH), since they built without -fpie +vpath %.c %.h $(SRC_PATH) QEMU_CFLAGS+=-I.. diff --git a/configure b/configure index 273b6b7c65c..5f463b05b5c 100755 --- a/configure +++ b/configure @@ -2652,3 +2652,6 @@ d=libuser mkdir -p $d rm -f $d/Makefile ln -s $source_path/Makefile.user $d/Makefile +if test "$static" = "no" -a "$user_pie" = "yes" ; then + echo "QEMU_CFLAGS+=-fpie" > $d/config.mak +fi -- 2.39.5