Closed seanmkauffman closed 9 years ago
It's probably a bug in the subtarget feature descriptions. I'll investigate.
The atmega2560 is apart of the avr6
architecture, and we make sure that we only emit instructions that this family supports.
What we aren't doing, however, is setting the architecture
field inside the ELF header appropriately - we always set it to avr
. The reason why AVR-GCC is failing to link the program is because it expects the architecture to be set to avr6
in the ELF header.
When compile to an object file using
llvm-mc
with-triple=avr-none -mcpu=atmega2560
and then try to link with ld, I get an error that the architecture is incompatible.It looks like the object files are specifying the architecture without the version that ld is expecting. This appears to occur regardless of the contents of the source file, so long as I'm compiling with these flags.
I tried removing the
-triple
argument, but then it won't assemble properly. It's possible I'm not specifying the flags properly, but I couldn't figure out how to resolve this from digging around in the code.