From db8804667d738c81eabaf84700d093f327283443 Mon Sep 17 00:00:00 2001 From: "Kreiliger, Flavio" Date: Thu, 22 Nov 2018 11:04:39 +0000 Subject: [PATCH] Used default path for passes if no environment variable was specified [The patch was streamlined by Michal Sojka] --- debian/patches/default-pass-root.patch | 24 ++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 25 insertions(+) create mode 100644 debian/patches/default-pass-root.patch diff --git a/debian/patches/default-pass-root.patch b/debian/patches/default-pass-root.patch new file mode 100644 index 0000000..fb139b4 --- /dev/null +++ b/debian/patches/default-pass-root.patch @@ -0,0 +1,24 @@ +--- a/clang/lib/Driver/Tools.cpp ++++ b/clang/lib/Driver/Tools.cpp +@@ -4090,16 +4090,18 @@ + // environment variable. + const char * herculesInstallPathEnv = std::getenv("HERCULES_INSTALL_PATH"); + const char * herculesPassRootEnv = std::getenv("HERCULES_PASS_ROOT"); +- if(herculesPassRootEnv != nullptr || herculesInstallPathEnv != nullptr) { ++ if(true || herculesPassRootEnv != nullptr || herculesInstallPathEnv != nullptr) { + std::string herculesPassRoot; + if(herculesInstallPathEnv != nullptr) { + herculesPassRoot = std::string(std::string(herculesInstallPathEnv) + + std::string("/lib/hercules/")); +- } else { ++ } else if(herculesPassRootEnv != nullptr) { + herculesPassRoot = std::string(std::string(herculesPassRootEnv) + + std::string("/src/Passes/")); ++ } else { ++ // Default path ++ herculesPassRoot = std::string("/opt/hercules-compiler/lib/hercules/"); + } +- + CmdArgs.push_back("-load"); + CmdArgs.push_back(Args.MakeArgString(herculesPassRoot + + "AnnotatePTXGlobals/libAnnotatePTXGlobals.so")); diff --git a/debian/patches/series b/debian/patches/series index c9cc759..1c0333e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ Guard-architecture-dependent-code-with-#ifdefs.patch require-cuda.patch configure-herculescompiler-via-cmake.patch use_gpuguard.patch +default-pass-root.patch -- 2.39.2