From patchwork Mon Sep 25 14:11:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9970043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 032B6602CB for ; Mon, 25 Sep 2017 14:14:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8ACE289B2 for ; Mon, 25 Sep 2017 14:13:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD4B728BBE; Mon, 25 Sep 2017 14:13:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C013289B2 for ; Mon, 25 Sep 2017 14:13:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwU6c-0002Zi-0d; Mon, 25 Sep 2017 14:11:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwU6a-0002Zb-Pd for xen-devel@lists.xenproject.org; Mon, 25 Sep 2017 14:11:28 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id F9/F9-01812-F8E09C95; Mon, 25 Sep 2017 14:11:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXitHRDpG4f38l Ig8YfQhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8birywFK3kq5mzexNLAuJ6ri5GTQ0LAX2LF ua2sIDaLgKpE85s2ZhCbTUBZ4mdnLxuILQJk9/76zQJiMwtUSFxefRusXlggXuJd91owm1fAQ mLR1VVgNUICORKP7z2BigtKnJz5BKpXR2LB7k9AMzmAbGmJ5f84QMKcAvYSm5esYAKxRQVUJD qXzoEaoyDRMf0Y0wRGvllIJs1CMmkWwqQFjMyrGDWKU4vKUot0DY30kooy0zNKchMzc3QNDYz 1clOLixPTU3MSk4r1kvNzNzECw4wBCHYwvup2PsQoycGkJMp7l+9EpBBfUn5KZUZicUZ8UWlO avEhRhkODiUJXi/ek5FCgkWp6akVaZk5wICHSUtw8CiJ8D7iAUrzFhck5hZnpkOkTjHqchzbd PkPkxBLXn5eqpQ4rwzIDAGQoozSPLgRsOi7xCgrJczLCHSUEE9BalFuZgmq/CtGcQ5GJWHeBJ ApPJl5JXCbXgEdwQR0RO/UEyBHlCQipKQaGAW3lXdaLSqpinSvLijaIJ78u+VHz91bep+uWjN e+zPrqkR3mET2IVXDBRaSD3u9ZVX9PQW/H4oP7+h+r6FQZGWkv/f+9ASuKFN1RadJEw3OVeTt Mu6wCMlbfPLnxk+9PgkrglWW7xU9nWY4/0DWl2fH1saUbpo97V14/OPcyVun+Hi22X5cocRSn JFoqMVcVJwIAM9NyX+5AgAA X-Env-Sender: prvs=4347d7e88=wei.liu2@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1506348684!116245411!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1691 invoked from network); 25 Sep 2017 14:11:25 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Sep 2017 14:11:25 -0000 X-IronPort-AV: E=Sophos;i="5.42,436,1500940800"; d="scan'208";a="441086606" Date: Mon, 25 Sep 2017 15:11:04 +0100 From: Wei Liu To: Jan Beulich Message-ID: <20170925141104.3g6ipsudclcvmonj@citrix.com> References: <20170925134057.30492-1-wei.liu2@citrix.com> <59C92797020000780017F75D@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <59C92797020000780017F75D@prv-mh.provo.novell.com> User-Agent: NeoMutt/20170113 (1.7.2) Cc: AndrewCooper , Wei Liu , Xen-devel Subject: Re: [Xen-devel] [PATCH v2] x86emul/test: generate non-pie executable for 64bit builds X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Sep 25, 2017 at 07:58:15AM -0600, Jan Beulich wrote: > >>> On 25.09.17 at 15:40, wrote: > > --- a/tools/tests/x86_emulator/Makefile > > +++ b/tools/tests/x86_emulator/Makefile > > @@ -76,7 +76,7 @@ $(addsuffix .c,$(SIMD)) $(addsuffix -avx.c,$(filter sse%,$(SIMD))): > > ln -sf simd.c $@ > > > > $(TARGET): x86_emulate.o test_x86_emulator.o > > - $(HOSTCC) -o $@ $^ > > + $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ > > > > .PHONY: clean > > clean: > > @@ -98,7 +98,9 @@ asm: > > > > asm/%: asm ; > > > > -HOSTCFLAGS += $(CFLAGS_xeninclude) -I. > > +HOSTCFLAGS-x86_64 := > > +$(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie) > > +HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH)) > > Hmm, so other than one could imply from gcc doc we get away > without using -fno-PIE at all, i.e. it's only an issue with how > linking is being done? Yeah, it was ld that complained. > Wouldn't it be better then to pass both (as > long as supported, if we really care about older compilers here)? I'm fine with that. -fno-PIE is supported a long time ago. I can fold in the following diff to this patch. diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile index 87064494d1..fbe02cd2f9 100644 --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -98,7 +98,7 @@ asm: asm/%: asm ; -HOSTCFLAGS-x86_64 := +HOSTCFLAGS-x86_64 := -fno-PIE $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie) HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))