FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-15-2012, 06:26 PM
Marcin Juszkiewicz
 
Default cross compilation of kernel does not need tools to be built

At Linaro we want to be able to cross compile as much as we can. One of
most popular targets for people (inside or outside) is kernel.

Today we are not able to cross build it due to linux-tools-VER package
as it requires libdw-dev which requires binutils-dev which is not
possible to install for other architecture then host one.

So solution which I want to propose is simple: disable build of tools/
when we cross compile:

diff -Naru linux-3.2.0/debian/rules.d/0-common-vars.mk
linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk
--- linux-3.2.0/debian/rules.d/0-common-vars.mk 2012-03-15
17:31:25.000000000 +0000
+++ linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk 2012-03-15
17:25:47.665905092 +0000
@@ -170,6 +170,9 @@
else
do_tools?=false
endif
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+do_tools=false
+endif
tools_pkg_name=$(src_pkg_name)-tools-$(abi_release)
tools_common_pkg_name=$(src_pkg_name)-tools-common


Other thing which I found during my work was wrong use of
$(CROSS_COMPILE) during build of tools:

diff -Naru linux-3.2.0/debian/rules.d/2-binary-arch.mk
linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk
--- linux-3.2.0/debian/rules.d/2-binary-arch.mk 2012-03-15
17:31:25.000000000 +0000
+++ linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk 2012-03-15
16:44:31.545858606 +0000
@@ -397,7 +397,7 @@
$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
ifeq ($(do_tools),true)
cd $(builddir)/tools/tools/perf &&
- make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) $(conc_level)
+ $(kmake) HAVE_CPLUS_DEMANGLE=1 $(conc_level)
if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then
cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make
$(CROSS_COMPILE);
cd $(builddir)/tools/tools/power/x86/turbostat && make
$(CROSS_COMPILE);


With my change $(CROSS_COMPILE) is used properly here.

Share opinion and please remember that I am not subscribed to this ML.

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-16-2012, 10:06 AM
Andy Whitcroft
 
Default cross compilation of kernel does not need tools to be built

On Thu, Mar 15, 2012 at 08:26:58PM +0100, Marcin Juszkiewicz wrote:
>
> At Linaro we want to be able to cross compile as much as we can. One of
> most popular targets for people (inside or outside) is kernel.
>
> Today we are not able to cross build it due to linux-tools-VER package
> as it requires libdw-dev which requires binutils-dev which is not
> possible to install for other architecture then host one.
>
> So solution which I want to propose is simple: disable build of tools/
> when we cross compile:
>
> diff -Naru linux-3.2.0/debian/rules.d/0-common-vars.mk
> linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk
> --- linux-3.2.0/debian/rules.d/0-common-vars.mk 2012-03-15
> 17:31:25.000000000 +0000
> +++ linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk 2012-03-15
> 17:25:47.665905092 +0000
> @@ -170,6 +170,9 @@
> else
> do_tools?=false
> endif
> +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
> +do_tools=false
> +endif
> tools_pkg_name=$(src_pkg_name)-tools-$(abi_release)
> tools_common_pkg_name=$(src_pkg_name)-tools-common
>
>
> Other thing which I found during my work was wrong use of
> $(CROSS_COMPILE) during build of tools:
>
> diff -Naru linux-3.2.0/debian/rules.d/2-binary-arch.mk
> linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk
> --- linux-3.2.0/debian/rules.d/2-binary-arch.mk 2012-03-15
> 17:31:25.000000000 +0000
> +++ linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk 2012-03-15
> 16:44:31.545858606 +0000
> @@ -397,7 +397,7 @@
> $(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
> ifeq ($(do_tools),true)
> cd $(builddir)/tools/tools/perf &&
> - make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) $(conc_level)
> + $(kmake) HAVE_CPLUS_DEMANGLE=1 $(conc_level)
> if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then
> cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make
> $(CROSS_COMPILE);
> cd $(builddir)/tools/tools/power/x86/turbostat && make
> $(CROSS_COMPILE);
>
>
> With my change $(CROSS_COMPILE) is used properly here.
>
> Share opinion and please remember that I am not subscribed to this ML.

There is some reason we cannot use this second part of the fix. This
breaks builds somewhere else like on buildds or something. Tim you and
I looked at this before when someone proposed exactly this second fix;
Loic perhaps -- can you remember?

As for the first change, I am not opposed to it, but would like to ask
why you cannot use the do_tools=false override; this is what I use when
cross building.

-apw


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-16-2012, 10:40 AM
Marcin Juszkiewicz
 
Default cross compilation of kernel does not need tools to be built

W dniu 16.03.2012 12:06, Andy Whitcroft pisze:
> On Thu, Mar 15, 2012 at 08:26:58PM +0100, Marcin Juszkiewicz wrote:
>>
>> At Linaro we want to be able to cross compile as much as we can. One of
>> most popular targets for people (inside or outside) is kernel.
>>
>> Today we are not able to cross build it due to linux-tools-VER package
>> as it requires libdw-dev which requires binutils-dev which is not
>> possible to install for other architecture then host one.
>>
>> So solution which I want to propose is simple: disable build of tools/
>> when we cross compile:
>>
>> diff -Naru linux-3.2.0/debian/rules.d/0-common-vars.mk
>> linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk
>> --- linux-3.2.0/debian/rules.d/0-common-vars.mk 2012-03-15
>> 17:31:25.000000000 +0000
>> +++ linux-3.2.0-hrw/debian/rules.d/0-common-vars.mk 2012-03-15
>> 17:25:47.665905092 +0000
>> @@ -170,6 +170,9 @@
>> else
>> do_tools?=false
>> endif
>> +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
>> +do_tools=false
>> +endif
>> tools_pkg_name=$(src_pkg_name)-tools-$(abi_release)
>> tools_common_pkg_name=$(src_pkg_name)-tools-common
>>
>>
>> Other thing which I found during my work was wrong use of
>> $(CROSS_COMPILE) during build of tools:
>>
>> diff -Naru linux-3.2.0/debian/rules.d/2-binary-arch.mk
>> linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk
>> --- linux-3.2.0/debian/rules.d/2-binary-arch.mk 2012-03-15
>> 17:31:25.000000000 +0000
>> +++ linux-3.2.0-hrw/debian/rules.d/2-binary-arch.mk 2012-03-15
>> 16:44:31.545858606 +0000
>> @@ -397,7 +397,7 @@
>> $(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
>> ifeq ($(do_tools),true)
>> cd $(builddir)/tools/tools/perf &&
>> - make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) $(conc_level)
>> + $(kmake) HAVE_CPLUS_DEMANGLE=1 $(conc_level)
>> if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then
>> cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make
>> $(CROSS_COMPILE);
>> cd $(builddir)/tools/tools/power/x86/turbostat && make
>> $(CROSS_COMPILE);
>>
>>
>> With my change $(CROSS_COMPILE) is used properly here.
>>
>> Share opinion and please remember that I am not subscribed to this ML.

> There is some reason we cannot use this second part of the fix. This
> breaks builds somewhere else like on buildds or something. Tim you and
> I looked at this before when someone proposed exactly this second fix;
> Loic perhaps -- can you remember?

Ok, what about s/$(CROSS_COMPILE)/CROSS_COMPILE=$(CROSS_COMPILE)/ then -
it will also solve problem as current version is just broken for cross.

> As for the first change, I am not opposed to it, but would like to ask
> why you cannot use the do_tools=false override; this is what I use when
> cross building.

If you mean "do_tools=false dpkg-buildpackage -b -armhf" call then think
how many people will know about it? Doing it automatically makes life
easier - especially when we are not able to cross compile tools.

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-16-2012, 06:06 PM
Loc Minier
 
Default cross compilation of kernel does not need tools to be built

On Fri, Mar 16, 2012, Andy Whitcroft wrote:
> There is some reason we cannot use this second part of the fix. This
> breaks builds somewhere else like on buildds or something. Tim you and
> I looked at this before when someone proposed exactly this second fix;
> Loic perhaps -- can you remember?

Sorry, I only have a vague memory of this :-/ I seem to recall tool
in the kernel tree that was then cross-built instead of being natively
built, or that had to be both cross-built and natively built, or that
would break the build or the packaging -- but I might be confusing this
with a similar issue we had with u-boot, sorry

> As for the first change, I am not opposed to it, but would like to ask
> why you cannot use the do_tools=false override; this is what I use when
> cross building.

In general it's best if we can arrange for dpkg-buildpackage cross
builds to not require any special per-package setup, that way we can
cross-build more and more of our packages; it doesn't scale to keep
track of what special thing we do for each package in a central place.

I didn't check the second change in hrw's patch, but the do_tools one
is similar to what I've done in other packages to fix cross-building;
it's often problematic because the tools might be needed both in target
binary packages *and* during build.

--
Loc Minier

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-16-2012, 06:20 PM
Tim Gardner
 
Default cross compilation of kernel does not need tools to be built

This is a multi-part message in MIME format.>
> If you mean "do_tools=false dpkg-buildpackage -b -armhf" call then think
> how many people will know about it? Doing it automatically makes life
> easier - especially when we are not able to cross compile tools.
>

How about this ?
--
Tim Gardner tim.gardner@canonical.com
 
Old 03-16-2012, 06:31 PM
Marcin Juszkiewicz
 
Default cross compilation of kernel does not need tools to be built

W dniu 16.03.2012 20:20, Tim Gardner pisze:
>>
>> If you mean "do_tools=false dpkg-buildpackage -b -armhf" call then think
>> how many people will know about it? Doing it automatically makes life
>> easier - especially when we are not able to cross compile tools.
>>
>
> How about this ?

Acked-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 01:31 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org