-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Compile Error on AVR atmega328p with global_asm! in lib.rs #134758
Copy link
Copy link
Open
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-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-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 controlE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleO-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)T-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.
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-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-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 controlE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleO-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is my first issue, so I'm not sure if this is the right place to report or if it is reported already.
Also formatting this issue is new to me ...
I'm on Rust with AVR atmega328p, using
I use "global_asm!" macro which compiles Ok in a bin main.rs and gives a compile error in a lib lib.rs.
The error is
The source in both, main.rs and lib.rs is
To test, I have two crates, one to test as --bin with main.rs, one to test as --lib with lib.rs
Both crates have .cargo/config.toml
Both have Config.toml
The main.rs in the bin test crate :
... compiles and links fine !
The lib.rs in the lib test crate :
... and gives compile error
Command for both crates is cargo build --release
I've tracked it down to llvm :
The ("","") forces the feature map to go to the lowest for AVR and does not honor, that "atmega328p" features should be used.
Ich I patch it to
it compiles fine :) But this is not a Solution
So here I stuck ...
br
xjn