Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
fix - Fixed dlsym issues on Linux
Browse files Browse the repository at this point in the history
---

We've fixed dlsym issues on Linux systems.

---

Type: fix
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jul 26, 2024
1 parent 8b1ca44 commit 84af1d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion NativeLand/LibraryItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ internal IntPtr LoadSymbol(string symbolName)
if (PlatformHelper.IsRunningFromMono())
result = Mono.dlsym(file.handle, symbolName);
else
result = Linux.dlsym(file.handle, symbolName);
{
try
{
result = Linux.dlsym(file.handle, symbolName);
}
catch
{
result = Linux.dlsym_new(file.handle, symbolName);
}
}
found = result != IntPtr.Zero;
}
else
Expand Down
2 changes: 1 addition & 1 deletion TestProcess/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static int CanLoadLibraryAndCallFunction()
new LibraryItem(Platform.Linux, Architecture.X64,
new LibraryFile(tempDir + @"/libTestLib.so")),
new LibraryItem(Platform.Linux, Architecture.Arm64,
new LibraryFile(tempDir + @"/libTestLib.so")));
new LibraryFile(tempDir + @"/libTestLib_Arm64.so")));

// Load the library
libManager.LoadNativeLibrary();
Expand Down

0 comments on commit 84af1d7

Please sign in to comment.