D69683-impl-path-hurd
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 15 Aug 2020 20:34:33 +0000 (21:34 +0100)
committerGianfranco Costamagna <locutusofborg@debian.org>
Sat, 15 Aug 2020 20:34:33 +0000 (21:34 +0100)
[Hurd]: use /proc/self/exe to get program path

https://reviews.llvm.org/D69683

Gbp-Pq: Topic hurd
Gbp-Pq: Name D69683-impl-path-hurd.diff

lib/Support/Unix/Path.inc

index d7cc0d627d09e894f6fb380bf18946576c526bd9..69f3131dc1e1d12137e7e5f0332d6ee72eddd52d 100644 (file)
@@ -177,7 +177,7 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
 
   if (getprogpath(exe_path, argv0) != NULL)
     return exe_path;
-#elif defined(__linux__) || defined(__CYGWIN__)
+#elif defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__)
   char exe_path[MAXPATHLEN];
   StringRef aPath("/proc/self/exe");
   if (sys::fs::exists(aPath)) {