Balasaheb Dabhade via llvm-dev
2016-May-06 17:28 UTC
[llvm-dev] build issue in llvm-clang cross tool chain for arm target
Hello All, I am building llvm-clang cross tool chain for arm target, after successful build for Linux host now I am now building toolchain for *arm target*. However, I am getting below error message which seems to be confusing and not getting any idea how to resolve this issue. *Command :* #CC='clang' CXX='clang++' cmake -G Ninja /home/iiita/crossbuild/llvm -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/home/iiita/crossbuild/build -DLLVM_TABLEGEN=/home/iiita/llvm-3.8/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/home/iiita/llvm-3.8/build/bin/clang-tblgen -DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9 -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard -ccc-gcc-name arm-linux-gnueabihf-gcc' *Error message:* CMake Error at cmake/modules/CheckAtomic.cmake:33 (message): Host compiler must support std::atomic! Call Stack (most recent call first): cmake/config-ix.cmake:296 (include) CMakeLists.txt:407 (include) -- Configuring incomplete, errors occurred! See also "/home/iiita/crossbuild/build/CMakeFiles/CMakeOutput.log". See also "/home/iiita/crossbuild/build/CMakeFiles/CMakeError.log". Does anyone know how to resolve this issue or any other way to build tool chain for arm from source code? Thanks, Bala -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160506/1f1e25f2/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeError.log Type: text/x-log Size: 12942 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160506/1f1e25f2/attachment.bin>
Renato Golin via llvm-dev
2016-May-06 18:50 UTC
[llvm-dev] build issue in llvm-clang cross tool chain for arm target
On 6 May 2016 at 18:28, Balasaheb Dabhade via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Error message: > CMake Error at cmake/modules/CheckAtomic.cmake:33 (message): > Host compiler must support std::atomic!Hi, It's possible that you don't have the required ARM libraries in your system? cheers, --renato
Renato Golin via llvm-dev
2016-May-08 14:22 UTC
[llvm-dev] build issue in llvm-clang cross tool chain for arm target
On 6 May 2016 at 18:28, Balasaheb Dabhade via llvm-dev <llvm-dev at lists.llvm.org> wrote:> -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS='-target > armv7a-linux-gnueabihf -mcpu=cortex-a9 > -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ > -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard -ccc-gcc-name > arm-linux-gnueabihf-gcc'I can think of two things: 1. You're using a triple that is different from your gcc name: '-target armv7a-linux-gnueabihf' vs '-ccc-gcc-name arm-linux-gnueabihf-gcc' You should use the target as "arm-linux-gnueabihf". 2. You're not including the GCC headers or libraries. You need to find where GCC keeps its libraries (normally /usr/lib/gcc/arm-linux-gnueabihf) and headers (if necessary). In your case, just adding -L"where your gcc libs are" should be enough. cheers, --renato
Balasaheb Dabhade via llvm-dev
2016-May-08 15:18 UTC
[llvm-dev] build issue in llvm-clang cross tool chain for arm target
Thanks a lot Renoto, I really appreciate your help. As you mentioned I have modified the command to include gcc libs path(-L ) option in cmake command as below : cmake -G Ninja /home/iiita/crossbuild/llvm -DLLVM_ENABLE_PIC=False -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/home/iiita/crossbuild/build -DLLVM_TABLEGEN=/home/iiita/llvm-3.8/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/home/iiita/llvm-3.8/build/bin/clang-tblgen -DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS='-target *arm-linux-gnueabihf-gcc* -mcpu=cortex-a9 -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ -I/usr/arm-linux-gnueabihf/include/ *-L/usr/lib/gcc/arm-linux-gnueabihf* -mfloat-abi=hard -ccc-gcc-name arm-linux-gnueabihf-gcc' However, I am still facing the issue since *cmake not able to find header file path as per **CMakeError.log (attached for email for reference) error message*. Do you have any idea about how to include header file path in cmake command line or is there any other thing I am missing? Thanks, Bala On Sun, May 8, 2016 at 7:52 PM, Renato Golin <renato.golin at linaro.org> wrote:> On 6 May 2016 at 18:28, Balasaheb Dabhade via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS='-target > > armv7a-linux-gnueabihf -mcpu=cortex-a9 > > -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ > > -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard -ccc-gcc-name > > arm-linux-gnueabihf-gcc' > > I can think of two things: > > 1. You're using a triple that is different from your gcc name: > > '-target armv7a-linux-gnueabihf' > > vs > > '-ccc-gcc-name arm-linux-gnueabihf-gcc' > > You should use the target as "arm-linux-gnueabihf". > > 2. You're not including the GCC headers or libraries. > > You need to find where GCC keeps its libraries (normally > /usr/lib/gcc/arm-linux-gnueabihf) and headers (if necessary). > > In your case, just adding -L"where your gcc libs are" should be enough. > > cheers, > --renato >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160508/41b1af16/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeError.log Type: text/x-log Size: 14895 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160508/41b1af16/attachment.bin>