From e05e15bce5a97ebe1064c811595ef82f9825315a Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Mon, 7 Sep 2026 23:14:51 +0200 Subject: [PATCH] Implement Linux executable directory lookup --- runtime/src/platform/host_platform.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/src/platform/host_platform.cpp b/runtime/src/platform/host_platform.cpp index c0caa95..71c70d7 100644 --- a/runtime/src/platform/host_platform.cpp +++ b/runtime/src/platform/host_platform.cpp @@ -46,6 +46,13 @@ std::optional ExecutableDirectory() noexcept { std::error_code ec; const auto resolved = std::filesystem::weakly_canonical(path, ec); return (ec ? std::filesystem::path(path) : resolved).parent_path(); +#elif defined(__linux__) + std::error_code ec; + const auto executable = std::filesystem::read_symlink("/proc/self/exe", ec); + if (ec) { + return std::nullopt; + } + return executable.parent_path(); #else return std::nullopt; #endif