Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.
authorlateralusX <lateralusx.github@gmail.com>
Mon, 31 Oct 2016 08:45:30 +0000 (09:45 +0100)
committerlateralusX <lateralusx.github@gmail.com>
Tue, 8 Nov 2016 12:09:00 +0000 (13:09 +0100)
commit8ec9b12e53e4c0f7ab3fde48ebadf20cdb4bff1b
tree884d38eebcf23c5f416e85cf5078791d55d989c7
parentb75ef2bf8505c8028c98a0ee9bb30abcabe52072
Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.

In order to reduce dependencies on external toolchains when doing full AOT on Windows
targeting x64 Windows platforms we would like to use what's available in
VS 2015 MSVC toolchain. Mono's full AOT compiler need an assembler and a linker from
available toolchain in order to do different full AOT scenarios, emitting assembler, compile
objects or link complete shared library.

Since the current emitter emits GNU assembler it is beneficial to reuse that assembler
syntax without the need to adopt to a different syntax. In VS2015 Update 1 a new toolchain
option has been released utilizing the Clang parser combined with MSVC code gen. This will
produce object files fully compatible with MSVC linker. It turns out that VS2015 Clang version
also supports GNU assembler and since Mono just uses simple constructs in the assembler
(all code is already compiled and emitted as byte streams in assembler) it is possible to use Clang
for VS to compile our emitted assembler files.

This PR switches to Clang for Microsoft VS2015 and MSVC linker when doing full AOT targeting Windows x64
platforms hosted on a Windows platform. It requires an installation of at least Microsoft VS2015 Update 1
with Clang component selected. NOTE all other scenarios is currently left as is.

This PR also makes adjustments to AOT compiler in order for above scenario to work, supporting asm only output, static output
and regular shared libraries using MSVC linker.
mono/mini/aot-compiler.c
mono/mini/image-writer.c
mono/utils/mono-threads.h