From: John M. <ato...@gm...> - 2012-12-13 06:14:24
|
HI Borja, Have you gone any farther with trying to setup a toolchain? It looks like clang can just be installed using the same PREFIX that avr-gcc was installed with in order to keep them in the same folder. The include path is hard coded in clang (except for Windows and Linux targets). So a quick and dirty way would be to make a patch to change it. Clang has Driver & Toolchain classes which I think needs to be modified to support an AVR target. On Tue, Aug 28, 2012 at 3:24 PM, Borja Ferrer <bor...@gm...> wrote: > Hello, > > With the latest changes, the backend is reaching the point where it can > compile nearly any sort of code. One thing that is missing is support for > inline asm which is heavily used in avr-libc, but apart from that it should > be able to compile the rest. With a few tweaks i've been able to compile a > 2200 line C file that stresses floating point calculations that produces > around 22k instructions (C file -> S file) > > Now I'm getting more interested on getting a very basic toolchain working, > Eric we'll need your help here. I've been able to build from a C file to a > hex file a very basic main() function. avr-gcc is needed to produce the elf > files and to drive the linker, so we'll have to stick with it for a while. > The setup I have is messy because avr-gcc is in one folder with avr-libc > and clang and llvm in another, so in order to get the toolchain with a > decent setup both things should be in the same folder. Also included files > default to the system's not the avr specific ones. Maybe others have tried > it before, so i want to know how you did it or how hard it was, but in my > case my first try was yesterday. > > Also I'm going to change how register-pairs are represented because avr-as > can't understand what r29:r28 is. The llvm asm writer needs a bit of > tweaking because avr-as can't understand some asm directives it produces. > > This is the cmd line i'm using to generate an object file: clang -O3 > test.c -o test.o -ccc-host-triple avr-generic-generic -ccc-gcc-name avr-gcc > -mmcu=avr5 > notice that avr-gcc is passed so that clang can drive it once the .S file > is generated. > > So try compiling a trivial main function to get the hex file generated, > you'll need avr-copy (provided by binutils) to convert the elf file to hex, > but that is easily handled by makefiles. Also people using windows try > doing it aswell since I dont have a setup for it and I'm looking forward > for it. > > Once we get the basic toolchain working, adding support for avr-libc and > linking programs with its libraries should be much easier. I look forward > for any help here! > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > avr-llvm-devel mailing list > avr...@li... > https://lists.sourceforge.net/lists/listinfo/avr-llvm-devel > > |