gollvm: build.ninja file is not created, in case if -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx passed #40407
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
While I was able to compile https://go.googlesource.com/gollvm/ project, by using
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
and corresponding GNU C++ compiler - I am surprised by LLVM related project, like such a Go front-end, was compiled with GCC (at least - the authors of the README file shared those commands/build instructions).
So I decided to compile using
$ clang -v
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
Candidate multilib: .;@m64
Selected multilib: .;@m64
and
$ cmake --version
cmake version 3.16.3
with https://libcxx.llvm.org/ (instead of https://gcc.gnu.org/onlinedocs/libstdc++/ ). Just to be more LLVM'ish, out here.
So while I was able to figure out (not without help of @jroelofs ) that I would have to rely on the following CMake's params:
$cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS=-stdlib=libc++ '-DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx' -DLLVM_USE_LINKER=gold -DLLVM_TARGETS_TO_BUILD=X86 -G Ninja ../llvm-project/llvm
However it looks like I am getting some errors, which avoid generating the build.ninja file :
.
My CMakeCache.txt contains the following line:
In the same time - I am able to run CMake with
$cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DLLVM_USE_LINKER=gold -DLLVM_TARGETS_TO_BUILD=X86 -G Ninja ../llvm-project/llvm
and generate build.ninja .
$ninja -j ... gollvm
allows to compile, by using Clang's C++ compiler, which I can track
408458 ubuntu 20 0 161824 78924 35912 R 94.1 1.0 0:01.26 clang++
408460 ubuntu 20 0 158608 75872 35776 R 88.2 0.9 0:01.18 clang++
.
I am not sure but it could relate to [https://reviews.llvm.org/D58791](https://reviews.llvm.org /D58791) . I am not sure that I do understand the cause - but I am attaching my logs, which reflect the situation around included runtime enablement.
Ivan
CMakeOutput.log
CMakeError.log
The text was updated successfully, but these errors were encountered: