While trying to build llvm/clang 3.42 on ubuntu 17.04, I have failed with configre+make as mentioned in this SO post. I gave cmake a shot with this very similar script:
#!/bin/bash
###############
# DEFINITIONS #
###############
LLVM_SVN=https://llvm.org/svn/llvm-project
TAG=tags/RELEASE_342/final
###############
# DIRECTORIES #
###############
BASEDIR=/home/oren/GIT/myLLVMpass
###############
# DIRECTORIES #
###############
LLVM_DIR=${BASEDIR}/llvm-3.4.2
LLVM_BUILD_DIR=${LLVM_DIR}/build
LLVM_SRC_DIR=${LLVM_DIR}/llvm
CLANG_SRC_DIR=${LLVM_SRC_DIR}/tools/clang
COMPILER_RT_SRC_DIR=${LLVM_SRC_DIR}/projects/compiler-rt
LIBCXX_SRC_DIR=${LLVM_SRC_DIR}/projects/libcxx
#########################################################
# Prepare llvm, llvm/src and llvm/build directories ... #
#########################################################
mkdir ${LLVM_DIR}
mkdir ${LLVM_SRC_DIR}
mkdir ${LLVM_BUILD_DIR}
##################
# Get llvm 3.4.2 #
##################
svn co ${LLVM_SVN}/llvm/${TAG} ${LLVM_SRC_DIR}
svn co ${LLVM_SVN}/cfe/${TAG} ${CLANG_SRC_DIR}
svn co ${LLVM_SVN}/compiler-rt/${TAG} ${COMPILER_RT_SRC_DIR}
svn co ${LLVM_SVN}/libcxx/${TAG} ${LIBCXX_SRC_DIR}
#################################
# No changes will be needed ... #
#################################
rm -rf ${LLVM_DIR}/.svn
rm -rf ${CLANG_DIR}/.svn
rm -rf ${COMPILER_RT_DIR}/.svn
rm -rf ${LIBCXX_DIR}/.svn
#####################################################
# Get inside the llvm/build directory and cmake ... #
#####################################################
cd ${LLVM_BUILD_DIR} && cmake ${LLVM_SRC_DIR}
###############
# make it !!! #
###############
make -j
I got a totally different error from the configure+make trial:
[ 78%] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/Thumb1FrameLowering.cpp.o
[ 78%] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMTargetObjectFile.cpp.o
[ 78%] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/MLxExpansionPass.cpp.o
[ 78%] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/Thumb2InstrInfo.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report, with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/clangDynamicASTMatchers.dir/build.make:134: recipe for target 'tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/clangDynamicASTMatchers.dir/Registry.cpp.o' failed
make[2]: *** [tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/clangDynamicASTMatchers.dir/Registry.cpp.o] Error 4
CMakeFiles/Makefile2:15102: recipe for target 'tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/clangDynamicASTMatchers.dir/all' failed
make[1]: *** [tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/clangDynamicASTMatchers.dir/all] Error 2
What is going on here? Any help is very much appreciated, thanks!