summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index eb95164c..46541063 100644
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,12 @@ endif
# Guess the compiler's XLEN
OPENSBI_CC_XLEN := $(shell TMP=`$(CC) $(CLANG_TARGET) -dumpmachine | sed 's/riscv\([0-9][0-9]\).*/\1/'`; echo $${TMP})
+# If guessing XLEN fails, default to 64
+ifneq ($(OPENSBI_CC_XLEN),32)
+ ifneq ($(OPENSBI_CC_XLEN),64)
+ OPENSBI_CC_XLEN = 64
+ endif
+endif
# Guess the compiler's ABI and ISA
ifneq ($(CC_IS_CLANG),y)