Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass flags to bootstrap links after #133092 #136984

Open
aeubanks opened this issue Feb 13, 2025 · 5 comments
Open

Cannot pass flags to bootstrap links after #133092 #136984

aeubanks opened this issue Feb 13, 2025 · 5 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@aeubanks
Copy link
Contributor

Summary

(https://crbug.com/395891130 is the bug on our side)

After #133092, flags we set via CFLAGS/CXXFLAGS/LDFLAGS/RUSTFLAGS_BOOTSTRAP/RUSTFLAGS_NOT_BOOTSTRAP no longer get passed to bootstrap links, resulting in the --sysroot= flag we pass not taking effect (they get passed to the compiles but not to the link) and getting weird link errors. I've commented on that PR with the location of which change breaks us. Looking at the PR, it seems like it's not possible to pass arbitrary link flags anymore, which seems like a big regression.

Command used

CFLAGS=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot \
CXXFLAGS=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot \
LDFLAGS=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot \
RUSTFLAGS_BOOTSTRAP='-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version' \
RUSTFLAGS_NOT_BOOTSTRAP='-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version' \
RUSTFLAGS='-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version' \
RUSTDOCFLAGS=-Clinker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang \
AR=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/llvm-ar \
CC=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang \
CXX=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang++ \
LD=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang \
PKG_CONFIG_SYSROOT_DIR=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot \
PKG_CONFIG_LIBDIR=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/pkgconfig \
LZMA_API_STATIC=1 \
CARGO_HOME=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/cargo-home \
GITHUB_ACTIONS=true \
python3 x.py build --stage 2 --build x86_64-unknown-linux-gnu library/std

Expected behaviour

Build succeeds

Actual behaviour

Operating system

Debian

HEAD

6171d94

Additional context

with RUST_BACKTRACE=1 and -v

   Compiling rustc-main v0.0.0 (/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/compiler/rustc)
     Running `/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc --crate-name rustc_main --edition=2021 compiler/rustc/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="llvm"' --cfg 'feature="max_level_info"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("jemalloc", "llvm", "max_level_info", "rustc_randomized_layouts"))' -C metadata=faf6fda14a794724 -C extra-filename=-f5c918c5576e06b8 --out-dir /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -C linker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang -L dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern rustc_codegen_ssa=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_ssa-a30735420db93cb6.rlib --extern rustc_driver=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so --extern rustc_driver_impl=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver_impl-a79152d59a8132bc.rlib --extern rustc_smir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_smir-d6e7aed835a9d792.rlib --extern stable_mir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libstable_mir-5bd981ba8eb6d62c.rlib -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off '-Wrustc::internal' -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zon-broken-pipe=kill -Z binary-dep-depinfo -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/psm-96715d9f18436e91/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-23f8365fbec3e480/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/lib -L native=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/gcc/x86_64-linux-gnu/10`
error: linking with `/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/home/aeubanks/bin:/usr/home/aeubanks/bin:/usr/home/aeubanks/repos/depot_tools:/usr/home/aeubanks/bin:/usr/home/aeubanks/bin:/usr/home/aeubanks/repos/depot_tools:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang" "-m64" "/tmp/rustcwdpjq0/symbols.o" "<1 object files omitted>" "-Wl,--as-needed" "-Wl,-Bdynamic" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so" "-Wl,-Bstatic" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libcompiler_builtins-9e63a6638183050d.rlib}" "-Wl,-Bdynamic" "-lrt" "-ldl" "-lpthread" "-lm" "-lz" "-lxml2" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/psm-96715d9f18436e91/out" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-23f8365fbec3e480/out" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/lib" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/gcc/x86_64-linux-gnu/10" "-L" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_main-f5c918c5576e06b8" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot" "-fuse-ld=lld" "-Wl,--undefined-version" "--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot" "-fuse-ld=lld" "-Wl,--undefined-version" "-Wl,-z,origin" "-Wl,-rpath,$ORIGIN/../lib"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld.lld: error: undefined reference: __libc_single_threaded
          >>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so (disallowed by --no-allow-shlib-undefined)
          
          ld.lld: error: undefined reference: std::__throw_bad_array_new_length()
          >>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so (disallowed by --no-allow-shlib-undefined)
          
          ld.lld: error: undefined reference: std::ios_base_library_init()
          >>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so (disallowed by --no-allow-shlib-undefined)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Did not run successfully: exit status: 1
LD_LIBRARY_PATH="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/lib:/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "--crate-name" "rustc_main" "--edition=2021" "compiler/rustc/src/main.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "bin" "--emit=dep-info,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "--cfg" "feature=\"llvm\"" "--cfg" "feature=\"max_level_info\"" "--check-cfg" "cfg(docsrs,test)" "--check-cfg" "cfg(feature, values(\"jemalloc\", \"llvm\", \"max_level_info\", \"rustc_randomized_layouts\"))" "-C" "metadata=faf6fda14a794724" "-C" "extra-filename=-f5c918c5576e06b8" "--out-dir" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps" "--target" "x86_64-unknown-linux-gnu" "-C" "linker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang" "-L" "dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps" "--extern" "rustc_codegen_ssa=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_ssa-a30735420db93cb6.rlib" "--extern" "rustc_driver=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so" "--extern" "rustc_driver_impl=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver_impl-a79152d59a8132bc.rlib" "--extern" "rustc_smir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_smir-d6e7aed835a9d792.rlib" "--extern" "stable_mir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libstable_mir-5bd981ba8eb6d62c.rlib" "-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot" "-Clink-arg=-fuse-ld=lld" "-Clink-arg=-Wl,--undefined-version" "-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot" "-Clink-arg=-fuse-ld=lld" "-Clink-arg=-Wl,--undefined-version" "--cfg=bootstrap" "--cfg=windows_raw_dylib" "-Csymbol-mangling-version=v0" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "--check-cfg=cfg(llvm_enzyme)" "-Zmacro-backtrace" "-Csplit-debuginfo=off" "-Wrustc::internal" "-Wkeyword_idents_2024" "-Wunsafe_op_in_unsafe_fn" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zon-broken-pipe=kill" "-Z" "binary-dep-depinfo" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/psm-96715d9f18436e91/out" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-23f8365fbec3e480/out" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/lib" "-L" "native=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/gcc/x86_64-linux-gnu/10" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Dwarnings" "--sysroot" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-sysroot" "-Ztls-model=initial-exec" "-Z" "force-unstable-if-unmarked"
-------------
error: could not compile `rustc-main` (bin "rustc-main") due to 1 previous error

Caused by:
  process didn't exit successfully: `/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc --crate-name rustc_main --edition=2021 compiler/rustc/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="llvm"' --cfg 'feature="max_level_info"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("jemalloc", "llvm", "max_level_info", "rustc_randomized_layouts"))' -C metadata=faf6fda14a794724 -C extra-filename=-f5c918c5576e06b8 --out-dir /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -C linker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang -L dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern rustc_codegen_ssa=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_ssa-a30735420db93cb6.rlib --extern rustc_driver=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-0535467ac2c0fa30.so --extern rustc_driver_impl=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver_impl-a79152d59a8132bc.rlib --extern rustc_smir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_smir-d6e7aed835a9d792.rlib --extern stable_mir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libstable_mir-5bd981ba8eb6d62c.rlib -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off '-Wrustc::internal' -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zon-broken-pipe=kill -Z binary-dep-depinfo -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/psm-96715d9f18436e91/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/blake3-44263fd409a648fe/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-23f8365fbec3e480/out -L native=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/lib -L native=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/gcc/x86_64-linux-gnu/10` (exit status: 1)
command did not execute successfully: cd "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_unknown_linux_gnu="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/llvm-ar" CARGO_INCREMENTAL="0" CARGO_LOG="cargo::core::compiler::fingerprint=info" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc" CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang" CC_x86_64_unknown_linux_gnu="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang" CFG_COMPILER_BUILD_TRIPLE="x86_64-unknown-linux-gnu" CFG_COMPILER_HOST_TRIPLE="x86_64-unknown-linux-gnu" CFG_DEFAULT_CODEGEN_BACKEND="llvm" CFG_LIBDIR_RELATIVE="lib" CFG_OMIT_GIT_HASH="1" CFG_RELEASE="1.86.0-dev" CFG_RELEASE_CHANNEL="dev" CFG_VERSION="1.86.0-dev (6171d944aea415a3023d4262e0895aa3b18c771f-1-llvmorg-21-init-853-gba476d0b chromium)" CFLAGS_x86_64_unknown_linux_gnu="" CXXFLAGS_x86_64_unknown_linux_gnu="" CXX_x86_64_unknown_linux_gnu="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang++" LIBC_CHECK_CFG="1" LLVM_CONFIG="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/llvm-config" LLVM_STATIC_STDCPP="/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot/usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a" RANLIB_x86_64_unknown_linux_gnu="/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/llvm-ar s" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/native" RUSTC="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="--cfg=bootstrap -Zunstable-options --check-cfg=cfg(bootstrap) -Clinker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTC_LINK_STD_INTO_RUSTC_DRIVER="1" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_REAL="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" RUSTC_SNAPSHOT="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTC_STAGE="0" RUSTC_SYSROOT="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-sysroot" RUSTC_TLS_MODEL_INITIAL_EXEC="1" RUSTC_VERBOSE="1" RUSTC_WRAPPER="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustc" RUSTDOC="/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(llvm_enzyme) -Clinker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.86.0-dev\t(6171d944aea415a3023d4262e0895aa3b18c771f-1-llvmorg-21-init-853-gba476d0b\tchromium) -Clinker=/usr/home/aeubanks/repos/chromium/src/third_party/rust-toolchain-intermediate/llvm-host-install/bin/clang -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version -Clink-arg=--sysroot=/usr/home/aeubanks/repos/chromium/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--undefined-version --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(llvm_enzyme) -Zmacro-backtrace -Csplit-debuginfo=off -Wrustc::internal -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Zon-broken-pipe=kill" RUST_TEST_THREADS="128" TERM="xterm" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="bootstrap" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "128" "-Zroot-dir=/usr/home/aeubanks/repos/chromium/src/third_party/rust-src" "-v" "--locked" "--color" "always" "--release" "--features" "llvm max_level_info" "--manifest-path" "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
Traceback (most recent call last):
  File "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/x.py", line 53, in <module>
    bootstrap.main()
  File "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/src/bootstrap/bootstrap.py", line 1339, in main
    bootstrap(args)
  File "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/src/bootstrap/bootstrap.py", line 1314, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/usr/home/aeubanks/repos/chromium/src/third_party/rust-src/src/bootstrap/bootstrap.py", line 236, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/bootstrap/debug/bootstrap build --stage 2 --build x86_64-unknown-linux-gnu library/std -v
@aeubanks aeubanks added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 13, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2025
@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2025
@jieyouxu
Copy link
Member

cc @madsmtm

@nico
Copy link

nico commented Feb 14, 2025

We currently cannot build Rust for Chromium's toolchain due to this regression. If it takes a while to resolve this, can we revert #133092 in the meantime to keep HEAD functional?

@madsmtm
Copy link
Contributor

madsmtm commented Feb 14, 2025

Sorry, should've commented here earlier. I'm working on a fix in cc-rs (EDIT: rust-lang/cc-rs#1401), will probably be out by next Friday though then cc-rs needs to be updated in-tree, is that quickly enough? Otherwise, we could do a hotfix to also read CFLAGS in bootstrap.

@madsmtm
Copy link
Contributor

madsmtm commented Feb 14, 2025

Another workaround in the meantime would be for you to pass CFLAGS_$TARGET (where TARGET is the target triple with - replaced by _).

@aeubanks
Copy link
Contributor Author

the CFLAGS_$TARGET workaround works for us, sounds good as a short term workaround

aarongable pushed a commit to chromium/chromium that referenced this issue Feb 14, 2025
…for upstream issue

And remove upstream rust revert.

Suggested at rust-lang/rust#136984 (comment).

Tested locally that removing the revert causes the build to break and
the CFLAGS workaround fixes it again, so there shouldn't be a need for a
new package.

Bug: 395891130
Change-Id: Iae7fc9e518e6ff955a09385f5443fac54ca6a015
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6269907
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420683}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

6 participants