building a cross compile NetBSD toolchain Notes - ipatch/theairportwiki GitHub Wiki

Contents

Building a cross compile toolchain for MIPS Big Endian

./build.sh -a mipseb -m evbmips -j8 tools
./build.sh -a mipseb -m evbmips -j8 distribution

Update January 8 2018

Making progress 📸 amd64 tools for netbsd4

Useful packages to install on the host system Debian Lenny before trying to build the NetBSD tools

apt-get install build-essential flex libncurses-dev ncurses-base zlib1g-dev zlib1g git-core

Giving credit 💳 where credit is due.

A little bash magic 🎩
for file in *.tgz
  do
    tar xfz $file
done
  • cd usr/src

The below example is for building a toolchain that will compile binaries for ARM little endian.

./build.sh -U -u -a arm -m evbarm -D ../../evbarm/dest/ -O ../../evbarm/obj/ -R ../../evbarm/release/ -T ../../evbarm/tools/ tools

Some useful tidbits about the above command,

  • -U Set MKUNPRIVED=yes.
  • -u Set MKUPDATE=yes.
  • -a arch Set the value of MACHINE_ARCH to arch.

ie, -a arm

  • -m Set the value of MACHINE to mach. All cross builds require -m
  • -D dest Set the value of DESTDIR to dest.
  • -O Create an appropriate transform macro for MAKEOBJDIR that will place the built object files under obj.
  • -R Set the value of RELEASEDIR to rel.
  • -T tools Set the value of TOOLDIR to tools.

Once the tools have been built, the userspace can be built with the below command.

./build.sh -U -u -a arm -m evbarm -D ../../evbarm/dest/ -O ../../evbarm/obj/ -R ../../evbarm/release/ -T ../../evbarm/tools/ release
  • Finally, copy all the archives and object files from

evbarm/dest/usr/lib/

to

evbarm/tools/arm--netbsdelf/lib/

To build the NetBSD userland libraries / components for Big Endian ARM

./build.sh -U -u -m evbarm -a armeb release

Random Notes > In no particular order

To install debootstrap on a Debian system.

apt-get install debootstrap

To search for a particular package on the apt-get registry

apt-cache search <package_name>

Ex

apt-cache search debootstrap

To debootstrap a lenny system

- debootstrap --arch amd64 lenny /opt/chroot-lenny http://snapshot.debian.org/archive/debian/20070730T000000Z/
- debootstrap --variant=buildd --arch amd64 lenny /opt/chroot/lenny http://archive.debian.org/debian/
- debootstrap --no-check-gpg lenny /opt/chroot/lenny http://archive.debian.org/debian
+ debootstrap --variant=buildd --no-check-gpg lenny /opt/chroot/lenny http://archive.debian.org/debian

Make sure to add --variant=buildd or else tools such as apt-get won't be installed.

Useful Links 🔗

TODOs

  • Add table of contents this markdown document
⚠️ **GitHub.com Fallback** ⚠️