Open lcheylus opened 2 months ago
Simple test to generate error when using libbacktrace
on OpenBSD/amd64:
./v -d use_libbacktrace run ~/tmp/hello_world.v
failed thirdparty object build cmd:
'/home/fox/dev/vlang.git/thirdparty/tcc/tcc.exe' -std=c99 -D_DEFAULT_SOURCE -fPIC -D GC_BUILTIN_ATOMIC=1 -D GC_THREADS=1 -I "/usr/local/include" -I "/home/fox/dev/vlang.git/thirdparty/libbacktrace" -o '/home/fox/.vmodules/cache/61/61fc8f5bdfdffed4bcf6b1b1604f5a61.module.builtin.o' -c '/home/fox/dev/vlang.git/thirdparty/libbacktrace/backtrace.c'
builder error: In file included from /home/fox/dev/vlang.git/thirdparty/libbacktrace/backtrace.c:103:
/home/fox/dev/vlang.git/thirdparty/libbacktrace/base.c:3778: error: 'KERN_PROC_PATHNAME' undeclared
=> error with KERN_PROC_PATHNAME'
not defined on OpenBSD
After fix and merge upstream, I propose to update libbacktrace in Vlang sources (using amalgamation). Do you agree?
Yes, that will be nice.
After fix and merge upstream, I propose to update libbacktrace in Vlang sources (using amalgamation). Do you agree?
Yes, that will be nice.
OK, I have created a specific issue #22268 to track this update of thirparty/libbacktrace
sources. This issue is focused on OpenBSD support of libbacktrace.
Describe the bug
libbacktrace is not supported on OpenBSD => error when building V code with
-d use_libbacktrace
flag.Reproduction Steps
Build Vlang on OpenBSD/amd64
Clone sources from Git for v-analyzer => https://github.com/vlang/v-analyzer
Try to build
v-analyzer
in normal mode =>-d use_libbacktrace
used inbuild.vsh
scriptExpected Behavior
No error when building V code with
-d use_libbacktrace
on OpenBSD.Current Behavior
Error when building
v-analyzer
on OpenBSD:Possible Solution
In
thirdparty/libbacktrace/base.c
, symbolKERN_PROC_PATHNAME
used bysyscall
is unknown on OpenBSD.It's a known issue on OpenBSD => devs don't want implement
KERN_PROC_PATHNAME
for syscall to locate the current executable path. :( See this response from Theo on OpenBSD misc mailing-list https://marc.info/?l=openbsd-misc&m=144987773230417&w=2An alternate solution is to use
whereami
library on OpenBSD to fix this issue inlibbacktrace
=> https://github.com/gpakosz/whereamiI will try to reproduce this problem on OpenBSD with the current version of
libbacktrace
and to create a similar issue upstream.After fix and merge upstream, I propose to update
libbacktrace
in Vlang sources (using amalgamation). Do you agree?Additional Information/Context
No response
V version
./v version V 0.4.7 9a0f4d8
Environment details (OS name and version, etc.)
V full version: V 0.4.7 63957f2.9a0f4d8 OS: openbsd, 7.6, GENERIC.MP#312 Processor: 2 cpus, 64bit, little endian
getwd: /home/fox/dev/vlang.git vexe: /home/fox/dev/vlang.git/v vexe mtime: 2024-09-19 13:51:18
vroot: OK, value: /home/fox/dev/vlang.git VMODULES: OK, value: /home/fox/.vmodules VTMP: OK, value: /tmp/v_1000
Git version: git version 2.46.1 Git vroot status: weekly.2024.37-30-g9a0f4d84 .git/config present: true
CC version: OpenBSD clang version 16.0.6 thirdparty/tcc status: thirdparty-openbsd-amd64 8205cc59