Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[embedding] MonoVM SONAME doesn't match file name in runtime packs #49661

Open
lambdageek opened this issue Mar 15, 2021 · 7 comments
Open

[embedding] MonoVM SONAME doesn't match file name in runtime packs #49661

lambdageek opened this issue Mar 15, 2021 · 7 comments

Comments

@lambdageek
Copy link
Member

lambdageek commented Mar 15, 2021

We compile mono as libmonosgen-2.0.so and then rename it to libcoreclr.so in the runtime pack (microsoft.netcore.app.runtime.mono.linux-x64/6.0.0-preview.2.21154.6/runtimes/linux-x64/native/libcoreclr.so).

This means we end up in a situation where linking with "-lcoreclr" works ok:

$ clang -std=c99 -g -o ../../out/native/main main.c -DCORELIB_FULL_PATH=\"/home/parallels/work/monovm-embed-sample/out/native/System.Private.CoreLib.dll\" -L/home/parallels/.nuget/packages/microsoft.netcore.app.runtime.mono.linux-x64/6.0.0-preview.2.21154.6/runtimes/linux-x64/native -lcoreclr -I../../out/native/generated -I../../vendor/mono-headers/include/mono-2.0

but at runtime we get:

$ make run
out/native/main: error while loading shared libraries: libmonosgen-2.0.so: cannot open shared object file: No such file or directory
$ ldd out/native/main 
	linux-vdso.so.1 (0x00007ffd891fc000)
	libmonosgen-2.0.so => not found
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb250845000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb250a4a000)

Even if we do #34202 (stop using "coreclr" for the monovm name), we should verify that the runtime has the correct SONAME set.

Part of #47763

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 15, 2021
@lambdageek lambdageek added area-Build-mono and removed untriaged New issue has not been triaged by the area owner labels Mar 15, 2021
@lambdageek
Copy link
Member Author

Updated my embedding sample to work around this issue using patchelf

@steveisok steveisok added this to the 6.0.0 milestone Jun 28, 2021
@steveisok
Copy link
Member

@lambdageek I'm assuming this is for 6.0. If not, please adjust accordingly.

@lambdageek
Copy link
Member Author

I think this is post-.net6 work since our mobile scenarios don't use the libcoreclr name.

@akoeplinger
Copy link
Member

Duplicate of #34202

@akoeplinger akoeplinger marked this as a duplicate of #34202 Jul 9, 2021
@lambdageek
Copy link
Member Author

It's not a duplicate. I'm not asking to rename the shared library (although that is also an acceptable fix). I'm asking to update the mono/mini/CMakeLists.txt to use whatever name we configure when it calls the linker instead of copying it to the final name as a post-build step in mono.proj

@lambdageek lambdageek reopened this Jul 9, 2021
@akoeplinger
Copy link
Member

@lambdageek that'll be done as part of #34202 once we get rid of the need to rename to libcoreclr, then we can use the correct filename/SONAME.

@directhex directhex modified the milestones: 7.0.0, 8.0.0 Jul 21, 2022
@steveisok steveisok modified the milestones: 8.0.0, Future Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants