* addr2line.c (main_exe_path): support OpenBSD via getexecpath()

This commit is contained in:
Brad Smith authored and Jeremy Evans committed 2026-10-19 20:30:49 -07:00
1 parent 6bb22453e7
commit 6aa5fae6d9
2 files changed
+13 -1
Notes: git 2026-10-20 03:31:19 +00:00

No files matched your search

+9
View File
@@ -2608,6 +2608,15 @@ main_exe_path(FILE *errout)
len--; /* sysctl sets strlen+1 */
return len;
}
#elif defined(__OpenBSD__) && defined(HAVE_GETEXECPATH)
static ssize_t
main_exe_path(FILE *errout)
{
if (getexecpath(binary_filename, PATH_MAX) == -1)
return 0;
return strlen(binary_filename);
}
#elif defined(HAVE_LIBPROC_H)
static ssize_t
main_exe_path(FILE *errout)
+4 -1
View File
@@ -3280,7 +3280,10 @@ AS_CASE(["$target_os"],
AS_IF([test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes], [
AC_CHECK_FUNCS(procstat_getvmmap)
])
])
],
[openbsd*], [
AC_CHECK_FUNCS([getexecpath])
])
AS_CASE(["$target_cpu-$target_os"],
[*-darwin*], [
AC_CHECK_HEADERS([libproc.h])