Hi,<br><br>i am a newbie to llvm architecture. i have been trying to
port llvm on ARM target. i am using the following configuration for
cross compiling llvm.<br><br>../llvm/configure --host=arm-linux
--target=arm-linux --build=i686-linux --prefix=/opt/llvm-arm/
--enable-optimized --disable-debug \<br>
 --disable-expensive-checks --disable-doxygen \<br>
 --disable-threads --enable-targets=cbe,cpp,arm<br>
<br>
using this configuration i am facing the following compilation error. pls help me how to resolve this error..<br>
<br><i style="color: rgb(204, 0, 0);">make[1]: Entering directory `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System'<br>
llvm[1]: Compiling Alarm.cpp for Release build<br>
llvm[1]: Compiling Atomic.cpp for Release build<br>
llvm[1]: Compiling Disassembler.cpp for Release build<br>
llvm[1]: Compiling DynamicLibrary.cpp for Release build<br>
llvm[1]: Compiling Errno.cpp for Release build<br>
llvm[1]: Compiling Host.cpp for Release build<br>
llvm[1]: Compiling IncludeFile.cpp for Release build<br>
llvm[1]: Compiling Memory.cpp for Release build<br>
/home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp: In
static member function ‘static void
llvm::sys::Memory::InvalidateInstructionCache(const void*, size_t)’:<br>
/home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp:67: error: ‘__clear_cache’ was not declared in this scope<br>
make[1]: *** [/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System/Release/Memory.o] Error 1<br>
make[1]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System'<br>
make: *** [all] Error 1</i><i><br>
<br>
</i>i can able to compile by commenting the line in Memory.cpp but i am
not sure whether it will affect anything while running llvm on target.<br>
After cross-compilation i copied the binaries to target and i tried to
compile and run a simple helloworld.c application. As clang requires a
working gcc on target i used to "-ccc-clang-archs" options to skip the
need for gcc on target. But still i am getting the following error.<br>
<br>
<i><span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);"># TMPDIR=/dtv/usb/sda ../bin/clang -ccc-clang-archs arm hello.c  -v -I/dtv/usb/sda/LLVM/include</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">clang version 1.0 (<a href="https://llvm.org/svn/llvm-project/cfe/branches/release_26">https://llvm.org/svn/llvm-project/cfe/branches/release_26</a> exported)</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">Target: arm-unknown-linux-gnu</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">Thread model: posix</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);"> "/dtv/usb/sda/LLVM/llvm-2.6-arm/bin/../libexec/clang-cc"
-triple arm-unknown-linux-gnu -S -disable-free -main-file-name hello.c
--relocation-mc</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">clang-cc version 1.0 based upon llvm 2.6 hosted on arm-unknown-linux-gnu</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">ignoring nonexistent directory "/usr/local/include"</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">ignoring nonexistent directory "/usr/include"</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">ignoring nonexistent directory "/System/Library/Frameworks"</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">ignoring nonexistent directory "/Library/Frameworks"</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">#include "..." search starts here:</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">#include <...> search starts here:</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);"> /dtv/usb/sda/LLVM/include</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);"> /dtv/usb/sda/LLVM/llvm-2.6-arm/lib/clang/1.0/include</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">End of search list.</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">clang-cc:
/home/prasanth/LLVM_ARM/llvm-target/llvm-2.6/include/llvm/ADT/ilist.h:197:
typename bidirectional_iterator<NodeTy, int>::reference ll.</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">0   clang-cc 0x00cd314c</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">Stack dump:</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">0.     
Program arguments:
/dtv/usb/sda/LLVM/llvm-2.6-arm/bin/../libexec/clang-cc -triple
arm-unknown-linux-gnu -S -disable-free -main-file-nam</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">1.      <eof> parser at end of file</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">2.      Code generation</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">
<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">3.      Running pass 'ARM Instruction Selection' on function '@main'</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">clang: error: compiler command failed due to signal 6 (use -v to see invocation)</span><br style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);">


<span style="background-color: rgb(255, 255, 255); color: rgb(204, 0, 0);"># </span><br style="color: rgb(204, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</i>can anyone help me how to use clang for compiling applications on
target. is it possible to run llvm bytecode on target using lli? if it
is so pls let me know how to do it..<br><br>following are the target info:<br><i>target : arm<br>cpu : arm1136jf-s<br>toolchain : armv6</i><br>
<br>
Thanks and Regards,<br clear="all">Prasanth J<br><br><br><br><br>