diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 38088e51f405f..1b1bf6a04815d 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -244,7 +244,7 @@ jobs: # Compose the Core_Root folder containing all artifacts needed for running # CoreCLR tests. This step also compiles the framework using Crossgen2 # in ReadyToRun jobs. - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(logRootNameArg)Layout $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) $(runtimeVariantArg) -ci + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(logRootNameArg)Layout $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) $(runtimeVariantArg) displayName: Generate CORE_ROOT # Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64) diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index 47ea88f3d1111..416960eae23c3 100644 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -693,6 +693,14 @@ def __init__(self, coreclr_args): self.pmi_location = determine_pmi_location(coreclr_args) self.corerun = os.path.join(self.core_root, self.corerun_tool_name) + if coreclr_args.crossgen2: + self.corerun = os.path.join(self.core_root, self.corerun_tool_name) + if coreclr_args.dotnet_tool_path is None: + self.crossgen2_driver_tool = self.corerun + else: + self.crossgen2_driver_tool = coreclr_args.dotnet_tool_path + logging.debug("Using crossgen2 driver tool %s", self.crossgen2_driver_tool) + if coreclr_args.pmi or coreclr_args.crossgen2: self.assemblies = coreclr_args.assemblies self.exclude = coreclr_args.exclude @@ -1058,7 +1066,7 @@ async def run_crossgen2(print_prefix, assembly, self): # # invoke with: # - # \crossgen2\crossgen2.exe @ + # dotnet \crossgen2\crossgen2.dll @ # # where "dotnet" is one of: # 1. \dotnet.cmd/sh @@ -1081,7 +1089,7 @@ async def run_crossgen2(print_prefix, assembly, self): # Log what is in the response file write_file_to_log(rsp_filepath) - command = [self.coreclr_args.crossgen2_tool_path, "@" + rsp_filepath] + command = [self.crossgen2_driver_tool, self.coreclr_args.crossgen2_tool_path, "@" + rsp_filepath] command_string = " ".join(command) logging.debug("%s%s", print_prefix, command_string) @@ -4908,8 +4916,7 @@ def verify_base_diff_args(): if coreclr_args.crossgen2: # Can we find crossgen2? - - crossgen2_tool_name = "crossgen2.exe" if platform.system() == "Windows" else "crossgen2" + crossgen2_tool_name = "crossgen2.dll" crossgen2_tool_path = os.path.abspath(os.path.join(coreclr_args.core_root, "crossgen2", crossgen2_tool_name)) if not os.path.exists(crossgen2_tool_path): print("`--crossgen2` is specified, but couldn't find " + crossgen2_tool_path + ". (Is it built?)") diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj index 25bfcc096d934..aebad93eae08e 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj @@ -37,7 +37,6 @@ - true $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) $(ROOTFS_DIR) diff --git a/src/coreclr/tools/r2rtest/Crossgen2Runner.cs b/src/coreclr/tools/r2rtest/Crossgen2Runner.cs index e9024d58da3a0..a93532e6382cb 100644 --- a/src/coreclr/tools/r2rtest/Crossgen2Runner.cs +++ b/src/coreclr/tools/r2rtest/Crossgen2Runner.cs @@ -24,19 +24,15 @@ class Crossgen2RunnerOptions class Crossgen2Runner : CompilerRunner { private Crossgen2RunnerOptions Crossgen2RunnerOptions; - private bool IsAssembly => _options.Crossgen2Path != null && _options.Crossgen2Path.FullName.EndsWith(".dll"); + public override CompilerIndex Index => CompilerIndex.CPAOT; - // Crossgen2 runs as a standalone binary + // Crossgen2 runs on top of corerun. protected override string CompilerRelativePath => ""; - protected override string CompilerFileName => ""; - - protected override string CompilerPath => IsAssembly ? _options.DotNetCli : _options.Crossgen2Path?.FullName - ?? Path.Combine(_options.CoreRootDirectory.FullName, "crossgen2", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "crossgen2.exe" : "crossgen2"); - - public override CompilerIndex Index => CompilerIndex.CPAOT; - protected readonly List _referenceFiles = new(); + protected override string CompilerFileName => _options.DotNetCli; + protected readonly List _referenceFiles = new List(); + private string Crossgen2Path => _options.Crossgen2Path != null ? _options.Crossgen2Path.FullName : Path.Combine(_options.CoreRootDirectory.FullName, "crossgen2", "crossgen2.dll"); private bool CompositeMode => Crossgen2RunnerOptions != null ? Crossgen2RunnerOptions.Composite : _options.Composite; public Crossgen2Runner(BuildOptions options, Crossgen2RunnerOptions crossgen2RunnerOptions, IEnumerable references, string overrideOutputPath = null) @@ -68,9 +64,7 @@ public Crossgen2Runner(BuildOptions options, Crossgen2RunnerOptions crossgen2Run public override ProcessParameters CompilationProcess(string outputFileName, IEnumerable inputAssemblyFileNames) { ProcessParameters processParameters = base.CompilationProcess(outputFileName, inputAssemblyFileNames); - if (IsAssembly) - processParameters.Arguments = $"{_options.Crossgen2Path.FullName} {processParameters.Arguments}"; - + processParameters.Arguments = $"{Crossgen2Path} {processParameters.Arguments}"; // DOTNET_ variables processParameters.EnvironmentOverrides["DOTNET_GCStress"] = ""; processParameters.EnvironmentOverrides["DOTNET_HeapVerify"] = ""; @@ -82,7 +76,6 @@ public override ProcessParameters CompilationProcess(string outputFileName, IEnu processParameters.EnvironmentOverrides["COMPlus_HeapVerify"] = ""; processParameters.EnvironmentOverrides["COMPlus_ReadyToRun"] = ""; processParameters.EnvironmentOverrides["COMPlus_GCName"] = ""; - return processParameters; } diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets index 27bcd1c1ccfc3..cacc3980c1a1d 100644 --- a/src/tests/Common/CLRTest.CrossGen.targets +++ b/src/tests/Common/CLRTest.CrossGen.targets @@ -85,17 +85,16 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then __ResponseFile="$__OutputFile.rsp" rm $__ResponseFile 2>/dev/null - __R2RDumpCommand=$_DebuggerFullPath + __Command=$_DebuggerFullPath # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path if [ ! -z ${__TestDotNetCmd+x} ] %3B then - __R2RDumpCommand+=" $__TestDotNetCmd" + __Command+=" $__TestDotNetCmd" else - __R2RDumpCommand+=" dotnet" + __Command+=" dotnet" fi - __R2RDumpCommand+=" $CORE_ROOT/R2RDump/R2RDump.dll" + __R2RDumpCommand=$__Command" $CORE_ROOT/R2RDump/R2RDump.dll" __R2RDumpCommand+=" --header --sc --in $__OutputFile --out $__OutputFile.r2rdump --val" - - __Command="$_DebuggerFullPath $CORE_ROOT/crossgen2/crossgen2" + __Command+=" $CORE_ROOT/crossgen2/crossgen2.dll" __Command+=" @$__ResponseFile" __Command+=" $ExtraCrossGen2Args" @@ -248,10 +247,11 @@ if defined RunCrossGen2 ( ) else ( set __DotNet="dotnet" ) - set __R2RDumpCommand=!_DebuggerFullPath! !__DotNet! "!CORE_ROOT!\r2rdump\r2rdump.dll" + set __Command=!_DebuggerFullPath! + set __Command=!__Command! !__DotNet! + set __R2RDumpCommand=!__Command! "!CORE_ROOT!\r2rdump\r2rdump.dll" set __R2RDumpCommand=!__R2RDumpCommand! --header --sc --in !__OutputFile! --out !__OutputFile!.r2rdump --val - - set __Command=!_DebuggerFullPath! "!CORE_ROOT!\crossgen2\crossgen2.exe" + set __Command=!__Command! "!CORE_ROOT!\crossgen2\crossgen2.dll" set __Command=!__Command! @"!__ResponseFile!" set __Command=!__Command! !ExtraCrossGen2Args! echo !__InputFile!>>!__ResponseFile! diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 6d5960ab2bff1..ae168e70984cc 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -18,7 +18,6 @@ true true - true @@ -35,47 +34,7 @@ - - - - - <_targetOS>$(TargetOS) - <_targetOS Condition="'$(_targetOS)' == 'windows'">win - <_apphostPath Condition="Exists('$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(HostConfiguration)\corehost\apphost$(ExeSuffix)')">$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(HostConfiguration)\corehost\apphost$(ExeSuffix) - <_apphostPath Condition="'$(_apphostPath)' == '' and Exists('$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(LibrariesConfiguration)\corehost\apphost$(ExeSuffix)')">$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(LibrariesConfiguration)\corehost\apphost$(ExeSuffix) - <_toolsConfiguration Condition="Exists('$(ArtifactsBinDir)ILLink.Tasks\$(ToolsConfiguration)\$(NetCoreAppToolCurrent)\ILLink.Tasks.dll')">$(ToolsConfiguration) - <_toolsConfiguration Condition="Exists('$(ArtifactsBinDir)ILLink.Tasks\$(LibrariesConfiguration)\$(NetCoreAppToolCurrent)\ILLink.Tasks.dll')">$(LibrariesConfiguration) - - - - - - - - - - - + DependsOnTargets="ResolveAssemblyReferences;ResolveRuntimeFilesFromLocalBuild"> @@ -121,6 +80,11 @@ + + + True + + True @@ -171,7 +135,7 @@ @@ -259,7 +223,7 @@ + $(__BinDir)\$(BuildArchitecture) + $(__TestIntermediatesDir)\crossgen.out $(DotNetCli) @@ -670,7 +672,7 @@ $(CrossgenCmd) --crossgen2-parallelism 1 $(CrossgenCmd) --verify-type-and-field-layout - $(CrossgenCmd) --crossgen2-path "$(__BinDir)\$(BuildArchitecture)\crossgen2\tools\crossgen2.dll" + $(CrossgenCmd) --crossgen2-path "$(CrossgenDir)\crossgen2\tools\crossgen2.dll" diff --git a/src/tests/readytorun/crossboundarylayout/buildcrossgen2image.cmd b/src/tests/readytorun/crossboundarylayout/buildcrossgen2image.cmd index dca44eeb371ab..e75f4808a4d9e 100644 --- a/src/tests/readytorun/crossboundarylayout/buildcrossgen2image.cmd +++ b/src/tests/readytorun/crossboundarylayout/buildcrossgen2image.cmd @@ -48,7 +48,7 @@ goto Loop if "%COMPOSITENAME%"=="" goto done -set BUILDCMD=%CORE_ROOT%\crossgen2\crossgen2.exe -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%Composite.dll --composite %COMPILEARG% +set BUILDCMD=%TESTBATCHROOT%\..\..\..\..\..\..\.dotnet\dotnet %CORE_ROOT%\crossgen2\crossgen2.dll -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%Composite.dll --composite %COMPILEARG% echo %BUILDCMD% > %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%Composite.dll.log call %BUILDCMD% >> %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%Composite.dll.log 2>&1 if NOT EXIST %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%Composite.dll del %TESTINITIALBINPATH%\%TESTTARGET_DIR%\a.dll @@ -56,28 +56,28 @@ goto done :CG2Single del %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll -set BUILDCMD=%CORE_ROOT%\crossgen2\crossgen2.exe -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll %TESTINITIALBINPATH%\%COMPOSITENAME%.dll +set BUILDCMD=%TESTBATCHROOT%\..\..\..\..\..\..\.dotnet\dotnet %CORE_ROOT%\crossgen2\crossgen2.dll -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll %TESTINITIALBINPATH%\%COMPOSITENAME%.dll echo %BUILDCMD% > %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log call %BUILDCMD% >> %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log 2>&1 goto done :CG2NoMethods del %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll -set BUILDCMD=%CORE_ROOT%\crossgen2\crossgen2.exe --compile-no-methods -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll %TESTINITIALBINPATH%\%COMPOSITENAME%.dll +set BUILDCMD=%TESTBATCHROOT%\..\..\..\..\..\..\.dotnet\dotnet %CORE_ROOT%\crossgen2\crossgen2.dll --compile-no-methods -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll %TESTINITIALBINPATH%\%COMPOSITENAME%.dll echo %BUILDCMD% > %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log call %BUILDCMD% >> %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log 2>&1 goto done :CG2SingleInputBubble del %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll -set BUILDCMD=%CORE_ROOT%\crossgen2\crossgen2.exe -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll --inputbubble %TESTINITIALBINPATH%\%COMPOSITENAME%.dll +set BUILDCMD=%TESTBATCHROOT%\..\..\..\..\..\..\.dotnet\dotnet %CORE_ROOT%\crossgen2\crossgen2.dll -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\*.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll --inputbubble %TESTINITIALBINPATH%\%COMPOSITENAME%.dll echo %BUILDCMD% > %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log call %BUILDCMD% >> %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log 2>&1 goto done :CG2SingleBubbleADOnly del %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll -set BUILDCMD=%CORE_ROOT%\crossgen2\crossgen2.exe -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\d.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll --inputbubble %TESTINITIALBINPATH%\%COMPOSITENAME%.dll +set BUILDCMD=%TESTBATCHROOT%\..\..\..\..\..\..\.dotnet\dotnet %CORE_ROOT%\crossgen2\crossgen2.dll -r %CORE_ROOT%\* -r %TESTINITIALBINPATH%\d.dll -o %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll --inputbubble %TESTINITIALBINPATH%\%COMPOSITENAME%.dll echo %BUILDCMD% > %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log call %BUILDCMD% >> %TESTINITIALBINPATH%\%TESTTARGET_DIR%\%COMPOSITENAME%.dll.log 2>&1 goto done diff --git a/src/tests/readytorun/determinism/crossgen2determinism.csproj b/src/tests/readytorun/determinism/crossgen2determinism.csproj index a68f9bae1d47c..30f34184583c1 100644 --- a/src/tests/readytorun/determinism/crossgen2determinism.csproj +++ b/src/tests/readytorun/determinism/crossgen2determinism.csproj @@ -24,16 +24,16 @@ diff --git a/src/tests/readytorun/multifolder/multifolder.csproj b/src/tests/readytorun/multifolder/multifolder.csproj index 071c4158dfe63..1cf1e99bd976c 100644 --- a/src/tests/readytorun/multifolder/multifolder.csproj +++ b/src/tests/readytorun/multifolder/multifolder.csproj @@ -56,7 +56,13 @@ $(CLRTestBatchPreCommands) set DOTNET_GCName= set __Command=%_DebuggerFullPath% - set __Command=%__Command% "%CORE_ROOT%\crossgen2\crossgen2.exe" + REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path + if defined __TestDotNetCmd ( + set __Command=!__Command! "!__TestDotNetCmd!" + ) else ( + set __Command=!__Command! "dotnet" + ) + set __Command=%__Command% "%CORE_ROOT%\crossgen2\crossgen2.dll" set __Command=%__Command% @"%__ResponseFile%" REM work around problems in 6.0 OSR @@ -99,7 +105,14 @@ $(CLRTestBashPreCommands) # Suppress some DOTNET variables for the duration of Crossgen2 execution export -n DOTNET_GCName DOTNET_GCStress DOTNET_HeapVerify DOTNET_ReadyToRun DOTNET_TC_OnStackReplacement DOTNET_TC_PartialCompilation - __Command="$_DebuggerFullPath $CORE_ROOT/crossgen2/crossgen2" + __Command=$_DebuggerFullPath + # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path + if [ ! -z ${__TestDotNetCmd+x} ] %3B then + __Command+=" $__TestDotNetCmd" + else + __Command+=" dotnet" + fi + __Command+=" $CORE_ROOT/crossgen2/crossgen2.dll" __Command+=" @$__ResponseFile" echo Response file: $__ResponseFile diff --git a/src/tests/readytorun/tests/mainv1.csproj b/src/tests/readytorun/tests/mainv1.csproj index 8b16d14fffd53..dba79aa2d2b35 100644 --- a/src/tests/readytorun/tests/mainv1.csproj +++ b/src/tests/readytorun/tests/mainv1.csproj @@ -44,8 +44,9 @@ if not exist IL_DLLS\mainv1.dll ( echo FAILED to copy mainv1.dll to IL_DLLS exit /b 1 ) +IF "%__TestDotNetCmd%"=="" set __TestDotNetCmd=dotnet -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:%25CD%\IL_DLLS\mainv1.dll -o:test.dll testv1\test.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:%25CD%\IL_DLLS\mainv1.dll -o:test.dll testv1\test.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -57,7 +58,7 @@ if not exist test.map ( exit /b 1 ) -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\mainv1.dll -r:testv1\test.dll -o:fieldgetter.dll IL_DLLS\fieldgetter.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\mainv1.dll -r:testv1\test.dll -o:fieldgetter.dll IL_DLLS\fieldgetter.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -69,7 +70,7 @@ if not exist fieldgetter.map ( exit /b 1 ) -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:testv1\test.dll --opt-cross-module:test -o:mainv1.dll IL_DLLS\mainv1.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:testv1\test.dll --opt-cross-module:test -o:mainv1.dll IL_DLLS\mainv1.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -111,7 +112,7 @@ then exit 1 fi -"$CORE_ROOT"/crossgen2/crossgen2 --map -r:"$CORE_ROOT"/*.dll -r:IL_DLLS/fieldgetter.dll -r:IL_DLLS/mainv1.dll -o:test.dll testv1/test.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:IL_DLLS/fieldgetter.dll -r:IL_DLLS/mainv1.dll -o:test.dll testv1/test.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ] @@ -125,7 +126,7 @@ then exit 1 fi -"$CORE_ROOT"/crossgen2/crossgen2 --map -r:"$CORE_ROOT"/*.dll -r:testv1/test.dll -r:IL_DLLS/mainv1.dll -o:fieldgetter.dll IL_DLLS/fieldgetter.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/mainv1.dll -o:fieldgetter.dll IL_DLLS/fieldgetter.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ] @@ -139,7 +140,7 @@ then exit 1 fi -"$CORE_ROOT"/crossgen2/crossgen2 --map -r:"$CORE_ROOT"/*.dll -r:testv1/test.dll -r:IL_DLLS/fieldgetter.dll --opt-cross-module:test -o:mainv1.dll IL_DLLS/mainv1.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/fieldgetter.dll --opt-cross-module:test -o:mainv1.dll IL_DLLS/mainv1.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ] diff --git a/src/tests/readytorun/tests/mainv2.csproj b/src/tests/readytorun/tests/mainv2.csproj index 4345632f63d3c..72e5d816629f0 100644 --- a/src/tests/readytorun/tests/mainv2.csproj +++ b/src/tests/readytorun/tests/mainv2.csproj @@ -44,8 +44,10 @@ if not exist IL_DLLS\mainv2.dll ( exit /b 1 ) +IF "%__TestDotNetCmd%"=="" set __TestDotNetCmd=dotnet + REM NOTE THAT THIS IS WHERE WE BUILD THE R2R IMAGE using V2 of test not V1 -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:%25CD%\IL_DLLS\mainv2.dll -o:test.dll testv2\test.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:%25CD%\IL_DLLS\mainv2.dll -o:test.dll testv2\test.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -57,7 +59,7 @@ if not exist test.map ( exit /b 1 ) -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\mainv2.dll -r:testv1\test.dll -o:fieldgetter.dll IL_DLLS\fieldgetter.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\mainv2.dll -r:testv1\test.dll -o:fieldgetter.dll IL_DLLS\fieldgetter.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -69,7 +71,7 @@ if not exist fieldgetter.map ( exit /b 1 ) -%Core_Root%\crossgen2\crossgen2.exe --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:testv1\test.dll --opt-cross-module:test -o:mainv2.dll IL_DLLS\mainv2.dll +%__TestDotNetCmd% %Core_Root%\crossgen2\crossgen2.dll --map -r:%Core_Root%\*.dll -r:%25CD%\IL_DLLS\fieldgetter.dll -r:testv1\test.dll --opt-cross-module:test -o:mainv2.dll IL_DLLS\mainv2.dll set CrossGenStatus=!ERRORLEVEL! IF NOT !CrossGenStatus!==0 ( @@ -112,7 +114,7 @@ then fi # NOTE THAT THIS IS WHERE WE BUILD THE R2R IMAGE using V2 of test not V1 -$CORE_ROOT/crossgen2/crossgen2 --map -r:$CORE_ROOT/*.dll -r:IL_DLLS/fieldgetter.dll -r:IL_DLLS/mainv2.dll -o:test.dll testv2/test.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:IL_DLLS/fieldgetter.dll -r:IL_DLLS/mainv2.dll -o:test.dll testv2/test.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ] @@ -126,7 +128,7 @@ then exit 1 fi -$CORE_ROOT/crossgen2/crossgen2 --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/mainv2.dll -o:fieldgetter.dll IL_DLLS/fieldgetter.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/mainv2.dll -o:fieldgetter.dll IL_DLLS/fieldgetter.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ] @@ -140,7 +142,7 @@ then exit 1 fi -$CORE_ROOT/crossgen2/crossgen2 --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/fieldgetter.dll --opt-cross-module:test -o:mainv2.dll IL_DLLS/mainv2.dll +$CORE_ROOT/corerun $CORE_ROOT/crossgen2/crossgen2.dll --map -r:$CORE_ROOT/*.dll -r:testv1/test.dll -r:IL_DLLS/fieldgetter.dll --opt-cross-module:test -o:mainv2.dll IL_DLLS/mainv2.dll __cgExitCode=$? if [ $__cgExitCode -ne 0 ]