public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Rabin Vincent <rabin.vincent@axis.com>
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>
Subject: Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs
Date: Thu, 29 Oct 2015 10:46:49 +0100	[thread overview]
Message-ID: <20151029094649.GA6280@gmail.com> (raw)
In-Reply-To: <1446104978-26429-3-git-send-email-rabin.vincent@axis.com>


* 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

  reply	other threads:[~2015-10-29  9:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  7:49 [PATCHv2 1/3] perf: unwind: pass symbol source to libunwind Rabin Vincent
2015-10-29  7:49 ` [PATCHv2 2/3] tools: build: fix libiberty feature detection Rabin Vincent
2015-10-29 20:45   ` Jiri Olsa
2015-10-30  9:14   ` [tip:perf/core] tools build: Fix " tip-bot for Rabin Vincent
2015-10-29  7:49 ` [PATCHv2 3/3] perf: add helper makefile for cross compiling libs Rabin Vincent
2015-10-29  9:46   ` Ingo Molnar [this message]
2015-11-06  8:09     ` Rabin Vincent
2015-11-27 11:35       ` Ingo Molnar
2015-10-30  9:15 ` [tip:perf/core] perf unwind: Pass symbol source to libunwind tip-bot for Rabin Vincent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151029094649.GA6280@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=rabin.vincent@axis.com \
    --cc=rabinv@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox