Skip to content
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

Fix building on OpenBSD #11750

Merged
merged 2 commits into from
Oct 27, 2024
Merged

Fix building on OpenBSD #11750

merged 2 commits into from
Oct 27, 2024

Conversation

artemist
Copy link
Member

Motivation

This is part of the larger NixBSD project, attempting to build a NixOS-like system on *BSD. As part of this, we want Nix to run well on several different BSD variants.

Context

OpenBSD has some peculiarities around its dynamic linking. Shared libraries never link to libc directly, only the main executable does that. The libc symbols in shared libraries are left undefined until they are dealt with by the dynamic linker.

Therefore, adding -Wl,-z,defs will always fail and we must disable it in the Makefiles. There is no similar rule in the meson build system, from what I can tell.

Separately, GC fails to work due to a missing symbol _data_start symbol. I'm not sure why, but we might as well disable it until we can find a better workaround.

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

OpenBSD dynamic libraries never link to libc directly.
Instead, they have undefined symbols for all libc functions they use
that ld.so resolves to the libc referred to in the main executable.

Thus, disallowing undefined symbols will always fail
Nix fails to build on OpenBSD with a linking error due to a non-found
symbol in boehm-gc. Just disable the GC until we can find a proper
workaround.
@artemist
Copy link
Member Author

@Ericson2314 You may be interested in reviewing

@edolstra edolstra merged commit 059bdb5 into NixOS:master Oct 27, 2024
11 checks passed
@Ericson2314 Ericson2314 added the backport 2.24-maintenance Automatically creates a PR against the branch label Oct 28, 2024
Ericson2314 added a commit that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.24-maintenance Automatically creates a PR against the branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants