aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-01-06 18:41:06 -0800
committerAnup Patel <anup@brainfault.org>2020-01-08 09:10:24 +0530
commit049ad0b3877352527ab470eba33bc767e9b54961 (patch)
tree92cd4aca5f2cdcf2c04fc1c2d98d4abb78fb0ae4 /Makefile
parenta67fd68cbf02af84af9e6e7f8e28aadcecc94910 (diff)
downloadopensbi-049ad0b3877352527ab470eba33bc767e9b54961.zip
opensbi-049ad0b3877352527ab470eba33bc767e9b54961.tar.gz
opensbi-049ad0b3877352527ab470eba33bc767e9b54961.tar.bz2
build: Use -ffreestanding
this is a stand-alone/baremetal application, therefore demanding -ffreestanding would help it compile with hosted toolchains e.g. ( linux toolchains ), it also ensures that it won't be using platform optimizations like inlining mem* str* functions which gcc might decide especially with wrapper string functions in opensbi code Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9aff070..aac422a 100644
--- a/Makefile
+++ b/Makefile
@@ -159,7 +159,7 @@ GENFLAGS += $(libsbiutils-genflags-y)
GENFLAGS += $(platform-genflags-y)
GENFLAGS += $(firmware-genflags-y)
-CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2
+CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
CFLAGS += -mno-save-restore -mstrict-align
CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)