lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151029094649.GA6280@gmail.com>
Date:	Thu, 29 Oct 2015 10:46:49 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Rabin Vincent <rabin.vincent@...s.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>, jolsa@...nel.org,
	namhyung@...nel.org, Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	linux-kernel@...r.kernel.org, Rabin Vincent <rabinv@...s.com>
Subject: Re: [PATCHv2 3/3] perf: add helper makefile for cross compiling libs


* Rabin Vincent <rabin.vincent@...s.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ