Closed
Description
Any crate that uses std::sync::Arc
fails to compile with a link error saying unresolved external symbol __atomic_fetch_sub_8
Test case on rustc 1.38.0-nightly (6a91782b7 2019-08-06)
fn main() {
let test = std::sync::Arc::new(32);
}
outputs:
link_error-44aa39a2e793d984.29ne1tatqckt0j9r.rcgu.o : error LNK2019: unresolved external symbol __atomic_fetch_sub_8 referenced in function _ZN4core4sync6atomic10atomic_sub17hb46c24bb21c6d0b1E
or from a bigger project:
build_script_build-10d0cb3662789960.build_script_build.brrzdj7n-cgu.18.rcgu.o : error LNK2019: unresolved external symbol __atomic_fetch_sub_8 referenced in function
_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17h215332bbcf7e5cb5E
build_script_build-10d0cb3662789960.build_script_build.brrzdj7n-cgu.20.rcgu.o : error LNK2001: unresolved external symbol __atomic_fetch_sub_8
F:\code\projects\active\untitled\target\debug\build\byteorder-10d0cb3662789960\build_script_build-10d0cb3662789960.exe : fatal error LNK1120: 1 unresolved externals
Nightly rustc 1.38.0-nightly (4bb6b4a5e 2019-07-11)
/nightly-2019-07-12-x86_64-pc-windows-msvc
works totally fine.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: linking into static, shared libraries and binariesCategory: This is a bug.Operating system: LinuxOperating system: WindowsRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to nightly.