Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -9,11 +9,24 @@ thisdir = class/aot-compiler
include ../../build/rules.make
the_libdir = $(topdir)/class/lib/$(PROFILE)/
CSC_DIR = $(dir $(CSC_LOCATION))
# The directory where the AOT images are stored
images_dir = $(the_libdir)
# mcs.exe is only in the build profile, but the aot image should be compiled against the current
# profile
mcs_exe = $(topdir)/class/lib/build/mcs.exe
mcs_exe = $(the_libdir)/mcs.exe
mcs_aot_image = $(the_libdir)/mcs.exe$(PLATFORM_AOT_SUFFIX)
csc_exe = $(CSC_LOCATION)
csc_aot_image = $(images_dir)/csc.exe$(PLATFORM_AOT_SUFFIX)
csc_MCS_dll = $(CSC_DIR)/Microsoft.CodeAnalysis.CSharp.dll
csc_MCS_image = $(images_dir)/Microsoft.CodeAnalysis.CSharp.dll$(PLATFORM_AOT_SUFFIX)
csc_MC_dll = $(CSC_DIR)/Microsoft.CodeAnalysis.dll
csc_MC_image = $(images_dir)/Microsoft.CodeAnalysis.dll$(PLATFORM_AOT_SUFFIX)
csc_SRM_dll = $(CSC_DIR)/System.Reflection.Metadata.dll
csc_SRM_image = $(images_dir)/System.Reflection.Metadata.dll$(PLATFORM_AOT_SUFFIX)
csc_SCI_dll = $(CSC_DIR)/System.Collections.Immutable.dll
csc_SCI_image = $(images_dir)/System.Collections.Immutable.dll$(PLATFORM_AOT_SUFFIX)
mscorlib_dll = $(the_libdir)/mscorlib.dll
mscorlib_aot_image = $(mscorlib_dll)$(PLATFORM_AOT_SUFFIX)
@@ -27,31 +40,68 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
ifndef SKIP_AOT
profile_file:=$(wildcard $(topdir)/class/lib/build/csc.*.aotprofile)
ifneq ($(profile_file),)
comma:=,
space:=
space+=
profile_arg:=$(subst $(space)$(comma),$(comma),$(foreach pf,$(profile_file),$(comma)profile=$(strip $(pf))))
endif
ifdef PLATFORM_AOT_SUFFIX
Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
$(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
$(csc_aot_image): $(csc_exe) $(mscorlib_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(csc_aot_image) --debug $(csc_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
$(mscorlib_aot_image): $(mscorlib_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version --debug $(mscorlib_dll) || (cat $(PROFILE)_aot.log; exit 1)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg) --debug $(mscorlib_dll) || (cat $(PROFILE)_aot.log; exit 1)
$(csc_MC_image): $(csc_MC_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(csc_MC_image) --debug $(csc_MC_dll) || (cat $(PROFILE)_aot.log; exit 1)
$(csc_MCS_image): $(csc_MCS_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(csc_MCS_image) --debug $(csc_MCS_dll) || (cat $(PROFILE)_aot.log; exit 1)
$(csc_SRM_image): $(csc_SRM_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(csc_SRM_image) --debug $(csc_SRM_dll) || (cat $(PROFILE)_aot.log; exit 1)
$(csc_SCI_image): $(csc_SCI_dll) $(runtime_dep)
$(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version$(profile_arg),outfile=$(csc_SCI_image) --debug $(csc_SCI_dll) || (cat $(PROFILE)_aot.log; exit 1)
ifdef ENABLE_AOT
clean-local:
-rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log
CSC_IMAGES = $(csc_aot_image) $(csc_SRM_image) $(csc_SCI_image) $(csc_MC_image) $(csc_MCS_image)
# AOT build profile mcs to speed up build
clean-local:
-rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(CSC_IMAGES) $(PROFILE)_aot.log
# AOT build profile to speed up build
ifeq ($(PROFILE),build)
all-local: $(mscorlib_aot_image) $(mcs_aot_image)
IMAGES = $(mscorlib_aot_image)
ifdef MCS_MODE
IMAGES += $(mcs_aot_image)
else
IMAGES += $(CSC_IMAGES)
endif
all-local: $(IMAGES)
install-local:
endif
ifeq ($(PROFILE), $(DEFAULT_PROFILE))
all-local: $(mscorlib_aot_image) $(mcs_aot_image)
IMAGES = $(mscorlib_aot_image) $(mcs_aot_image) $(CSC_IMAGES)
all-local: $(IMAGES)
install-local:
$(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
$(INSTALL_LIB) $(mscorlib_aot_image) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
$(INSTALL_LIB) $(mcs_aot_image) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(INSTALL_LIB) $(IMAGES) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
endif
endif