From patchwork Mon Sep 5 14:02:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9313987 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 98EC7607D3 for ; Mon, 5 Sep 2016 14:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A1C428A86 for ; Mon, 5 Sep 2016 14:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EF0328AB1; Mon, 5 Sep 2016 14:04:41 +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 2DC1028A86 for ; Mon, 5 Sep 2016 14:04:41 +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 1bguU6-0004nt-GX; Mon, 05 Sep 2016 14:02:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bguU5-0004jo-2Z for xen-devel@lists.xenproject.org; Mon, 05 Sep 2016 14:02:49 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 7F/2C-03271-80B7DC75; Mon, 05 Sep 2016 14:02:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeJIrShJLcpLzFFi42JxWrrBXpe9+my 4wZ7zVhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aTzVMZC7aKV8x/PZ+xgXGtYBcjJ4eEgL/E lK6XTCA2m4CuRNOWv2xdjBwcIgIqErf3GoCYzAKhEjteWIJUCAv4SUxpX8UKYrMAVbw6/R+sm lfAQ2L+4nqIgXIS54//ZAaxOYHCa062sYDYQgLuEjdnXWAHKRcSUJOYuz4eJMwrIChxcuYTsB JmAQmJgy9eMIOUSAhwS/zttp/AyDcLSdUsJFULGJlWMaoXpxaVpRbpmuklFWWmZ5TkJmbm6Bo aGOvlphYXJ6an5iQmFesl5+duYgQGUj0DA+MOxittzocYJTmYlER5C1TPhgvxJeWnVGYkFmfE F5XmpBYfYpTh4FCS4I2vBMoJFqWmp1akZeYAQxomLcHBoyTC2wCS5i0uSMwtzkyHSJ1iVJQS5 7UBSQiAJDJK8+DaYHF0iVFWSpiXkYGBQYinILUoN7MEVf4VozgHo5IwrxXIFJ7MvBK46a+AFj MBLV63+zTI4pJEhJRUA6NQwJp6FQb23SfVvNe/Z/qw4vLTteWTwh+wdAt82Lgc6NnnCy59TfU pcq//+bBruuvLfQ26cdK3efJaXU7+ZdR0Vf1RvHCjW9uPFef1FS5OXM9lNH9u7d72C7c9zM5f mLBoakVHRvyRD0YXA3oNNJ6xPDHWnMS37tRLWwaZY4tW25zczZ7+u1eJpTgj0VCLuag4EQA9d t1BngIAAA== X-Env-Sender: prvs=0495da155=Ian.Jackson@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1473084165!59036681!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37986 invoked from network); 5 Sep 2016 14:02:47 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 5 Sep 2016 14:02:47 -0000 X-IronPort-AV: E=Sophos;i="5.30,286,1470700800"; d="scan'208";a="384415468" From: Ian Jackson To: Date: Mon, 5 Sep 2016 15:02:22 +0100 Message-ID: <1473084154-396-15-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473084154-396-1-git-send-email-ian.jackson@eu.citrix.com> References: <1473084154-396-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 14/26] rumprun: ts-rumprun-build: Update for newer Xen 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 Newer Xen needs more work to make it cross compile for rump. * Pass --host=TARGET to configure. This is needed so that configure knows that we are deliberately cross compiling. (Otherwise it tries to run target binaries on the host, and crashes when that fails.) * Pass CROSS_COMPILE in the environment. This arranges for the Xen Makefiles to run the right compiler, ie $(CROSS_COMPILE)-gcc. * Put the rump compiler directory on PATH, so that the Xen Makefiles can find it. * Pass HOSTCC=gcc in the environment; otherwise it tries to use the default CC (which is $(CROSS_COMPILE)gcc), when building build-system-internal tools which are to be run on the host as part of the build. The need for this could be avoided by setting XEN_TARGET_ARCH to the rump architecture, but then we would have to provide a Xen arch config file for that architecture, which would be meaningless since we are not actually building a hypervisor, and would have to contain various dummy information. NB in this commit message I use Xen terminology for cross arch names: Xen GCC/GNU Meaning Example for terminology terminology rump cross build host build Native architecture of i586-linux-gnu the environment in which we are running the build. target host Foreign architecture on i486-rumprun-netbsdelf which the objects etc. which we are now building will eventually be run. n/a target Used only when building a "Canadian" cross compiler: the 2nd foreign architecture for which the compiler which we are now building (on the `build(gnu)' arch) will, when we run it, produce binaries (when it is run on the `host(gnu)' arch). Signed-off-by: Ian Jackson --- ts-rumprun-build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ts-rumprun-build b/ts-rumprun-build index 7184f9d..98c8efc 100755 --- a/ts-rumprun-build +++ b/ts-rumprun-build @@ -55,10 +55,17 @@ END sub recordtools() { my $gcc = target_cmd_output($ho, "echo $rux/rumprun/bin/*-gcc"); chomp $gcc; - die "$gcc ?" if $gcc =~ m/\S/; - my $prefix = "CC=$gcc "; + die "$gcc ?" unless $gcc =~ m#^(\S+)/([^/ \t]+)-g?cc$#; + my $bindir = $1; + my $gnutriplet = $2; + my $prefix = "PATH=$bindir:\$PATH "; + $prefix .= "CROSS_COMPILE=$gnutriplet- HOSTCC=gcc "; store_runvar('cmdprefix_configure', $prefix); store_runvar('cmdprefix_make', $prefix); + store_runvar('cmdsuffix_configure', " --host=$gnutriplet"); + # "host" is daft GCC/GNU terminology for the target architecture of + # a cross-compile, ie in our case the rump environemnt architecture + # for which the rump compilers are going to generate code. } sub install() {