diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 5272fdaf3d..56229667ce 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -39,8 +39,9 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) { } $if linux { $if !android { + $if glibc { // backtrace is not available on Android. - if C.backtrace_symbols_fd != 0 { + //if C.backtrace_symbols_fd != 0 { buffer := [100]byteptr nr_ptrs := C.backtrace(*voidptr(buffer), 100) nr_actual_frames := nr_ptrs-skipframes @@ -70,7 +71,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) { } //C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_actual_frames, 1) return - }else{ + }$else{ C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n') C.printf('Some libc implementations like musl simply do not provide it.\n') }