-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Constantly receiving Undefined symbols for architecture x86_64
#79946
Comments
This looks like it might be caused by wasm-bindgen. Have you asked those maintainers whether they recognize the issue? |
I think this is actually an incremental compilation bug. @jkelleyrtp: What versions of Rust are you using? |
@jyn514 not a wasm bug, this happens with all sorts of crates. In this case, it just so happens that wasm-bindgen got caught by the issue.
I think it has to do with incremental compilation. Often times I close an editor or Rust Analyzer locks the build directory, and I could imagine that it might crash rustc while building. My stable is:
My nightly is
If rustc gets killed while compiling, would it corrupt build artifacts? Though, I'm not entirely sure, because running |
The nightly build that you're using includes #76859. I had hoped that that PR would solve this kind of issue once and for all - unfortunately, that doesn't seem to be the case. @jkelleyrtp Can you share one of the projects that this happens with? It would be extremely helpful if you could provide precise reproduction instructions (e.g. do you need to modify any files)? |
I've been hitting spurious errors while building rustc itself. They're different from yours (more along the lines seen in #67802), but there are some commonalities. Incremental seems to play a role, |
@tgnottingham can you paste the full errors you're running into? |
They're varied, but generally along those lines. And they're different from @jkelleyrtp's, as I said, so maybe totally unrelated (apologies for derailment). |
Heh, I just ran into this myself:
and now I think I know what's going wrong - @tgnottingham do you have an IDE set up to run |
@jyn514, I don't think anything is running |
@tgnottingham rust analyzer invokes either cargo check or x.py depending on how you set it up: https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=Rust-analyzer#configuring-rust-analyzer-for-rustc. So I expect that's what's going wrong. Do you want to move to zulip so we're not spamming the issue? I think this is different from the wasm error. |
I just ran into this. I'm not running anything in the background, so this is definitely a rustc or LLVM bug. |
I just ran into this issue as well, building from scratch, no background build processes happening. Is there any information I can give to help with this? |
Found a clue... I turned on |
In case it helps somebody I encountered the issue in a build at work on CI using
Plateforms impacted (for us)
What we usedWe used grcov with configuration for gitlab CI inspired from the So we configure something like this: Setup
The fail occurs while building stacktraceerror: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-Wl,--version-script=/tmp/rustco1AkJk/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustco1AkJk/symbols.o" "/tmp/cargo-installR9oiqm/release/deps/thiserror_impl-4f744515f9cb4819.thiserror_impl.ac9971b9d8603b5c-cgu.0.rcgu.o" "/tmp/cargo-installR9oiqm/release/deps/thiserror_impl-4f744515f9cb4819.461oo03yg4smhdm9.rcgu.rmeta" "/tmp/cargo-installR9oiqm/release/deps/thiserror_impl-4f744515f9cb4819.2z5rthv354yodzxf.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installR9oiqm/release/deps" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installR9oiqm/release/deps/libsyn-4077fd9350529457.rlib" "/tmp/cargo-installR9oiqm/release/deps/libquote-e42fdfbb74cb4817.rlib" "/tmp/cargo-installR9oiqm/release/deps/libproc_macro2-6ba8af40d919ba07.rlib" "/tmp/cargo-installR9oiqm/release/deps/libunicode_ident-a505ddbb66acf82e.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-50086f81dc2d4d6f.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-b02085de848d0686.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-19964a87984cce8a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort-27be7e902ae40178.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-37a5cbc9c5c20c04.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e8cedd2960ff146a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5deb081ad96d9130.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-22c964fd8f2dfaf9.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-6971442fd1c2cfbb.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-ec7906ee77b1d540.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-4307a3ebc7f0bfcf.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c2ab156d57b93da1.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-763bbb8717f828b7.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-eb9ba65f17380c5d.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-4286d0bf3addfc05.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-fa17a4d002f91ad9.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ff4ae84067796be3.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6f47c72c85a10103.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-cd2f2bc505f56f50.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ec02dd343723da85.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-4df0073ab5846ddb.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/tmp/cargo-installR9oiqm/release/deps/libthiserror_impl-4f744515f9cb4819.so" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-u" "__llvm_profile_runtime"
= note: /usr/bin/ld: /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-50086f81dc2d4d6f.rlib(InstrProfilingPlatformLinux.o): relocation R_X86_64_PC32 against undefined hidden symbol `__ehdr_start' can not be used when making a shared object
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: could not compile `thiserror-impl` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-Wl,--version-script=/tmp/rustctpHzqt/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustctpHzqt/symbols.o" "/tmp/cargo-installR9oiqm/release/deps/serde_derive-f0beeb3c8c1c4dec.serde_derive.b21f8c48fc810b11-cgu.0.rcgu.o" "/tmp/cargo-installR9oiqm/release/deps/serde_derive-f0beeb3c8c1c4dec.2fxq5lwx6clvk4ro.rcgu.rmeta" "/tmp/cargo-installR9oiqm/release/deps/serde_derive-f0beeb3c8c1c4dec.4hkmz16s2bgqz7ni.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installR9oiqm/release/deps" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installR9oiqm/release/deps/libsyn-4077fd9350529457.rlib" "/tmp/cargo-installR9oiqm/release/deps/libquote-e42fdfbb74cb4817.rlib" "/tmp/cargo-installR9oiqm/release/deps/libproc_macro2-6ba8af40d919ba07.rlib" "/tmp/cargo-installR9oiqm/release/deps/libunicode_ident-a505ddbb66acf82e.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-50086f81dc2d4d6f.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-b02085de848d0686.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-19964a87984cce8a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort-27be7e902ae40178.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-37a5cbc9c5c20c04.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e8cedd2960ff146a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5deb081ad96d9130.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-22c964fd8f2dfaf9.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-6971442fd1c2cfbb.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-ec7906ee77b1d540.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-4307a3ebc7f0bfcf.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c2ab156d57b93da1.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-763bbb8717f828b7.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-eb9ba65f17380c5d.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-4286d0bf3addfc05.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-fa17a4d002f91ad9.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ff4ae84067796be3.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6f47c72c85a10103.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-cd2f2bc505f56f50.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ec02dd343723da85.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-4df0073ab5846ddb.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/tmp/cargo-installR9oiqm/release/deps/libserde_derive-f0beeb3c8c1c4dec.so" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-u" "__llvm_profile_runtime"
= note: /usr/bin/ld: /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-50086f81dc2d4d6f.rlib(InstrProfilingPlatformLinux.o): relocation R_X86_64_PC32 against undefined hidden symbol `__ehdr_start' can not be used when making a shared object
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: could not compile `serde_derive` (lib) due to previous error
error: failed to compile `grcov v0.8.18`, intermediate artifacts can be found at `/tmp/cargo-installR9oiqm`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. |
I'm constantly receiving
Undefined symbols for architecture x86_64
when runningcargo build/test/check/run
. It happens in projects with a variety of targets (wasm/arm/x86/musl). I can make it temporarily go away when switching my default from stable to nightly, but the issues will resume and I'll have to switch back.The stack traces I'm receiving are especially nasty:
Unfortunately,
cargo clean
doesn't help, nor does switching from debug to release.The text was updated successfully, but these errors were encountered: