From 7de9c242381df28c455a90dfc8d183aacf5530aa Mon Sep 17 00:00:00 2001 From: dotnet-bot Date: Tue, 7 Nov 2017 17:07:42 -0800 Subject: Fix a CoreRT build failure due to System.Diagnostics.Process use The ProjectX stack trace work introduces a use of System.Diagnostics.Process which doesn't seem to be in the Nuget packages CoreRT references. The code is ProjectX specific so disabling that for CoreRT. [tfs-changeset: 1680495] --- .../src/Compiler/UtcStackTraceEmissionPolicy.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ILCompiler.Compiler/src/Compiler/UtcStackTraceEmissionPolicy.cs b/src/ILCompiler.Compiler/src/Compiler/UtcStackTraceEmissionPolicy.cs index 533759f15..1c44d690e 100644 --- a/src/ILCompiler.Compiler/src/Compiler/UtcStackTraceEmissionPolicy.cs +++ b/src/ILCompiler.Compiler/src/Compiler/UtcStackTraceEmissionPolicy.cs @@ -122,9 +122,14 @@ namespace ILCompiler /// string GetAppExeDirectory() { +#if !CORERT var process = Process.GetCurrentProcess(); string fullPath = process.MainModule.FileName; return Path.GetDirectoryName(fullPath); +#else + Debug.Assert(false); + return null; +#endif } /// @@ -132,6 +137,10 @@ namespace ILCompiler /// void LoadExceptionFile(string exceptionFileName) { +#if CORERT + Debug.Assert(false); + return; +#else if (!File.Exists(exceptionFileName)) return; @@ -183,6 +192,7 @@ namespace ILCompiler line = tr.ReadLine(); } } +#endif } } } -- cgit v1.2.3 From a0495d135109f4f6b60df64883fd1dffa747ae31 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Tue, 7 Nov 2017 18:19:24 -0800 Subject: Consider types marked as having strong metadata mappings as rooted [tfs-changeset: 1680506] --- src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs index f21cedb90..2191198f0 100644 --- a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs +++ b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs @@ -435,6 +435,12 @@ namespace ILCompiler { MetadataLoadedInfo loadedMetadata = _loadedMetadata.Value; + // Add all non-generic reflectable types as roots. + foreach (var type in loadedMetadata.TypesWithStrongMetadataMappings) + { + rootProvider.AddCompilationRoot(type, "Required non-generic type"); + } + // Add all non-generic reflectable methods as roots. // Virtual methods need special handling (e.g. with dependency tracking) since they can be abstract. foreach (var method in loadedMetadata.MethodMappings.Keys) -- cgit v1.2.3