[LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue

Xerxes Rånby xerxes at zafena.se
Mon Nov 9 03:50:49 PST 2009


Prasanth J skrev:
> Hi,
>
> 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.
>
> ../llvm/configure --host=arm-linux --target=arm-linux
> --build=i686-linux --prefix=/opt/llvm-arm/ --enable-optimized
> --disable-debug \
>  --disable-expensive-checks --disable-doxygen \
>  --disable-threads --enable-targets=cbe,cpp,arm
>
> using this configuration i am facing the following compilation error.
> pls help me how to resolve this error..
>
> /make[1]: Entering directory
> `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System'
> llvm[1]: Compiling Alarm.cpp for Release build
> llvm[1]: Compiling Atomic.cpp for Release build
> llvm[1]: Compiling Disassembler.cpp for Release build
> llvm[1]: Compiling DynamicLibrary.cpp for Release build
> llvm[1]: Compiling Errno.cpp for Release build
> llvm[1]: Compiling Host.cpp for Release build
> llvm[1]: Compiling IncludeFile.cpp for Release build
> llvm[1]: Compiling Memory.cpp for Release build
> /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)’:
> /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp:67:
> error: ‘__clear_cache’ was not declared in this scope
> make[1]: ***
> [/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System/Release/Memory.o]
> Error 1
> make[1]: Leaving directory
> `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System'
> make: *** [all] Error 1//
>
> /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.
> 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.

By commenting out that line will make your llvm version crash
sporadically since you would recreate llvm PR4960 if using the llvm JIT.
http://llvm.org/bugs/show_bug.cgi?id=4960

__clear_cache are needed to clear the instructioncache after jitting a
function and this gcc builtin are found in gcc 4.3.3 and later or
CodeSourcery's 2007Q3/2008Q1 compiler releases and later.

Try updating you cross compiler!

Cheers
Xerxes



More information about the llvm-dev mailing list