[LLVMdev] Fwd: JIT on ARM
Duncan Sands
baldrick at free.fr
Wed Oct 14 09:19:34 PDT 2009
Hi Martins,
>> I tried building bitcode on windows with llvm-gcc that is provided on
>> llvm home page. Resulting bitcode runs great in interpreter, but it
>> doesn't use JIT. From what I understand from LLVM that it is because
>> of target triple or datalayout. On PC in my case target triple is
>> "i386-mingw32", but LLVM JIT for ARM expects something that starts
>> with "armv" or "thumb". Also datalayout differs a lot. If I understand
>> correctly that is because bitcode actually contains some of platform
>> specific optimizations (like integer endianness), so I can't simply
>> change target triple string and everything will run.
as you have understood, the JIT requires bitcode that targets the
machine you are jiting on, so you need to cross-compile for arm.
I don't know anything about cross-compiling, for example whether
it is possible and whether you are doing it right - hopefully one
of the arm guys can help you out.
Ciao,
Duncan.
>> What I am now doing, is - I am trying to build gcc from
>> gcc-4.2-llvm-2.5 sources with following configure line in cygwin shell:
>>
>> ../llvm-gcc4.2-2.4.source/configure --enable-languages=c,c++
>> --enable-checking --enable-llvm=$PWD/../llvm-objects
>> --disable-bootstrap --disable-multilib --disable-nls --target=arm-eabi
>>
>> My undertanding is that this will produce llvm-gcc compiler that will
>> output LLVM bitcode with target triple that starts with "arm", so LLVM
>> will use JIT on it.
>>
>> Currently I am getting compile problems when running make (see below).
>> Has anyone done something similar and can explain what I am doing
>> wrong, or how should it be done in some other way to get JIT compiler
>> running on ARM?
>>
>>
>> make[2]: Entering directory
>> `/cygdrive/r/android/llvm/llvm-gcc4.2-objects/gcc'
>> gcc -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall
>> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
>> -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
>> -Wold-style-definition -Wmissing-format-attribute -fno-common
>> -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/gengtype.exe \
>> build/gengtype.o build/gengtype-lex.o build/gengtype-yacc.o
>> build/errors.o ../build-i686-pc-cygwin/libiberty/libiberty.a
>> build/gengtype.o: In function `adjust_field_type':
>> /cygdrive/r/android/llvm/llvm-gcc4.2-objects/gcc/../../llvm-gcc4.2-2.4.source/gcc/gengtype.c:763:
>> undefined reference to `_lexer_line'
...
More information about the llvm-dev
mailing list