[cfe-dev] Which is the best compiler to build LLVM 5.0.0 rc2?
Fletcher, John P via cfe-dev
cfe-dev at lists.llvm.org
Sat Aug 19 09:00:49 PDT 2017
Recently I have been building LLVM and Clang from the distribution using gcc 4.9.2. With the new 5.0.0 rc2 that is giving warning messages during the compilation. I have been trying out some other compilers.
gcc 5.2 with -std=c++11 This works, although there are still some warnings.
gcc 6.4 and gcc 7.1 fail with errors such as this in building libcxxabi as follows:
Command: /opt/cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/fletcher/LLVM/llvm-5.0.rc2/local_71 -DCMAKE_C_COMPILER=/opt/gcc-7.1/bin/gcc CMAKE_CXX_COMPILER=/opt/gcc-7.1/bin/g++ -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_CXX_FLAGS="-std=c++11 -I/opt/gcc-7.1/include/c++/7.1.0" -DCMAKE_EXE_LINKER_FLAGS="-Xlinker -R/opt/gcc-7.1/lib64 -L/opt/gcc-7.1/lib64" ../llvm
First Error:
Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_aux_runtime.cpp.o
In file included from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxx/include/stdlib.h:94:0,
from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxx/include/cstdlib:86,
from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxx/include/exception:82,
from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxx/include/new:89,
from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxxabi/src/cxa_aux_runtime.cpp:14:
/opt/gcc-7.1/include/c++/7.1.0/stdlib.h:38:12: error: std::abort has not been declared
using std::abort;
clang 4.0.0 fails with a different problem with libcxxabi -
Command:
/opt/cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/fletcher/LLVM/llvm-5.0.rc2/local_40 -DCMAKE_C_COMPILER=/home/fletcher/LLVM/llvm-4.0.distrib/local/bin/clang CMAKE_CXX_COMPILER=/home/fletcher/LLVM/llvm-4.0.distrib/local/bin/clang++ -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_CXX_FLAGS="-I/home/fletcher/LLVM/llvm-4.0.distrib/local/include/c++/v1 -stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-Xlinker -R/home/fletcher/LLVM/llvm-4.0.distrib/local/lib -L/home/fletcher/LLVM/llvm-4.0.distrib/local/lib -lc++abi -lclangBasic -lLLVMSupport -lpthread -ldl " ../llvm
Error:
Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_aux_runtime.cpp.o
In file included from /home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxxabi/src/cxa_aux_runtime.cpp:13:
/home/fletcher/LLVM/llvm-5.0.rc2/llvm/projects/libcxxabi/include/cxxabi.h:42:26: error: unknown type name
'size_t'
It seems to me that there are some configuration problems here in getting the correct header arrangement.
The rest of the build works, and looking around clang is recommended for building libcxxabi.
Is this a known problem?
Thanks
John Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170819/47575745/attachment.html>
More information about the cfe-dev
mailing list