self.collection_shim_path = os.path.join(self.core_root, self.collection_shim_name)
- self.jit_path = os.path.join(coreclr_args.core_root, get_jit_name(coreclr_args))
+ jit_name = get_jit_name(coreclr_args)
+ self.jit_path = os.path.join(coreclr_args.core_root, jit_name)
+ if coreclr_args.crossgen2:
+ # There are issues when running SuperPMI and crossgen2 when using the same JIT binary.
+ # Therefore, we produce a copy of the JIT binary for SuperPMI to use.
+ jit_name_ext = os.path.splitext(jit_name)[1]
+ jit_name_without_ext = os.path.splitext(jit_name)[0]
+ self.superpmi_jit_path = os.path.join(coreclr_args.core_root, jit_name_without_ext + "_superpmi." + jit_name_ext)
+ shutil.copyfile(self.jit_path, self.superpmi_jit_path)
+ else:
+ self.superpmi_jit_path = self.jit_path
+
self.superpmi_path = determine_superpmi_tool_path(coreclr_args)
self.mcs_path = determine_mcs_tool_path(coreclr_args)
if passed:
logging.info("Generated MCH file: %s", self.final_mch_file)
+ # Cleanup the copy of the JIT binary.
+ if self.coreclr_args.crossgen2 and not self.coreclr_args.skip_cleanup:
+ os.remove(self.superpmi_jit_path)
+
return passed
############################################################################
root_env = {}
root_env["SuperPMIShimLogPath"] = self.temp_location
- root_env["SuperPMIShimPath"] = self.jit_path
+ root_env["SuperPMIShimPath"] = self.superpmi_jit_path
dotnet_env = {}
dotnet_env["EnableExtraSuperPmiQueries"] = "1"