]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
riscv: Set MACHINE_ARCH correctly
authorkp <kp@FreeBSD.org>
Sat, 22 Feb 2020 13:23:27 +0000 (13:23 +0000)
committerkp <kp@FreeBSD.org>
Sat, 22 Feb 2020 13:23:27 +0000 (13:23 +0000)
commitd11a896d9331a9b317bb6df2e6f263227bfc9733
tree603b9a9cf45b4115ecbb8a86068bcad1bedac39b
parentf31a7683bf2b79bf1ac546400cab33fb0d372a37
riscv: Set MACHINE_ARCH correctly

MACHINE_ARCH sets the hw.machine_arch sysctl in the kernel. In userspace
it sets MACHINE_ARCH in bmake, which bsd.cpu.mk uses to configure the
target ABI for ports.

For riscv64sf builds (i.e. soft-float) that needs to be riscv64sf, but
the sysctl didn't reflect that. It is static.

Set the define from the riscv makefile so that we correctly reflect our
actual build (i.e. riscv64 or riscv64sf), depending on what TARGET_ARCH
we were built with.

That still doesn't satisfy userspace builds (e.g. bmake), so check if
we're building with a software-floating point toolchain there. That
check doesn't work in the kernel, because it never uses floating point.

Reviewed by: philip (previous version), mhorne
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D23741
sys/conf/Makefile.riscv
sys/riscv/include/param.h