From: Fadi Hanna Date: Thu, 5 Dec 2019 17:27:12 +0000 (-0800) Subject: Two more fixes for crossgen2 (#538) X-Git-Tag: submit/tizen/20210909.063632~10797 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48c238734436ad63cfa97db3940cd3c4b1ad77fc;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Two more fixes for crossgen2 (#538) * Reference the test working directory when running crossgen2 * Fix GCRefMapBuilder to correctly detect if certain methods are "empty" and not crash --- diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs index 416016e..07dfd94 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs @@ -83,7 +83,7 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun for (int methodIndex = 0; methodIndex < _methods.Count; methodIndex++) { IMethodNode methodNode = _methods[methodIndex]; - if (methodNode == null || (methodNode is MethodWithGCInfo methodWithGCInfo && methodWithGCInfo.IsEmpty)) + if (methodNode == null || (methodNode is LocalMethodImport localMethod && localMethod.MethodCodeNode.IsEmpty)) { // Flush an empty GC ref map block to prevent // the indexed records from falling out of sync with methods diff --git a/src/coreclr/tests/src/CLRTest.CrossGen.targets b/src/coreclr/tests/src/CLRTest.CrossGen.targets index 097adb1..c074e68 100644 --- a/src/coreclr/tests/src/CLRTest.CrossGen.targets +++ b/src/coreclr/tests/src/CLRTest.CrossGen.targets @@ -69,7 +69,7 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then mkdir IL cp $(MSBuildProjectName).dll IL/$(MSBuildProjectName).dll mv $(MSBuildProjectName).dll $(MSBuildProjectName).org - __Command=$_DebuggerFullPath "$CORE_ROOT/crossgen2/crossgen2" -r:$CORE_ROOT/*.dll --targetarch=x64 -O --inputbubble -o:$(scriptPath)$(MSBuildProjectName).dll $(scriptPath)$(MSBuildProjectName).org + __Command=$_DebuggerFullPath "$CORE_ROOT/crossgen2/crossgen2" -r:$CORE_ROOT/*.dll -r:$PWD/*.dll --targetarch=x64 -O --inputbubble -o:$(scriptPath)$(MSBuildProjectName).dll $(scriptPath)$(MSBuildProjectName).org echo $__Command $__Command __cg2ExitCode=$? @@ -130,7 +130,7 @@ if defined RunCrossGen2 ( mkdir IL copy $(MSBuildProjectName).dll IL\$(MSBuildProjectName).dll ren $(MSBuildProjectName).dll $(MSBuildProjectName).org - set __Command=!_DebuggerFullPath! "!CORE_ROOT!\crossgen2\crossgen2" %21scriptPath%21$(MSBuildProjectName).org -o:%21scriptPath%21$(MSBuildProjectName).dll --targetarch:x64 -O --inputbubble -r:!CORE_ROOT!\*.dll + set __Command=!_DebuggerFullPath! "!CORE_ROOT!\crossgen2\crossgen2" %21scriptPath%21$(MSBuildProjectName).org -o:%21scriptPath%21$(MSBuildProjectName).dll --targetarch:x64 -O --inputbubble -r:!CORE_ROOT!\*.dll -r:%25cd%25\*.dll echo "!__Command!" call !__Command! set CrossGen2Status=!ERRORLEVEL!