#undef __STR
#undef __XSTR
-static const char* CORERUN_CMD = "/usr/share/dotnet.tizen/netcoreapp/corerun";
-static const char* CROSSGEN2_PATH = "/usr/share/dotnet.tizen/netcoreapp/crossgen2/crossgen2.dll";
-static const char* CLRJIT_PATH = "/usr/share/dotnet.tizen/netcoreapp/libclrjit.so";
+static std::string CORERUN_CMD = "/usr/share/dotnet.tizen/netcoreapp/corerun";
+static std::string CROSSGEN2_PATH = "/usr/share/dotnet.tizen/netcoreapp/crossgen2/crossgen2.dll";
+static std::string CLRJIT_PATH = "/usr/share/dotnet.tizen/netcoreapp/libclrjit.so";
static const char* CROSSGEN_OPT_JITPATH = "--jitpath";
static const char* CROSSGEN_OPT_TARGET_ARCH = "--targetarch";
static const char* CROSSGEN_OPT_OUT_NEAR_INPUT = "--out-near-input";
static void makeArgs(std::vector<const char*>& args, const std::vector<std::string>& refPaths, NIOption* opt)
{
- args.push_back(CORERUN_CMD);
- args.push_back(CROSSGEN2_PATH);
+ args.push_back(CORERUN_CMD.c_str());
+ if (CROSSGEN2_PATH != "") {
+ args.push_back(CROSSGEN2_PATH.c_str());
+ }
args.push_back(CROSSGEN_OPT_JITPATH);
- args.push_back(CLRJIT_PATH);
+ args.push_back(CLRJIT_PATH.c_str());
args.push_back(CROSSGEN_OPT_TARGET_ARCH);
args.push_back(ARCHITECTURE_IDENTIFIER);
if (!(opt->flags & NI_FLAGS_NO_PIPELINE)) {
}
} else {
std::vector<const char*> argv;
-
makeArgs(argv, refPaths, opt);
// add input files at the end of parameter
_SOUT("+ %s", input.c_str());
}
+ // end param
argv.push_back(nullptr);
// print cmd
for (auto &arg: argv) _SOUT("+ %s", arg);
}
- execv(CORERUN_CMD, const_cast<char* const*>(argv.data()));
+ execv(CORERUN_CMD.c_str(), const_cast<char* const*>(argv.data()));
clearArgs(argv);
exit(0);
for (auto &arg: argv) _SOUT("+ %s", arg);
}
- execv(CORERUN_CMD, const_cast<char* const*>(argv.data()));
+ execv(CORERUN_CMD.c_str(), const_cast<char* const*>(argv.data()));
clearArgs(argv);
exit(0);
ni_error_e initNICommon()
{
#if defined(__arm__) || defined(__aarch64__)
+
+ char *env = nullptr;
+ env = getenv("MIC_CROSSGEN2_ENABLED");
+ if (env != nullptr && !strcmp(env, "1")) {
+ CORERUN_CMD = std::string("/opt/usr/dotnet/mic/crossgen2");
+ CROSSGEN2_PATH = "";
+ CLRJIT_PATH = std::string("/opt/usr/dotnet/mic/libclrjit_unix_") + ARCHITECTURE_IDENTIFIER + std::string("_x64.so");
+ }
+
// get interval value
const static std::string intervalFile = concatPath(__NATIVE_LIB_DIR, "crossgen_interval.txt");
std::ifstream inFile(intervalFile);