[PATCH] D44153: Build system changes for RISCV

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 12:18:39 PDT 2018


asb added a comment.

In https://reviews.llvm.org/D44153#1036096, @azharudd wrote:

> In https://reviews.llvm.org/D44153#1031976, @asb wrote:
>
> > Actually, looking again I'm not having any problems building just the RISCV backend even without this patch. e.g. an invocation like the following seems fine:
> >
> >   cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" \
> >     -DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True \
> >     -DLLVM_OPTIMIZED_TABLEGEN=True \
> >     -DLLVM_BUILD_TESTS=True \
> >     -DLLVM_TARGETS_TO_BUILD="RISCV" \
> >     -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV" ../
> >   cmake --build .
> >   
> >
> > Could you please clarify exactly which build problems this fixes?
>
>
> Alex, add -DLLVM_TARGET_ARCH=riscv32-unknown-linux-gnu to your cmake command above, and you'll hit the "Unknown architecture ..." error. Since we are cross-compiling, we'll need that option to default to riscv target arch. Without that option, it will target the host as the native arch.


Thanks for the clarification. I suppose a more accurate description of this patch would be that it enables LLVM_TARGET_ARCH to be set to riscv32 or riscv64, as it seems that building with   -DLLVM_TARGETS_TO_BUILD="RISCV" did work as expected (building only lib/Target/RISCV) just fine prior to this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D44153





More information about the llvm-commits mailing list