<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96743>96743</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
AVR rtlib linking quirks warning emitted even when not linking
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AVR,
clang:driver
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DavidSpickett
</td>
</tr>
</table>
<pre>
Originally reported in https://discourse.llvm.org/t/how-to-debug-to-learn-llvm-backend/79655/8.
```
$ cat /tmp/test.c
int main() {
return 0;
}
```
If I try to link the program I get these warnings:
```
$ ./bin/clang --target=avr /tmp/test.c -o /dev/null
clang: warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name> [-Wavr-rtlib-linking-quirks]
clang: warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked [-Wavr-rtlib-linking-quirks]
clang: warning: support for passing the data section address to the linker for microcontroller '' is not implemented [-Wavr-rtlib-linking-quirks]
clang: error: unable to execute command: Executable "avr-ld" doesn't exist!
clang: error: avr-ld command failed with exit code 1 (use -v to see invocation)
```
Which is expected. What is not expected is that I get one of them even when not linking:
```
$ ./bin/clang --target=avr /tmp/test.c -S -o -
clang: warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name> [-Wavr-rtlib-linking-quirks]
.text
<...>
```
Also emitted for `-E`:
```
$ ./bin/clang --target=avr /tmp/test.c -E -o -
clang: warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name> [-Wavr-rtlib-linking-quirks]
# 1 "/tmp/test.c"
```
And `-c`:
```
$ ./bin/clang --target=avr /tmp/test.c -c -o /dev/null
clang: warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name> [-Wavr-rtlib-linking-quirks]
```
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?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVk1v2zgT_jX0ZSBDJv0RH3xw4wjo4cULtEB7psixxA0_tOTIif_9YiQ7iwbpYbG9dINAlobkzDPPfHB0Ka6LiAex-SQ2p4UeqU_5cNIXZ78Ozjwj0aJN9nr4f3adi9r7K2QcUia04CL0REMR6ihkI2RjXTFpzAWX3l_CMuVOyIaEbPr0UlGqLLZjxy8edY4Vb6pabZ4xWiGb3X672QjZPCxFfRL18fbc1rf_-VOuwWgCVhwGfmKhpZkXXSQI2kUhH4Tcg9h9muUAGWnMEWqhbiKxO32o__MZPgPlK1AC7-IzUI8w5NRlHeAzdEgsKQgvOkcXu8n5nwFdCtm0DKcxXscOqop07pCEOulLfu8DVIlFFi9CNnH0flY0HRXqeLfIrzHBrAmCMzmZFCkn7zFDGdC4s0MLKYJJIeho2REU8hGMjjHR7FchHa3OvNhmnR0W3jF41AVh0KVAFYIZhToJ9RjMCFEHFOoJxOZT9V1fcpXJu7ZiZS521Z-jy89FbE4_R_3O5BXuYNACwyyJHXORMOdxILigoZSBdOsRUmZ3BsdO5jGSCwg5jeQiFnhx3kOLd2X_AuI4cHLDOeWJBBe7KQOsJg0FDbkUQVubsRROEV6bjObpyPtoCLkTcgeuTK66MHgMGOmfQ8ScU-aXMU5sUAJ8RTMS3oPMi0-TaNogpGTt3gopwSYsUcgdAb66QkKufqZ-PvOWOGftPFp4cdTzUQKTLMIKhHwYC0J1YSAFEVy8JKOZHSH3H9fD9PzeO9MzH_g6oCG0S_jea7ozdJfyN7F8rrgUEdKZyQ6AF4zw0mN8y545dL-sCL9yHVa_c-3B7W9J-Eo3ItTjcrkU6ulDmo6-JMDgiKnnPBbbunri5V_I69Nvz6uQasp9-f7ykfJjWqOdmDS_mMn_1k3xAWlDxjIG3for6HiFRD1mCMnirSvY9Fb8P8wK_9PXFrlNZOQOUlLA2-HiLAKez2iIOwlH5YaZy2Jbz3pf0ujtfZsuBQND4Ct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