ziglang / zig-bootstrap

take off every zig
368 stars 86 forks source link

nixos: linker error when linking host zig with host LLD built from source #138

Closed kubkon closed 1 year ago

kubkon commented 1 year ago

The error:

LLD Link... ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crt1.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                  
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crt1.o:(.debug_info) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                                 
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crt1.o:(.debug_abbrev) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                               
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crt1.o:(.debug_line) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                                 
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crt1.o:(.debug_str) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                                  
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crti.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                              
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crti.o:(.debug_ranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                               
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crtn.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support                                                                                                                                              
ld.lld: error: /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/crtn.o:(.debug_ranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support    

It appears to be a direct result of https://github.com/ziglang/zig-bootstrap/commit/acc6df8f6f850524d7c208b582be7e9832c87f1f

andrewrk commented 1 year ago

ugh, alright the commit can be reverted but keep the zstd line because it fixes the build on FreeBSD

kubkon commented 1 year ago

Sounds good, although gimme a couple minutes to verify this fixes it for me locally :-)

fleimgruber commented 1 year ago

This still fails for me on latest master. NixOS 22.05, build command: CMAKE_GENERATOR=Ninja ./build x86_64-linux-musl native.

Error log:

[1/2] Building stage3
FAILED: CMakeFiles/stage3 /home/fps/dev/zig-bootstrap/out/build-zig-host/CMakeFiles/stage3 
cd /home/fps/dev/zig-bootstrap/zig && /home/fps/dev/zig-bootstrap/out/build-zig-host/zig2 build compile --zig-lib-dir /home/fps/dev/zig-bootstrap/zig/lib -Dconfig_h=/home/fps/dev/zig-bootstrap/out/build-zig-host/config.h -Denable-llvm -Denable-stage1 -Drelease -Dstrip -Dtarget=native -Dcpu=native -Dversion-string=0.11.0-dev.448+e6e459e9e
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crt1.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crt1.o:(.debug_info) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crt1.o:(.debug_abbrev) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crt1.o:(.debug_line) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crt1.o:(.debug_str) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crti.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crti.o:(.debug_ranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crtn.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
error: ld.lld: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/crtn.o:(.debug_ranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support