OpenBSD - roybaer/sdcc-wiki GitHub Wiki

Installing SDCC on OpenBSD 6.2

As of OpenBSD 6.2 (released 2017), SDCC 3.6.0 (released 2016) is included in the OpenBSD packages.

Compiling newer SDCC on OpenBSD 6.2 seems problematic: https://sourceforge.net/p/sdcc/bugs/2699/

Installing SDCC on OpenBSD 6.0

As of OpenBSD 6.0 (released 2016), SDCC 2.8.0 (released 2008) is included in the OpenBSD packages.

To use a more current SDCC, such as 3.6.0 on OpenBSD it will have to be built from source:

  • Get the source of the desired SDCC version, e.g. download and unpack a release tarball or checkout from svn.
  • Configure via
CXXFLAGS=-I/usr/local/include ./configure --disable-pic14-port --disable-pic16-port
This will complain about any missing dependencies. If that happens, install the dependency, and try configure again. The CXXFLAGS is necessary to find the boost headers, since /usr/local/include is not in the default include path for OpenBSD. The dependencies of the pic ports are hard to satisfy on OpenBSD; the easiest way aroaund is to just disable building of those ports.
  • Build via
MAKE=gmake gmake
gmake is not part of the default install and might have to be installed first. We need it since SDCC won't build with the OpenBSD make.

Using SDCC

SDCC uses more stack space than typical applications, and OpenBSD has a lower stack size limit than typical operating systems. The limit can be increased e.g. via

ulimit -s 32768
⚠️ **GitHub.com Fallback** ⚠️