2011-03-25 to 2011-04-01

Loïc's initial notes:

First step is bootstrapping the build-essential pieces, mostly the toolchain.

It will be useful to have cross-toolchains around, and these shouldn't need any armhf builds, and that's a nice way to work towards build-essential.

dpkg is the first obvious thing to bootstrap as the other packages might rely on its view of supported Debian architectures.

Setup linaro-octo/armhf PPA to host patched sources.

Cherry-picked 88b0c3043a651a422cd0c43c38ab6d553e2214ea from dpkg.git into dpkg and uploaded this to ~linaro-octo/armhf

Patched binutils to be ready for armhf and uploaded to linaro-octo/armhf as to get a fixed binutils-source.

Patched linux to be ready for armhf and uploaded to linaro-octo/armhf as to get a fixed linux-source-2.6.38. First upload failed as both debian/changelog and debian.master seem to be needed for the proper version to be picked up. Rewrote the changes on top of ubuntu:ubuntu/ubuntu-natty.git but didn't include any kernel flavor, then sent them to the Ubuntu kernel team.

Patched linux-meta to be ready for armhf as to get proper meta-packages but didn't upload to linaro-octo/armhf yet as it's best to have linux built first.

Checked eglibc, and it seemed to be nicely patched for armhf; handling seemed entirely identical to the armel handling, so seems complete.

Checked gcc-4.5 and gcc-4.4; the changelogs claim support for armhf, but there are relatively large differences between armel and armhf support which suggest that support is incomplete. For instance, there are some debian/*.symbols.armel but no debian/*.symbols.armhf. Most places seem to be patched adequately, but in some cases some dead code wasn't updated which is risky. The legitimate points of divergence are: a) soft-float packages are disabled on armhf (I guess it doesn't make sense to have them); b) "slow buildds" quirks are disabled on armhf.

Prepared an armhf-cross-toolchain-base package based on armel-cross-toolchain-base and uploaded to linaro-octo/armhf; this failed to build as linux wasn't yet aware of armhf.

Noticed while running debuild with armhf in control files that lintian would complain about armhf being an unknown architecture; updated lintian data with an armhf-aware dpkg-architecture and copied the armel "file" regexp for armhf. Rebased changes on top of Debian's lintian 2.5.0~rc1 and sent them in Debian #618587. Upload to ~linaro-octo/armhf PPA failed to build as lintian also failed to build in natty.

Looked at fixing "file" to output different regexps for armel; it is reasonnably easy to detect "EABI" but detecting hard-float ABI seems much trickier, perhaps not doable with the semantics of "magic" files: one has to search for an ELF section with a specific name (the one with aeabi attributes) which requires parsing the ELF string tables and then search this section for the right tag.

#Prepared a gcc-4.5-armhf-cross package based on gcc-4.5-armel-cross and #uploaded to linaro-octo/armhf.

Reviewed occurrences of armel in lp:ubuntu/gcc-4.5: - debian/rules.d/binary-gcc.mk: reworked to use upstream architectures - debian/rules.d/binary-java.mk: TODO, but I think gcj is broken - debian/rules.d/binary-libgcc.mk: rewored to use upstream triplet and to note

  • that it's dead code for recent dpkg-dev versions anyway

- debian/control.m4: checked, seems correct to not list armhf in Architecture:

  • for gcc`'PV-soft-float as it's a set of static libraries built with -msoft-float and people probably shouldn't be using an armhf cross-compiler if they look for soft-float support, but armel; it might be possible to get this working, but doesn't seem terribly important

- debian/rules.patch:

  • libjava-armel-unwind enabled on all of arm, armel and armhf, TODO: not
    • clear what the root cause is, this patch should be disabled and the root cause fixed as it's a kludge and can't be upstreamed; could also enable for DEB_TARGET_GNU_CPU = arm instead of by DEB_TARGET_ARCH, but probably doesn't matter too much, also java might be broken on ARM anyway
  • libstdc++-no-testsuite: workaround timeouts when building the libstdc++
    • testsuite on Debian and Ubuntu armel buildds; it seems it's not an issue for debian-ports armhf buildds and we would want to fix this anyway, so keep it

- debian/rules.conf:

  • $1_no_archs += !arm !armel !armhf already patched for armhf; this seems a
    • relatively ugly custom hack to filter out the Debian arm architectures if arm_no_cpus is set; doesn't seem too important, probably just some convenience for the packager
  • ifneq (,$(java_awt_peers)) [...] ifneq ($(PKGSOURCE),gcc-snapshot) [...]
    • JAVA_BUILD_DEP += g++-4.5 [armel armhf], not very clear, but since it relates to java which is probably broken and already mentions armhf, skip for now
  • ifeq ($(with_ecj),yes) [...] else [...] ifneq (,$(filter $(DEB_HOST_ARCH),arm armel armhf))
    • same thing: java related, already patched for armhf
  • ifeq ($(PKGSOURCE),gcc-snapshot) [...]
    • - #GNAT_BUILD_DEP := gnat (>= 4.1) [$(ada_no_archs)], gcc-snapshot (>= 20090821-1) [armel],

      • patched comment to not mention only armel and not armhf

      - GNAT_BUILD_DEP := gnat (>= 4.1) [!arm !armel !armhf !m68k !sparc64 !hurd-i386], gcc-snapshot (>= 20090113) [sparc64 armel armhf], seems already patched for armhf; not clear why ARM specific deps there

  • ifneq ($(with_standalone_gcj),yes) ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf))
    • java related and already patched anyway

- debian/patches/libjava-armel-unwind.diff: not really armel specific, discussed earlier - debian/patches/gcc-hash-style-both.diff, debian/patches/gcc-hash-style-gnu.diff: mentions armel but not really armel specific, will just work on armhf, but updated comment - debian/patches/libstdc++-nothumb-check.diff: disables libstdc++-v3 testsuite in thumb mode on armel; TODO: if this passes on armhf, then this could likely be re-enabled on armel - debian/rules.defs:

  • ifeq ($(distribution),Ubuntu) ifeq (,$(findstring gnat, $(PKGSOURCE))) ifneq (,$(findstring $(DEB_TARGET_ARCH),amd64 armel armhf i386 powerpc))
    • seems patched correctly already; also immediately afterwards: ifeq ($(DEB_TARGET_ARCH),armhf)
      • with_linaro_branch := yes
      endif
  • snippet to set float_abi; seems to cover very Debian specific needs, so
    • probably fine
  • snippet setting with_common_libs := 0 and with_common_pkgs := no on a hardcoded list of arches; this seems to be for Debian experimental but it's not clear why it's needed; code seems to be dead, but good to patch the list anyway; not clear if only packages in experimental are allowed there; also testing DEB_TARGET_ARCH_CPU is probably not going to work for armel here; fixed to test for arm instead
  • ifeq ($(with_ada),yes) [...] libgnat_sjlj_only_cpus := arm armel armhf
    • seems to select different exception handling backends for gnat depending on Debian CPU; TODO: this should probably be done with an upstream arch test, or directly in the upstream configure
  • java_cpu_map = armel=arm armhf=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips powerpc=ppc sh4=sh
    • already patched
  • libgc_no_cpus := avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
    • comment already patched
  • gold_archs = amd64 armel armhf i386 lpia powerpc sparc
    • seems to relate to binutils with gold enabled, see binutils changes; comment "armel with binutils 2.20.51 only" doesn't seem worth updating
  • # neon_archs = armel armhf
    • commented out code seems patched already; this seems to be to build a neon pass on Ubuntu

- debian/rules2:

  • STAGE1_CFLAGS = -g -O2 on armel and armhf; seems already patched, quite distro specific
  • # BOOT_CFLAGS = -g -O1 on armel; removed, seems useless as this is fixed upstream in 4.4+
  • # ifneq (,$(findstring arm-linux-gnueabi,$(DEB_TARGET_GNU_TYPE)))
    • ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),arm armel armhf)) fixed to test for arm alone
  • no_profiled_bs_archs := alpha arm armel armhf hppa m68k
    • another case of bogus use of DEB_TARGET_GNU_CPU; fixed
  • ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel armhf mips mipsel sparc))
    • this one seems correct
  • DEJAGNU_TIMEOUT=600, seems correct as well, but wasn't applied to Ubuntu;
    • fixed
  • # FIXME Ubuntu armel buildd hangs
    • comment mentions armel, but test uses DEB_TARGET_GNU_CPU; fixed the broken use of armel/armhf in the test; TODO: check whether dejagnu still hangs
  • ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),armel armhf))
    • fixed as well
  • configure_neon_stamp: TODO hardcodes arm-linux-gnueabi triplet; seems unused right now though
  • ifneq (,$(findstring arm-linux-gnueabi,$(DEB_TARGET_GNU_TYPE)))
    • this is supsicious, but it's not clear what it's used for

- debian/control: same as control.m4

2011-04-08

Steve

  • Building eglibc to work with cross toolchain. Added support for new triplet, extending globs in ports/sysdeps/arm/preconfigure and ports/sysdeps/arm/shlib-versions. Building for ppa at ppa:steve-mcintyre/armhf now.

2011-04-11 to 2011-04-15

Steve

  • eglibc built and seems to be working (eglibc_2.13-0ubuntu13armhf1_source.changes). Needed rebuilding a few times, was bitten by changes from other folks working in parallel and needed to rebase forwards. Patch trivial in the end.
  • armhf-cross-toolchain-base_1.62build1_source.changes - built and uploaded. Trivial changes needed:
    • edit changelog and s/armel-cross-toolchain/armhf-cross-toolchain
    • make -f debian/rules control
    • build
    • Found and fixed a bug: LP#761613
  • gcc-4.5-armhf-cross_1.47build1_source.changes uploaded, waiting on a build. Equivalent gcc-4.4 package FTBFS with #error "Must use SJLJ exceptions but configured not to". Don't know if we actually need to care about that - is gcc-4.4 necessary for us?

  • Builds are taking a long time for me, waiting on LP to pick things up and build them. I'm testing everything builds locally first, which I'm doing for build sanity but that means I end up waiting for a double-build every time. Is that standard practice?

2011-04-18 to 2011-04-21

Steve

Loïc pointed me at the fix for gcc-4.4 (http://bugs.debian.org/621083). Taken that patch as a backport locally, rebuilding gcc-4.4-source now so that gcc-4.4-armhf-cross will work.

2011-05-09 to 2011-05-13

LDS. Budapest

2011-05-16

$ debootstrap --print-debs --variant=buildd natty dbtmp http://cam-ubuntu/ubuntu 2>/dev/null | tr ' ' '\n' > debootstrap-list

generates the list of packages that we want (140 in total):

adduser base-files base-passwd bash bsdutils busybox-initramfs coreutils cpio dash debconf debconf-i18n debianutils diffutils dpkg e2fslibs e2fsprogs findutils gcc-4.5-base grep gzip hostname ifupdown initramfs-tools initramfs-tools-bin initscripts insserv klibc-utils libacl1 libattr1 libblkid1 libbz2-1.0 libc-bin libc6 libcomerr2 libdb4.8 libdbus-1-3 libdrm-intel1 libdrm-nouveau1a libdrm-radeon1 libdrm2 libgcc1 libglib2.0-0 libklibc liblocale-gettext-perl liblzma2 libncurses5 libncursesw5 libnih-dbus1 libnih1 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3 libplymouth2 libpng12-0 libselinux1 libsepol1 libslang2 libss2 libssl0.9.8 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libudev0 libusb-0.1-4 libuuid1 locales login lsb-base makedev mawk module-init-tools mount mountall multiarch-support ncurses-base ncurses-bin net-tools passwd perl-base plymouth procps python-minimal python2.7-minimal sed sensible-utils sysv-rc sysvinit-utils tar tzdata udev upstart util-linux xz-utils zlib1g apt binutils build-essential bzip2 cpp cpp-4.5 dpkg-dev fakeroot g++ g++-4.5 gcc gcc-4.5 gnupg gpgv libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-dev-bin libc6-dev libcloog-ppl0 libdpkg-perl libelfg0 libgdbm3 libgmp3c2 libgmpxx4ldbl libgomp1 libmpc2 libmpfr4 libppl-c2 libppl7 libreadline6 libstdc++6 libstdc++6-4.5-dev libtimedate-perl linux-libc-dev make manpages manpages-dev netbase patch perl perl-modules readline-common ubuntu-keyring

Feed that list into a wrapper around xdeb: (mainly because xdeb doesn't cope with binary packages, just source packages. Not clear why!)

PKGLIST=$1

for binpkg in `cat $PKGLIST`; do
    echo "Looking at binary $binpkg" >> LOGFILE
    srcpkg=`apt-cache showsrc $binpkg | awk '/^Package:/ {print $2}' | uniq`
    echo "   srcpkg $srcpkg" >> LOGFILE
    COMMAND="xdeb -a armhf --apt-source --prefer-apt --debug $srcpkg"
    echo "   command $COMMAND" >> LOGFILE
    $COMMAND
done

and see where it goes!

Answer: lots of build logs to work through, 79 in total (logs for source packages rather than build packages, and some of those sources build multiple of our binaries), 17 failures:

BUILD

RESULT

LOG if failed

Debian bug# (with patch if possible)

acl_2.2.49-4ubuntu2_armhf.build

successful

adduser_3.112+nmu1ubuntu5_armhf.build

successful

attr_2.4.44-2ubuntu3_armhf.build

successful

base-files_5.0.0ubuntu28_armhf.build

successful

base-passwd_3.5.22_armhf.build

successful

bash_4.2-0ubuntu3_armhf.build

FAILED - looks like crossbuild failure

bash_4.2-0ubuntu3_armhf.build

#629929

binutils_2.21.0.20110327-2ubuntu2_armhf.build

successful

build-essential_11.5ubuntu1_armhf.build

successful

busybox_1.17.1-10ubuntu1_armhf.build

successful

bzip2_1.0.5-6ubuntu1_armhf.build

successful

coreutils_8.5-1ubuntu6_armhf.build

FAILED - docs build failure: uses help2man and so can never be made to cross-build totally. ICK.

coreutils_8.5-1ubuntu6_armhf.build

#630735 - patch to disable docs generation on cross-build. Better solution would be to fix the man page issue, but that's major work for upstream.

cpio_2.11-7ubuntu1_armhf.build

FAILED - build failure in "stat" macro

cpio_2.11-7ubuntu1_armhf.build

#627444

dash_0.5.5.1-7.2ubuntu1_armhf.build

successful

debconf_1.5.36ubuntu4_armhf.build

successful

debianutils_3.4.3ubuntu1_armhf.build

successful

diffutils_3.0-1_armhf.build

successful

dpkg_1.16.0~ubuntu7_armhf.build

successful

eglibc_2.13-0ubuntu13armhf1_armhf.build

successful

expat_2.0.1-7ubuntu3_armhf.build

successful

findutils_4.4.2-1ubuntu3_armhf.build

successful

flex_2.5.35-10ubuntu1_armhf.build

successful

gcc-defaults_1.98ubuntu3_armhf.build

successful

gdbm_1.8.3-9ubuntu1_armhf.build

successful

glib2.0_2.28.6-0ubuntu1_armhf.build

successful

gmp_4.3.2+dfsg-1ubuntu3_armhf.build

successful

gpm_1.20.4-3.3ubuntu2_armhf.build

successful

grep_2.6.3-3ubuntu1_armhf.build

successful

gzip_1.3.12-9ubuntu1.1_armhf.build

successful

hostname_3.05ubuntu1_armhf.build

successful

ifupdown_0.6.10ubuntu4_armhf.build

FAILED - error from strip

ifupdown_0.6.10ubuntu4_armhf.build

#627437

insserv_1.14.0-2_armhf.build

FAILED - error from strip

insserv_1.14.0-2_armhf.build

#629539 - nocheck; #629540 - cross

klibc_1.5.20-1ubuntu6_armhf.build

FAILED - missing header error

klibc_1.5.20-1ubuntu6_armhf.build

#629934 - accepted by maintainer and uploaded

langpack-locales_2.13+git20100825-4_armhf.build

SUCCESSFUL

libalgorithm-diff-perl_1.19.02-2_armhf.build

SUCCESSFUL

libalgorithm-diff-xs-perl_0.04-1_armhf.build

FAILED - error from strip

libalgorithm-diff-xs-perl_0.04-1_armhf.build

#633950

libalgorithm-merge-perl_0.08-2_armhf.build

successful

libelf_0.8.13-1_armhf.build

FAILED - error from strip; cross-build is failing to work because of configure confusion?

libelf_0.8.13-1_armhf.build

#630378 - accepted by maintainer and uploaded

liblocale-gettext-perl_1.05-6_armhf.build

FAILED - error from strip

liblocale-gettext-perl_1.05-6_armhf.build

#633949

libpng_1.2.44-1ubuntu3_armhf.build

successful

libpthread-stubs_0.3-2_armhf.build

successful

libselinux_2.0.96-1ubuntu2_armhf.build

FAILED - build completes, but does the wrong thing and builds using the native headers on the build system.

libselinux_2.0.96-1ubuntu2_armhf.build

#630626

libsepol_2.0.41-1_armhf.build

successful

libtext-charwidth-perl_0.04-6_armhf.build

FAILED - error from strip

libtext-charwidth-perl_0.04-6_armhf.build

#633955

libtext-iconv-perl_1.7-2_armhf.build

FAILED - error from strip

libtext-iconv-perl_1.7-2_armhf.build

#633954 - ignores DEB_BUILD_OPTIONS
#633960 - cross build support

libtext-wrapi18n-perl_0.06-7_armhf.build

successful

libtimedate-perl_1.2000-1_armhf.build

successful

libusb_0.1.12-17_armhf.build

successful

libxau_1.0.6-1ubuntu1_armhf.build

successful

libxcb_1.7-2ubuntu2_armhf.build

FAILED - error from debhelper

libxcb_1.7-2ubuntu2_armhf.build

#629691; bug fixed by the maintainer, but in a different way

libxdmcp_1.1.0-1ubuntu1_armhf.build

successful

lsb_4.0-0ubuntu11_armhf.build

successful

make-dfsg_3.81-8ubuntu1_armhf.build

successful

makedev_2.3.1-89ubuntu1_armhf.build

successful

manpages_3.27-1ubuntu2_armhf.build

successful

mawk_1.3.3-15ubuntu2_armhf.build

successful

module-init-tools_3.12-1ubuntu6_armhf.build

successful

mpclib_0.9-1_armhf.build

successful

mpfr4_3.0.0-7_armhf.build

successful

ncurses_5.7+20101128-1_armhf.build

successful

net-tools_1.60-23ubuntu3_armhf.build

FAILED - error from strip

net-tools_1.60-23ubuntu3_armhf.build

#451281 Bug already filed, prodded maintainers; NMU uploaded with blessing of maintainers.

netbase_4.45ubuntu1_armhf.build

successful

patch_2.6-3_armhf.build

FAILED - error from running self-test despite nocheck

patch_2.6-3_armhf.build

#627196; bug fixed by the maintainer, but in a different way

pcre3_8.12-3ubuntu2_armhf.build

successful

ppl0.10_0.10.2-10ubuntu1_armhf.build

FAILED - error from libtool at link stage

ppl0.10_0.10.2-10ubuntu1_armhf.build

Major issue in libtool / cross-compiler; stalled waiting on those

procps_3.2.8-10ubuntu3_armhf.build

successful

python-defaults_2.7.1-0ubuntu5_armhf.build

successful

sed_4.2.1-8_armhf.build

successful

sensible-utils_0.0.6ubuntu2_armhf.build

successful

sysvinit_2.87dsf-4ubuntu23_armhf.build

successful

tar_1.25-3_armhf.build

successful

tcl8.5_8.5.9-2_armhf.build

FAILED - error from running itself to install files in the output tree

tcl8.5_8.5.9-2_armhf.build

#631995

tzdata_2011f-1_armhf.build

successful

ubuntu-keyring_2010.+09.30_armhf.build

successful

x11proto-core_7.0.20-1_armhf.build

successful

x11proto-kb_1.0.5-1_armhf.build

successful

x11proto-xext_7.1.99.0~git20110111.9df8b776-0ubuntu2_armhf.build

successful

x11proto-xf86bigfont_1.2.0-2_armhf.build

successful

xz-utils_5.0.0-2_armhf.build

FAILED - error from running self-test despite nocheck

xz-utils_5.0.0-2_armhf.build

#627209 - opened and closed immediately: there's already a patch in git and it just hasn't been uploaded yet!]

zlib_1.2.3.4.dfsg-3ubuntu3_armhf.build

successful

And some extra patches for packages that xdeb didn't pick up, but are also needed to make things work:

PACKAGE

DESCRIPTION

Debian bug# (with patch if possible)

perl

Cross-compile support, needed when cross-building perl modules

#633884

dpkg-cross

Copy perl cross-config scripts

#632871

xdeb

Needs to call dpkg-cross with -A

OfficeofCTO/HardFloat/Log (last modified 2011-07-20 11:54:14)