hexagon: use a single global_asm! block for source-order stability - #1241
Conversation
Since rust-lang/rust#145358 ("Sort mono items by symbol name", merged 2025-08-22), rustc sorts mono items within a codegen unit by symbol name rather than source order unless -Zcodegen-source-order is passed. That breaks func_macro.s, which defines asm macros for use by "later" files. Merge all includes into one global_asm! call. A single MonoItem cannot be reordered against itself, so the source order becomes the order the assembler sees. The file set and its order are unchanged, and all these items already shared one codegen unit, so object-file granularity is unaffected.
|
Fixes #1240 |
|
Be aware that macros are technically not allowed in |
Okay - good point. I liked having the asm here resemble the corresponding stuff in compiler-rt. But I'm fine w/remediating this by fixing the asm to no longer depend on the |
Sadly, we have not done a good enough job maintaining the hexagon targets. 😖 |
|
You still want to avoid code duplication you could use a rust macro that you invoke inside the |
Since rust-lang/rust#145358 ("Sort mono items by symbol name", merged 2025-08-22), rustc sorts mono items within a codegen unit by symbol name rather than source order unless -Zcodegen-source-order is passed.
That breaks func_macro.s, which defines asm macros for use by "later" files.
Merge all includes into one global_asm! call. A single MonoItem cannot be reordered against itself, so the source order becomes the order the assembler sees. The file set and its order are unchanged, and all these items already shared one codegen unit, so object-file granularity is unaffected.
Closes: #1240