From patchwork Tue Dec 15 20:55:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 41216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 09A83B6F14 for ; Wed, 16 Dec 2009 07:57:15 +1100 (EST) Received: from localhost ([127.0.0.1]:58241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKeSF-0007BT-Gb for incoming@patchwork.ozlabs.org; Tue, 15 Dec 2009 15:57:11 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKeRj-0007B8-SR for qemu-devel@nongnu.org; Tue, 15 Dec 2009 15:56:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKeRe-000770-Qs for qemu-devel@nongnu.org; Tue, 15 Dec 2009 15:56:38 -0500 Received: from [199.232.76.173] (port=46645 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKeRe-00076x-Kr for qemu-devel@nongnu.org; Tue, 15 Dec 2009 15:56:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61079) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKeRe-0000FX-7U for qemu-devel@nongnu.org; Tue, 15 Dec 2009 15:56:34 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBFKuQCU027960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Dec 2009 15:56:27 -0500 Received: from localhost (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBFKuP2p028136; Tue, 15 Dec 2009 15:56:26 -0500 From: Juan Quintela To: "Kirill A. Shutemov" In-Reply-To: (Kirill A. Shutemov's message of "Tue, 15 Dec 2009 21:48:00 +0200") References: <1260839404-28622-1-git-send-email-kirill@shutemov.name> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Date: Tue, 15 Dec 2009 21:55:33 +0100 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Blue Swirl , qemu-devel@nongnu.org Subject: [Qemu-devel] Re: [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org "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 >> --- >>  Makefile.user |    4 ++-- >>  configure     |    1 + >>  2 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 >> >>  .PHONY: all >> >> -VPATH=$(SRC_PATH) >> +vpath %.c $(SRC_PATH) This change is needed? >> >> -QEMU_CFLAGS+=-I.. >> +QEMU_CFLAGS+=-I$(SRC_PATH)/ $(CFLAGS_PIE) Why do you change it? QEMU_CFLAGS has this value in configure QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS" >> >>  obj-y = >>  obj-y += 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" = "yes" -a "$static" = "no" -a \ >>        "$user_pie" = "yes" ; then >>   cflags="-fpie $cflags" >>   ldflags="-pie $ldflags" >> +  echo "CFLAGS_PIE=-fpie" >> $config_host_mak >>  fi >> >>  if test "$target_softmmu" = "yes" -a \( \ >> -- >> 1.6.5.6 >> >> Can you test this other patch: From bdc26201bb83df3786722a63c3caf387914f8539 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Tue, 15 Dec 2009 21:53:26 +0100 Subject: [PATCH] user_only: compile everything with -fpie Signed-off-by: Juan Quintela --- Makefile.user | 1 + configure | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Makefile.user b/Makefile.user index 907e74b..e4b5def 100644 --- a/Makefile.user +++ b/Makefile.user @@ -2,6 +2,7 @@ include ../config-host.mak include $(SRC_PATH)/rules.mak +include config.mak .PHONY: all diff --git a/configure b/configure index cf1db86..d815c7a 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