Re: LLVM-libc FreeBSD Port

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <[email protected]>
On Mon, May 11, 2026 at 02:16:22AM +0000, Schrodinger ZHU Yifan wrote:
> The existing PR was really just a PoC. 
> 
> As for syscall stubs, it depends on the recommended method from the Oses. I can
> try to come up with a libsys version if that is the suggested way to do it.
> 
> On Linux, we also have a separated syscall_wrapper module; but that is more like
> a header library.
> 

Our libsys is practically the internal library.  We do not advertise it
as a library for user consumptions, it is currently strictly for libc and
libthr.  In particular, the ABI of libsys might change.

If you need the syscall stubs, link them through libc. If not, use
direct invocation of the SYSCALL instruction, as you currently do.

> Yifan
> 
> 
> 
> Schrodinger ZHU Yifan, Ph.D. Student
> Computer Science Department, University of Rochester
> 
> Personal Email: [email protected]
> Work Email: [email protected]
> Website: https://www.cs.rochester.edu/~yzhu104/Main.html
> Github: SchrodingerZhu
> GPG Fingerprint: BA02CBEB8CB5D8181E9368304D2CC545A78DBCC3
> 
> 
> Sent from Proton Mail for iOS.
> 
> 
> -------- Original Message --------
> On Sunday, 05/10/26 at 21:35 Minsoo Choo <[email protected]> wrote:
> 
> > On Sunday, May 10th, 2026 at 3:37 PM, Schrodinger ZHU Yifan <[email protected]>
> > wrote:
> > 
> > > Hi all,
> > > 
> > > I am one of the maintainers of LLVM libc, mainly responsible for its
> > > threading support, and I currently daily drive FreeBSD.
> > > 
> > > LLVM libc is a from-scratch implementation of the C standard library
> > > developed as part of the LLVM project. It is designed to be modular, so
> > > individual components can be used independently; multiplatform, targeting
> > > Linux, GPUs, bare-metal embedded systems, UEFI, macOS, Windows, and more;
> > > and written in modern C++ with a focus on correctness, performance, and
> > > safety. See also https://libc.llvm.org/ .
> > > 
> > > We recently had a casual discussion on our Discord about bringing up FreeBSD
> > > support. This would be an interesting step toward broadening LLVM libc’s
> > > perspective from Linux-only to more general *nix portability, which should
> > > also help improve its overall structure. The initial bring-up was fairly
> > > straightforward (the PR is a bit outdated but can be fixed without much
> > > effort): https://github.com/llvm/llvm-project/pull/124459. This already
> > > delivers LLVM libc’s correctly rounded math and mathvec support to FreeBSD.
> > > 
> > > However, moving toward completeness will require more work. We would also
> > > need CI pipelines and stable maintainers before FreeBSD could be added to
> > > the list of supported platforms.
> > > 
> > > Personally, I think bringing a modular libc design with modern features that
> > > continue to evolve rapidly would also be a plus for the FreeBSD community,
> > > especially given FreeBSD’s close relationship with LLVM. If anyone is
> > > interested, please feel free to ping me at i [at] zhuyi [dot] fan.
> > > 
> > > By the way, the Discord link on your website appears to be broken.
> > > 
> > > Best,
> > > Yifan
> > > 
> > > 
> > > Schrodinger ZHU Yifan, Ph.D. Student
> > > Computer Science Department, University of Rochester
> > > 
> > > Personal Email: [email protected]
> > > Work Email: [email protected]
> > > Github: SchrodingerZhu
> > 
> > Hi Schrodinger,
> > 
> > Glad to hear that you are working on this project. I'm working on LLDB for
> > FreeBSD, so feel free to reach me out if you have any questions on FreeBSD.
> > 
> > So I want to clarify here: LLVM's libc has its own header and implementation,
> > so it is possible to compile FreeBSD libc on other OSes, right? This also
> > means llvm's libc doesn't use our libsys library but has its own syscall
> > assemblies, which I see from your GitHub PR.
> > 
> > --
> > Minsoo Choo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.