-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Excess object in staticlib archive eventually causing link error #125619
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.C-external-bugCategory: issue that is caused by bugs in software beyond our controlCategory: issue that is caused by bugs in software beyond our controlO-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-muslTarget: The musl libcTarget: The musl libcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.C-external-bugCategory: issue that is caused by bugs in software beyond our controlCategory: issue that is caused by bugs in software beyond our controlO-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-muslTarget: The musl libcTarget: The musl libcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen:
The
nmoutput shouldn't sayU __builtin_copysignq, since that's an x86 intrinsic unavailable onaarch64-unknown-linux-gnuInstead, this happened:
Over in Ruby, because we consume the static archive by partial linking it into an
.ofile first, we've been getting reports of link errors due to this unused object in the archive:It looks like this particular intrinsic comes from a file that isn't included for ARM Windows targets:
https://github.com/rust-lang/compiler-builtins/blob/c04eb9e1afb72bdf943f5e5d77b3812f40526602/build.rs#L537-L539
so in fact it should be completely unused. In the README for
compiler-builtins, the file is listed under "Unimplemented" and seemingly with no plan for usage:I'm wondering if rust could stop including this object in the archive.
Meta
This is regression that started in
1.78.0. With1.77.0the nm output is:and it works fine for ruby.
Issue exists in latest nightly.
rustc --version --verbose: