123elf icon indicating copy to clipboard operation
123elf copied to clipboard

Port to FreeBSD

Open vrza opened this issue 2 years ago • 5 comments

  • Ported to FreeBSD
  • Makefile now compatible with both GNU make and BSD make

Caveat: needs GNU binutils 2.38 which is not yet in the FreeBSD ports tree, and binutils.sh will not compile it cleanly as configuration fails to include headers /usr/local/include. Did not want to go down this rabbit hole for now, as perhaps arrival of binutils 2.38 in FreeBSD ports will solve it.

Closes https://github.com/taviso/123elf/issues/81

vrza avatar Jun 08 '22 10:06 vrza

Thanks so much for working on this - I think we can merge most of this!

I think must be alloca() defined somewhere, and if not we can just use #define alloca __builtin_alloca, but we can't just s/alloca/malloc/, because it will leak memory.

taviso avatar Jun 10 '22 14:06 taviso

@taviso Yeah, good catch. While BSD does not have strndupa(3), it does have plain alloca(3), but it's declared in stdlib.h rather than alloca.h. Fixed.

vrza avatar Jun 10 '22 17:06 vrza

Sorry for the slow response here - I've been working on tests and the showme bug! Now that I have some tests I'm less worried about big changes.

taviso avatar Jun 15 '22 05:06 taviso

Great, having a regression test suite is super helpful.

Perhaps setting up an automated CI workflow is in order.

Not sure about a cheap way to run CI for FreeBSD, OpenBSD, Solaris etc. GitHub Actions is free (as in beer), integrates with the GitHub workflow out of the box, and supports Linux and MacOS runners out of the box, so might be a decent starting point. Maybe there's a way to spin up VMs in their CI runner hosts.

The regression test suite should be portable as well.

vrza avatar Jun 15 '22 09:06 vrza

Not sure about a cheap way to run CI for FreeBSD, OpenBSD, Solaris etc.

FreeBSD CI can be done via Cirrus-CI, although that still leaves the others.

emaste avatar Sep 06 '22 15:09 emaste