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 > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 09-30-2012, 02:34 PM
peter green
 
Default thoughts on using multi-arch based cross-building

I've been attempting to use multi-arch for cross-building packages for
raspbian (a debian derivative I am working on for armv6 hardfloat) and
run into a few things which I thought i'd share and/or ask about.



Build-depends installation:
apt-get build-dep is fine if you are building an unmodified package from
a repo but it's of no use if you have modified the build-dependencies to
make them satisfiable.


dpkg-checkbuilddeps doesn't tell me what architecture the packages need
to be for and i'm not sure it can (since to do so it would need to know
whether packages that are not installed are multi-arch foreign or not).


Does a tool exist that can be told "install the build-depends needed to
build the debianised source tree in directory x for architecture y"? if
not IMO such a tool (or a new option in an existing tool) needs to be
created.



Pkg-config:
A soloution needs to be found for this, so-far I have worked arround by
hacking the package to be multi-arch foreign and then manually creating
the symlink to the crosswrapper but there has to be a better soloution.



Packages that need a specific gcc version:
Sometimes packages need to be built using a non-default gcc version. We
would rather they didn't but i'm sure there will always be such cases.


Conventionally in such cases I've added a build-depends on gcc-<version>
version and then set CC to gcc-<version> but this obviously isn't
suitable for cross-building.


Setting the CC environment variable is easy to fix (set it to
<triplet>-gcc-<version> which afaict is fine for both native and cross
building) but I can't think of a good and simple soloution to the
build-dependency problem since the package name for the cross-compiler
depends on the architecture.



Arch all development dependency packages:
In debian there are some development dependency packages, typically
packages that depend on the latest version of a library. Since these
packages don't contain anything that is actually architecture specific
they are usually arch all. One example is tcl-dev.


The problem is that dpkg/apt always treat arch all packages the same as
packages for the native architecture making these arch all packages
useless for cross-building.


I see two possible soloutions to this
1: make those dependency packages arch any. This will take up a bit of
archive space but since the packages in question are empty anyway it
shouldn't be too bad.

2: introduce a concept of "effective architecture(s)" for arch all packages.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5068586A.50903@p10link.net">http://lists.debian.org/5068586A.50903@p10link.net
 
Old 09-30-2012, 04:15 PM
James McCoy
 
Default thoughts on using multi-arch based cross-building

On Sun, Sep 30, 2012 at 03:34:18PM +0100, peter green wrote:
> Build-depends installation:
> apt-get build-dep is fine if you are building an unmodified package
> from a repo but it's of no use if you have modified the
> build-dependencies to make them satisfiable.
>
> dpkg-checkbuilddeps doesn't tell me what architecture the packages
> need to be for and i'm not sure it can (since to do so it would need
> to know whether packages that are not installed are multi-arch
> foreign or not).
>
> Does a tool exist that can be told "install the build-depends needed
> to build the debianised source tree in directory x for architecture
> y"? if not IMO such a tool (or a new option in an existing tool)
> needs to be created.

See mk-build-deps(1) from devscripts. For example:

mk-build-deps -a y -i -s sudo -r x/debian/control

Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan@debian.org>
 
Old 10-01-2012, 12:05 AM
Wookey
 
Default thoughts on using multi-arch based cross-building

+++ peter green [2012-09-30 15:34 +0100]:
> I've been attempting to use multi-arch for cross-building packages
> for raspbian (a debian derivative I am working on for armv6
> hardfloat) and run into a few things which I thought i'd share
> and/or ask about.

I've been doing a fair amount of this too. Some results for unstable
and quantal are here:
http://people.linaro.org/~wookey/buildd/

> Build-depends installation:
> apt-get build-dep is fine if you are building an unmodified package
> from a repo but it's of no use if you have modified the
> build-dependencies to make them satisfiable.

Annoying isn't it? This has been irritating me for years.
/usr/lib/pbuilder-satisfydepends-classic is very useful for the
native-build case, but I am not aware of a multiarch-aware tool. A
tool like this should really be in devscripts.

> dpkg-checkbuilddeps doesn't tell me what architecture the packages
> need to be for and i'm not sure it can (since to do so it would need
> to know whether packages that are not installed are multi-arch
> foreign or not).
>
> Does a tool exist that can be told "install the build-depends needed
> to build the debianised source tree in directory x for architecture
> y"? if not IMO such a tool (or a new option in an existing tool)
> needs to be created.

The dose3 tools can produce the same answers as apt for this problem,
and could quite easily be modified to look at a local source package
rather than only at packages files. Johannes Schauer was looking into
doing this a couple of weeks ago. Any joy Johannes?

I don't know how hard it is to get apt have a 'use the source in front
of you instead' option. That would guarantee consistency but is
somewhat antithetical to the way apt works. (all about archives, not
local sources).

> Pkg-config:
> A soloution needs to be found for this, so-far I have worked arround
> by hacking the package to be multi-arch foreign and then manually
> creating the symlink to the crosswrapper but there has to be a
> better soloution.

Yes. So in ubuntu the gcc-defaults-<arch> package produces a trivial
pkg-config-<triplet> package which depends on pkg-config and install
the appropriate symlink.

I don't much like a package for each symlink, even though it's simple.

Discussion at debconf suggested that for debian a cross-support
package should do this sort of thing. Currently dpkg-cross provides
per-arch autoconf variables, so getting it to stick in the pkg-config
link too seems sensible. At some point (after wheezy) it should be
renamed to cross-support and drop it's existing
library-package-mangling functionality.

I have just created (following on from PJ McDermott's GSOC work) a
cross-build-essential source package that makes crossbuild-essential-<arch>
packages to bring in cross-gcc, cross-g++, dpkg-cross (aka
cross-support) pkg-config-<triplet>. That in this PPA:
https://launchpad.net/~linaro-foundations/+archive/cross-build-tools
and needs some dpkg-vendor foo adding to make it right for both debian
and ubuntu.

> Packages that need a specific gcc version:
> Sometimes packages need to be built using a non-default gcc version.
> We would rather they didn't but i'm sure there will always be such
> cases.
>
> Conventionally in such cases I've added a build-depends on
> gcc-<version> version and then set CC to gcc-<version> but this
> obviously isn't suitable for cross-building.
>
> Setting the CC environment variable is easy to fix (set it to
> <triplet>-gcc-<version> which afaict is fine for both native and
> cross building)

it is, and has been since gcc-4.4 in squeeze at least.

> but I can't think of a good and simple soloution to
> the build-dependency problem since the package name for the
> cross-compiler depends on the architecture.

Hmm, I see what you mean. Build-essential brings in 'latest compiler'
and crossbuild-essential bring in 'latest cross-compiler'. Ideally
something would note the native build-dep on a specific not-latest
native compiler and bring in (or at least try to use) the
corresponding cross-compiler. I'm not sure what that something might
be.

I think a good brainstorm is required on this whole subject,
because we have the clang/gcc issue and the cross/native issue and the gcc
version issue which all require 'compiler selection'. I'd like to
think that there was a good way to do this but I'm not at all sure
what is best. Solutions for one of these cases shouldn't break the
others, and I don't think we've achieved that yet.

Default compiler selections is currently messy for toolchains:
_something_ in the system has to set the gcc-<triplet> link to point
at gcc-<version-<triplet>. This is done by gcc-defaults in the native
case and gcc-defaults-<triplet> for ubuntu toolchains, and using
alternatives mechanism for debian toolchains. I have been told why the
gcc-defaults mechanism is preferred over alternatives, but I've
fogotten.

> Arch all development dependency packages:
> In debian there are some development dependency packages, typically
> packages that depend on the latest version of a library. Since these
> packages don't contain anything that is actually architecture
> specific they are usually arch all. One example is tcl-dev.
>
> The problem is that dpkg/apt always treat arch all packages the same
> as packages for the native architecture making these arch all
> packages useless for cross-building.

Right. Such packages need to have an arch set so that
they preserve the required architecture over the transitive dependecy.
See:
http://wiki.debian.org/Multiarch/CrossDependencies#all_vs_any_-dev_packages


> I see two possible soloutions to this
> 1: make those dependency packages arch any. This will take up a bit
> of archive space but since the packages in question are empty anyway
> it shouldn't be too bad.
> 2: introduce a concept of "effective architecture(s)" for arch all packages.

1 is the right answer. Simple, works. The point being that the
'generic-name' -dev package is not really arch all - it's a library
package just like the arch-any package it depends on and thus should
be arch any too. It's just that in a pre-multiarch world the way apt
worked meant tha tit didn't matter.

Wookey
--
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20121001000510.GK24695@stoneboat.aleph1.co.uk">htt p://lists.debian.org/20121001000510.GK24695@stoneboat.aleph1.co.uk
 
Old 10-01-2012, 08:34 AM
Johannes Schauer
 
Default thoughts on using multi-arch based cross-building

Hi,

On Mon, Oct 01, 2012 at 01:05:11AM +0100, Wookey wrote:
> > Build-depends installation: apt-get build-dep is fine if you are
> > building an unmodified package from a repo but it's of no use if you
> > have modified the build-dependencies to make them satisfiable.
>
> Annoying isn't it? This has been irritating me for years.
> /usr/lib/pbuilder-satisfydepends-classic is very useful for the
> native-build case, but I am not aware of a multiarch-aware tool. A
> tool like this should really be in devscripts.

dpkg-dev has dpkg-checkbuilddeps which also has the -a switch for
foreign architectures. But it has two problems:

- the string it outputs contains versions in a format not compatible
with the apt-get command line.
- even with -a it doesnt seem to append architecture qualifiers to
package name (package:arch)

But dpkg-checkbuilddeps could probably easily be used as a template for
a script that is able to feed apt.

> > Does a tool exist that can be told "install the build-depends needed
> > to build the debianised source tree in directory x for architecture
> > y"? if not IMO such a tool (or a new option in an existing tool)
> > needs to be created.
>
> The dose3 tools can produce the same answers as apt for this problem,
> and could quite easily be modified to look at a local source package
> rather than only at packages files. Johannes Schauer was looking into
> doing this a couple of weeks ago. Any joy Johannes?

When we talked about it, I did some quick hacking and created some
patches for the dose3 parser so that it would also be able to read
debian/control files. When I was in Paris we didnt talk much about dose3
but more about my code. I will ask Pietro about the best way to
integrate this into dose3 on the debian-bootstrap list [1] today.

> I have just created (following on from PJ McDermott's GSOC work) a
> cross-build-essential source package that makes
> crossbuild-essential-<arch> packages to bring in cross-gcc, cross-g++,
> dpkg-cross (aka cross-support) pkg-config-<triplet>. That in this PPA:
> https://launchpad.net/~linaro-foundations/+archive/cross-build-tools
> and needs some dpkg-vendor foo adding to make it right for both debian
> and ubuntu.

And it needs wanna-build fixing (support for architecture qualifiers eg
package:arch) in Debian.

cheers, josch

[1] http://lists.mister-muffin.de/cgi-bin/mailman/listinfo/debian-bootstrap


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20121001083403.GB1682@hoothoot
 
Old 10-01-2012, 09:42 AM
Paul Wise
 
Default thoughts on using multi-arch based cross-building

On Sun, Sep 30, 2012 at 10:34 PM, peter green wrote:

> I've been attempting to use multi-arch for cross-building packages for
> raspbian (a debian derivative I am working on for armv6 hardfloat) and run
> into a few things which I thought i'd share and/or ask about.

I'd like to see cross-toolchains in sid before wheezy is out, is that
going to be possible? Perhaps with some sort of temporary source
package build-depending on gcc-4.7-source?

--
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAKTje6HLVC4bKkKHspWtndSHXKj7fKwMtE-sTmgFg7K9+fOV4A@mail.gmail.com">http://lists.debian.org/CAKTje6HLVC4bKkKHspWtndSHXKj7fKwMtE-sTmgFg7K9+fOV4A@mail.gmail.com
 
Old 10-01-2012, 10:14 AM
Wookey
 
Default thoughts on using multi-arch based cross-building

+++ Paul Wise [2012-10-01 17:42 +0800]:
> On Sun, Sep 30, 2012 at 10:34 PM, peter green wrote:
>
> > I've been attempting to use multi-arch for cross-building packages for
> > raspbian (a debian derivative I am working on for armv6 hardfloat) and run
> > into a few things which I thought i'd share and/or ask about.
>
> I'd like to see cross-toolchains in sid before wheezy is out, is that
> going to be possible? Perhaps with some sort of temporary source
> package build-depending on gcc-4.7-source?

It's possible, but some more is still needed to have them built by the
normal buildds. Wanna-build needs support for cross-arch dependencies;
that's not been done yet. Splitting (multiarching) libc++-dev is also
needed to build the g++ cross-compiler, http://bugs.debian.org/678623
and it would need either a small source package to the do the
non-standard GCC_TARGET=foo dpkg-buildpackage build, or a bit more
work to make it standard.

Thibg's final report gives a useful summary:
http://lists.debian.org/debian-embedded/2012/08/msg00002.html
and this blog post gives some more details:
http://gsoc.sitedethib.com/posts/State_of_Multiarch_Cross-toolchains_three_weeks_after_GSoC/


Wookey
--
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20121001101413.GO24695@stoneboat.aleph1.co.uk">htt p://lists.debian.org/20121001101413.GO24695@stoneboat.aleph1.co.uk
 
Old 10-01-2012, 10:16 AM
Wookey
 
Default thoughts on using multi-arch based cross-building

+++ Wookey [2012-10-01 11:14 +0100]:
> +++ Paul Wise [2012-10-01 17:42 +0800]:
> >
> > I'd like to see cross-toolchains in sid before wheezy is out, is that
> > going to be possible?

Sorry - meant to say, that whilst we should definately have a go at
this in experiemental, the libsdtc++ changes needed andprobaby some of
the others may not be a good idea in sid right now?

Wookey
--
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20121001101657.GP24695@stoneboat.aleph1.co.uk">htt p://lists.debian.org/20121001101657.GP24695@stoneboat.aleph1.co.uk
 
Old 10-01-2012, 10:27 AM
Paul Wise
 
Default thoughts on using multi-arch based cross-building

On Mon, Oct 1, 2012 at 6:14 PM, Wookey wrote:

> It's possible, but some more is still needed to have them built by the
> normal buildds. Wanna-build needs support for cross-arch dependencies;
> that's not been done yet. Splitting (multiarching) libc++-dev is also
> needed to build the g++ cross-compiler, http://bugs.debian.org/678623
> and it would need either a small source package to the do the
> non-standard GCC_TARGET=foo dpkg-buildpackage build, or a bit more
> work to make it standard.

Hmm, ok. I guess that means it would have to go experimental then.
Fine for me though.

> Thibg's final report gives a useful summary:
> http://lists.debian.org/debian-embedded/2012/08/msg00002.html
> and this blog post gives some more details:
> http://gsoc.sitedethib.com/posts/State_of_Multiarch_Cross-toolchains_three_weeks_after_GSoC/

I tried following that the other week and came across some gotchas:

You really do need to apply his patches, the blog post doesn't make
that too obvious.

He missed out the GCC_TARGET=armhf in front of the `debian/rules
control` and `dpkg-buildpackage -uc -us -b` commands.

--
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAKTje6EBcSn6oZk-OMrwM1-EXwApFU83SURaQzutJYhntOp-FA@mail.gmail.com">http://lists.debian.org/CAKTje6EBcSn6oZk-OMrwM1-EXwApFU83SURaQzutJYhntOp-FA@mail.gmail.com
 
Old 10-01-2012, 11:28 AM
Thibaut Girka
 
Default thoughts on using multi-arch based cross-building

On Sun, Sep 30, 2012 at 03:34:18PM +0100, peter green wrote:
> I've been attempting to use multi-arch for cross-building packages
> for raspbian (a debian derivative I am working on for armv6
> hardfloat) and run into a few things which I thought i'd share
> and/or ask about.

Great!
I'm busy with uni, but I'll try to help.

> Build-depends installation:
> apt-get build-dep is fine if you are building an unmodified package
> from a repo but it's of no use if you have modified the
> build-dependencies to make them satisfiable.
>
> dpkg-checkbuilddeps doesn't tell me what architecture the packages
> need to be for and i'm not sure it can (since to do so it would need
> to know whether packages that are not installed are multi-arch
> foreign or not).
>
> Does a tool exist that can be told "install the build-depends needed
> to build the debianised source tree in directory x for architecture
> y"? if not IMO such a tool (or a new option in an existing tool)
> needs to be created.

The tool you're looking for is mk-build-deps from the devscripts package,
I'm not sure about how it handles multiarch, though. I'll have a look into it.

I think pbuilder comes with a similar script, but again, I'm not
sure it handles multiarch correctly.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20121001112852.GA2718@localhost
 
Old 10-01-2012, 12:28 PM
Thibaut Girka
 
Default thoughts on using multi-arch based cross-building

On Mon, Oct 01, 2012 at 06:27:04PM +0800, Paul Wise wrote:
> On Mon, Oct 1, 2012 at 6:14 PM, Wookey wrote:
> > Thibg's final report gives a useful summary:
> > http://lists.debian.org/debian-embedded/2012/08/msg00002.html
> > and this blog post gives some more details:
> > http://gsoc.sitedethib.com/posts/State_of_Multiarch_Cross-toolchains_three_weeks_after_GSoC/
>
> I tried following that the other week and came across some gotchas:
>
> You really do need to apply his patches, the blog post doesn't make
> that too obvious.
>
> He missed out the GCC_TARGET=armhf in front of the `debian/rules
> control` and `dpkg-buildpackage -uc -us -b` commands.

I have updated my blog post.
If something still isn't clear, please tell me in a private mail.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20121001122824.GA6696@localhost
 

Thread Tools




All times are GMT. The time now is 08:35 AM.

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