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

Prasanth J j.prasanth.j at gmail.com
Fri Nov 13 21:46:58 PST 2009


Hi,

As you said i downloaded arm toolchain from codesourcery(2009q3 with gcc
4.4.1 version).. if i use this toolchain i am getting the following error..

make[2]: Entering directory
`/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis'
llvm[2]: Compiling LoopPass.cpp for Release build
if arm-none-linux-gnueabi-g++
-I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/include
-I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis
-I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/include
-I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis
-D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2
-fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual    -pedantic
-Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings  -c -MMD -MP
-MF
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp"
-MT
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o"
-MT
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d"
/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp
-o
/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o
; \
            then /bin/mv -f
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp"
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d";
else /bin/rm
"/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp";
exit 1; fi
/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:
In member function 'void
llvm::LPPassManager::deleteLoopFromQueue(llvm::Loop*)':
/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://support.codesourcery.com/GNUToolchain/> for instructions.
/bin/rm: cannot remove
`/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp':
No such file or directory
make[2]: ***
[/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o]
Error 1
make[2]: Leaving directory
`/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis'
make[1]: *** [Analysis/.makeall] Error 2
make[1]: Leaving directory
`/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib'
make: *** [all] Error 1

please let me know how should i resolve this error...

Thanks and Regards,
Prasanth J




On Fri, Nov 13, 2009 at 7:39 PM, Xerxes RĂ„nby <xerxes at zafena.se> wrote:

> Prasanth J wrote:
> >
> > Hi all,
> > with reference to the reply below, I downloaded toolchain from
> > codesourcery (arm-2009q1-203-arm-none-linux-gnueabi) with gcc 4.3.3...
> > when i compile llvm+clang with this toolchain i am getting the
> > following error
> >
> > make[4]: Entering directory
> >
> `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test'
> > llvm[4]: Linking Release executable c-index-test (without symbols)
> >
> /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
> >
> /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test:
> > hidden symbol `__sync_val_compare_and_swap_4' in
> >
> /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o)
> > is referenced by DSO
> >
> /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
> > final link failed: Nonrepresentable section on output
> > collect2: ld returned 1 exit status
> > make[4]: ***
> >
> [/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test]
> > Error 1
> > make[4]: Leaving directory
> >
> `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test'
> > make[3]: *** [all] Error 1
> > make[3]: Leaving directory
> > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools'
> > make[2]: *** [all] Error 1
> > make[2]: Leaving directory
> > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang'
> > make[1]: *** [clang/.makeall] Error 2
> > make[1]: Leaving directory
> > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools'
> > make: *** [all] Error 1
> >
> > can anyone please tell me why am i getting this error and how can i
> > resolve this?
> >
> > Thanks and Regards,
> > Prasanth J
> >
> >
> You get this linking error because the code contains a gcc atomic
> intrinsic calls using __sync_val_compare_and_swap . These are GCC
> built-ins and have only been implemented on ARM using GCC 4.4.
> http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Atomic-Builtins.html
> If you want to use GCC 4.3.3 then you have to implement the
> __sync_val_compare_and_swap_4 function yourself.
>
> Ubuntu Jaunty ARM toolchains have been patched to contains the atomic
> intrinsics support in GCC 4.3.3
>
> So to solve this issue do one of the following:
> a) update your code sourcery cross compiler to arm-2009q3 that are using
> GCC 4.4
> b) use the Ubuntu gcc 4.3.3 provided toolchain (i use this when
> compiling llvm natively on a arm machine without cross compilation)
> c) implement the __sync_val_compare_and_swap_4 function and patch llvm
> to enable compilation using older toolchains.
>
> Cheers
> Xerxes
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091114/b7113b6a/attachment.html>


More information about the llvm-dev mailing list