From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbbJMMoE (ORCPT ); Tue, 13 Oct 2015 08:44:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39839 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbbJMMoB (ORCPT ); Tue, 13 Oct 2015 08:44:01 -0400 Date: Tue, 13 Oct 2015 14:43:58 +0200 From: Jiri Olsa To: He Kuang , Arnaldo Carvalho de Melo Cc: jolsa@kernel.org, David Ahern , Namhyung Kim , Peter Zijlstra , linux-kernel@vger.kernel.org, Wang Nan Subject: build: Fix cross compile build Message-ID: <20151013124358.GB9467@krava.brq.redhat.com> References: <560B547C.6080205@huawei.com> <20150930061310.GB26628@krava.redhat.com> <56162328.1030502@huawei.com> <20151008083004.GB17581@krava.landal.opennet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151008083004.GB17581@krava.landal.opennet> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2015 at 10:30:04AM +0200, Jiri Olsa wrote: > On Thu, Oct 08, 2015 at 04:02:48PM +0800, He Kuang wrote: > > hi, Jirka > > > > On 2015/9/30 14:13, Jiri Olsa wrote: > > >On Wed, Sep 30, 2015 at 11:18:20AM +0800, He Kuang wrote: > > >>Hi, > > >> > > >>perf cross-compile error dual to fixdep is not a host executable, first bad commit > > >>is 7c422f557266("tools build: Build fixdep helper from perf and basic libs") > > >> > > >>Cross-compiling an aarch64 target on x86_64 host, error like this: > > >> > > >> $ make ARCH=aarch64 O=xx/aarch64 CROSS_COMPILE=aarch64-linux-gnu > > >> ... > > >> make[3]: *** [xx/aarch64/parse-utils.o] Error 126 > > >> make[3]: *** Waiting for unfinished jobs.... > > >> /bin/sh: xx/aarch64//fixdep: cannot execute binary file > > >> > > >> $ uname -a > > >> x86_64 x86_64 x86_64 GNU/Linux > > >> > > >> $ file xx/aarch64//fixdep > > >> xx/aarch64//fixdep : ELF 64-bit LSB executable, ARM aarch64, version 1 > > >> (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for > > >> GNU/Linux 3.7.0, not stripped > > > > > >hum, we need fixdep to stay the host arch.. I should have seen it :-\ > > >could you please check attached patch? > > > > > >thanks, > > >jirka > > > > > > > It does not work, 'fixdep' still be compiled as target executable. > > could you please provide output from that build with 'JOBS=1 V=1' > > last chance before I kick myself to actualy setup cross compiling :-\ > > thanks, > jirka posting patch for the issue thanks, jirka --- He Kuang the new fixdep tool breaks cross compiling. The reason is it wouldn't get compiled under host arch, but under cross arch and failed to run. We need to add support for host side tools build, meanwhile disabling fixdep usage for cross arch builds. Reported-by: He Kuang Link: http://lkml.kernel.org/n/tip-3h8xhjd858qf03mnqbmzfvgl@git.kernel.org Signed-off-by: Jiri Olsa --- tools/build/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include index 6572bb023543..4e09ad617a60 100644 --- a/tools/build/Makefile.include +++ b/tools/build/Makefile.include @@ -1,6 +1,10 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj +ifdef CROSS_COMPILE +fixdep: +else fixdep: $(Q)$(MAKE) -C $(srctree)/tools/build fixdep +endif .PHONY: fixdep -- 2.4.3