Skip to content

Cannot cross compile to linux from mac #18089

Open
@JoyceBabu

Description

@JoyceBabu

Describe the bug

I am getting a missing symbol error when trying to cross compile to linux from macOS.

Expected Behavior

Compilation to succeed.

Current Behavior

$ v -os linux test.v
Cross compilation for Linux failed (first step, cc). Make sure you have clang installed.
builder error: /tmp/v_501/test.13625188599121801123.tmp.c:7399:19: error: call to undeclared function 'backtrace'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                                int nr_ptrs = backtrace(&buffer[0], 100);
                                              ^
/tmp/v_501/test.13625188599121801123.tmp.c:7406:23: error: call to undeclared function 'backtrace_symbols'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                                char** csymbols = backtrace_symbols(((voidptr)(&buffer[v_fixed_index(skipframes, 100)])), nr_actual_frames);
                                                  ^
2 errors generated.

Reproduction Steps

Create a sample v file

fn main() {
	println('hello, world')
}

Compile with v -os linux test.v

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.3.3 0898f57

Environment details (OS name and version, etc.)

V full version: V 0.3.3 0898f57
OS: macos, macOS, 13.3.1, 22E261
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz

getwd: /Users/joyce/Projects/ennexa/git-deploy-hook
vexe: /usr/local/Cellar/vlang/0.3.3/libexec/v
vexe mtime: 2023-04-30 15:25:24

vroot: OK, value: /usr/local/Cellar/vlang/0.3.3/libexec
VMODULES: OK, value: /Users/joyce/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.39.2
Git vroot status: weekly.2023.17-15-g0898f579
.git/config present: true

CC version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
thirdparty/tcc status: thirdparty-macos-amd64 46662e2

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.BuildV build error on any OS/CPU architecture.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions