-
Notifications
You must be signed in to change notification settings - Fork 166
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
riscv-rt
: Cannot be built with lto = true
if the user defines replacement for .weak
symbols
#247
Comments
Maybe you can try this: #200 (comment) and see if it resolves it. It should discard asm syms in LTO consideration. |
Ah, sorry, I completely forgot to link the issue I filed in the original post. It's #133974. I already have a working solution using |
I prefer @MabezDev 's suggestion, as it would fit stable Rust too. In any case, while these crates are mainly focused on stable Rust, it should be harmless to provide some nightly functionalities under feature gates. |
I've been trying that for a couple hours today and I'm either not clever enough to get it to work or it just doesn't work. If I put the |
Let me think a bit on this issue. Maybe we can try to reduce the number of weak symbols by making the build script more sophisticated. |
I did find the PR that introduced weak symbols was marked as closing #155. Is there a mechanism for pruning the default definitions if they're not overridden by the end user? I thought maybe |
Looks like Rust already does that (link), but it didn't work? Maybe we can make If we want to keep What do you think? Am I missing something important? |
In fact, |
The cause of the change in is #197 . So... perhaps the |
I think that sounds about right to me. Just to clarify my understanding of this so I can work on it - do you mean to remove the busy loop-defined default functions from the Rust code and instead replace them with a |
So, abort is renamed to
I would like @MabezDev and @jessebraham to share their opinions about this move. They work a lot in the |
I think that could be a workable solution. Frankly I'm entirely unsure of how |
OK, you can open a PR with these changes and we move the discussion there |
With the current design choice for some functions to be written in Assembly and be marked as
.weak
, this can remove the ability for downstream users to build withlto = true
. I initially filed a bug withrustc
, however, bjorn3 there suggested that this crate could replace.weak
with#[linkage = "weak"]
behind some sort of nightly feature. I have a locally patched version, however it at minimum would require#![feature(linkage)]
and possibly even#![feature(linkage, naked_functions)]
. I don't know where this project stands on nightly usage, but I think this could fairly easily be hidden behind a feature flag.The text was updated successfully, but these errors were encountered: