Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258688

Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs
Date 2015-10-29 10:50 +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>
Organization linux.* mail to news gateway

Show all headers | 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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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