Menu

PortingNotes

Joseph Koshy

Porting Notes

This wiki page documents various issues encountered while keeping our code base portable.

bsd.inc.mk

This make ruleset handles include files. It is not present in all the operating systems we are interested in.

We use a wrapper trunk/mk/elftoolchain.inc.mk, to work around these differences.

Char Signedness

  • 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.

isdigit(3)

  • 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().

mktemp(1)

mmap(2)

  • 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].

strmode(3)

  • 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.

Yacc

  • 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 [r999] for the current solution to this issue.

Related

Commit: [r1124]
Commit: [r999]
Tickets: #265
Tickets: #366
Wiki: BuildAutomation
Wiki: BuildingFromSource
Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.