The source project of this merge request has been removed.
Draft: Build with zlib enabled
Some distributions (Tumbleweed, Void, Solus, etc.) build their libc with zlib compression enabled, which would cause problems with the current wasi-sdk
's lld
:
Command line: $HOME/.ghcup/bin/ghc -Wall -Wcompat -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stageBoot/lib/package.conf.d' '-this-unit-id unlit-0.1-inplace' -i -i$HOME/CS/Haskell/ghc/_build/stageBoot/utils/unlit/build -i$HOME/CS/Haskell/ghc/_build/stageBoot/utils/unlit/build/unlit/autogen -i$HOME/CS/Haskell/ghc/utils/unlit -I_build/stageBoot/utils/unlit/build -optP-include -optP_build/stageBoot/utils/unlit/build/unlit/autogen/cabal_macros.h -outputdir _build/stageBoot/utils/unlit/build -fdiagnostics-color=always -XHaskell2010 -no-auto-link-packages -no-hs-main -optc-Wno-unknown-pragmas _build/stageBoot/utils/unlit/build/c/fs.o _build/stageBoot/utils/unlit/build/c/unlit.o -o _build/stageBoot/lib/bin/wasm32-wasi-unlit -O0 -H64m
===> Command failed with error code: 1
ld.lld: error: /usr/lib64/gcc/x86_64-solus-linux/12/../../../../lib64/crtn.o:(.debug_line) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
ld.lld: error: /usr/lib64/gcc/x86_64-solus-linux/12/../../../../lib64/crti.o:(.debug_line) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
ld.lld: error: /usr/lib64/gcc/x86_64-solus-linux/12/../../../../lib64/crtn.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
ld.lld: error: /usr/lib64/gcc/x86_64-solus-linux/12/../../../../lib64/crti.o:(.debug_aranges) is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib support
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Command failed
The solution is to pass the LLVM_ENABLE_ZLIB
CMake configuration flag to enable zlib
support for lld
.
Ref: Zig had a similar issue.