Bug 46159 - Building mono with --disable-static --disable-system-aot fails
Summary: Building mono with --disable-static --disable-system-aot fails
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-10-28 17:35 UTC by blog
Modified: 2016-10-28 19:09 UTC (History)
4 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 46159 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 blog 2016-10-28 17:35:49 UTC
I'm currently about to prepare an update of the mono runtime for Void Linux (voidlinux.eu). The mono package is built from this package template:


I believe the most relevant information there is that it is configured with "--disable-static --disable-system-aot", the rest of the configure options are generic and automatically create by the build system. After configure is run, mono should compile with sgen and boehm. However the build fails with the following error message:

/builddir/mono-4.6.1/mono/mini/main.c:174: undefined reference to `mono_build_date'
collect2: error: ld returned 1 exit status

I looked a bit through the code and found that the pointer is declared in mini.h (which is included in main.c) but not defined in main.c. The only other place this pointer is used is in mini-runtime.c but it is correctly defined there.

If found two ways to work around this issue: Either define the pointer properly or remove it/comment it out. Since it is not initialized anywhere else, removing it entirely is probably the worse way to deal with it. If I understand it correctly, initialization cannot happen in mini-runtime.c because it doesn't include the buildver header file. So my best guess is that the proper solution would be defining the pointer in main.c before initializing it.

In the case that matters: It all happens with gcc 4.9.4 in this case.
Comment 1 Zoltan Varga 2016-10-28 19:09:20 UTC
--disable-static is not frequently used and is prone to break. Its better to avoid it.