Skip to content

LLVMRust symbols not defined when building with -Zcross-crate-inline-threshold=always #118084

Closed
@saethlin

Description

@saethlin

I tried this code:

RUSTFLAGS_NOT_BOOTSTRAP=-Zcross-crate-inline-threshold=yes x build --stage 2 library

I expected to see this happen: build succeeds

Instead, this happened: huge linker error

  = note: /usr/bin/ld: /home/ben/rust-master/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_main-7ded3dee8b4f0982.rustc_main.8884e0661a07df8b-cgu.00.rcgu.o: in function `rustc_codegen_llvm::debuginfo::metadata::extend_scope_to_file':
          /home/ben/rust-master/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1530:(.text._RINvMNtNtCs2lOlULwIAjb_17rustc_codegen_ssa3mir9debuginfoINtB3_10DebugScopeRNvNtNtCs4kfzHsID1rW_18rustc_codegen_llvm5llvm_3ffi8MetadataB1a_E25adjust_dbg_scope_for_spanNtNtB1h_7context9CodegenCxECsbIGDuTTUdex_10rustc_main+0x90): undefined reference to `LLVMRustDIBuilderCreateLexicalBlockFile'
          /usr/bin/ld: /home/ben/rust-master/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_main-7ded3dee8b4f0982.rustc_main.8884e0661a07df8b-cgu.00.rcgu.o: in function `rustc_codegen_llvm::llvm_util::configure_llvm':
          /home/ben/rust-master/compiler/rustc_codegen_llvm/src/llvm_util.rs:53:(.text.unlikely._RINvMs0_NtNtNtCs7JBb18HWky5_3std10sys_common4once5futexNtB6_4Once4callNCINvMs0_NtNtBc_4sync4onceNtB1f_4Once9call_onceNCNvNtCs4kfzHsID1rW_18rustc_codegen_llvm9llvm_util4init0E0ECsbIGDuTTUdex_10rustc_main+0x1eb): undefined reference to `LLVMRustInstallFatalErrorHandler'
          /usr/bin/ld: /home/ben/rust-master/compiler/rustc_codegen_llvm/src/llvm_util.rs:58:(.text.unlikely._RINvMs0_NtNtNtCs7JBb18HWky5_3std10sys_common4once5futexNtB6_4Once4callNCINvMs0_NtNtBc_4sync4onceNtB1f_4Once9call_onceNCNvNtCs4kfzHsID1rW_18rustc_codegen_llvm9llvm_util4init0E0ECsbIGDuTTUdex_10rustc_main+0x22b): undefined reference to `LLVMRustDisableSystemDialogsOnCrash'
          /usr/bin/ld: /home/ben/rust-master/compiler/rustc_codegen_llvm/src/llvm_util.rs:124:(.text.unlikely._RINvMs0_NtNtNtCs7JBb18HWky5_3std10sys_common4once5futexNtB6_4Once4callNCINvMs0_NtNtBc_4sync4onceNtB1f_4Once9call_onceNCNvNtCs4kfzHsID1rW_18rustc_codegen_llvm9llvm_util4init0E0ECsbIGDuTTUdex_10rustc_main+0x616): undefined reference to `LLVMTimeTraceProfilerInitialize'
          /usr/bin/ld: /home/ben/rust-master/compiler/rustc_codegen_llvm/src/llvm_util.rs:129:(.text.unlikely._RINvMs0_NtNtNtCs7JBb18HWky5_3std10sys_common4once5futexNtB6_4Once4callNCINvMs0_NtNtBc_4sync4onceNtB1f_4Once9call_onceNCNvNtCs4kfzHsID1rW_18rustc_codegen_llvm9llvm_util4init0E0ECsbIGDuTTUdex_10rustc_main+0x820): undefined reference to `LLVMRustSetLLVMOptions'
          /usr/bin/ld: /home/ben/rust-master/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_main-7ded3dee8b4f0982.rustc_main.8884e0661a07df8b-cgu.00.rcgu.o: in function `<rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::consts::ConstMethods>::const_to_opt_uint::{closure#0}':
          /home/ben/rust-master/compiler/rustc_codegen_llvm/src/common.rs:223:(.text._RINvMs_NtNtCs2lOlULwIAjb_17rustc_codegen_ssa3mir5placeINtB5_8PlaceRefRNvNtNtCs4kfzHsID1rW_18rustc_codegen_llvm5llvm_3ffi5ValueE13project_indexNtNtB1c_7builder7BuilderECsbIGDuTTUdex_10rustc_main+0x63): undefined reference to `LLVMRustConstIntGetZExtValue'

... and on and on and on...

(it is entirely possible that the flag is broken, I haven't tried using it very many places yet)

Metadata

Metadata

Assignees

Labels

A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions