vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.86k stars 2.17k forks source link

Cross compile to Linux broken on Macos Catalina #7388

Open kingsleyh opened 3 years ago

kingsleyh commented 3 years ago
OS: macos, Mac OS X, 10.15.7, 19H15
Processor: 20 cpus, 64bit, little endian, Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
CC version: Apple clang version 12.0.0 (clang-1200.0.32.28)

getwd: /Users/kings/dev/projects/axentro-x-miner
vmodules: /Users/kings/.vmodules
vroot: /Users/kings/dev/projects/v
vexe: /Users/kings/dev/projects/v/v
vexe mtime: 2020-12-18 10:33:19
is vroot writable: true
is vmodules writable: true
V full version: V 0.1.30 8addb31.04757a4

Git version: git version 2.24.3 (Apple Git-128)
Git vroot status: weekly.2020.51.2-22-g04757a48
.git/config present: true
thirdparty/tcc status: thirdparty-macos-amd64 689c8a02

repo: https://github.com/kingsleyh/axentro-x-miner

What did you do? tried to cross compile for linux from macos catalina v -v -os linux t.v

What did you expect to see? a linux binary

What did you see instead? a big error as shown below:

builder.compile() pref:
all .v files before:
v.pref.lookup_path: ['/Users/kings/dev/projects/v/vlib', '/Users/kings/.vmodules']
v_files_from_dir ("/Users/kings/dev/projects/v/vlib/builtin")
get_v_files(t.v)
> just compile one file: "t.v"
user_files: ['t.v']
x: "/Users/kings/dev/projects/axentro-x-miner/modules"
v.module_search_paths:
['/Users/kings/dev/projects/axentro-x-miner', '/Users/kings/dev/projects/axentro-x-miner/modules', '/Users/kings/dev/projects/v/vlib', '/Users/kings/.vmodules']
all .v files:
['/Users/kings/dev/projects/v/vlib/builtin/array.v', '/Users/kings/dev/projects/v/vlib/builtin/builtin.c.v', '/Users/kings/dev/projects/v/vlib/builtin/builtin.v', '/Users/kings/dev/projects/v/vlib/builtin/builtin_nix.c.v', '/Users/kings/dev/projects/v/vlib/builtin/cfns.c.v', '/Users/kings/dev/projects/v/vlib/builtin/chan.v', '/Users/kings/dev/projects/v/vlib/builtin/float.v', '/Users/kings/dev/projects/v/vlib/builtin/int.v', '/Users/kings/dev/projects/v/vlib/builtin/map.v', '/Users/kings/dev/projects/v/vlib/builtin/option.v', '/Users/kings/dev/projects/v/vlib/builtin/rune.v', '/Users/kings/dev/projects/v/vlib/builtin/sorted_map.v', '/Users/kings/dev/projects/v/vlib/builtin/string.v', '/Users/kings/dev/projects/v/vlib/builtin/utf8.c.v', '/Users/kings/dev/projects/v/vlib/builtin/utf8.v', 't.v']
build_c(/var/folders/rl/1f19_bhs46v9mkr066yl2q1m0000gn/T/v/t.10360748130153469324.tmp.c)
  >> trying to find strings in /Users/kings/dev/projects/v/strings ..
  >> trying to find strings in /Users/kings/dev/projects/axentro-x-miner/strings ..
  >> trying to find strings in /Users/kings/dev/projects/axentro-x-miner/modules/strings ..
  >> trying to find strings in /Users/kings/dev/projects/v/vlib/strings ..
  << found /Users/kings/dev/projects/v/vlib/strings .
v_files_from_dir ("/Users/kings/dev/projects/v/vlib/strings")
  >> trying to find strconv in /Users/kings/dev/projects/v/strconv ..
  >> trying to find strconv in /Users/kings/dev/projects/axentro-x-miner/strconv ..
  >> trying to find strconv in /Users/kings/dev/projects/axentro-x-miner/modules/strconv ..
  >> trying to find strconv in /Users/kings/dev/projects/v/vlib/strconv ..
  << found /Users/kings/dev/projects/v/vlib/strconv .
v_files_from_dir ("/Users/kings/dev/projects/v/vlib/strconv")
  >> trying to find hash in /Users/kings/dev/projects/v/hash ..
  >> trying to find hash in /Users/kings/dev/projects/axentro-x-miner/hash ..
  >> trying to find hash in /Users/kings/dev/projects/axentro-x-miner/modules/hash ..
  >> trying to find hash in /Users/kings/dev/projects/v/vlib/hash ..
  << found /Users/kings/dev/projects/v/vlib/hash .
v_files_from_dir ("/Users/kings/dev/projects/v/vlib/hash")
  >> trying to find argon2 in /Users/kings/dev/projects/axentro-x-miner/argon2 ..
  << found /Users/kings/dev/projects/axentro-x-miner/argon2 .
v_files_from_dir ("/Users/kings/dev/projects/axentro-x-miner/argon2")
  >> trying to find math.bits in /Users/kings/dev/projects/v/math/bits ..
  >> trying to find math.bits in /Users/kings/dev/projects/axentro-x-miner/math/bits ..
  >> trying to find math.bits in /Users/kings/dev/projects/axentro-x-miner/modules/math/bits ..
  >> trying to find math.bits in /Users/kings/dev/projects/v/vlib/math/bits ..
  << found /Users/kings/dev/projects/v/vlib/math/bits .
v_files_from_dir ("/Users/kings/dev/projects/v/vlib/math/bits")
  >> trying to find constants in /Users/kings/dev/projects/axentro-x-miner/argon2/constants ..
  << found /Users/kings/dev/projects/axentro-x-miner/argon2/constants .
v_files_from_dir ("/Users/kings/dev/projects/axentro-x-miner/argon2/constants")
------ resolved dependencies graph: ------

 * strconv -> strings
 * strconv -> math.bits
 * builtin -> strings
 * builtin -> strconv
 * builtin -> hash
 * constants -> builtin
 * argon2 -> builtin
 * argon2 -> constants
 * main -> builtin
 * main -> argon2

------------------------------------------
------ imported modules: ------
['strings', 'hash', 'math.bits', 'strconv', 'builtin', 'constants', 'argon2', 'main']
-------------------------------
PARSE: 39 ms
CHECK: 10 ms
C GEN: 88 ms
builder.cc() pref.out_name="/Users/kings/dev/projects/axentro-x-miner/t"
build_thirdparty_obj_files: v.table.cflags: [CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/argon2.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/core.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/thread.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/encoding.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/blake2/blake2b.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/ref.o" mod: "argon2" os: "" cached: "" }, CFlag{ name: "-I" value: "/Users/kings/dev/projects/axentro-x-miner/argon2/c/include" mod: "argon2" os: "" cached: "" }]
/Users/kings/dev/projects/axentro-x-miner/argon2/c/src/ref.o not found, building it in /Users/kings/.vmodules/cache/43/43ef947c8ea96897b20ecc3c04d7b638.o ...

cc() isprod=false outname=/Users/kings/dev/projects/axentro-x-miner/t
Cross compilation for Linux failed (second step, lld).
builder error: LLD 8.0.0 (compatible with GNU linkers)
ld.lld: error: /Users/kings/.vmodules/cache/e0/e0f069bf6d5ce3b9e1d53395970d91fd.o: unknown file type
ld.lld: error: /Users/kings/.vmodules/cache/62/62d193d115f6f2be0f0321e0a97a20be.o: unknown file type
ld.lld: error: /Users/kings/.vmodules/cache/c1/c1120b8789135b59e8fe6fb9c053686f.o: unknown file type
ld.lld: error: /Users/kings/.vmodules/cache/eb/ebcdd79f9932c03b2c3fd16f45cafbbb.o: unknown file type
ld.lld: error: /Users/kings/.vmodules/cache/8e/8ed495218d4fdf7c83dbdb636b6ea538.o: unknown file type
ld.lld: error: /Users/kings/.vmodules/cache/43/43ef947c8ea96897b20ecc3c04d7b638.o: unknown file type
ArtemkaKun commented 2 years ago

Hi @kingsleyh ,

can you confirm that the problem still exists in a fresh V (0.2.4)?

odunboye commented 2 years ago

This is still an issue

felipensp commented 2 months ago

Is this still an issue?