Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

building a cross compile NetBSD toolchain Notes

Chris Jones edited this page Feb 21, 2019 · 4 revisions

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 (ε‰Šι™€γ“γ“γΎγ§)

Clone this wiki locally

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /