Include DragonFlyBSD in library loading fallback paths#1727
Merged
dbwiddis merged 1 commit intoMay 27, 2026
Merged
Conversation
11d5ced to
85b7567
Compare
DragonFlyBSD platform support was added in java-native-access#1593 but the NativeLibrary fallback paths for versioned .so resolution, libc special-case loading, and 64-bit library search paths were not updated to include it. This causes NoClassDefFoundError when loading libc on DragonFlyBSD because the matchLibrary() fallback and the mapSharedLibraryName() handling only trigger for Linux and FreeBSD.
85b7567 to
08628c0
Compare
matthiasblaesing
approved these changes
May 26, 2026
Member
matthiasblaesing
left a comment
There was a problem hiding this comment.
Makes sense to me. Thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DragonFlyBSD platform support was added in #1593 but
NativeLibrarywas not updated to include DragonFlyBSD in the fallback paths that FreeBSD already uses.Problem
When loading
libc(or any library by short name) on DragonFlyBSD, the following fails withUnsatisfiedLinkError/NoClassDefFoundError:.sofallback (matchLibrary()) only triggers for Linux and FreeBSDmapSharedLibraryName()handling for.sofiles only covers Linux and FreeBSDFix
Add
Platform.isDragonFlyBSD()to all four locations inNativeLibrary.javawherePlatform.isFreeBSD()is checked. DragonFlyBSD is a FreeBSD derivative and uses the same library naming conventions.Testing
Discovered while porting OSHI to DragonFlyBSD. Verified that the workaround (using
"c"instead of"libc") resolves the loading issue, confirming the root cause is in these fallback paths.