-
Notifications
You must be signed in to change notification settings - Fork 85
"error: cortex-m-rt appears more than once in the dependency graph" #275
Comments
That's odd, the string is the export name of an empty static variable so shouldn't end up in the actual binary output. Is it appearing in the output ELF file or the output raw binary (i.e. |
It seems it isn't present in the binary that objcopy gives me, which is weird because the assembly listing contains a lot of this: movw r2, :lower16:"error: cortex-m-rt appears more than once in the dependency graph"
mov r0, r1
movt r2, :upper16:"error: cortex-m-rt appears more than once in the dependency graph"
movs r1, #1 |
I think what's going on might be that because that variable is static and zero-sized, the next static variable is assigned to the same address, and when the disassembler tries to work out what symbol name to display, it picks the wrong one. How are you generating the assembly listing? |
I'm using |
How about if using |
It looks like you are right about the symbol being assigned to something else, I see a lot of jumps to the symbol plus a random offset. Sounds odd, but it looks like a harmless quirk. Although, in the disassembly by objdump, the symbol is listed in different context than when using emit asm... But I guess that's also some tool quirk. |
Probably the solution is to move to the |
Unfortunately this doesn't look like something we can fix any time soon; eventually we can remove One workaround for development purposes might be to add a small static to your firmware that ends up mapped to the ONCE address but isn't otherwise used, so that your other references to actual statics still disassemble correctly. Since there's not much else to do now I'll close this issue; please re-open if further discussion is needed though. Thank you for reporting it! |
Fortunately, this does seem the case. Thank you for investigating. |
276: Replace __ONCE__ with Cargo links key r=jonas-schievink a=adamgreig This would fix #275. We use the links key in cortex-m already [here](https://github.com/rust-embedded/cortex-m/blob/master/Cargo.toml#L16). See also rust-embedded/wg#467. Co-authored-by: Adam Greig <adam@adamgreig.com>
I've been reading some of the emitted ASM of my application, and I've found that "error: cortex-m-rt appears more than once in the dependency graph" is present in the generated binary (-O3) and is referenced 126 times (63 loads I think) in my assembly. What's up with that, if the error is only there for compile-time?
The text was updated successfully, but these errors were encountered: