Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032879AbbKFIJV (ORCPT ); Fri, 6 Nov 2015 03:09:21 -0500 Received: from bes.se.axis.com ([195.60.68.10]:38296 "EHLO bes.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757234AbbKFIJT (ORCPT ); Fri, 6 Nov 2015 03:09:19 -0500 Date: Fri, 6 Nov 2015 09:09:17 +0100 From: Rabin Vincent To: Ingo Molnar Cc: Arnaldo Carvalho de Melo , "jolsa@kernel.org" , "namhyung@kernel.org" , Peter Zijlstra , "linux-kernel@vger.kernel.org" Subject: Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs Message-ID: <20151106080917.GA12203@axis.com> References: <1446104978-26429-1-git-send-email-rabin.vincent@axis.com> <1446104978-26429-3-git-send-email-rabin.vincent@axis.com> <20151029094649.GA6280@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151029094649.GA6280@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1885 Lines: 50 On Thu, Oct 29, 2015 at 10:46:49AM +0100, Ingo Molnar wrote: > Would it be possible to add a gcc and glibc building portion as well? That would > make it entirely self-hosting. Yes, but: - Those that intend to run the built binary on a target would presumably already have a cross-compiler lying around which they use to build the rest of userspace. - Those that don't have a cross-compiler or need a newer one can already very easily create one using other specialized tools such as crosstool-ng (see below). > > Something like: > > make ARCH=arm BOOTSTRAP=1 > > ... would magically fetch everything needed, and (given enough Internet bandwidth > and a fast enough machine) build a whole cross-environment from scratch. This is already possible using crosstool-ng. Getting an ARM GCC 5.2 cross-compiler is as simple as: $ git clone git://crosstool-ng.org/crosstool-ng $ cd crosstool-ng $ ./bootstrap && ./configure --enable-local && make $ ./ct-ng arm-unknown-linux-gnueabi $ ./ct-ng build $ export PATH=$PATH:~/x-tools/arm-unknown-linux-gnueabi/bin/ $ arm-unknown-linux-gnueabi-gcc --version arm-unknown-linux-gnueabi-gcc (crosstool-NG crosstool-ng-1.20.0-361-g85f9814) 5.2.0 > Personally I'd even use this to bootstrap kernel cross-builds. > > It could also be used to cross-build to the host architecture as well: it would > make it easier to test perf on the latest GCC and glibc versions. (Which the host > distribution does not carry.) This is also possible with crosstool-ng. You just need to build the x86_64-unknown-linux-gnu config to get GCC 5.2 + glibc 2.22 toolchain for an x86-64 host. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/