From 701daf7690b8fe898779d8117e371930d7478abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=B0=9A=E8=AF=9A10330306?= Date: Thu, 5 Feb 2026 00:25:43 +0800 Subject: [PATCH] Build: Add `-mno-strict-align` flag for RISC-V architecture --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index b726f7970ce..d393221285b 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,13 @@ else EXT = endif +# Detect if the architecture is RISC-V (native build) +UNAME_M ?= $(shell uname -m) +ifneq (,$(filter riscv%,$(UNAME_M))) + MOREFLAGS += -mno-strict-align + export MOREFLAGS +endif + ## default: Build lib-release and zstd-release .PHONY: default default: lib-release zstd-release