ARMCrossCompilers

Differences between revisions 3 and 4
Revision 3 as of 2010-05-13 14:50:24
Size: 2629
Editor: 217
Comment:
Revision 4 as of 2010-05-18 12:29:56
Size: 7245
Editor: 5ac884b8
Comment: Add notes from UDS-M session
Deletions are marked like this. Additions are marked like this.
Line 61: Line 61:
Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected. === Discussions from UDS-M ===

==== Improve packaging of cross-compilers ====

Overall goal: try to script creation of cross-compiler packages and allow in archive cross-compilers (and not out of archive + manually built)

 * Improve support for -sysroot
 * Merge the binary-cross target into binary for e.g. gcc
 * Other simplifications of gcc/binutils etc. packaging to allow replacing these
 * Provide .dsc + .diff.gz etc. in the -source packages.

First goal:

 * have x-compiler packages of the same version and targeting the same toolchain as the native compilers
 * compiler targeting arm running on x86 obvious first goal
 * also can target e.g. uclibc

Existing approach: dpkg-cross, other highly manual approaches.

Can't run it in build environment because you can't build-depend on arm versions
of packages.

==== Boot Strapping ====
Bootstrap from source:
 * linux
 * binutils
 * gcc
 * eglibc
 * gcc
 * eglibc
 * gcc

Emdebian bootstrap:
 * dpkg-cross <long list>
 * binutils
 * gcc binary-cross
 * eglibc binary-cross

Bootstrap of cross-compiler requires building glibc-initial, then gcc-cross-initial, glibc, gcc-cross.

Could build e.g. glibc-arm package that could be installable on x86, but it would be ugly to provide an arm package as arch: all

Check how gcc-mingw32 is done?
 * support is split into few packages:
  * mingw32-runtime (headers + libraries)
  * mingw32-binutils
  * mingw32 (cross compiler)

Want to have the native and cross- packaging for gcc as similar as possible.
 * perhaps don't need to mangle the binary names and have things like gcc-defaults
  * but maybe we want to anyway

Use case for build-depending on x-compiler: targeting nolibc (?)

Need/opportunity to refactor/simplify gcc packaging because we want the rules to build the cross compiler and native compiler to be similar.

==== Current Situation ====

We currently have binary packages gcc-4.4-source which contain the debianized source tree of the gcc build, but not the dsc.
If we provide the .dsc we know that building the package is easier.
Need to provide -source packages for build dependencies of the cross compiler, would be nice if they could all be built the same way.

Need to move to using sysroot rather than configuring the cross toolchain at build time and using dpkg -i a lot (?)

==== Future Direction ====
sysroot or multiarch?

gcc 4.5 packaging uses sysroot already
OpenEmbedded moved to sysroot too

Dependencies:
{{{
# download armel toolchain debs to dpkg-cross them
# linux headers
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/linux-libc-dev_2.6.32-17.26_armel.deb
# gcc-4.4 runtime lib (eglibc and gmp runtime dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gcc-4.4/libgcc1_4.4.3-4ubuntu4_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gcc-4.4/libstdc++6_4.4.3-4ubuntu4_armel.deb
# eglibc runtime lib and headers
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/e/eglibc/libc6_2.11.1-0ubuntu5_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/e/eglibc/libc6-dev_2.11.1-0ubuntu5_armel.deb
# zlib1g runtime lib and headers (gcc-4.4 build-dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/z/zlib/zlib1g_1.2.3.3.dfsg-15ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/z/zlib/zlib1g-dev_1.2.3.3.dfsg-15ubuntu1_armel.deb
# mpfr runtime lib and headers (gcc-4.4 build-dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/m/mpfr/libmpfr1ldbl_2.4.2-3ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/m/mpfr/libmpfr-dev_2.4.2-3ubuntu1_armel.deb
# gmp runtime lib and headers (mpfr dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmp3c2_4.3.2+dfsg-1ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmpxx4ldbl_4.3.2+dfsg-1ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmp3-dev_4.3.2+dfsg-1ubuntu1_armel.deb
}}}

What languages to build cross compilers for?
 * demand driven, or keep things equivalent?
 * some things easy (obj-c) some things hard (java)
 * really only needs C and C++
 * could target everything which is in main: C, C++, Fortran

Also see: discussion of how to break build-dependency loops
 https://blueprints.edge.launchpad.net/ubuntu-arm/+spec/arm-m-automated-bootstrap

pbuilder?
apt-cross?

Problem looming with gcc runtime libraries between

== ACTIONS ==

 * lool to check reverse-build-deps in Debian of the tools source packages, to verify whether they'll be ok to transition to a common approach of shipping full Debian source packages (.dsc) in the binary package
 * lool to look into replacing dh_movefiles in the gcc packaging

Summary

This should provide an overview of the issue/functionality/change proposed here. Focus here on what will actually be DONE, summarising that so that other people don't have to read the whole spec. See also CategorySpec for examples.

Release Note

This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)

It is mandatory.

Rationale

This should cover the _why_: why is this change being proposed, what justifies it, where we see this justified.

User stories

Assumptions

Design

You can have subsections that better describe specific parts of the issue.

Implementation

This section should describe a plan of action (the "how") to implement the changes discussed. Could include subsections like:

UI Changes

Should cover changes required to the UI, or specific UI that is required to implement this

Code Changes

Code changes should include an overview of what needs to change, and in some cases even the specific details.

Migration

Include:

  • data migration, if any
  • redirects from old URLs to new ones, if any
  • how users will be pointed to the new way of doing things, if necessary.

Test/Demo Plan

It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage.

This need not be added or completed until the specification is nearing beta.

Unresolved issues

This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.

BoF agenda and discussion

Discussions from UDS-M

Improve packaging of cross-compilers

Overall goal: try to script creation of cross-compiler packages and allow in archive cross-compilers (and not out of archive + manually built)

  • Improve support for -sysroot
  • Merge the binary-cross target into binary for e.g. gcc
  • Other simplifications of gcc/binutils etc. packaging to allow replacing these
  • Provide .dsc + .diff.gz etc. in the -source packages.

First goal:

  • have x-compiler packages of the same version and targeting the same toolchain as the native compilers
  • compiler targeting arm running on x86 obvious first goal
  • also can target e.g. uclibc

Existing approach: dpkg-cross, other highly manual approaches.

Can't run it in build environment because you can't build-depend on arm versions of packages.

Boot Strapping

Bootstrap from source:

  • linux
  • binutils
  • gcc
  • eglibc
  • gcc
  • eglibc
  • gcc

Emdebian bootstrap:

  • dpkg-cross <long list>

  • binutils
  • gcc binary-cross
  • eglibc binary-cross

Bootstrap of cross-compiler requires building glibc-initial, then gcc-cross-initial, glibc, gcc-cross.

Could build e.g. glibc-arm package that could be installable on x86, but it would be ugly to provide an arm package as arch: all

Check how gcc-mingw32 is done?

  • support is split into few packages:
    • mingw32-runtime (headers + libraries)
    • mingw32-binutils
    • mingw32 (cross compiler)

Want to have the native and cross- packaging for gcc as similar as possible.

  • perhaps don't need to mangle the binary names and have things like gcc-defaults
    • but maybe we want to anyway

Use case for build-depending on x-compiler: targeting nolibc (?)

Need/opportunity to refactor/simplify gcc packaging because we want the rules to build the cross compiler and native compiler to be similar.

Current Situation

We currently have binary packages gcc-4.4-source which contain the debianized source tree of the gcc build, but not the dsc. If we provide the .dsc we know that building the package is easier. Need to provide -source packages for build dependencies of the cross compiler, would be nice if they could all be built the same way.

Need to move to using sysroot rather than configuring the cross toolchain at build time and using dpkg -i a lot (?)

Future Direction

sysroot or multiarch?

gcc 4.5 packaging uses sysroot already OpenEmbedded moved to sysroot too

Dependencies:

# download armel toolchain debs to dpkg-cross them
# linux headers
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/linux-libc-dev_2.6.32-17.26_armel.deb
# gcc-4.4 runtime lib (eglibc and gmp runtime dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gcc-4.4/libgcc1_4.4.3-4ubuntu4_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gcc-4.4/libstdc++6_4.4.3-4ubuntu4_armel.deb
# eglibc runtime lib and headers
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/e/eglibc/libc6_2.11.1-0ubuntu5_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/e/eglibc/libc6-dev_2.11.1-0ubuntu5_armel.deb
# zlib1g runtime lib and headers (gcc-4.4 build-dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/z/zlib/zlib1g_1.2.3.3.dfsg-15ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/z/zlib/zlib1g-dev_1.2.3.3.dfsg-15ubuntu1_armel.deb
# mpfr runtime lib and headers (gcc-4.4 build-dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/m/mpfr/libmpfr1ldbl_2.4.2-3ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/m/mpfr/libmpfr-dev_2.4.2-3ubuntu1_armel.deb
# gmp runtime lib and headers (mpfr dep)
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmp3c2_4.3.2+dfsg-1ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmpxx4ldbl_4.3.2+dfsg-1ubuntu1_armel.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gmp/libgmp3-dev_4.3.2+dfsg-1ubuntu1_armel.deb

What languages to build cross compilers for?

  • demand driven, or keep things equivalent?
  • some things easy (obj-c) some things hard (java)
  • really only needs C and C++
  • could target everything which is in main: C, C++, Fortran

Also see: discussion of how to break build-dependency loops

pbuilder? apt-cross?

Problem looming with gcc runtime libraries between

ACTIONS

  • lool to check reverse-build-deps in Debian of the tools source packages, to verify whether they'll be ok to transition to a common approach of shipping full Debian source packages (.dsc) in the binary package
  • lool to look into replacing dh_movefiles in the gcc packaging


CategorySpec

Specs/M/ARMCrossCompilers (last edited 2010-12-01 17:50:22 by 74)