llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.26k stars 11.67k forks source link

Option required: -march=rv64gc for building LLVM #93444

Open ArielHeleneto opened 4 months ago

ArielHeleneto commented 4 months ago

Add an option for choosing arch instead of only auto-detect in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp#L335

Add a feather like gcc.

llvmbot commented 4 months ago

@llvm/issue-subscribers-clang-driver

Author: Ariel Xiong (ArielHeleneto)

Add an option for choosing arch instead of only auto-detect in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp#L335 Add a feather like gcc.
llvmbot commented 4 months ago

@llvm/issue-subscribers-backend-risc-v

Author: Ariel Xiong (ArielHeleneto)

Add an option for choosing arch instead of only auto-detect in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp#L335 Add a feather like gcc.
dtcxzyw commented 4 months ago

cc @topperc @wangpc-pp

wangpc-pp commented 4 months ago

I may misunderstand your question, but I think we do support -march=rv64gc. The code you are pointing to are logics that we will set a default march based on some information if you don't specify -march option.

ArielHeleneto commented 4 months ago

I may misunderstand your question, but I think we do support -march=rv64gc. The code you are pointing to are logics that we will set a default march based on some information if you don't specify -march option.

-march=rv64gc for building LLVM like with-arch

wangpc-pp commented 4 months ago

You want a CMake option, for example, "-DDEFAULT_RISCV_MARCH=rv64gc", and clang will use this march if we don't specify -march option? If so, I would suggest you to use configuration files (https://clang.llvm.org/docs/UsersManual.html#configuration-files).