aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2019-01-17 17:33:47 -0800
committerAnup Patel <anup@brainfault.org>2019-02-08 09:18:46 +0530
commit5a91fec1a80939e78e37a0b2bc1d3043dcac23f4 (patch)
treeaaddc0894f782c361a11ea5d72f2aa9efdff0d56 /Makefile
parentb4c72deba98b6398a4c44198553093670d226e2d (diff)
downloadopensbi-5a91fec1a80939e78e37a0b2bc1d3043dcac23f4.zip
opensbi-5a91fec1a80939e78e37a0b2bc1d3043dcac23f4.tar.gz
opensbi-5a91fec1a80939e78e37a0b2bc1d3043dcac23f4.tar.bz2
platform/qemu/virt: Dynamically calculate xlen
The QEMU virt machine can be either 32 or 66 bit. Don't hard code the CPU bit length and instead let the compiler determine it. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6f67c54..2848d09 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,9 @@ endif
AS = $(CC)
DTC = dtc
+# Guess the compillers xlen
+OPENSBI_CC_XLEN = `expr substr \`$(CC) -dumpmachine\` 6 2`
+
# Setup compilation commands flags
CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls