Skip to content

Add OpenBSD support for ICU library loading#129124

Open
am11 wants to merge 3 commits into
dotnet:mainfrom
am11:feature/port/openbsd-libs-loading
Open

Add OpenBSD support for ICU library loading#129124
am11 wants to merge 3 commits into
dotnet:mainfrom
am11:feature/port/openbsd-libs-loading

Conversation

@am11
Copy link
Copy Markdown
Member

@am11 am11 commented Jun 8, 2026

OpenBSD uses ABI versioning in SONAME rather than ICU version numbering. Use unversioned dlopen calls and probe symbol versioning instead of attempting to load versioned library names.

Contributes to #124911.

OpenBSD uses ABI versioning in SONAME rather than ICU version numbering.
Use unversioned dlopen calls and probe symbol versioning instead of
attempting to load versioned library names.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 8, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

.
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
@am11 am11 added the os-openbsd OpenBSD OS, currently not officially supported label Jun 8, 2026
@am11
Copy link
Copy Markdown
Member Author

am11 commented Jun 8, 2026

Hello world was working with the override:

am11@foo:~$ DOTNET_ICU_VERSION_OVERRIDE=22 th/artifacts/bin/testhost/net11.0-openbsd-Debug-x64/dotnet exec ~/projects/hw1/hw1/bin/Debug/net11.0/hw1.dll

Hello, World!
Environment.Version: 11.0.0
RuntimeInformation.OSDescription: OpenBSD 7.8 GENERIC.MP#54

This makes it work without.

@tarekgh
Copy link
Copy Markdown
Member

tarekgh commented Jun 8, 2026

Two important caveats this PR introduces

  1. The manually installed ICU must be built --disable-renaming. The OpenBSD path calls FindSymbolVersion(-1, -1, -1, ...), which only matches the unversioned u_strlen. If you drop in a stock upstream ICU build (renaming enabled → u_strlen_78), dlopen succeeds but symbol resolution returns false and ICU fails to load. So a "more recent ICU" has to be packaged the OpenBSD way (unversioned symbols), not a vanilla ./configure && make build.

  2. DOTNET_ICU_VERSION_OVERRIDE no longer works on OpenBSD after this PR. This is the subtle one. FindLibUsingOverride (which reads DOTNET_ICU_VERSION_OVERRIDE) lives only in the #else generic-Unix branch (lines 332-432). The new OpenBSD #elif branch never calls it. Pre-PR, OpenBSD fell through to #else, which is exactly why the author's DOTNET_ICU_VERSION_OVERRIDE=22 workaround worked. Post-PR, that env var is silently ignored on OpenBSD. So the one knob that let you force a particular major version on the Linux path is gone for OpenBSD — you'd have to use LD_LIBRARY_PATH or app-local ICU instead.

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

Labels

area-System.Globalization 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