ziglang / zig-bootstrap

take off every zig
368 stars 86 forks source link

lld link error using zig-bootstrap to build zig #133

Closed david-vanderson closed 1 year ago

david-vanderson commented 1 year ago

This is on x86_64 linux with master zig-bootstrap and master zig.

~/zig-bootstrap$ ./build -j12 x86_64-linux-musl baseline

zig-bootstrap builds successfully. But trying to use it to compile zig:

~/zig$ /home/dvanderson/zig-bootstrap/out/host/bin/zig build -p stage3 --search-prefix /home/dvanderson/zig-bootstrap/out/host --zig-lib-dir lib -Dstatic-llvm
LLD Link... ld.lld: error: undefined symbol: llvm::SubtargetFeatures::getString() const
>>> referenced by zig_llvm.cpp:101 (src/zig_llvm.cpp:101)
>>>               /home/dvanderson/zig/zig-cache/o/ee82a7ca45e2a20ff0c0a78abfce3ae5/zig_llvm.o:(ZigLLVMGetNativeFeatures)

followed by lots of similar link errors. I've tried some stuff but unable to figure out what's going wrong.

Any advice for things to look at or try?

matu3ba commented 1 year ago

Does your system use glibc, musl or another libc?

david-vanderson commented 1 year ago

$ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35

It's Linux Mint 21. Am I supposed to use x86_64-linux-gnu in my build command?

andrewrk commented 1 year ago

https://github.com/ziglang/zig/issues/13138#issuecomment-1281628150

david-vanderson commented 1 year ago

Thank you!