Skip to content

add FreeBSD libc as a cross compilation target #2876

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 · 2 comments
Closed
Tracked by #1002

add FreeBSD libc as a cross compilation target #2876

andrewrk opened this issue Jul 12, 2019 · 2 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-freebsd
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Jul 12, 2019

Extracted from #514.

This is needed for FreeBSD to become a tier 1 target (#1759)

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-freebsd labels Jul 12, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Jul 12, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Feb 10, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 14, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@alexrp alexrp self-assigned this Apr 6, 2025
@alexrp alexrp modified the milestones: 0.16.0, 0.15.0 Apr 11, 2025
@alexrp alexrp added the libc Issues related to libzigc and Zig's vendored libc code. label Apr 11, 2025
alexrp added a commit to alexrp/zig that referenced this issue May 8, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 8, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 8, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 8, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 9, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 9, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 9, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 10, 2025
Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
alexrp added a commit to alexrp/zig that referenced this issue May 10, 2025
…raries.

Only works for FreeBSD 14+. Note that we still default to targeting FreeBSD 13.

Contributes to ziglang#2876.
@alexrp
Copy link
Member

alexrp commented May 12, 2025

This is supported as of #23835.

I'll leave this issue open for tracking support for linking FreeBSD libc statically.

@alexrp alexrp removed the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label May 14, 2025
@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 (~13M for FreeBSD).
  • 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 #23835.

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-freebsd
Projects
None yet
Development

No branches or pull requests

2 participants