Skip to content

Commit

Permalink
Fix crossgen2 compilation (#5661)
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Oct 30, 2023
1 parent f9c022c commit 9daa1a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/compilers/dotnet.ts
Expand Up @@ -71,7 +71,7 @@ class DotNetCompiler extends BaseCompiler {
this.langVersion = this.compilerProps<string>(`compiler.${this.compiler.id}.langVersion`);

this.corerunPath = path.join(this.clrBuildDir, 'corerun');
this.crossgen2Path = path.join(this.clrBuildDir, 'crossgen2', 'crossgen2');
this.crossgen2Path = path.join(this.clrBuildDir, 'crossgen2', 'crossgen2.dll');
this.asm = new DotNetAsmParser();
this.versionString = '';
this.disassemblyLoaderPath = path.join(this.clrBuildDir, 'DisassemblyLoader', 'DisassemblyLoader.dll');
Expand Down Expand Up @@ -400,6 +400,7 @@ class DotNetCompiler extends BaseCompiler {

if (isCrossgen2) {
const crossgen2Result = await this.runCrossgen2(
compiler,
execOptions,
this.clrBuildDir,
programDllPath,
Expand Down Expand Up @@ -514,6 +515,7 @@ class DotNetCompiler extends BaseCompiler {
}

async runCrossgen2(
compiler: string,
execOptions: ExecutionOptions,
bclPath: string,
dllPath: string,
Expand All @@ -525,13 +527,14 @@ class DotNetCompiler extends BaseCompiler {

// prettier-ignore
const crossgen2Options = [
this.crossgen2Path,
'-r', path.join(bclPath, '/'),
'-r', this.disassemblyLoaderPath,
dllPath,
'-o', `${AssemblyName}.r2r.dll`,
].concat(toolOptions).concat(toolSwitches);

const compilerExecResult = await this.exec(this.crossgen2Path, crossgen2Options, execOptions);
const compilerExecResult = await this.exec(compiler, crossgen2Options, execOptions);
const result = this.transformToCompilationResult(compilerExecResult, dllPath);

await fs.writeFile(
Expand Down

0 comments on commit 9daa1a9

Please sign in to comment.