You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@radare Good point. Aldo the current backtrace implementation rely's on functions from it, we should have a minimal or different backtrace implementation when it isn't available (or no backtrace in that case)
I just tried to compile V on chimera linux and got the following error:
clang -g -std=gnu11 -w -o v1 vc/v.c -lm -lexecinfo -lpthread
ld: error: unable to find library -lexecinfo
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
After compiling and installing the libexecinfo library (repo has been archived!) the error message when compiling V changed to
Details
cc -pipe -g -std=gnu11 -w -o v1 vc/v.c -lm -lexecinfo -lpthread
./v1 -no-parallel -o v2 -cc gcc cmd/v
================== C compilation error (from gcc): ==============
cc: /tmp/v_1000/v2.01J4S9AQENEY9DHCEQC23JYGSS.tmp.c:21879:19: error: call to undeclared function 'backtrace'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
cc: 21879 | int nr_ptrs = backtrace(&buffer[0], 100);
cc: | ^
cc: /tmp/v_1000/v2.01J4S9AQENEY9DHCEQC23JYGSS.tmp.c:21886:23: error: call to undeclared function 'backtrace_symbols'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
cc: 21886 | char** csymbols = backtrace_symbols(((voidptr)(&buffer[v_fixed_index(skipframes, 100)])), nr_actual_frames);
cc: | ^
cc: /tmp/v_1000/v2.01J4S9AQENEY9DHCEQC23JYGSS.tmp.c:21886:12: error: incompatible integer to pointer conversion initializing 'char **' with an expression of type 'int' [-Wint-conversion]
cc: 21886 | char** csymbols = backtrace_symbols(((voidptr)(&buffer[v_fixed_index(skipframes, 100)])), nr_actual_frames);
cc: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc: /tmp/v_1000/v2.01J4S9AQENEY9DHCEQC23JYGSS.tmp.c:29920:4: warning: expression result unused [-Wunused-value]
cc: 29920 | (*(string*)_t3.data);
cc: | ^~~~~~~~~~~~~~~~~~
... (the original output was 244 lines long, and was truncated to 12 lines)
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
*** Error code 1
Does anyone have any other ideas on how to get this to work reliably on a modern musl based distro? Thank you very much!
I just tried again to compile and run V on Chimera Linux, and it working perfectly now. But I don't know whether anything relevant in V, execinfo or Chimera has changed.
doas apk add gmake clang musl-devel
make
./v
>> Welcome to the V REPL ...
Activity
unknown-v commentedon Oct 18, 2019
alpineLinux has libexecinfo
donΒ΄t know about other musl based distros.
radare commentedon Oct 19, 2019
joe-conigliaro commentedon Oct 19, 2019
@radare Good point. Aldo the current backtrace implementation rely's on functions from it, we should have a minimal or different backtrace implementation when it isn't available (or no backtrace in that case)
unknown-v commentedon Oct 19, 2019
@radare
radare commentedon Oct 19, 2019
Ok i manage to compile it by adding the LDFLAGS=-lexecinfo env var but then it fails to do anything because:
radare commentedon Oct 19, 2019
unknown-v commentedon Oct 19, 2019
export VFLAGS="-cc gcc"
bogen85 commentedon Oct 23, 2019
I got tcc to work by replacing what what was put in tmp.
What was put in tmp for tcc by the v update process did not work for me anyways on alpine.
medvednikov commentedon Oct 23, 2019
@bogen85 so tcc works with musl with
-lexecinfo?bogen85 commentedon Oct 23, 2019
@medvednikov well, compiles and links on alpine with -lexecinfo... (and a lot works) but backtrace does not... See #2508
comcloudway commentedon Dec 6, 2022
With Alpine Linux
3.17, they apparently removedlibexecinfo-devManually building and installing https://github.com/ronchaine/libexecinfo fixes the
execinfo.herror thoughBrixy commentedon Aug 8, 2024
I just tried to compile V on chimera linux and got the following error:
After compiling and installing the libexecinfo library (repo has been archived!) the error message when compiling V changed to
Details
Does anyone have any other ideas on how to get this to work reliably on a modern musl based distro? Thank you very much!
P.S.: Compiling V on alpine works.
medvednikov commentedon Aug 9, 2024
I think we only tested musl builds on alpine.
execinfo is a common source of issues, would be best to avoid this dep.
Brixy commentedon Dec 27, 2024
Hello guys,
I just tried again to compile and run V on Chimera Linux, and it working perfectly now. But I don't know whether anything relevant in V, execinfo or Chimera has changed.
execinfo.h is not available on musl (fixes #2397)
execinfo.h is not available on musl (fixes #2397)
execinfo.h is not available on musl (fixes #2397)
execinfo.h is not available on musl (fixes #2397)
execinfo.h is not available on musl (fixes #2397)
execinfo.h is not available on musl (fixes #2397)
builtin: fix execinfo.h is not available on musl (fixes vlang#2397)