Continue to link the JIT in for Windows Arm64 builds until 4717 is fixed.
# TODO_DJIT: Remove this "set" to commence loading JIT dynamically.
if(NOT WIN32)
set(FEATURE_MERGE_JIT_AND_ENGINE 1)
+elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
+ # TODO_DJIT: Remove this as part of enabling cross-compiling standalone JIT binary.
+ set(FEATURE_MERGE_JIT_AND_ENGINE 1)
endif(NOT WIN32)
+
if(FEATURE_MERGE_JIT_AND_ENGINE)
# Disable the following for UNIX altjit on Windows
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
SString m_platformWinmdPaths;
#endif // FEATURE_CORECLR || CROSSGEN_COMPILE
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ SString m_CLRJITPath;
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
bool m_fForceFullTrust;
SString m_outputFilename;
void SetForceFullTrust(bool val);
#endif // FEATURE_CORECLR || CROSSGEN_COMPILE
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ void SetCLRJITPath(LPCWSTR pwszCLRJITPath);
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
void SetOutputFilename(LPCWSTR pwszOutputFilename);
SString GetOutputFileName();
#define NumItems(s) (sizeof(s) / sizeof(s[0]))
STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzPlatformWinmdPaths);
-STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL);
+STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr);
void SetSvcLogger(ICorSvcLogger *pCorSvcLogger);
#ifdef FEATURE_CORECLR
void SetMscorlibPath(LPCWSTR wzSystemDirectory);
W(" /Tuning - Generate an instrumented image to collect\n")
W(" scenario traces, which can be used with ibcmerge.exe\n")
#endif
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ W(" /JITPath\n")
+ W(" - Specifies the absolute file path to JIT compiler to be used.\n")
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
#ifdef FEATURE_READYTORUN_COMPILER
W(" /ReadyToRun - Generate images resilient to the runtime and\n")
W(" dependency versions\n")
LPCWSTR pwzOutputFilename = NULL;
LPCWSTR pwzPublicKeys = nullptr;
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ LPCWSTR pwszCLRJITPath = nullptr;
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
HRESULT hr;
#ifndef PLATFORM_UNIX
// We dont explicitly set the flag here again so that if "/PartialTrust" is specified, then it will successfully override the default
// fulltrust behaviour.
}
+#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ else if (MatchParameter(*argv, W("JITPath")) && (argc > 1))
+ {
+ pwszCLRJITPath = argv[1];
+
+ // skip JIT Path
+ argv++;
+ argc--;
+ }
+#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
#endif
#ifdef FEATURE_WINMD_RESILIENT
else if (MatchParameter(*argv, W("WinMDResilient")))
pwzAppPaths,
pwzOutputFilename,
pwzPlatformWinmdPaths
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ ,
+ NULL, // ICorSvcLogger
+ pwszCLRJITPath
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
);
}
#if defined(FEATURE_CORECLR) || defined(CROSSGEN_COMPILE)
-STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL)
+STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr)
{
HRESULT hr = S_OK;
if (pwzPlatformWinmdPaths != nullptr)
zap->SetPlatformWinmdPaths(pwzPlatformWinmdPaths);
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ if (pwszCLRJITPath != nullptr)
+ zap->SetCLRJITPath(pwszCLRJITPath);
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
zap->SetForceFullTrust(!!(dwFlags & NGENWORKER_FLAGS_FULLTRUSTDOMAIN));
g_fNGenMissingDependenciesOk = !!(dwFlags & NGENWORKER_FLAGS_MISSINGDEPENDENCIESOK);
#if defined(FEATURE_CORECLR) || defined(FEATURE_MERGE_JIT_AND_ENGINE)
// Note: FEATURE_MERGE_JIT_AND_ENGINE is defined for the Desktop crossgen compilation as well.
//
- // For Crossgen, we always look up the JIT from the same location as CoreCLR.
PathString CoreClrFolder;
extern HINSTANCE g_hThisInst;
+
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ if (m_CLRJITPath.GetCount() > 0)
+ {
+ // If we have been asked to load a specific JIT binary, load it.
+ CoreClrFolder.Set(m_CLRJITPath);
+ hr = S_OK;
+ }
+ else
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
if (WszGetModuleFileName(g_hThisInst, CoreClrFolder))
{
- if (SUCCEEDED(CopySystemDirectory(CoreClrFolder, CoreClrFolder)))
+ hr = CopySystemDirectory(CoreClrFolder, CoreClrFolder);
+ if (SUCCEEDED(hr))
{
CoreClrFolder.Append(pwzJitName);
- *phJit = ::WszLoadLibrary(CoreClrFolder);
- if (*phJit == NULL)
- {
- hr = HRESULT_FROM_GetLastError();
- }
- else
- {
- hr = S_OK;
- }
+ }
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ *phJit = ::WszLoadLibrary(CoreClrFolder);
+ if (*phJit == NULL)
+ {
+ hr = HRESULT_FROM_GetLastError();
+ }
+ else
+ {
+ hr = S_OK;
}
}
#else
Print(level, W("%s"), message.GetUnicode());
}
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+void Zapper::SetCLRJITPath(LPCWSTR pwszCLRJITPath)
+{
+ m_CLRJITPath.Set(pwszCLRJITPath);
+}
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
#if defined(FEATURE_CORECLR) || defined(CROSSGEN_COMPILE)
void Zapper::SetPlatformAssembliesPaths(LPCWSTR pwzPlatformAssembliesPaths)