Bug 33085 - Mkbundle broken in OSX mono 4.0
Summary: Mkbundle broken in OSX mono 4.0
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: mkbundle ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-08-13 23:44 UTC by Rodrigo Kumpera
Modified: 2017-08-31 14:50 UTC (History)
3 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 33085 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Rodrigo Kumpera 2015-08-13 23:44:05 UTC
The Mkbundle we ship on OSX is completely broken. We should fix it.


-4.0 is 32bits only and both CC/AS default to 64bits, which means it will fail to link the result
-mkbundle should provide a default PKG_CONFIG_PATH if not set, otherwise compilation fails due not finding some of mono headers
-Our mono-2.pc file doesn't include -framework CoreFoundation -framework Foundation which produces a broken runtime.

Which all the above fixed, mkbundle works in dynamic mode.

Then I tried mkbundle --static and it failed because we hacked our way around some problems around the lib of iconv on eglib.
It's missing "-Wl,-undefined -Wl,suppress -Wl,-flat_namespace" to work.

I managed to make it work with this hack (it's a >HACK<, don't apply it):

The invoked it like this:
PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/  mono ~/src/mono/mcs/class/lib/net_4_x/mkbundle.exe --deps hello.exe