Skip to content

Implement a FreeBSD syscall layer #16590

Open
@andrewrk

Description

@andrewrk

source: https://lobste.rs/s/yjd59n/crt_free_2023_tips_tricks#c_viakfm

The task is to change this to false for FreeBSD:

zig/lib/std/target.zig

Lines 398 to 413 in 282cb5e

/// On Darwin, we always link libSystem which contains libc.
/// Similarly on FreeBSD and NetBSD we always link system libc
/// since this is the stable syscall interface.
pub fn requiresLibC(os: Os) bool {
return switch (os.tag) {
.freebsd,
.netbsd,
.macos,
.ios,
.tvos,
.watchos,
.dragonfly,
.openbsd,
.haiku,
.solaris,
=> true,

And then go implement syscalls in the standard library via inline assembly like we already do for Linux rather than relying on libc for this target.

This is great news, hurray! We no longer need to build libc in order to cross-compile zig code for this target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.os-freebsdstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions