Repository navigation
Regression when using linker=arm-none-eabi-gcc #113597
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.regression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.
on Jul 12, 2023 - addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.and removedregression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.
on Jul 12, 2023 linker: Some("rust-lld".into()),
shows that the default for the target is rust-lld. i wonder if the new code uses the default instead of the linker in -C linker for some reason?- addedA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compiler
on Jul 12, 2023 - removedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Jul 12, 2023 I wonder if we're meant to be adding some other argument to disable adding -fuse-ld=lld?
You were not meant to do anything, sorry about that. I'll fix it.
I can't build a
thumbv6m-none-eabitoolchain locally, via./x build library/ --target thumbv6m-none-eabi, which would be complete enough for thiscortex-mtest to build. There are issues about missing core/std.I tried on a
no_stdexample, and can also reproduce thearm-none-eabi-gccissue and investigate more there, and thatrust-lldandarm-none-eabi-ldwork.The code I added in #112910 is asked to add CLI arguments for a
Gnu(Cc::Yes, Lld::Yes)flavor: this asks to link usinglldvia a c/c++ compiler, and why-fuse-ld=lldis added. I assume that flavor is incorrect when using-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles@adamgreig ? (I don't know who the target maintainers are, so I'll also ping the other 2 people involved in the discovery: @hannobraun @thejpster)-C linker=arm-none-eabi-ldand-C linker=rust-lldstill work because they result in a non-ccrequest, and we don't do anything there as expected.For my own understanding: does
arm-none-eabi-gccusearm-none-eabi-ldby default maybe ? And if so, I'd expect that explicitly specifying the linker would also fix the issue, à la-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles -C link-arg=-fuse-ld=bfdwhich seems to work for me ?I'll look into why this surprising flavor is used in this situation, as it seems to be the pre-existing issue here uncovered by the PR, and report back. It could be an issue in the flavor inference, or some information missing in the targets' definitions, and so on.
- addedP-mediumMedium priorityMedium priorityand removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Jul 12, 2023 9 remaining items
- added a commit that references this issue
on Jul 13, 2023 Thanks for the information, it's very helpful.
The good news is that using GCC as a linker is still working 😅. In the future where we switch to lld, maybe rustc will also need an explicit linker flavor here, to make sure the flavor it guesses actually matches your expectations. But that's a topic for another day/stabilization: in the more immediate future, things will return to normal for the target and
cortex-m's tests in a day or two.Reacted by Adam Greig- added a commit that references this issue
on Jul 13, 2023 Thank you!
Just to come back to this point:
I don't know who the target maintainers are
I was under the impression that Arm Ltd were maintaining the
thumbv*m-none-eabi*targets. However, they don't appear to have the platform-support documentation that is required for more recently added targets. Maybe that could be addressed.Reacted by JubileeThis is now on beta, reopening to track backport.
@thejpster Pursuant to your concern I have opened #113739 to summarize the issue that affects indeed all our tier 2 targets.
Reacted by jyn and Jonathan 'theJPster' Pallant
The cortex-m CI tests building with all our supported linkers: Rust's provided
lld, ARM GCC'sarm-none-eabi-ld, and ARM GCC'sarm-none-eabi-gcc. It recently encountered an error when usingarm-none-eabi-gccin nightly builds since #112910.The most likely culprit is that the failing version has started added
"-fuse-ld=lld"to the linker arguments, which was not present in previous working versions. @lqd, I wonder if we're meant to be adding some other argument to disable adding-fuse-ld=lld?Code
The error occurs with the cortex-m-rt CI and can be reproduced like so:
Or viewed in CI here.
The error is:
Version it worked on
nightly-2023-07-02
Version with regression
nightly-2023-07-03
bisected to 8e2d5e3
from PR #112910
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged