Bug 59128 - dllmap entries in dll.config in payload attached at end of main is not processed.
Summary: dllmap entries in dll.config in payload attached at end of main is not proce...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Interop (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-30 21:54 UTC by Hin-Tak Leung
Modified: 2017-09-16 00:47 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Hin-Tak Leung 2017-08-30 21:54:21 UTC
I am experimenting with the --simple option of mkbundle (which attaches everything to the end of the main mono executable, introduced recently). One of my dll.config has this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<dllmap dll="freetype6">
		<dllentry os="linux" dll="libfreetype.so.6" />
		<dllentry os="osx" dll="libfreetype.6.dylib" />
		<dllentry os="freebsd" target="libfreetype.so.6" />
	</dllmap>
</configuration>


When I ran MONO_LOG_MASK=dll MONO_LOG_LEVEL=debug, I found that mono never looks for the so.6 entry, i.e. the dllmap is simply ignored.
This is first seen on Mac OS X but I replicated the problem on linux too.

I can work around this problem by doing "--library freetype6,..." directly on the mkbundle invocation, but it seems quite confusing when the mkbundle --simple option is embedding the config but ignoring it (instead of simply not embedding).

This is mono 4.8.0 - I see there are some further changes after, so apologies if this is fixed in later releases.

Although this mostly concerns new functionality in mkbundle and how it should work in the runtime, the relevant code for registering and and lookup native library is part of the run time and is in mono/mini/main.c ( https://github.com/mono/mono/commit/2f1e6655e2c9a9dd28c0a8b14f26d3d6b1c720bd )
Comment 1 Ludovic Henry 2017-09-16 00:47:06 UTC
Alexander, this seems related to mkbundle, could you please take a look? Thank you.

Note You need to log in before you can comment on or make changes to this bug.