links llvm linker for a host that is only one of the targets, it does not bind to each target in the list. it will definitely compile for any purpose. Basically, clang goes from C / C ++ to bytecode, then llc takes the bytecode and builds for a specific purpose (new experimental option to take the bytecode directly to the object file), then you need to get a cross assembler and a crosslinking agent to take its final mile (I use gnu binutils). Unfortunately, I found that clang to bytecode is not completely general (I hoped and expected it to be so), it will actually change the target independent output based on the target. The example below, using the host triple instead of using -march, allowed my examples to build correctly on other hosts.
ARMGNU?=arm-none-eabi LOPS = -Wall -m32 -emit-llvm -ccc-host-triple $(ARMGNU) OOPS = -std-compile-opts LLCOPS = -march=thumb -mtriple=$(ARMGNU) clang $(LOPS) -c blinker03.c -o blinker03.clang.bc opt $(OOPS) blinker03.clang.bc -o blinker03.clang.thumb.opt.bc llc $(LLCOPS) blinker03.clang.thumb.opt.bc -o blinker03.clang.thumb.opt.s $(ARMGNU)-as blinker03.clang.thumb.opt.s -o blinker03.clang.thumb.opt.o $(ARMGNU)-ld -o blinker03.clang.thumb.opt.elf -T memmap vectors.o blinker03.clang.thumb.opt.o
I donβt have, but will soon be experimenting using llc directly to the object (in fact, I tried this on a simple test, but did not use it on anything else or did not place it anywhere).
see examples at http://github.com/dwelch67 There are several raspberrypi in mbed, maybe there are some, thumbulator. Most of the examples are gnu based, but for some of them I also included llvm / clang commands in the Makefile.
source share