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 (backport #11750) #11762

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Oct 28, 2024

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.


This is an automatic backport of pull request #11750 done by [Mergify](https://mergify.com).

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

(cherry picked from commit c49bff2)
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.

(cherry picked from commit fecc1ca)
@mergify mergify bot requested a review from edolstra as a code owner October 28, 2024 10:27
@mergify mergify bot added the merge-queue label Oct 28, 2024
@Ericson2314 Ericson2314 merged commit 7e6e75f into 2.24-maintenance Oct 28, 2024
24 of 26 checks passed
@Ericson2314 Ericson2314 deleted the mergify/bp/2.24-maintenance/pr-11750 branch October 28, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants