-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Invalid bitcast
error when building rustc (rustc-std-workspace-core)
#110472
Comments
Could you please rerun the last rustc command (maybe you need to pass |
Here it is: the command I ran(I actually ran it twice because the first time I wasn't sure if it was working and then I later found where the cd "/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2" && AR_x86_64_unknown_linux_gnu="ar" CARGO_INCREMENTAL="1" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_TARGET_DIR="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage1-std" CC_x86_64_unknown_linux_gnu="cc" CFG_COMPILER_HOST_TRIPLE="x86_64-unknown-linux-gnu" CFG_RELEASE_CHANNEL="dev" CFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXXFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXX_x86_64_unknown_linux_gnu="c++" LIBC_CHECK_CFG="1" RANLIB_x86_64_unknown_linux_gnu="ar s" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/native" RUSTC="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/bootstrap/debug/rustc" RUSTC_BACKTRACE_ON_ICE="1" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage1/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings" RUSTC_REAL="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" RUSTC_SNAPSHOT="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTC_STAGE="1" RUSTC_SYSROOT="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage1" RUSTC_VERBOSE="1" RUSTDOC="/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-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","loongarch64") --check-cfg=values(target_env,"ohos") -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.71.0-dev -Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/\")" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-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","loongarch64") --check-cfg=values(target_env,"ohos") -Zmacro-backtrace -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Csplit-debuginfo=off -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Zinline-mir -Cembed-bitcode=yes -Clto=off -Csave-temps=yes -Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/\")" RUST_TEST_THREADS="96" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="devstd" "/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "-Zcheck-cfg=names,values,output" "-Zbinary-dep-depinfo" "-j" "96" "-v" "--features" " panic-unwind backtrace" "--manifest-path" "/local/home/garzbrya/projects/rustc/issue-110467-safe-transmute2/library/test/Cargo.toml" "--message-format" "json-render-diagnostics" |
Some of the optimized bitcode files do contain invalid alignments, but I did not manage to produce such corrupted files from the unoptimized bitcodes files. |
Update: I used git bisect -- the LLVM 16 commit seems to be the one causing the error #109474 |
Seems setting |
I did some reduction of the #![feature(no_core, const_trait_impl, rustc_attrs, lang_items, fundamental, auto_traits)]
#![no_std]
#![no_core]
#![crate_type="rlib"]
#[lang = "copy"] trait Copy: Clone { }
#[lang = "clone"] trait Clone: Sized { fn clone(&self) -> Self; }
#[lang = "sized"] trait Sized { }
#[lang = "freeze"] unsafe auto trait Freeze {}
#[lang = "receiver"] trait Receiver { } impl<T: ?Sized> Receiver for &T {}
impl Copy for u8 {}
impl Copy for [u8; 1] {}
impl Clone for u8 { fn clone(&self) -> Self { *self } }
impl Clone for [u8; 1] { fn clone(&self) -> Self { *self } }
struct Pc { _size: [u8; 1], }
impl Copy for Pc {}
impl Clone for Pc { fn clone(&self) -> Pc { *self } } Invocation:
Output:
|
Running into this on commit |
Per https://pkgs.org/search/?q=libstdc%2B%2B it looks like Amazon Linux 2 uses libstdc++ 7, which is ABI incompatible with the libLLVM.so for download-ci-llvm. I believe you need at least libstdc++ 8. Possibly the build system should check the version. |
#125411 would catch this problem. |
Closing this as #125411 is merged and now the build system is capable of checking |
Description
I'm building rustc on an Amazon Linux 2 (m5.24xlarge) machine. This has worked for me the last 5 months, but currently, HEAD is giving me an error when running
./x.py build library
.I thought that it was maybe something I had caused, so I spun up a brand new instance, but I'm still able to reproduce.
Meta
uname -a
:rust HEAD
Error output
The text was updated successfully, but these errors were encountered: