Skip to content

add NetBSD libc as a cross compilation target #2877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #1002
andrewrk opened this issue Jul 12, 2019 · 3 comments
Closed
Tracked by #1002

add NetBSD libc as a cross compilation target #2877

andrewrk opened this issue Jul 12, 2019 · 3 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. libc Issues related to libzigc and Zig's vendored libc code. os-netbsd
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Jul 12, 2019

Extracted from #514.

This is needed for NetBSD 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 andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. os-netbsd labels Jul 12, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Jul 12, 2019
@daurnimator
Copy link
Contributor

@cryo

@nikkicoon
Copy link
Contributor

nikkicoon commented Mar 31, 2023

I'm interested in picking this up, but will have some questions in the future.
For now: The glibc example uses tools/process_headers.zig, would a requirement for this include adding netbsd to this file as well?

@alexrp alexrp self-assigned this Apr 6, 2025
@alexrp alexrp added the libc Issues related to libzigc and Zig's vendored libc code. label Apr 11, 2025
@alexrp alexrp removed the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label May 14, 2025
@alexrp alexrp modified the milestones: 0.16.0, 0.15.0 May 14, 2025
alexrp added a commit to alexrp/zig that referenced this issue May 16, 2025
…aries.

Only works for NetBSD 10.1+. Note that we still default to targeting NetBSD 9.

Contributes to ziglang#2877.
alexrp added a commit to alexrp/zig that referenced this issue May 17, 2025
…aries.

Only works for NetBSD 10.1+. Note that we still default to targeting NetBSD 9.

Contributes to ziglang#2877.
alexrp added a commit to alexrp/zig that referenced this issue May 17, 2025
…aries.

Only works for NetBSD 10.1+. Note that we still default to targeting NetBSD 9.

Contributes to ziglang#2877.
@alexrp
Copy link
Member

alexrp commented May 20, 2025

We've decided that we're not going to support upstream static libc for the BSDs for two reasons:

  • It's a significant amount of C code we'd have to import (~17M for NetBSD).
  • BSD libcs are developed alongside the kernel, meaning whenever we import libc code, it's likely to contain subtle dependencies on the kernel from that same OS version. This makes static libc a strictly worse option for cross-compilation on BSDs.

Therefore, this issue is done as of #23913.

We're still open to exploring static libc for the BSDs, but it'll have to be by way of libzigc, i.e. #2879.

@alexrp alexrp closed this as completed May 20, 2025
@alexrp alexrp removed their assignment May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. libc Issues related to libzigc and Zig's vendored libc code. os-netbsd
Projects
None yet
Development

No branches or pull requests

4 participants