Open gavv opened 4 years ago
I've been able to compile and test the devel branch in a FreeNAS jail (11.5, FreeBSD 11.3-RELEASE-p6), although there were a few issues. After building, I was able to successfully roc-send a wav file from the FreeNAS to a remote linux host. Did have to pull in sox from the FreeBSD Ports tree to send a wave file, as sox is not in the main package repo.
IN_MULTICAST
and MSG_DONTWAIT
requires __BSD_VISIBLE
to be defined, M_PI
requires __BSD_VISIBLE
or __XSI_VISIBLE
, and struct sigaction
and related requires _POSIX_SOURCE
, __POSIX_VISIBLE
, and __XSI_VISIBLE
. There's probably some meta-flag that can be defined to set these correctly for the entire build, will see if I can find out what that might be.Edit: the defines issue is related to _POSIX_C_SOURCE
: like with darwin, it appears that macro should not be defined for FreeBSD.
@jdeblese Great news! May I ask if you consider sending a patch? Right now I don't have a bsd machine at hand, so I kind of don't like to apply the changes blindly without being able to test them. But thanks for sharing anyway.
The SConstruct struggled to find the correct toolchain to build with
Would be awesome if you could provide exact error messages or maybe even debug it a bit.
Yes, I'll submit a PR to develop. Happy to experiment a bit more as well, and I may get a RPi set up with NetBSD or OpenBSD and test out compiling on there as well.
Re: scons, the exact error is problem detecting AR: found '/usr/local/bin/llvm-ar', which reports version 9.0.1, but expected version 8.0.0
, which I fixed by replacing meta.compiler_ver
with (9,0,1)
at around line 525 in the calls to FindTool. Building in a new, clean jail had no such issue, so it is something specific to the jail that I first tried it in. I'm not familiar with FindTool, however, so I'm not sure I can debug that any further.
Fresh master has some related changes in build system:
unix
platform, used when we're building for *nix that is not linux and darwincc
compiler, used when we're building for *nix and the compiler is not gcc and clang
Last revised: Oct 2023
Add support for FreeBSD and probably other BSDs.
Some preliminary work is already done: #284 (see discussion).
In
SConstruct
, we already have genericunix
platform (automatically used on non-linux and non-darwin posix) and genericcc
compiler (to be used with POSIX-compatible C compilers other than gcc and clang). When these platform and compiler are used, no linux- or gcc/clang-specific code or options are used. However, so far they were actually tested only on Linux.First we should try to build Roc on FreeBSD using
unix
--platfrom andgcc
orclang
--compiler. If it doesn't work out of the box, we should fix the issues by either editing the portable part of the code (e.g. in under target_posix directory) or creating new OS-specific target directories if necessary. See #292 for details on the porting process and this page for details on target directories.We should also try to add FreeBSD to CI. Ideally, using qemu. If it wont work well, we can try to cross-compile to freebsd from Linux without running tests.
We should also update docs: