[PATCH] Makefile: Add option to use toolchain default ABI and ISA string

Jessica Clarke jrtc27 at jrtc27.com
Thu Oct 29 17:58:17 EDT 2020


On 29 Oct 2020, at 17:08, Alistair Francis <Alistair.Francis at wdc.com> wrote:
> 
> On Thu, 2020-10-29 at 14:28 +0530, Anup Patel wrote:
>> When PLATFORM_RISCV_ABI and PLATFORM_RISCV_ISA are not specified,
>> we force "-mabi=lp64 -march=rv64gc" for RV64 and force "-mabi=ilp32
>> -march=rv32gc" for RV32. This can prevent users from using the
>> toolchain default "-mabi" and "-march" options.
>> 
>> To allow using toolchain defaults, we add compile-time option
>> PLATFORM_RISCV_TOOLCHAIN_DEFAULT which when enabled forces the
>> top-level makefile to use toolchain default ABI and ISA string.
>> 
>> To enable the option, pass "PLATFORM_RISCV_TOOLCHAIN_DEFAULT=1"
>> to top-level make.
>> 
>> Reported-by: Alistair Francis <alistair.francis at wdc.com>
>> Signed-off-by: Anup Patel <anup.patel at wdc.com>
> 
> Thanks!
> 
> Reviewed-by: Alistair Francis <alistair.francis at wdc.com>

FYI, --with-arch/--with-abi are GCC-specific configure flags. Clang
doesn't have such a notion, and even if it did it's using CMake so
those would be differently-named. Though I don't understand why we need
to probe to see what they are; if you want the default, just don't
specify -march/-mabi? Seems a bit unnecessary to go and ask what the
default is only to then explicitly give it to the tool you just asked.

Jess




More information about the opensbi mailing list