Skip to content

MonoVM: add back dllmap support for macOS #43204

@rolfbjarne

Description

@rolfbjarne

Description

dllmap support is enabled for iOS (Xamarin.iOS) targets:

runtime/src/mono/configure.ac

Lines 1420 to 1422 in c5b6881

if test "x$enable_monodroid" = "xno" -a "x$enable_monotouch" = "xno"; then
mono_feature_disable_dllmap='yes' # FIXME: the mobile products use this
fi

this is needed for macOS (Xamarin.Mac) as well, because we use it for the exact same purpose (redirect calls to objc_msgSend to our own implementations).

Example disassembly that shows that it's disabled (calls to mono_dll_insert asserts) on macOS:

$ otool -vVt -p _mono_dllmap_insert ./microsoft.netcore.app.runtime.ios-x64/5.0.0-rc.2.20475.5/runtimes/ios-x64/native/libmonosgen-2.0.dylib
./microsoft.netcore.app.runtime.ios-x64/5.0.0-rc.2.20475.5/runtimes/ios-x64/native/libmonosgen-2.0.dylib:
(__TEXT,__text) section
_mono_dllmap_insert:
00000000001cdda2	pushq	%rbp
00000000001cdda3	movq	%rsp, %rbp
00000000001cdda6	popq	%rbp
00000000001cdda7	jmp	_mono_dllmap_insert_internal
$ otool -vVt -p _mono_dllmap_insert ./microsoft.netcore.app.runtime.mono.osx-x64/5.0.0-rc.2.20475.5/runtimes/osx-x64/native/libcoreclr.dylib
./microsoft.netcore.app.runtime.mono.osx-x64/5.0.0-rc.2.20475.5/runtimes/osx-x64/native/libcoreclr.dylib:
(__TEXT,__text) section
_mono_dllmap_insert:
000000000022d430	pushq	%rbp
000000000022d431	movq	%rsp, %rbp
000000000022d434	leaq	0x103e97(%rip), %rdi ## literal pool for: "/Users/runner/work/1/s/src/mono/mono/metadata/native-library.c"
000000000022d43b	movl	$0x112, %esi
000000000022d440	callq	_mono_assertion_message_unreachable
000000000022d445	nopw	%cs:(%rax,%rax)
000000000022d44f	nop

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions