Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to FreeBSD #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Port to FreeBSD #28

wants to merge 2 commits into from

Conversation

Low-power
Copy link

Tested with FreeBSD 10 and 11.

Includes pull request #25 for correct building for FreeBSD i386.

Major changes/fixes:

  • FreeBSD have their own runetype.h, renamed Darwin-specific runetype.h to mac-runetype.h just like mac-ctype.h, alone with associated identifiers, to avoid conflicts.
  • Neither FreeBSD kernel nor C library provide *stat64, *statfs64 and fseeko64, avoid using them in such case.
  • Implements getting executable file path using sysctl(3), in addition to the Linux-specific /proc/self/exe.
  • Handles some differences in pthread-related macros between GNU and FreeBSD.
  • qsort_r(3) has different prototype between GNU and FreeBSD, handled it accordingly.
  • Function MachOLoader::loadSegments(const MachO &, intptr *, intptr *) contains a bug where it calls mmap(2) with MAP_ANON but 0 as fd, this is invalid, as kindly pointed out by FreeBSD kernel by a EINVAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants