Allow ARCH to be overriden in Makefile

To support changing compilers which is particularly useful for cross
compilation, use the defined ARCH if it exists.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
This commit is contained in:
Charlie Jenkins
2025-01-24 14:11:46 -08:00
parent 7d3c7595d2
commit 57b14649b5

View File

@@ -89,7 +89,7 @@ else
## OS detection. Comment out if gmake syntax not supported by other 'make'.
OSNAME:=$(shell uname -s)
ARCH := $(shell uname -m)
ARCH ?= $(shell uname -m)
ifeq ($(OSNAME),Linux)
# Not all CPU architectures support "-march" or "-march=native".
# - Supported : x86, x86_64, ARM, AARCH64, riscv64, etc..