Repository: rust
Issue: Build on x32 ABI on gentoo
Labels: O-x32

I'm trying to build rustc on gentoo in x32 ABI, and got some error in build system, that i can't fix by itself. I think that I can fix it if I realize it's reason.
First error is wrong folder name ~/rust/build/x86_64-unknown-linux-gnux32**x32**/llvm/build/lib instead ~/rust/build/x86_64-unknown-linux-gnux32/llvm/build/lib. I fix it with symlinc, but it isn't good solution.
```
     Running `/home/thousand/tmp/rust/build/bootstrap/debug/rustc --crate-name rustc_llvm --edition=2018 src/librustc_llvm/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=0 -C metadata=dd81f0e0b2097af2 -C extra-filename=-dd81f0e0b2097af2 --out-dir /home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps --target x86_64-unknown-linux-gnux32 -C linker=cc -L dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps -L dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps --extern libc=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/liblibc-89295cd55ffe317e.rmeta -Zmacro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out -L native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib --cfg 'llvm_component="asmparser"' --cfg 'llvm_component="bitreader"' --cfg 'llvm_component="bitwriter"' --cfg 'llvm_component="instrumentation"' --cfg 'llvm_component="ipo"' --cfg 'llvm_component="linker"' --cfg 'llvm_component="lto"' --cfg 'llvm_component="x86"' --cfg llvm_has_msp430_asm_parser -l static=rustllvm -l static=LLVMX86Disassembler -l static=LLVMX86AsmParser -l static=LLVMX86CodeGen -l static=LLVMCFGuard -l static=LLVMGlobalISel -l static=LLVMSelectionDAG -l static=LLVMAsmPrinter -l static=LLVMDebugInfoDWARF -l static=LLVMX86Desc -l static=LLVMMCDisassembler -l static=LLVMX86Utils -l static=LLVMX86Info -l static=LLVMLTO -l static=LLVMPasses -l static=LLVMObjCARCOpts -l static=LLVMCodeGen -l static=LLVMTarget -l static=LLVMipo -l static=LLVMVectorize -l static=LLVMScalarOpts -l static=LLVMLinker -l static=LLVMIRReader -l static=LLVMInstCombine -l static=LLVMAggressiveInstCombine -l static=LLVMInstrumentation -l static=LLVMTransformUtils -l static=LLVMBitWriter -l static=LLVMAnalysis -l static=LLVMProfileData -l static=LLVMObject -l static=LLVMTextAPI -l static=LLVMMCParser -l static=LLVMMC -l static=LLVMDebugInfoCodeView -l static=LLVMDebugInfoMSF -l static=LLVMBitReader -l static=LLVMAsmParser -l static=LLVMCore -l static=LLVMRemarks -l static=LLVMBitstreamReader -l static=LLVMBinaryFormat -l static=LLVMSupport -l static=LLVMDemangle -l stdc++`
rustc command: "LD_LIBRARY_PATH"="/home/thousand/.cargo/lib:/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps:/home/thousand/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib:/home/thousand/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib" "/home/thousand/.cargo/bin/rustc" "--crate-name" "rustc_llvm" "--edition=2018" "src/librustc_llvm/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-Cembed-bitcode=no" "-C" "debuginfo=0" "-C" "metadata=dd81f0e0b2097af2" "-C" "extra-filename=-dd81f0e0b2097af2" "--out-dir" "/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "--target" "x86_64-unknown-linux-gnux32" "-C" "linker=cc" "-L" "dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-L" "dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps" "--extern" "libc=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/liblibc-89295cd55ffe317e.rmeta" "-Zmacro-backtrace" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Wrustc::internal" "-Cprefer-dynamic" "-Zbinary-dep-depinfo" "-L" "native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out" "-L" "native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib" "--cfg" "llvm_component=\"asmparser\"" "--cfg" "llvm_component=\"bitreader\"" "--cfg" "llvm_component=\"bitwriter\"" "--cfg" "llvm_component=\"instrumentation\"" "--cfg" "llvm_component=\"ipo\"" "--cfg" "llvm_component=\"linker\"" "--cfg" "llvm_component=\"lto\"" "--cfg" "llvm_component=\"x86\"" "--cfg" "llvm_has_msp430_asm_parser" "-l" "static=rustllvm" "-l" "static=LLVMX86Disassembler" "-l" "static=LLVMX86AsmParser" "-l" "static=LLVMX86CodeGen" "-l" "static=LLVMCFGuard" "-l" "static=LLVMGlobalISel" "-l" "static=LLVMSelectionDAG" "-l" "static=LLVMAsmPrinter" "-l" "static=LLVMDebugInfoDWARF" "-l" "static=LLVMX86Desc" "-l" "static=LLVMMCDisassembler" "-l" "static=LLVMX86Utils" "-l" "static=LLVMX86Info" "-l" "static=LLVMLTO" "-l" "static=LLVMPasses" "-l" "static=LLVMObjCARCOpts" "-l" "static=LLVMCodeGen" "-l" "static=LLVMTarget" "-l" "static=LLVMipo" "-l" "static=LLVMVectorize" "-l" "static=LLVMScalarOpts" "-l" "static=LLVMLinker" "-l" "static=LLVMIRReader" "-l" "static=LLVMInstCombine" "-l" "static=LLVMAggressiveInstCombine" "-l" "static=LLVMInstrumentation" "-l" "static=LLVMTransformUtils" "-l" "static=LLVMBitWriter" "-l" "static=LLVMAnalysis" "-l" "static=LLVMProfileData" "-l" "static=LLVMObject" "-l" "static=LLVMTextAPI" "-l" "static=LLVMMCParser" "-l" "static=LLVMMC" "-l" "static=LLVMDebugInfoCodeView" "-l" "static=LLVMDebugInfoMSF" "-l" "static=LLVMBitReader" "-l" "static=LLVMAsmParser" "-l" "static=LLVMCore" "-l" "static=LLVMRemarks" "-l" "static=LLVMBitstreamReader" "-l" "static=LLVMBinaryFormat" "-l" "static=LLVMSupport" "-l" "static=LLVMDemangle" "-l" "stdc++" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Dwarnings" "--sysroot" "/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
sysroot: "/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot"
libdir: "/home/thousand/.cargo/lib"
error: could not find native static library `LLVMX86Disassembler`, perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `rustc_llvm`.

Caused by:
  process didn't exit successfully: `/home/thousand/tmp/rust/build/bootstrap/debug/rustc --crate-name rustc_llvm --edition=2018 src/librustc_llvm/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=0 -C metadata=dd81f0e0b2097af2 -C extra-filename=-dd81f0e0b2097af2 --out-dir /home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps --target x86_64-unknown-linux-gnux32 -C linker=cc -L dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps -L dependency=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps --extern libc=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/liblibc-89295cd55ffe317e.rmeta -Zmacro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out -L native=/home/thousand/tmp/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib --cfg 'llvm_component="asmparser"' --cfg 'llvm_component="bitreader"' --cfg 'llvm_component="bitwriter"' --cfg 'llvm_component="instrumentation"' --cfg 'llvm_component="ipo"' --cfg 'llvm_component="linker"' --cfg 'llvm_component="lto"' --cfg 'llvm_component="x86"' --cfg llvm_has_msp430_asm_parser -l static=rustllvm -l static=LLVMX86Disassembler -l static=LLVMX86AsmParser -l static=LLVMX86CodeGen -l static=LLVMCFGuard -l static=LLVMGlobalISel -l static=LLVMSelectionDAG -l static=LLVMAsmPrinter -l static=LLVMDebugInfoDWARF -l static=LLVMX86Desc -l static=LLVMMCDisassembler -l static=LLVMX86Utils -l static=LLVMX86Info -l static=LLVMLTO -l static=LLVMPasses -l static=LLVMObjCARCOpts -l static=LLVMCodeGen -l static=LLVMTarget -l static=LLVMipo -l static=LLVMVectorize -l static=LLVMScalarOpts -l static=LLVMLinker -l static=LLVMIRReader -l static=LLVMInstCombine -l static=LLVMAggressiveInstCombine -l static=LLVMInstrumentation -l static=LLVMTransformUtils -l static=LLVMBitWriter -l static=LLVMAnalysis -l static=LLVMProfileData -l static=LLVMObject -l static=LLVMTextAPI -l static=LLVMMCParser -l static=LLVMMC -l static=LLVMDebugInfoCodeView -l static=LLVMDebugInfoMSF -l static=LLVMBitReader -l static=LLVMAsmParser -l static=LLVMCore -l static=LLVMRemarks -l static=LLVMBitstreamReader -l static=LLVMBinaryFormat -l static=LLVMSupport -l static=LLVMDemangle -l stdc++` (exit code: 1)
```
Second error is a linked error because missing zlib flag as I understand.
```
  Compiling rustc-main v0.0.0 (/home/thousand/rust/src/rustc)
     Running `/home/thousand/rust/build/bootstrap/debug/rustc --crate-name rustc_binary --edition=2018 src/rustc/rustc.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=0 --cfg 'feature="llvm"' -C metadata=7fbbb2a031e20cd8 -C extra-filename=-7fbbb2a031e20cd8 --out-dir /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps --target x86_64-unknown-linux-gnux32 -C linker=cc -L dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps -L dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps --extern rustc_codegen_ssa=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_codegen_ssa-a8eb44cc4897fe21.rlib --extern rustc_driver=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so -Zmacro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/psm-12e0dd56ecfdb7d5/out -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib`
rustc command: "LD_LIBRARY_PATH"="/home/thousand/.cargo/lib:/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps:/home/thousand/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib:/home/thousand/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib" "/home/thousand/.cargo/bin/rustc" "--crate-name" "rustc_binary" "--edition=2018" "src/rustc/rustc.rs" "--error-format=json" "--json=diagnostic-rendered-ansi" "--crate-type" "bin" "--emit=dep-info,link" "-C" "opt-level=3" "-Cembed-bitcode=no" "-C" "debuginfo=0" "--cfg" "feature=\"llvm\"" "-C" "metadata=7fbbb2a031e20cd8" "-C" "extra-filename=-7fbbb2a031e20cd8" "--out-dir" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "--target" "x86_64-unknown-linux-gnux32" "-C" "linker=cc" "-L" "dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-L" "dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps" "--extern" "rustc_codegen_ssa=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_codegen_ssa-a8eb44cc4897fe21.rlib" "--extern" "rustc_driver=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so" "-Zmacro-backtrace" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Wrustc::internal" "-Cprefer-dynamic" "-Zbinary-dep-depinfo" "-L" "native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/psm-12e0dd56ecfdb7d5/out" "-L" "native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out" "-L" "native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Dwarnings" "--sysroot" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
sysroot: "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot"
libdir: "/home/thousand/.cargo/lib"
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-mx32" "-Wl,--eh-frame-hdr" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8.rustc_binary.1pqhew6z-cgu.0.rcgu.o" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8.rustc_binary.1pqhew6z-cgu.1.rcgu.o" "-o" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/psm-12e0dd56ecfdb7d5/out" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-lrustc_driver-ea894bbe8e42eb4f" "-Wl,--start-group" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "-lstd-762f2aa7e940aab0" "-Wl,--end-group" "-Wl,-Bstatic" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib/libcompiler_builtins-2782ebd1f212e87c.rlib" "-Wl,-Bdynamic" "-lstdc++" "-lutil" "-ldl" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-Wl,-rpath,$ORIGIN/../lib"
  = note: /usr/lib/gcc/x86_64-pc-linux-gnux32/9.3.0/../../../../x86_64-pc-linux-gnux32/bin/ld: /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so: undefined reference to `uncompress'
          /usr/lib/gcc/x86_64-pc-linux-gnux32/9.3.0/../../../../x86_64-pc-linux-gnux32/bin/ld: /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so: undefined reference to `compress2'
          /usr/lib/gcc/x86_64-pc-linux-gnux32/9.3.0/../../../../x86_64-pc-linux-gnux32/bin/ld: /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so: undefined reference to `crc32'
          /usr/lib/gcc/x86_64-pc-linux-gnux32/9.3.0/../../../../x86_64-pc-linux-gnux32/bin/ld: /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so: undefined reference to `compressBound'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `rustc-main`.

Caused by:
  process didn't exit successfully: `/home/thousand/rust/build/bootstrap/debug/rustc --crate-name rustc_binary --edition=2018 src/rustc/rustc.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=0 --cfg 'feature="llvm"' -C metadata=7fbbb2a031e20cd8 -C extra-filename=-7fbbb2a031e20cd8 --out-dir /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps --target x86_64-unknown-linux-gnux32 -C linker=cc -L dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps -L dependency=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps --extern rustc_codegen_ssa=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_codegen_ssa-a8eb44cc4897fe21.rlib --extern rustc_driver=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/librustc_driver-ea894bbe8e42eb4f.so -Zmacro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/psm-12e0dd56ecfdb7d5/out -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out -L native=/home/thousand/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib` (exit code: 1)
command did not execute successfully: "/home/thousand/.cargo/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnux32" "-Zbinary-dep-depinfo" "-j" "4" "-v" "--release" "--features" " llvm" "--manifest-path" "/home/thousand/rust/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
Traceback (most recent call last):
  File "./x.py", line 11, in <module>
    bootstrap.main()
  File "/home/thousand/rust/src/bootstrap/bootstrap.py", line 981, in main
    bootstrap(help_triggered)
  File "/home/thousand/rust/src/bootstrap/bootstrap.py", line 967, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/home/thousand/rust/src/bootstrap/bootstrap.py", line 143, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /home/thousand/rust/build/bootstrap/debug/bootstrap b
```

I added flag "-lz" and run it manually in shell. So this command processed secessfully.

"cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-mx32" "-Wl,--eh-frame-hdr" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8.rustc_binary.1pqhew6z-cgu.0.rcgu.o" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8.rustc_binary.1pqhew6z-cgu.1.rcgu.o" "-o" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/release/deps" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/psm-12e0dd56ecfdb7d5/out" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/build/rustc_llvm-1531e84115e847d2/out" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32x32/llvm/build/lib" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps" "-lrustc_driver-ea894bbe8e42eb4f" "-Wl,--start-group" "-L" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib" "-lstd-762f2aa7e940aab0" "-Wl,--end-group" "-Wl,-Bstatic" "/home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnux32/lib/libcompiler_builtins-2782ebd1f212e87c.rlib" "-Wl,-Bdynamic" "-lstdc++" **"-lz"** "-lutil" "-ldl" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-Wl,-rpath,$ORIGIN/../lib"

But when I retry build with ./x.py b it delete /home/thousand/rust/build/x86_64-unknown-linux-gnux32/stage0-rustc/x86_64-unknown-linux-gnux32/release/deps/rustc_binary-7fbbb2a031e20cd8 so building failed again.

This error can be reproducing by emerge dev-lang/rust or installing rust with rustup and building cloned this repo.