From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKpW5-0003Cf-U8 for qemu-devel@nongnu.org; Wed, 16 Dec 2009 03:45:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKpW1-0003Bu-OW for qemu-devel@nongnu.org; Wed, 16 Dec 2009 03:45:53 -0500 Received: from [199.232.76.173] (port=43531 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKpW1-0003Br-GI for qemu-devel@nongnu.org; Wed, 16 Dec 2009 03:45:49 -0500 Received: from mail-yw0-f171.google.com ([209.85.211.171]:61914) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKpW1-0005Vm-0K for qemu-devel@nongnu.org; Wed, 16 Dec 2009 03:45:49 -0500 Received: by ywh1 with SMTP id 1so738185ywh.18 for ; Wed, 16 Dec 2009 00:45:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1260839404-28622-1-git-send-email-kirill@shutemov.name> Date: Wed, 16 Dec 2009 10:45:47 +0200 Message-ID: From: "Kirill A. Shutemov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: Blue Swirl , qemu-devel@nongnu.org On Tue, Dec 15, 2009 at 10:55 PM, Juan Quintela wrote= : > "Kirill A. Shutemov" wrote: >> Please, apply it. >> >> On Tue, Dec 15, 2009 at 3:10 AM, Kirill A. Shutemov >> wrote: >>> We really need compile _all_ sources for user target with -fpie when >>> use --enable-user-pie. >>> >>> It's regression introduced by commit add16157d72454. >>> Please, do not break it any more. > > Wishful thinking :p > I bet that: > a- Blue Swirl didn't do it on purpose > b- our build system is very fragile, it will happens again. > > Learn to live with it. :( >>> Signed-off-by: Kirill A. Shutemov >>> Cc: Blue Swirl >>> --- >>> =C2=A0Makefile.user | =C2=A0 =C2=A04 ++-- >>> =C2=A0configure =C2=A0 =C2=A0 | =C2=A0 =C2=A01 + >>> =C2=A02 files changed, 3 insertions(+), 2 deletions(-) >>> >>> diff --git a/Makefile.user b/Makefile.user >>> index 907e74b..0be73df 100644 >>> --- a/Makefile.user >>> +++ b/Makefile.user >>> @@ -5,9 +5,9 @@ include $(SRC_PATH)/rules.mak >>> >>> =C2=A0.PHONY: all >>> >>> -VPATH=3D$(SRC_PATH) >>> +vpath %.c $(SRC_PATH) > > This change is needed? Yes. We dont want to take %.o from $(SRC_PATH) since they built without -fp= ie. >>> >>> -QEMU_CFLAGS+=3D-I.. >>> +QEMU_CFLAGS+=3D-I$(SRC_PATH)/ $(CFLAGS_PIE) > > Why do you change it? > > QEMU_CFLAGS has this value in configure > QEMU_CFLAGS=3D"-I. -I\$(SRC_PATH) $QEMU_CFLAGS" Ok >>> >>> =C2=A0obj-y =3D >>> =C2=A0obj-y +=3D envlist.o path.o >>> diff --git a/configure b/configure >>> index 273b6b7..6200391 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -2555,6 +2555,7 @@ if test "$target_user_only" =3D "yes" -a "$static= " =3D "no" -a \ >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0"$user_pie" =3D "yes" ; then >>> =C2=A0 cflags=3D"-fpie $cflags" >>> =C2=A0 ldflags=3D"-pie $ldflags" >>> + =C2=A0echo "CFLAGS_PIE=3D-fpie" >> $config_host_mak >>> =C2=A0fi >>> >>> =C2=A0if test "$target_softmmu" =3D "yes" -a \( \ >>> -- >>> 1.6.5.6 >>> >>> > > Can you test this other patch: It doesn't work. It uses %.o from $(SRC_DIR). Updated version, based on your patch: >>From 5389617c7fa585126aab62c7a36e98116fa1f1aa Mon Sep 17 00:00:00 2001 From: Kirill A. Shutemov Date: Wed, 16 Dec 2009 10:43:02 +0200 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 --- Makefile.user | 7 ++++++- configure | 3 +++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Makefile.user b/Makefile.user index 907e74b..75c92d4 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=3D$(SRC_PATH) +# Do not take %.o from $(SRC_PATH), only %.c +# 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 $(SRC_PATH) QEMU_CFLAGS+=3D-I.. diff --git a/configure b/configure index 273b6b7..5f463b0 100755 --- a/configure +++ b/configure @@ -2652,3 +2652,6 @@ d=3Dlibuser mkdir -p $d rm -f $d/Makefile ln -s $source_path/Makefile.user $d/Makefile +if test "$static" =3D "no" -a "$user_pie" =3D "yes" ; then + echo "QEMU_CFLAGS+=3D-fpie" > $d/config.mak +fi --=20 1.6.5.6