Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258688
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Ingo Molnar <mingo@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs |
| Date | Thu, 29 Oct 2015 10:50:01 +0100 |
| Message-ID | <qoS0h-6Ul-1@gated-at.bofh.it> (permalink) |
| References | <qoQhQ-5NH-7@gated-at.bofh.it> <qoQhQ-5NH-9@gated-at.bofh.it> |
| X-Original-To | Rabin Vincent <rabin.vincent@axis.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XWjOmM5+JX7AKQcpNHbP6OJzCzrEBRuvLW1tqu9tqPM=; b=Y6T56ZDPoaaigF3f1LCTxIDBI2COK46iL8rM979U2VwDQDxx6PkwH9XQyehH+fck5c zd48/q23G4aaf3JQSIIMZXplruPGUgC2GpU1D+4Re862Qjj+vR+zGIz14y+fn/x8ZgDw IRiMJ+GtC85ZW05m/FkAi3MWq48ycElHII7gXLj1yslG2Prtx8pKTs1dKFqzgfh53utt a1chSPKS/6ccS3ZDMyQ6eGCFhWD55hyfvq/TDFFmSeFsRI2mQJ5Cjzrjdy5KKTmdEFwa hTEPJMtGNwKncrgugUsjVKNMn8E19smNA1mEopRfqovzTk7cD7hL8ZjYHnA4KQJri0Oq gSUw== |
| X-Received | by 10.28.15.136 with SMTP id 130mr2647802wmp.36.1446112012853; Thu, 29 Oct 2015 02:46:52 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 87 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Arnaldo Carvalho de Melo <acme@kernel.org>, jolsa@kernel.org, namhyung@kernel.org, Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <a.p.zijlstra@chello.nl>, linux-kernel@vger.kernel.org, Rabin Vincent <rabinv@axis.com> |
| X-Original-Date | Thu, 29 Oct 2015 10:46:49 +0100 |
| X-Original-Message-ID | <20151029094649.GA6280@gmail.com> |
| X-Original-References | <1446104978-26429-1-git-send-email-rabin.vincent@axis.com> <1446104978-26429-3-git-send-email-rabin.vincent@axis.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1258688 |
Show key headers only | View raw
* Rabin Vincent <rabin.vincent@axis.com> wrote:
> It's easy to cross-compile a minimal perf binary without any external
> libraries (other than a C library of course). But many useful features
> depend on external libraries, so to get them one needs to either
> cross-compile a bunch of libraries manually and send in the correct
> paths or integrate the perf build into some external build system.
>
> In order to make it easier for people to qucikly get up and running with
> a fairly full featured cross-compiled mainline perf, provide a helper makefile
> which can be used to download and build the required libraries, which can then
> be used in a static build of perf.
>
> For example, assuming an arm-linux-gcc cross-compiler is present in the
> PATH, the following is what one seens if one tries to build a static
> perf for ARM:
>
> $ make ARCH=arm CROSS_COMPILE=arm-linux- LDFLAGS="-static"
>
> Auto-detecting system features:
> ... dwarf: [ OFF ]
> ... glibc: [ on ]
> ... gtk2: [ OFF ]
> ... libaudit: [ OFF ]
> ... libbfd: [ OFF ]
> ... libelf: [ OFF ]
> ... libnuma: [ OFF ]
> ... numa_num_possible_cpus: [ OFF ]
> ... libperl: [ OFF ]
> ... libpython: [ OFF ]
> ... libslang: [ OFF ]
> ... libunwind: [ OFF ]
> ... libdw-dwarf-unwind: [ OFF ]
> ... zlib: [ OFF ]
> ... lzma: [ OFF ]
> ... get_cpuid: [ OFF ]
>
> By using the new Makefile.cross first, we get many important features:
>
> $ make ARCH=arm CROSS_COMPILE=arm-linux- -f Makefile.cross
> $ make ARCH=arm CROSS_COMPILE=arm-linux- LDFLAGS="-static"
>
> Auto-detecting system features:
> ... dwarf: [ on ]
> ... glibc: [ on ]
> ... gtk2: [ OFF ]
> ... libaudit: [ on ]
> ... libbfd: [ on ]
> ... libelf: [ on ]
> ... libnuma: [ OFF ]
> ... numa_num_possible_cpus: [ OFF ]
> ... libperl: [ OFF ]
> ... libpython: [ OFF ]
> ... libslang: [ on ]
> ... libunwind: [ on ]
> ... libdw-dwarf-unwind: [ OFF ]
> ... zlib: [ on ]
> ... lzma: [ on ]
> ... get_cpuid: [ OFF ]
That's really nice!
Would it be possible to add a gcc and glibc building portion as well? That would
make it entirely self-hosting.
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.
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.)
Thanks,
Ingo
--
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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv2 1/3] perf: unwind: pass symbol source to libunwind Rabin Vincent <rabin.vincent@axis.com> - 2015-10-29 09:00 +0100
[PATCHv2 3/3] perf: add helper makefile for cross compiling libs Rabin Vincent <rabin.vincent@axis.com> - 2015-10-29 09:00 +0100
Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs Ingo Molnar <mingo@kernel.org> - 2015-10-29 10:50 +0100
[PATCHv2 2/3] tools: build: fix libiberty feature detection Rabin Vincent <rabin.vincent@axis.com> - 2015-10-29 09:00 +0100
Re: [PATCHv2 2/3] tools: build: fix libiberty feature detection Jiri Olsa <jolsa@redhat.com> - 2015-10-29 21:50 +0100
[tip:perf/core] tools build: Fix libiberty feature detection tip-bot for Rabin Vincent <tipbot@zytor.com> - 2015-10-30 10:20 +0100
[tip:perf/core] perf unwind: Pass symbol source to libunwind tip-bot for Rabin Vincent <tipbot@zytor.com> - 2015-10-30 10:20 +0100
csiph-web