summaryrefslogtreecommitdiff
path: root/src/tools/crossgen/crossgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/crossgen/crossgen.cpp')
-rw-r--r--src/tools/crossgen/crossgen.cpp65
1 files changed, 15 insertions, 50 deletions
diff --git a/src/tools/crossgen/crossgen.cpp b/src/tools/crossgen/crossgen.cpp
index a3e66e69e2..43e667bd25 100644
--- a/src/tools/crossgen/crossgen.cpp
+++ b/src/tools/crossgen/crossgen.cpp
@@ -36,9 +36,7 @@ enum ReturnValues
STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzPlatformWinmdPaths, LPCWSTR pwzDiasymreaderPath);
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);
-#endif
/* --------------------------------------------------------------------------- *
* Console stuff
@@ -94,11 +92,7 @@ void ErrorWin32(DWORD err)
void PrintLogoHelper()
{
-#ifdef FEATURE_CORECLR
Output(W("Microsoft (R) CoreCLR Native Image "));
-#else
- Output(W("Microsoft (R) CLR Native Image "));
-#endif
Outputf(W("Generator - Version %S\n"), VER_FILEVERSION_STR);
Outputf(W("%S\n"), VER_LEGALCOPYRIGHT_LOGO_STR);
Output(W("\n"));
@@ -114,14 +108,12 @@ void PrintUsageHelper()
W("\n")
W(" /? or /help - Display this screen\n")
W(" /nologo - Prevents displaying the logo\n")
+ W(" /silent - Do not display completion message\n")
W(" @response.rsp - Process command line arguments from specified\n")
W(" response file\n")
-#ifdef FEATURE_CORECLR
W(" /partialtrust - Assembly will be run in a partial trust domain.\n")
-#endif
W(" /in <file> - Specifies input filename (optional)\n")
W(" /out <file> - Specifies output filename (optional)\n")
-#ifdef FEATURE_CORECLR
W(" /Trusted_Platform_Assemblies <path[") PATH_SEPARATOR_STR_W W("path]>\n")
W(" - List of assemblies treated as trusted platform\n")
W(" - Cannot be used with Platform_Assemblies_Paths\n")
@@ -134,15 +126,12 @@ void PrintUsageHelper()
W(" - List of paths containing user-application native images\n")
W(" - Must be used with /CreatePDB switch\n")
#endif // NO_NGENPDB
-#endif // FEATURE_CORECLR
W(" /Platform_Assemblies_Paths <path[") PATH_SEPARATOR_STR_W W("path]>\n")
W(" - List of paths containing target platform assemblies\n")
-#ifdef FEATURE_CORECLR
// If Platform_Assemblies_Paths, we will use it to build the TPA list and thus,
// TPA list cannot be explicitly specified.
W(" - Cannot be used with Trusted_Platform_Assemblies\n")
-#endif // FEATURE_CORECLR
#ifdef FEATURE_COMINTEROP
W(" /Platform_Winmd_Paths <path[") PATH_SEPARATOR_STR_W W("path]>\n")
@@ -156,10 +145,10 @@ void PrintUsageHelper()
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)
+#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
W(" /JITPath <path>\n")
W(" - Specifies the absolute file path to JIT compiler to be used.\n")
-#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
#ifdef FEATURE_READYTORUN_COMPILER
W(" /ReadyToRun - Generate images resilient to the runtime and\n")
W(" dependency versions\n")
@@ -168,19 +157,15 @@ void PrintUsageHelper()
W(" WinMD Parameters\n")
W(" /WinMDResilient - Generate images resilient to WinMD dependency changes.\n")
#endif
-#ifdef FEATURE_CORECLR
W(" Size on Disk Parameters\n")
W(" /NoMetaData - Do not copy metadata and IL into native image.\n")
-#endif // FEATURE_CORECLR
#ifndef NO_NGENPDB
W(" Debugging Parameters\n")
W(" /CreatePDB <Dir to store PDB> [/lines [<search path for managed PDB>] ]\n")
W(" When specifying /CreatePDB, the native image should be created\n")
W(" first, and <assembly name> should be the path to the NI.\n")
-#ifdef FEATURE_CORECLR
W(" /DiasymreaderPath <Path to diasymreader.dll>\n")
W(" - Specifies the absolute file path to diasymreader.dll to be used.\n")
-#endif // FEATURE_CORECLR
#elif defined(FEATURE_PERFMAP)
W(" Debugging Parameters\n")
W(" /CreatePerfMap <Dir to store perf map>\n")
@@ -265,7 +250,6 @@ bool StringEndsWith(LPCWSTR pwzString, LPCWSTR pwzCandidate)
return !_wcsicmp(pwzStringEnd, pwzCandidate);
}
-#ifdef FEATURE_CORECLR
//
// When using the Phone binding model (TrustedPlatformAssemblies), automatically
// detect which path CoreLib.[ni.]dll lies in.
@@ -429,7 +413,6 @@ void ComputeTPAListFromPlatformAssembliesPath(LPCWSTR pwzPlatformAssembliesPaths
}
}
}
-#endif // FEATURE_CORECLR
extern HMODULE g_hThisInst;
@@ -459,9 +442,9 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
LPCWSTR pwzOutputFilename = NULL;
LPCWSTR pwzPublicKeys = nullptr;
-#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
LPCWSTR pwszCLRJITPath = nullptr;
-#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
LPCWSTR pwzDiasymreaderPath = nullptr;
@@ -501,10 +484,8 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
// By default, Crossgen will assume code-generation for fulltrust domains unless /PartialTrust switch is specified
dwFlags |= NGENWORKER_FLAGS_FULLTRUSTDOMAIN;
-#ifdef FEATURE_CORECLR
// By default, Crossgen will generate readytorun images unless /FragileNonVersionable switch is specified
dwFlags |= NGENWORKER_FLAGS_READYTORUN;
-#endif
while (argc > 0)
{
@@ -518,6 +499,10 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
{
fDisplayLogo = false;
}
+ else if (MatchParameter(*argv, W("silent")))
+ {
+ dwFlags |= NGENWORKER_FLAGS_SILENT;
+ }
else if (MatchParameter(*argv, W("Tuning")))
{
dwFlags |= NGENWORKER_FLAGS_TUNING;
@@ -526,7 +511,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
{
dwFlags |= NGENWORKER_FLAGS_MISSINGDEPENDENCIESOK;
}
-#ifdef FEATURE_CORECLR
else if (MatchParameter(*argv, W("PartialTrust")))
{
// Clear the /fulltrust flag
@@ -551,7 +535,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
argc--;
}
#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-#endif
#ifdef FEATURE_WINMD_RESILIENT
else if (MatchParameter(*argv, W("WinMDResilient")))
{
@@ -568,12 +551,10 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
dwFlags &= ~NGENWORKER_FLAGS_READYTORUN;
}
#endif
-#ifdef FEATURE_CORECLR
else if (MatchParameter(*argv, W("NoMetaData")))
{
dwFlags |= NGENWORKER_FLAGS_NO_METADATA;
}
-#endif
else if (MatchParameter(*argv, W("out")))
{
if (pwzOutputFilename != NULL)
@@ -596,7 +577,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
argv++;
argc--;
}
-#ifdef FEATURE_CORECLR
else if (MatchParameter(*argv, W("Trusted_Platform_Assemblies")) && (argc > 1))
{
pwzTrustedPlatformAssemblies = argv[1];
@@ -631,7 +611,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
argc--;
}
#endif // NO_NGENPDB
-#endif // FEATURE_CORECLR
else if (MatchParameter(*argv, W("Platform_Assemblies_Paths")) && (argc > 1))
{
pwzPlatformAssembliesPaths = argv[1];
@@ -708,7 +687,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
argv--;
argc++;
}
-#ifdef FEATURE_CORECLR
else if (MatchParameter(*argv, W("DiasymreaderPath")) && (argc > 1))
{
pwzDiasymreaderPath = argv[1];
@@ -717,7 +695,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
argv++;
argc--;
}
-#endif // FEATURE_CORECLR
#endif // NO_NGENPDB
#ifdef FEATURE_PERFMAP
else if (MatchParameter(*argv, W("CreatePerfMap")) && (argc > 1))
@@ -816,23 +793,22 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
exit(FAILURE_RESULT);
}
-#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
if (pwszCLRJITPath != nullptr && fCreatePDB)
{
Output(W("The /JITPath switch can not be used with the /CreatePDB switch.\n"));
exit(FAILURE_RESULT);
}
-#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-#if defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+#if !defined(NO_NGENPDB)
if (pwzDiasymreaderPath != nullptr && !fCreatePDB)
{
Output(W("The /DiasymreaderPath switch can only be used with the /CreatePDB switch.\n"));
exit(FAILURE_RESULT);
}
-#endif // defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+#endif // !defined(NO_NGENPDB)
-#if defined(FEATURE_CORECLR)
if ((pwzTrustedPlatformAssemblies != nullptr) && (pwzPlatformAssembliesPaths != nullptr))
{
Output(W("The /Trusted_Platform_Assemblies and /Platform_Assemblies_Paths switches cannot be both specified.\n"));
@@ -863,15 +839,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
exit(FAILURE_RESULT);
}
}
-#endif // FEATURE_CORESYSTEM
-
-#ifdef FEATURE_READYTORUN_COMPILER
- if (((dwFlags & NGENWORKER_FLAGS_TUNING) != 0) && ((dwFlags & NGENWORKER_FLAGS_READYTORUN) != 0))
- {
- Output(W("The /Tuning switch cannot be used with /ReadyToRun switch.\n"));
- exit(FAILURE_RESULT);
- }
-#endif
// All argument processing has happened by now. The only messages that should appear before here are errors
// related to argument parsing, such as the Usage message. Afterwards, other messages can appear.
@@ -888,7 +855,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
PathString wzTrustedPathRoot;
-#ifdef FEATURE_CORECLR
SString ssTPAList;
if (fCreatePDB)
@@ -924,7 +890,6 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
SetMscorlibPath(pwzPlatformAssembliesPaths);
}
}
-#endif // FEATURE_CORECLR
if (pwzPlatformAssembliesPaths == NULL)
{
@@ -977,11 +942,11 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
pwzAppPaths,
pwzOutputFilename,
pwzPlatformWinmdPaths
-#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
,
NULL, // ICorSvcLogger
pwszCLRJITPath
-#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
);
}