ziglang/zig

add OpenBSD libc as a cross compilation target

andrewrk opened this issue · 8 comments

Extracted from #514.

This is needed for OpenBSD to become a tier 1 target.

The example set by glibc can be followed.

See also this wiki page: https://github.com/ziglang/zig/wiki/Updating-libc

@andrewrk is that link broken? It leads to a "create new page" for me.

redj commented

Is this the right wiki page?
https://github.com/ziglang/zig/wiki/Updating-libc

same issue in : #2877 (NetBSD) and #2878 (OpenBSD)

I fixed the link in andrew's comment.

What should I do to add OpenBSD libc?
This project can fetch openbsd libc files.

@locriacyber, openbsd-ziglibc is getting real libc and headers files. I think what is expected here is to get only functions stubs.

not header files? openbsd use clang as the compiler and I think it has its own libc headers. Given how OpenBSD has no ABI guarantee, every version of OpenBSD has its own libc.a libc.so to link with.

to build C program (using zig compiler), you need both (libc stubs and header files). to build ZIG program (using zig compiler), you need only libc stubs (assuming no C dependency).

openbsd-ziglibc extracts the whole sets of C headers which are normally installed (~50 Mo for only one OS version and only one architecture).

(and not all architectures are using clang as compiler, but it is another discussion)

What do you mean by "libc stubs" in case of OpenBSD? The symbol table of libc?