Note: These instructions are current as of OpenBSD 7.6.
This is the directory that maintains the development environment on OpenBSD.
Required programs to build a complete DiscoBSD distribution are:
- Version control: git
- Native compiler: clang or gcc
- Utilities: awk, bison, bmake, byacc, flex, gettext, groff
- Utilities: mandoc, pkg-config, sed, sudo, unzip, zip
- Libraries: libbsd, libelf, libfuse
- Cross compiler (ARM): binutils and gcc arm-none-eabi rmprofile
- Cross debugger (ARM): gdb arm-none-eabi or gdb multiarch
- Firmware loader (ARM): dfu-util, openocd, stlink
- Cross compiler (MIPS): binutils and gcc mips-elf
- Cross debugger (MIPS): gdb mips-elf or gdb multiarch
- Firmware loader (MIPS): pic32prog
All components of the development environment are available from the
OpenBSD base system, the OpenBSD package system, or as a user-compiled
OpenBSD port in the mystuff directory subtree.
Information about the OpenBSD Package System can be found at: https://www.openbsd.org/faq/faq15.html
Packages need no setup.
These required utilities can be installed as Packages:
$ pkg_add bison dfu-util elftoolchain gettext-runtime
$ pkg_add git groff openocd sudo unzip zipThe remaining required utilities must be built as Ports.
Information about the OpenBSD Ports System can be found at: https://www.openbsd.org/faq/ports/ports.html
- Fetch and Install the Ports Collection:
$ cd /tmp
$ ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
$ cd /usr
$ tar xzvf /tmp/ports.tar.gz- Add the Ports from this repo to the
/usr/ports/mystuffdirectory:
$ cd {where this repo is cloned}/tools/openbsd/ports
$ cp -R mystuff /usr/ports/ $ cd /usr/ports/mystuff/devel/stlink
$ sudo make
$ sudo make install $ cd /usr/ports/mystuff/emulators/qemu-arm
$ sudo make
$ sudo make install $ sudo pkg_add arm-none-eabi-binutilsNote: DO NOT install the default OpenBSD arm-none-eabi-gcc Package.
It does not enable the rmprofile multilib, missing critical library files.
Instead, compile the custom-configured GCC port as outlined below.
$ cd /usr/ports/mystuff/devel/arm-none-eabi/gcc
$ sudo make
$ sudo make install $ cd /usr/ports/mystuff/devel/arm-none-eabi/gdb
$ sudo make
$ sudo make installNote: The whole meta-package can be compiled and installed by one command:
$ cd /usr/ports/mystuff/devel/arm-none-eabi
$ sudo make
$ sudo make installNote: These steps assume that all previous steps have been completed.
$ cd /usr/ports/mystuff/devel/mips-elf/binutils
$ sudo make
$ sudo make install $ cd /usr/ports/mystuff/devel/mips-elf/gcc
$ sudo make
$ sudo make installNote: The whole meta-package can be compiled and installed by one command:
$ cd /usr/ports/mystuff/devel/mips-elf
$ sudo make
$ sudo make install