Skip to content

Fix libs.native subset on OpenBSD#125562

Open
am11 wants to merge 16 commits intodotnet:mainfrom
am11:patch-48
Open

Fix libs.native subset on OpenBSD#125562
am11 wants to merge 16 commits intodotnet:mainfrom
am11:patch-48

Conversation

@am11
Copy link
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
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
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
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
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
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! :)

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.

2 participants