User:Fabled

From Alpine Linux
Revision as of 14:44, 5 July 2013 by Fabled (talk | contribs) (Created page with "==Bootstrapping new architectures== # Create cross compiler #* I decided to use crosstool-ng as build cross-compiler is tricky #** Wrote patch to support musl as C-library #*...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Bootstrapping new architectures

  1. Create cross compiler
    • I decided to use crosstool-ng as build cross-compiler is tricky
      • Wrote patch to support musl as C-library
      • Wrote patch to enable building toolchains with PIE as default
    • TODO: post crosstool-ng .config used (TODO)
      • NOTE: for some reason binutils gold linker crashes when compiling gcc, so needed to keep it disabled.
  2. Cross compile minimal system image
    • abuild and core APKBUILDs modified to support cross building
    • Wrote crossbuild-alpine-bootstrap.sh to invoke abuild with cross-compiler
    • Cross-building script uses abuild.conf overlay to define new target
    • TODO: post crossbuild-alpine-bootstrap.sh and abuild-cross-armel.conf
    • This produces all core .apk files for the target platform that can be used to boot qemu, qemu-user target or native hardware
  3. Rebuild system and setup builder
    • Decided to use qemu-user for ARM as it the fastest option available for us (no fast native hardware yet)
    • Setup qemu-arm support for target chroot
      1. apk --arch x86 --root $chroot/qemu --initdb add qemu-arm
      2. cd $chroot/lib ; ln -s ../qemu/lib/ld-* .
      3. ldconfig -r $chroot /qemu/lib /qemu/usr/lib
      4. create binfmt_misc mapping
      5. seems qemu-user needs to access /proc/sys/vm/mmap_min_addr or it does not work
    • Setup target main chroot
      • apk --arch arm --root $chroot --initdb add alpine-base build-base
      • enter chroot