[Bug 281600] lang/rust failing to build on risc-v (again)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 19 Oct 2024 04:40:35 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281600

--- Comment #29 from dgilbert@eicat.ca ---
So the patch, to make this compile and work, is to put COMPAT_FREEBSD11 into
the kernel and recompile the kernel.  Then things work.

Now obviously, several people here understand, but just to be clear:

Languages like rust don't use libc (or use it sparingly).  In their own
equivalent of libc, they call syscalls _directly_.  Now, there do not exist
ports that sensibly depend on COMPAT_11 on risc-v for FreeBSD because 11 was
deprecated before FreeBSD ran on risc-v.  But, a language that doesn't use libc
and calls syscalls directly can be written to use the FreeBSD-11 set of
syscalls.

Technically the nirvana of shared libraries is the idea that a binary can
function without even knowing about syscalls --- as they're all provided for
the binary --- and provided in updated form such that the binary still runs. 
COMPAT and friends are needed, in those cases, when a statically linked binary
is in play --- as it might call old syscalls that no longer exist.

This is not the play here.  Think of rust as an entirely different and somewhat
incompatible way to generate those binaries, that, from the perview of the OS,
are in the same bin as statically linked.  We provide the userland shared
libraries --- this "upgrades" most things, but not, sadly, rust.

-- 
You are receiving this mail because:
You are on the CC list for the bug.