This was originally introduced to deal with the JIT being in a separate NuGet package. No longer the case for a years.
*propertyValuesWRef = propertyValuesW;
}
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-// Reference to the global holding the path to the JIT
-extern LPCWSTR g_CLRJITPath;
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
#ifdef FEATURE_GDBJIT
GetInfoForMethodDelegate getInfoForMethodDelegate = NULL;
extern "C" int coreclr_create_delegate(void*, unsigned int, const char*, const char*, const char*, void**);
// This will take ownership of propertyKeysWTemp and propertyValuesWTemp
Configuration::InitializeConfigurationKnobs(propertyCount, propertyKeysW, propertyValuesW);
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
- // Fetch the path to JIT binary, if specified
- g_CLRJITPath = Configuration::GetKnobStringValue(W("JIT_PATH"));
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
STARTUP_FLAGS startupFlags;
InitializeStartupFlags(&startupFlags);
// Here's the global data for JIT load and initialization state.
JIT_LOAD_DATA g_JitLoadData;
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
-// Global that holds the path to custom JIT location
-LPCWSTR g_CLRJITPath = nullptr;
-
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
-
// LoadAndInitializeJIT: load the JIT dll into the process, and initialize it (call the UtilCode initialization function,
// check the JIT-EE interface GUID, etc.)
//
extern HINSTANCE g_hThisInst;
bool havePath = false;
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
- if (g_CLRJITPath != nullptr)
- {
- // If we have been asked to load a specific JIT binary, load from that path.
- // The main JIT load will use exactly that name because pwzJitName will have
- // been computed as the last component of g_CLRJITPath by ExecutionManager::GetJitName().
- // Non-primary JIT names (such as compatjit or altjit) will be loaded from the
- // same directory.
- // (Ideally, g_CLRJITPath would just be the JIT path without the filename component,
- // but that's not how the JIT_PATH variable was originally defined.)
- CoreClrFolderHolder.Set(g_CLRJITPath);
- havePath = true;
- }
- else
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
if (WszGetModuleFileName(g_hThisInst, CoreClrFolderHolder))
{
// Load JIT from next to CoreCLR binary
return FALSE;
}
-#ifndef DACCESS_COMPILE
-
#ifndef FEATURE_MERGE_JIT_AND_ENGINE
/*********************************************************************/
// This static method returns the name of the jit dll
{
STANDARD_VM_CONTRACT;
- LPCWSTR pwzJitName = NULL;
-
-#if !defined(CROSSGEN_COMPILE)
- if (g_CLRJITPath != nullptr)
- {
- const WCHAR* p = wcsrchr(g_CLRJITPath, DIRECTORY_SEPARATOR_CHAR_W);
- if (p != nullptr)
- {
- pwzJitName = p + 1; // Return just the filename, not the directory name
- }
- else
- {
- pwzJitName = g_CLRJITPath;
- }
- }
-#endif // !defined(CROSSGEN_COMPILE)
-
- if (NULL == pwzJitName)
- {
- pwzJitName = MAKEDLLNAME_W(W("clrjit"));
- }
-
- return pwzJitName;
+ return MAKEDLLNAME_W(W("clrjit"));
}
#endif // !FEATURE_MERGE_JIT_AND_ENGINE
-#endif // #ifndef DACCESS_COMPILE
-
RangeSection* ExecutionManager::GetRangeSection(TADDR addr)
{
CONTRACTL {
#define FALLBACK_HOST_RID _X("linux")
#endif
-#define LIBCLRJIT_NAME MAKE_LIBNAME("clrjit")
-
#define LIBCORECLR_FILENAME (LIB_PREFIX _X("coreclr"))
#define LIBCORECLR_NAME MAKE_LIBNAME("coreclr")
_X("FX_DEPS_FILE"),
_X("PROBING_DIRECTORIES"),
_X("FX_PRODUCT_VERSION"),
- _X("JIT_PATH"),
_X("STARTUP_HOOKS"),
_X("APP_PATHS"),
_X("APP_NI_PATHS"),
FxDepsFile,
ProbingDirectories,
FxProductVersion,
- JitPath,
StartUpHooks,
AppPaths,
AppNIPaths,
m_coreclr_library_version = entry.library_version;
return;
}
- if (m_clrjit_path.empty() && ends_with(path, DIR_SEPARATOR + pal::string_t(LIBCLRJIT_NAME), false))
- {
- m_clrjit_path = path;
- return;
- }
}
void deps_resolver_t::resolve_additional_deps(const arguments_t& args, const deps_json_t::rid_fallback_graph_t& rid_fallback_graph)
add_unique_path(asset_type, m_app_dir, &items, output, &non_serviced, core_servicing);
(void) library_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path);
- (void) library_exists_in_dir(m_app_dir, LIBCLRJIT_NAME, &m_clrjit_path);
}
// Handle any additional deps.json that were specified.
// If we found coreclr and the jit during native path probe, set the paths now.
probe_paths->coreclr = m_coreclr_path;
- probe_paths->clrjit = m_clrjit_path;
return true;
}
pal::string_t native;
pal::string_t resources;
pal::string_t coreclr;
- pal::string_t clrjit;
};
struct deps_resolved_asset_t
// Special entry for coreclr library version
pal::string_t m_coreclr_library_version;
- // Special entry for JIT path
- pal::string_t m_clrjit_path;
-
// The filepaths for the app custom deps
std::vector<pal::string_t> m_additional_deps_files;
probe_paths.tpa.append(corelib_path);
- pal::string_t clrjit_path = probe_paths.clrjit;
- if (clrjit_path.empty())
- {
- trace::warning(_X("Could not resolve CLRJit path"));
- }
- else if (pal::realpath(&clrjit_path))
- {
- trace::verbose(_X("The resolved JIT path is '%s'"), clrjit_path.c_str());
- }
- else
- {
- clrjit_path.clear();
- trace::warning(_X("Could not resolve symlink to CLRJit path '%s'"), probe_paths.clrjit.c_str());
- }
-
const fx_definition_vector_t &fx_definitions = resolver.get_fx_definitions();
pal::string_t fx_deps_str;
coreclr_properties.add(common_property::FxProductVersion, clr_library_version.c_str());
coreclr_properties.add(common_property::RuntimeIdentifier, get_current_runtime_id(true /*use_fallback*/).c_str());
- if (!clrjit_path.empty())
- coreclr_properties.add(common_property::JitPath, clrjit_path.c_str());
-
bool set_app_paths = false;
// Runtime options config properties.
coreClrProperty.Parent.Add(newCoreClrProperty);
coreClrProperty.Remove();
- // Change the clrjit.dll asset to specify only "clrjit.dll" as the relative path (no directories).
- string clrJitLibraryName = RuntimeInformationExtensions.GetSharedLibraryFileNameForCurrentPlatform("clrjit");
- JProperty clrJitProperty = netCoreAppNativeAssets.First(p => p.Name.Contains(clrJitLibraryName));
- JProperty newClrJitProperty = new JProperty(clrJitProperty.Name.Substring(clrJitProperty.Name.LastIndexOf('/') + 1), clrJitProperty.Value);
- clrJitProperty.Parent.Add(newClrJitProperty);
- clrJitProperty.Remove();
-
File.WriteAllText(sharedFxDepsJsonPath, root.ToString());
dotnet.Exec(appDll)
.CaptureStdErr()
.Execute()
.Should().Pass()
- .And.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(sharedFxPath, coreClrLibraryName)}'")
- .And.HaveStdErrContaining($"The resolved JIT path is '{Path.Combine(sharedFxPath, clrJitLibraryName)}'");
+ .And.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(sharedFxPath, coreClrLibraryName)}'");
}
}
}