Module Name: src Committed By: skrll Date: Sun Feb 25 14:27:41 UTC 2024
Modified Files: src/sys/arch/riscv/conf: Makefile.riscv Log Message: Warn about building a kernel with the wrong toolchain. Idea from mrg@ To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/conf/Makefile.riscv Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/riscv/conf/Makefile.riscv diff -u src/sys/arch/riscv/conf/Makefile.riscv:1.10 src/sys/arch/riscv/conf/Makefile.riscv:1.11 --- src/sys/arch/riscv/conf/Makefile.riscv:1.10 Wed Jul 26 03:41:57 2023 +++ src/sys/arch/riscv/conf/Makefile.riscv Sun Feb 25 14:27:41 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.riscv,v 1.10 2023/07/26 03:41:57 rin Exp $ +# $NetBSD: Makefile.riscv,v 1.11 2024/02/25 14:27:41 skrll Exp $ # Makefile for NetBSD # @@ -21,6 +21,18 @@ USETOOLS?= no NEED_OWN_INSTALL_TARGET?=no .include <bsd.own.mk> + +.if !defined(LP64) && ${MACHINE_ARCH} == "riscv64" +. info (Building GENERIC instead of GENERIC64?) +. error Don't build 32-bit kernel with 64-bit toolchain +.endif + +.if defined(LP64) && ${MACHINE_ARCH} == "riscv32" +. info (Building GENERIC64 instead of GENERIC?) +. error Don't build 64-bit kernel with 32-bit toolchain +.endif + + ## ## (1) port identification ##