Files
termux-packages/packages/libllvm/llvm-lib-Support-Unix-Path.inc.patch
termux-pacman-bot daab57c3d1 llvm: Avoid looking at /proc/self/exe
LLVM looks at /proc/self/exe to determine which binary has been called.
This does not work with the proposed changes for termux-exec:
https://github.com/termux/termux-exec/pull/24

Luckily the fallback to look at argv0 works instead.
2023-10-04 12:40:02 +00:00

20 lines
826 B
Diff

diff -u -r ../orig-src/llvm/lib/Support/Unix/Path.inc ./llvm/lib/Support/Unix/Path.inc
--- ../orig-src/llvm/lib/Support/Unix/Path.inc 2023-09-29 21:36:47.056335287 +0000
+++ ./llvm/lib/Support/Unix/Path.inc 2023-09-29 21:40:31.091417185 +0000
@@ -252,6 +252,7 @@
return exe_path;
#elif defined(__linux__) || defined(__CYGWIN__) || defined(__gnu_hurd__)
char exe_path[PATH_MAX];
+#ifndef __ANDROID__ /* Avoid looking at /proc/self/exe, as it does not work with termux-exec linker wrapping */
const char *aPath = "/proc/self/exe";
if (sys::fs::exists(aPath)) {
// /proc is not always mounted under Linux (chroot for example).
@@ -280,6 +281,7 @@
return std::string(real_path);
#endif
}
+#endif
// Fall back to the classical detection.
if (getprogpath(exe_path, argv0))
return exe_path;