]> rtime.felk.cvut.cz Git - hercules2020/hercules-compiler.git/commitdiff
Used default path for passes if no environment variable was specified
authorKreiliger, Flavio <kreilfla@fel.cvut.cz>
Thu, 22 Nov 2018 11:04:39 +0000 (11:04 +0000)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 22 Nov 2018 16:26:24 +0000 (17:26 +0100)
[The patch was streamlined by Michal Sojka]

debian/patches/default-pass-root.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/default-pass-root.patch b/debian/patches/default-pass-root.patch
new file mode 100644 (file)
index 0000000..fb139b4
--- /dev/null
@@ -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"));
index c9cc75908e6df668e49659f2463ecd6a58f2d6e8..1c0333ed5b2a5205f582ac2ddc4087c9009f4a1b 100644 (file)
@@ -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