Open DavidSpickett opened 1 week ago
@llvm/issue-subscribers-clang-driver
Author: David Spickett (DavidSpickett)
The -mmcu
option does affect even with -c
/-S
, some instructions are not available on compact devices, such as JMP
/CALL
(4-byte instructions), and clang
/llvm
will decide to emit them or not according to -mmcu
.
But it is to verbose to mention that, so how about change the warning more brief?
clang: warning: no target microcontroller specified, please pass -mmcu=<mcu name> [-Wavr-rtlib-linking-quirks]
That works, and if you try to link you'll get this warning as well:
warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked
So it's implied that -mmcu
is doing more than just selecting libraries.
Also, while I have your attention, when I selected avr1
I got a crash: https://godbolt.org/z/GeGqWxMrz
Is this worth reporting or is the support here known to have issues? GCC has assembler only support, so maybe I am just asking clang to do something silly here.
Also, while I have your attention, when I selected
avr1
I got a crash: https://godbolt.org/z/GeGqWxMrzIs this worth reporting or is the support here known to have issues? GCC has assembler only support, so maybe I am just asking clang to do something silly here.
Please submit another issue for this crash. Thanks!
Originally reported in https://discourse.llvm.org/t/how-to-debug-to-learn-llvm-backend/79655/8.
If I try to link the program I get these warnings:
Which is expected. What is not expected is that I get one of them even when not linking:
Also emitted for
-E
:And
-c
:And presumably any other modes that do not link.
Maybe there is some other side effect of
-mmcu=...
that would effect assembly or the preprocessor (seems most likely), but if so, perhaps the warning could mention that too?