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

liballoc built with -Csplit-debuginfo=unpacked despite not being supported on riscv32imc-unknown-none-elf #112406

Open
tmandry opened this issue Jun 7, 2023 · 1 comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-riscv Target: RISC-V architecture T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@tmandry
Copy link
Member

tmandry commented Jun 7, 2023

I've only observed this on Mac hosts, not Linux. (Are we mixing up host and target somewhere?)

Given the following config.toml:

# Includes one of the default files in src/bootstrap/defaults
profile = "library"
changelog-seen = 2

[rust]
debuginfo-level-std = 2

[target.riscv32imc-unknown-none-elf]
cc = "/usr/bin/clang"
cxx = "/usr/bin/clang++"
linker = "/usr/bin/clang++"

I get this error:

➜  rust git:(master) ✗ ./x.py build library/alloc --target riscv32imc-unknown-none-elf
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.12s
Building stage0 library artifacts {alloc} (aarch64-apple-darwin -> riscv32imc-unknown-none-elf)
   Compiling core v0.0.0 (/Users/tmandry/code/rust/library/core)
   Compiling rustc-std-workspace-core v1.99.0 (/Users/tmandry/code/rust/library/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.92
error: A dwo section may not contain relocations

   Compiling alloc v0.0.0 (/Users/tmandry/code/rust/library/alloc)
error: could not compile `compiler_builtins` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `core` (lib) due to previous error
error: could not compile `alloc` (lib) due to previous error
Build completed unsuccessfully in 0:00:08

Rerunning with -v reveals that rustc is invoked with -Csplit-debuginfo=unpacked.

Verbose output
➜  rust git:(master) ✗ ./x.py build library/alloc --target riscv32imc-unknown-none-elf -v
Building bootstrap
running: /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/cargo build --manifest-path /Users/tmandry/code/rust/src/bootstrap/Cargo.toml --verbose
       Fresh cfg-if v1.0.0
       Fresh unicode-ident v1.0.0
       Fresh version_check v0.9.4
       Fresh bitflags v1.3.2
       Fresh libc v0.2.140
       Fresh cc v1.0.73
       Fresh once_cell v1.12.0
       Fresh proc-macro2 v1.0.56
       Fresh memchr v2.5.0
       Fresh typenum v1.15.0
       Fresh pkg-config v0.3.25
       Fresh io-lifetimes v1.0.9
       Fresh errno v0.3.0
       Fresh quote v1.0.26
       Fresh generic-array v0.14.5
       Fresh aho-corasick v0.7.18
       Fresh anstyle v1.0.0
       Fresh regex-syntax v0.6.26
       Fresh clap_lex v0.4.1
       Fresh syn v2.0.8
       Fresh heck v0.4.1
       Fresh clap_builder v4.2.4
       Fresh crypto-common v0.1.3
       Fresh serde v1.0.160
       Fresh regex v1.5.6
       Fresh log v0.4.17
       Fresh block-buffer v0.10.2
       Fresh clap_derive v4.2.0
       Fresh bstr v0.2.17
       Fresh rustix v0.37.6
       Fresh fnv v1.0.7
       Fresh same-file v1.0.6
       Fresh lzma-sys v0.1.17
       Fresh digest v0.10.3
       Fresh clap v4.2.4
       Fresh globset v0.4.8
       Fresh walkdir v2.3.2
       Fresh crossbeam-utils v0.8.14
       Fresh thread_local v1.1.4
       Fresh cpufeatures v0.2.5
       Fresh filetime v0.2.16
       Fresh xattr v0.2.3
       Fresh ryu v1.0.10
       Fresh itoa v1.0.2
       Fresh lazy_static v1.4.0
       Fresh clap_complete v4.2.2
       Fresh semver v1.0.17
       Fresh sha2 v0.10.2
       Fresh serde_derive v1.0.160
       Fresh xz2 v0.1.6
       Fresh ignore v0.4.18
       Fresh tar v0.4.38
       Fresh serde_json v1.0.81
       Fresh fd-lock v3.0.11
       Fresh is-terminal v0.4.6
       Fresh toml v0.5.9
       Fresh object v0.31.1
       Fresh cmake v0.1.48
       Fresh termcolor v1.2.0
       Fresh build_helper v0.1.0 (/Users/tmandry/code/rust/src/tools/build_helper)
       Fresh hex v0.4.3
       Fresh opener v0.5.0
       Fresh bootstrap v0.0.0 (/Users/tmandry/code/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 0.07s
running: /Users/tmandry/code/rust/build/bootstrap/debug/bootstrap build library/alloc --target riscv32imc-unknown-none-elf -v
finding compilers
CC_aarch64-apple-darwin = "cc"
CFLAGS_aarch64-apple-darwin = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-arch", "arm64", "-stdlib=libc++"]
CXX_aarch64-apple-darwin = "c++"
CXXFLAGS_aarch64-apple-darwin = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-arch", "arm64", "-stdlib=libc++"]
AR_aarch64-apple-darwin = "ar"
CC_riscv32imc-unknown-none-elf = "/usr/bin/clang"
CFLAGS_riscv32imc-unknown-none-elf = ["-ffunction-sections", "-fdata-sections", "--target=riscv32imc-unknown-none-elf"]
CXX_riscv32imc-unknown-none-elf = "/usr/bin/clang++"
CXXFLAGS_riscv32imc-unknown-none-elf = ["-ffunction-sections", "-fdata-sections", "--target=riscv32imc-unknown-none-elf"]
AR_riscv32imc-unknown-none-elf = "/usr/bin/ar"
running sanity check
learning about cargo
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot to avoid caching bugs
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib to avoid caching bugs
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot/lib/rustlib/aarch64-apple-darwin/lib to avoid caching bugs
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot to avoid caching bugs
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib to avoid caching bugs
Removing sysroot /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot/lib/rustlib/aarch64-apple-darwin/lib to avoid caching bugs
Building stage0 library artifacts {alloc} (aarch64-apple-darwin -> riscv32imc-unknown-none-elf)
running: cd "/Users/tmandry/code/rust" && AR_riscv32imc_unknown_none_elf="/usr/bin/ar" CARGO_INCREMENTAL="1" CARGO_PROFILE_RELEASE_DEBUG="2" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_TARGET_DIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std" CARGO_TARGET_RISCV32IMC_UNKNOWN_NONE_ELF_LINKER="/usr/bin/clang++" CC_riscv32imc_unknown_none_elf="/usr/bin/clang" CFG_COMPILER_HOST_TRIPLE="riscv32imc-unknown-none-elf" CFG_RELEASE_CHANNEL="dev" CFLAGS_riscv32imc_unknown_none_elf="-ffunction-sections -fdata-sections --target=riscv32imc-unknown-none-elf" CXXFLAGS_riscv32imc_unknown_none_elf="-ffunction-sections -fdata-sections --target=riscv32imc-unknown-none-elf" CXX_riscv32imc_unknown_none_elf="/usr/bin/clang++" LIBC_CHECK_CFG="1" RANLIB_riscv32imc_unknown_none_elf="/usr/bin/ar s" REAL_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/Users/tmandry/code/rust/build/riscv32imc-unknown-none-elf/native" RUSTC="/Users/tmandry/code/rust/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/Users/tmandry/code/rust/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings" RUSTC_REAL="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" RUSTC_SNAPSHOT="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" RUSTC_STAGE="0" RUSTC_SYSROOT="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot" RUSTC_VERBOSE="1" RUSTDOC="/Users/tmandry/code/rust/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="--cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.72.0-dev -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\") -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="--cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Zmacro-backtrace -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" RUST_TEST_THREADS="10" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="bootstrapstd" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/cargo" "build" "--target" "riscv32imc-unknown-none-elf" "--release" "-Zcheck-cfg=names,values,output" "-Zbinary-dep-depinfo" "-j" "10" "-v" "-p" "alloc" "--manifest-path" "/Users/tmandry/code/rust/library/alloc/Cargo.toml" "--features" " compiler-builtins-mem" "-p" "alloc" "--message-format" "json-render-diagnostics"
   Compiling core v0.0.0 (/Users/tmandry/code/rust/library/core)
     Running `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=6dae326047fff8df -C extra-filename=-6dae326047fff8df --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -C incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo`
       Dirty rustc-std-workspace-core v1.99.0 (/Users/tmandry/code/rust/library/rustc-std-workspace-core): the dependency core was rebuilt
   Compiling rustc-std-workspace-core v1.99.0 (/Users/tmandry/code/rust/library/rustc-std-workspace-core)
     Running `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name rustc_std_workspace_core --edition=2021 library/rustc-std-workspace-core/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=fc593dfc8d04f127 -C extra-filename=-fc593dfc8d04f127 --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -C incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --extern core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcore-6dae326047fff8df.rmeta --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo`
   Compiling compiler_builtins v0.1.92
     Running `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name compiler_builtins /Users/tmandry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.92/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=10000 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' --cfg 'feature="rustc-dep-of-std"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=acda6d6c8945d01d -C extra-filename=-acda6d6c8945d01d --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --extern core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/librustc_std_workspace_core-fc593dfc8d04f127.rmeta --cap-lints allow --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo --cfg 'feature="unstable"' --cfg 'feature="mem"'`
error: A dwo section may not contain relocations

   Compiling alloc v0.0.0 (/Users/tmandry/code/rust/library/alloc)
     Running `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name alloc --edition=2021 library/alloc/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="compiler-builtins-mem"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=26880db47770d3ae -C extra-filename=-26880db47770d3ae --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -C incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --extern compiler_builtins=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcompiler_builtins-acda6d6c8945d01d.rmeta --extern core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcore-6dae326047fff8df.rmeta --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo`
    Building [=============>               ] 3/6: core, compiler_builtins, alloc
Did not run successfully: exit status: 1
DYLD_LIBRARY_PATH="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" "--crate-name" "compiler_builtins" "/Users/tmandry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.92/src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--diagnostic-width=195" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "-C" "codegen-units=10000" "-C" "debuginfo=2" "--cfg" "feature=\"compiler-builtins\"" "--cfg" "feature=\"core\"" "--cfg" "feature=\"default\"" "--cfg" "feature=\"mem\"" "--cfg" "feature=\"rustc-dep-of-std\"" "-Zunstable-options" "--check-cfg" "names()" "--check-cfg" "values()" "-C" "metadata=acda6d6c8945d01d" "-C" "extra-filename=-acda6d6c8945d01d" "--out-dir" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "--target" "riscv32imc-unknown-none-elf" "-C" "linker=/usr/bin/clang++" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps" "--extern" "core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/librustc_std_workspace_core-fc593dfc8d04f127.rmeta" "--cap-lints" "allow" "--cfg=bootstrap" "-Csymbol-mangling-version=legacy" "-Zunstable-options" "-Zunstable-options" "--check-cfg=values(bootstrap)" "--check-cfg=values(stdarch_intel_sde)" "--check-cfg=values(no_fp_fmt_parse)" "--check-cfg=values(no_global_oom_handling)" "--check-cfg=values(no_rc)" "--check-cfg=values(no_sync)" "--check-cfg=values(freebsd12)" "--check-cfg=values(freebsd13)" "--check-cfg=values(backtrace_in_libstd)" "--check-cfg=values(target_env,\"libnx\")" "--check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\")" "-Zmacro-backtrace" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Csplit-debuginfo=unpacked" "-Cprefer-dynamic" "-Cllvm-args=-import-instr-limit=10" "-Zinline-mir" "-Clto=off" "-Cforce-unwind-tables=yes" "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" "-Z" "binary-dep-depinfo" "--cfg" "feature=\"unstable\"" "--cfg" "feature=\"mem\"" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Wsemicolon_in_expressions_from_macros" "-Dwarnings" "--sysroot" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
-------------
error: could not compile `compiler_builtins` (lib) due to previous error

Caused by:
  process didn't exit successfully: `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name compiler_builtins /Users/tmandry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.92/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=10000 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' --cfg 'feature="rustc-dep-of-std"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=acda6d6c8945d01d -C extra-filename=-acda6d6c8945d01d --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --extern core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/librustc_std_workspace_core-fc593dfc8d04f127.rmeta --cap-lints allow --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo --cfg 'feature="unstable"' --cfg 'feature="mem"'` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
    Building [==================>          ] 4/6: core, alloc
Did not run successfully: exit status: 1
DYLD_LIBRARY_PATH="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" "--crate-name" "core" "--edition=2021" "library/core/src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--diagnostic-width=195" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "-Zunstable-options" "--check-cfg" "names()" "--check-cfg" "values()" "-C" "metadata=6dae326047fff8df" "-C" "extra-filename=-6dae326047fff8df" "--out-dir" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "--target" "riscv32imc-unknown-none-elf" "-C" "linker=/usr/bin/clang++" "-C" "incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps" "--cfg=bootstrap" "-Csymbol-mangling-version=legacy" "-Zunstable-options" "-Zunstable-options" "--check-cfg=values(bootstrap)" "--check-cfg=values(stdarch_intel_sde)" "--check-cfg=values(no_fp_fmt_parse)" "--check-cfg=values(no_global_oom_handling)" "--check-cfg=values(no_rc)" "--check-cfg=values(no_sync)" "--check-cfg=values(freebsd12)" "--check-cfg=values(freebsd13)" "--check-cfg=values(backtrace_in_libstd)" "--check-cfg=values(target_env,\"libnx\")" "--check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\")" "-Zmacro-backtrace" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Csplit-debuginfo=unpacked" "-Cprefer-dynamic" "-Cllvm-args=-import-instr-limit=10" "-Zinline-mir" "-Clto=off" "-Cforce-unwind-tables=yes" "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" "-Z" "binary-dep-depinfo" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Wsemicolon_in_expressions_from_macros" "-Dwarnings" "--sysroot" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
-------------
error: could not compile `core` (lib) due to previous error

Caused by:
  process didn't exit successfully: `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=6dae326047fff8df -C extra-filename=-6dae326047fff8df --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -C incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 1)
    Building [=======================>     ] 5/6: alloc
Did not run successfully: exit status: 1
DYLD_LIBRARY_PATH="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" "--crate-name" "alloc" "--edition=2021" "library/alloc/src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--diagnostic-width=195" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "--cfg" "feature=\"compiler-builtins-mem\"" "-Zunstable-options" "--check-cfg" "names()" "--check-cfg" "values()" "-C" "metadata=26880db47770d3ae" "-C" "extra-filename=-26880db47770d3ae" "--out-dir" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "--target" "riscv32imc-unknown-none-elf" "-C" "linker=/usr/bin/clang++" "-C" "incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps" "-L" "dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps" "--extern" "compiler_builtins=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcompiler_builtins-acda6d6c8945d01d.rmeta" "--extern" "core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcore-6dae326047fff8df.rmeta" "--cfg=bootstrap" "-Csymbol-mangling-version=legacy" "-Zunstable-options" "-Zunstable-options" "--check-cfg=values(bootstrap)" "--check-cfg=values(stdarch_intel_sde)" "--check-cfg=values(no_fp_fmt_parse)" "--check-cfg=values(no_global_oom_handling)" "--check-cfg=values(no_rc)" "--check-cfg=values(no_sync)" "--check-cfg=values(freebsd12)" "--check-cfg=values(freebsd13)" "--check-cfg=values(backtrace_in_libstd)" "--check-cfg=values(target_env,\"libnx\")" "--check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\")" "-Zmacro-backtrace" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Csplit-debuginfo=unpacked" "-Cprefer-dynamic" "-Cllvm-args=-import-instr-limit=10" "-Zinline-mir" "-Clto=off" "-Cforce-unwind-tables=yes" "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" "-Z" "binary-dep-depinfo" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Wsemicolon_in_expressions_from_macros" "-Dwarnings" "--sysroot" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
-------------
error: could not compile `alloc` (lib) due to previous error

Caused by:
  process didn't exit successfully: `/Users/tmandry/code/rust/build/bootstrap/debug/rustc --crate-name alloc --edition=2021 library/alloc/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=195 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="compiler-builtins-mem"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=26880db47770d3ae -C extra-filename=-26880db47770d3ae --out-dir /Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps --target riscv32imc-unknown-none-elf -C linker=/usr/bin/clang++ -C incremental=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/incremental -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps -L dependency=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/release/deps --extern compiler_builtins=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcompiler_builtins-acda6d6c8945d01d.rmeta --extern core=/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std/riscv32imc-unknown-none-elf/release/deps/libcore-6dae326047fff8df.rmeta --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(freebsd13)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 1)
command did not execute successfully: cd "/Users/tmandry/code/rust" && AR_riscv32imc_unknown_none_elf="/usr/bin/ar" CARGO_INCREMENTAL="1" CARGO_PROFILE_RELEASE_DEBUG="2" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_TARGET_DIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-std" CARGO_TARGET_RISCV32IMC_UNKNOWN_NONE_ELF_LINKER="/usr/bin/clang++" CC_riscv32imc_unknown_none_elf="/usr/bin/clang" CFG_COMPILER_HOST_TRIPLE="riscv32imc-unknown-none-elf" CFG_RELEASE_CHANNEL="dev" CFLAGS_riscv32imc_unknown_none_elf="-ffunction-sections -fdata-sections --target=riscv32imc-unknown-none-elf" CXXFLAGS_riscv32imc_unknown_none_elf="-ffunction-sections -fdata-sections --target=riscv32imc-unknown-none-elf" CXX_riscv32imc_unknown_none_elf="/usr/bin/clang++" LIBC_CHECK_CFG="1" RANLIB_riscv32imc_unknown_none_elf="/usr/bin/ar s" REAL_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/Users/tmandry/code/rust/build/riscv32imc-unknown-none-elf/native" RUSTC="/Users/tmandry/code/rust/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/Users/tmandry/code/rust/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings" RUSTC_REAL="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" RUSTC_SNAPSHOT="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/lib" RUSTC_STAGE="0" RUSTC_SYSROOT="/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0-sysroot" RUSTC_VERBOSE="1" RUSTDOC="/Users/tmandry/code/rust/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="--cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.72.0-dev -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\") -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="--cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Zmacro-backtrace -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Zunstable-options -Csplit-debuginfo=unpacked -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Clto=off -Cforce-unwind-tables=yes -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" RUST_TEST_THREADS="10" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="bootstrapstd" "/Users/tmandry/code/rust/build/aarch64-apple-darwin/stage0/bin/cargo" "build" "--target" "riscv32imc-unknown-none-elf" "--release" "-Zcheck-cfg=names,values,output" "-Zbinary-dep-depinfo" "-j" "10" "-v" "-p" "alloc" "--manifest-path" "/Users/tmandry/code/rust/library/alloc/Cargo.toml" "--features" " compiler-builtins-mem" "-p" "alloc" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
Traceback (most recent call last):
  File "/Users/tmandry/code/rust/./x.py", line 32, in <module>
    bootstrap.main()
  File "/Users/tmandry/code/rust/src/bootstrap/bootstrap.py", line 1094, in main
    bootstrap(args)
  File "/Users/tmandry/code/rust/src/bootstrap/bootstrap.py", line 1069, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/Users/tmandry/code/rust/src/bootstrap/bootstrap.py", line 184, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /Users/tmandry/code/rust/build/bootstrap/debug/bootstrap build library/alloc --target riscv32imc-unknown-none-elf -v

#110224 is related, but the resolution for that appears to be to fix the target definition. The definition for the riscv32imc target correctly lists the only supported option as off:

➜  rust git:(master) ✗ rustc --target riscv32imc-unknown-none-elf --print split-debuginfo
off

So this might actually be a cargo bug. cc @ehuss

@tmandry tmandry added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. O-riscv Target: RISC-V architecture labels Jun 7, 2023
@ehuss
Copy link
Contributor

ehuss commented Jun 8, 2023

This looks to be like a bug in bootstrap here. It is checking for the build target and not the std target. Additionally, it is injecting split-debuginfo settings in RUSTFLAGS instead of using cargo profiles.

I would suggest that bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it. Cargo already dynamically detects if split-debuginfo is supported on the platform.

@ehuss ehuss removed the T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. label Jun 8, 2023
@workingjubilee workingjubilee added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Jun 26, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
[bootstrap] Move the `split-debuginfo` setting to the per-target section

As described in rust-lang#112406, bootstrap currently applies the global `split-debuginfo` setting to all artifacts, irrespective of their target triple.

This doesn't cause problems when the "build" triple defaults `split-debuginfo` to `off` (as is the case on Linux, for example).

However, when the "build" triple has `split-debuginfo` enabled and additional target triples are configured, then artifacts for the additional triples will also be built with `split-debuginfo` (despite not necessarily supporting `split-debuginfo`).

rust-lang#112406 mentions `riscv32imc-unknown-none-elf` as one target where this happens, and I've run into this with Wasm as well.

This PR does **not** implement `@ehuss's` suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.

---

After this PR, anyone explicitly setting `rust.split-debuginfo` should update their configuration to specify the setting in the `target.<triple>` section, though `rust.split-debuginfo` will still be honored for the "build" triple for now.

This PR changes the behavior when `rust.split-debuginfo` was **not** explicitly set **and** bootstrap is configured to cross-compile to a triple that has a different `split-debuginfo` than the "build" triple.

---

If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in [`builder/tests.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/builder/tests.rs)).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
[bootstrap] Move the `split-debuginfo` setting to the per-target section

As described in rust-lang#112406, bootstrap currently applies the global `split-debuginfo` setting to all artifacts, irrespective of their target triple.

This doesn't cause problems when the "build" triple defaults `split-debuginfo` to `off` (as is the case on Linux, for example).

However, when the "build" triple has `split-debuginfo` enabled and additional target triples are configured, then artifacts for the additional triples will also be built with `split-debuginfo` (despite not necessarily supporting `split-debuginfo`).

rust-lang#112406 mentions `riscv32imc-unknown-none-elf` as one target where this happens, and I've run into this with Wasm as well.

This PR does **not** implement ``@ehuss's`` suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.

---

After this PR, anyone explicitly setting `rust.split-debuginfo` should update their configuration to specify the setting in the `target.<triple>` section, though `rust.split-debuginfo` will still be honored for the "build" triple for now.

This PR changes the behavior when `rust.split-debuginfo` was **not** explicitly set **and** bootstrap is configured to cross-compile to a triple that has a different `split-debuginfo` than the "build" triple.

---

If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in [`builder/tests.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/builder/tests.rs)).
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 12, 2024
…rum,onur-ozkan

[bootstrap] Move the `split-debuginfo` setting to the per-target section

As described in rust-lang#112406, bootstrap currently applies the global `split-debuginfo` setting to all artifacts, irrespective of their target triple.

This doesn't cause problems when the "build" triple defaults `split-debuginfo` to `off` (as is the case on Linux, for example).

However, when the "build" triple has `split-debuginfo` enabled and additional target triples are configured, then artifacts for the additional triples will also be built with `split-debuginfo` (despite not necessarily supporting `split-debuginfo`).

rust-lang#112406 mentions `riscv32imc-unknown-none-elf` as one target where this happens, and I've run into this with Wasm as well.

This PR does **not** implement `@ehuss's` suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.

---

After this PR, anyone explicitly setting `rust.split-debuginfo` should update their configuration to specify the setting in the `target.<triple>` section, though `rust.split-debuginfo` will still be honored for the "build" triple for now.

This PR changes the behavior when `rust.split-debuginfo` was **not** explicitly set **and** bootstrap is configured to cross-compile to a triple that has a different `split-debuginfo` than the "build" triple.

---

If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in [`builder/tests.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/builder/tests.rs)).
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 12, 2024
Rollup merge of rust-lang#121754 - TimNN:split-target, r=Mark-Simulacrum,onur-ozkan

[bootstrap] Move the `split-debuginfo` setting to the per-target section

As described in rust-lang#112406, bootstrap currently applies the global `split-debuginfo` setting to all artifacts, irrespective of their target triple.

This doesn't cause problems when the "build" triple defaults `split-debuginfo` to `off` (as is the case on Linux, for example).

However, when the "build" triple has `split-debuginfo` enabled and additional target triples are configured, then artifacts for the additional triples will also be built with `split-debuginfo` (despite not necessarily supporting `split-debuginfo`).

rust-lang#112406 mentions `riscv32imc-unknown-none-elf` as one target where this happens, and I've run into this with Wasm as well.

This PR does **not** implement `@ehuss's` suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.

---

After this PR, anyone explicitly setting `rust.split-debuginfo` should update their configuration to specify the setting in the `target.<triple>` section, though `rust.split-debuginfo` will still be honored for the "build" triple for now.

This PR changes the behavior when `rust.split-debuginfo` was **not** explicitly set **and** bootstrap is configured to cross-compile to a triple that has a different `split-debuginfo` than the "build" triple.

---

If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in [`builder/tests.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/builder/tests.rs)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-riscv Target: RISC-V architecture 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

3 participants