This wiki page documents various issues encountered while keeping our code base portable.
This make ruleset handles include files. It is not present in all the operating systems we are interested in.
- The file is named bsd.inc.mk in NetBSD and in the pmake package in Ubuntu GNU/Linux.
- FreeBSD and DragonFlyBSD have a related rule set called bsd.incs.mk which is not compatible with bsd.inc.mk.
- The rule set is missing entirely in OpenBSD.
We use a wrapper source:trunk/mk/elftoolchain.inc.mk, to work around these differences.
- NetBSD/i386 uses signed characters. FreeBSD and Ubuntu GNU/Linux use unsigned characters. Code needs to be written to explicitly mention the desired signedness of char sized values.
- On NetBSD 5, isdigit(3) is a macro that expands inline to an array access. The compiler will warn if a char sized quantity is passed in as a parameter to isdigit().
- On Ubuntu 10.04, mktemp has a bug (589408) that affects source:trunk/common/native-elf-format. Changeset  has a work-around.
- Some systems (such as Minix3, a BSD-licensed microkernel) do not implement the mmap() API. We fall back to a combination of read()/write() for this case. See: ticket #366.
- On NetBSD the prototype for this BSD function is present in <unistd.h>.
- FreeBSD places the prototype in <string.h>
Variances in ELF Types
- On 64-bit platforms, NetBSD 5 defines the Elf64_Half type as being 4 bytes wide. This is at variance with the ELF ABI definition for 64-bit platforms, and breaks assumptions in our libelf library about structure layout. On 64-bit platforms, NetBSD 5 defines a (non-standard) Elf64_Quarter type that is 2 bytes wide. Reducing our reliance on system headers (see #265) could be a possible solution to deal with such issues.
- NetBSD's default rules for handling YACC input uses the -o option. This causes the generated header file to have a different name than the standard "y.tab.h". See  for the current solution to this issue.