Skip to content

Fix libs.native subset on OpenBSD#125562

Merged
jkoritzinsky merged 16 commits intodotnet:mainfrom
am11:patch-48
Mar 16, 2026
Merged

Fix libs.native subset on OpenBSD#125562
jkoritzinsky merged 16 commits intodotnet:mainfrom
am11:patch-48

Conversation

@am11
Copy link
Copy Markdown
Member

@am11 am11 commented Mar 14, 2026

With this patch and #125294, src/native/libs/build-native.sh -cross -os openbsd -a x64 succeeds with rootfs.

Contributes to #124911.

cc @sethjackson

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 14, 2026
@am11 am11 added the os-openbsd OpenBSD OS, currently not officially supported label Mar 14, 2026
@sethjackson
Copy link
Copy Markdown
Contributor

Nice! @am11 see #125294 where I fix some of the HAVE_XXX things. OpenBSD has a non legacy statfs impl but CMake is being weird and not detecting it and I haven’t figured it out yet.

@am11
Copy link
Copy Markdown
Member Author

am11 commented Mar 14, 2026

@sethjackson, updated so we don't have to branch on TARGET_OPENBSD but rather rely on HAVE_xx introspection. Continues to cross-build cleanly.

@am11 am11 requested a review from jkoritzinsky March 15, 2026 00:07
@sethjackson
Copy link
Copy Markdown
Contributor

sethjackson commented Mar 15, 2026

This gets me through libs.native too except for pal_memory.c as I haven't figured out how to fix it in #125010 yet.
And if I pull that in to just "make it build" I get this link error:
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_post_threaded'; recompile with -fPIC

@am11
Copy link
Copy Markdown
Member Author

am11 commented Mar 15, 2026

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_post_threaded'; recompile with -fPIC

Could you show the surrounding context of this error? Also, have you tried recreating crossrootfs with changes in #125557 to see if it helps?

@sethjackson
Copy link
Copy Markdown
Contributor

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_post_threaded'; recompile with -fPIC

Could you show the surrounding context of this error? Also, have you tried recreating crossrootfs with changes in #125557 to see if it helps?

I forgot about crossrootfs changes. Rebuilding with those changes seems to have fixed this. Sorry about that and thanks for the reminder! :)

@jkoritzinsky
Copy link
Copy Markdown
Member

/ba-g ios failures unrelated to openbsd infra changes

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) March 16, 2026 20:10
@jkoritzinsky jkoritzinsky merged commit e2f9257 into dotnet:main Mar 16, 2026
164 of 173 checks passed
@am11 am11 deleted the patch-48 branch March 16, 2026 21:06
jkotas pushed a commit that referenced this pull request Apr 4, 2026
OpenBSD does not support cgroups.

Fix `HAVE_NON_LEGACY_STATFS` while here. See #125562 where this was done
for `libs.native`.

Contributes to #124911.
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Apr 9, 2026
OpenBSD does not support cgroups.

Fix `HAVE_NON_LEGACY_STATFS` while here. See dotnet#125562 where this was done
for `libs.native`.

Contributes to dotnet#124911.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr community-contribution Indicates that the PR has been added by a community member os-openbsd OpenBSD OS, currently not officially supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants