[llvm-dev] Which libc/libc++ to use with LLVM RISCV?

Chen Zou via llvm-dev llvm-dev at lists.llvm.org
Fri May 21 19:24:09 PDT 2021


I hope I am posting this question in the right place.

Knowing that rvv intrinsics support is pushed to LVV upstream. I am eager
to try it out.
But it seems I could not get libc set up correctly.

If I configured LLVM compilation with:
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi"
 -DCMAKE_BUILD_TYPE="Release" -DLLVM_BUILD_TESTS=False
 -DLLVM_TARGETS_TO_BUILD="RISCV" -DCMAKE_INSTALL_PREFIX=$RISCV   ../llvm &&
make -j16
I got compilation errors as attached at the end of this email.

The compilation would succeed if I omit libcxx libcxxabi from
LLVM_ENABLE_PROJECTS. But it seems clang would not find assert.h:
clang -static --target=riscv32 -menable-experimental-extensions
-march=rv32imv0p10 -mabi=ilp32 -g -O2 -Wall -fPIC -I../../include -std=c11
  -c -o ../../sep/test.o ../../sep/test.c
../../sep/test.c:4:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~


Attached compilation error for libcxx:

In file included from
$HOME/riscv/llvm-project/build/include/c++/v1/exception:84:0,
         from
$HOME/riscv/llvm-project/libcxxabi/src/cxa_default_handlers.cpp:11:
$HOME/riscv/llvm-project/build/include/c++/v1/type_traits: In substitution
of ‘template<class ... _Args> using _SecondType = typename
std::__1::_MetaBase<(sizeof... (_Args) >= 2)>::_SecondImpl<_Args ...> [with
_Args = {_Tp ..., _Dep}]’:
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1000:51: required from
here
$HOME/riscv/llvm-project/build/include/c++/v1/type_traits:501:117: error:
pack expansion argument for non-pack parameter ‘<template-parameter-1-1>’
of alias template ‘template<class, class _Second, class ...> using
_SecondImpl = _Second’
 using _SecondType _LIBCPP_NODEBUG_TYPE = typename
_MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>;
                                                           ^
In file included from
$HOME/riscv/llvm-project/build/include/c++/v1/exception:84:0,
         from
$HOME/riscv/llvm-project/libcxxabi/src/cxa_default_handlers.cpp:11:
$HOME/riscv/llvm-project/build/include/c++/v1/type_traits:473:13: note:
declared here
  template <class, class _Second, class...>
       ^
In file included from
$HOME/riscv/llvm-project/build/include/c++/v1/memory:678:0,
         from
$HOME/riscv/llvm-project/libcxxabi/src/include/atomic_support.h:17,
         from
$HOME/riscv/llvm-project/libcxxabi/src/cxa_default_handlers.cpp:18:
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1000:66: error:
template argument 1 is invalid
       is_assignable<_SecondType<_Tp..., _Dep>&, _Up2 const&>
                                 ^
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1001:9: error: template
argument 4 is invalid
     >::value
     ^
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1002:9: error: template
argument 1 is invalid
   ,int> = 0>
     ^
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1019:59: error:
template argument 1 is invalid
       is_assignable<_SecondType<_Tp..., _Dep>&, _Up2>
                              ^
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1020:9: error: template
argument 4 is invalid
     >::value
     ^
$HOME/riscv/llvm-project/build/include/c++/v1/tuple:1021:9: error: template
argument 1 is invalid
   ,int> = 0>
     ^
projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/build.make:95: recipe
for target
'projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o'
failed
make[2]: ***
[projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o]
Error 1
CMakeFiles/Makefile2:19706: recipe for target
'projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/all' failed
make[1]: *** [projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/all]
Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210521/63eac1c1/attachment.html>


More information about the llvm-dev mailing list