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 (show other bugs)
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)

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


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.

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