From f599b6c77f3585c8917f4d685689da4cc8a8bf04 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 8 Jan 2020 08:42:54 -0800 Subject: opensbi: Use -ffreestanding compiler options This usually helps compiler to not use built-in optimizations for string functions and mem* functions unnecessarily, since OE's compiler is hosted for linux cross compile, this also means we instruct it rightly for building a baremetal application Refresh the patches to apply without fuzz Fixes linking errors e.g. platform/qemu/virt/lib/libplatsbi.a(sbi_string.o): in function `sbi_memset': | /mnt/b/yoe/build/tmp/work/riscv64-yoe-linux/opensbi/0.5-r0/git/lib/sbi/sbi_string.c:102: undefined reference to `memset' | collect2: error: ld returned 1 exit status Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- .../files/0001-Makefile-Don-t-specify-mabi-or-march.patch | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch') diff --git a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch b/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch index 9c2d0eb479..74d93618b2 100644 --- a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch +++ b/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch @@ -13,11 +13,9 @@ Signed-off-by: Alistair Francis Makefile | 2 -- 1 file changed, 2 deletions(-) -diff --git a/Makefile b/Makefile -index ae68f55..10851fc 100644 --- a/Makefile +++ b/Makefile -@@ -145,7 +145,6 @@ GENFLAGS += $(firmware-genflags-y) +@@ -162,7 +162,6 @@ GENFLAGS += $(firmware-genflags-y) CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2 CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls CFLAGS += -mno-save-restore -mstrict-align @@ -25,7 +23,7 @@ index ae68f55..10851fc 100644 CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) CFLAGS += $(GENFLAGS) CFLAGS += $(platform-cflags-y) -@@ -158,7 +157,6 @@ CPPFLAGS += $(firmware-cppflags-y) +@@ -176,7 +175,6 @@ CPPFLAGS += $(firmware-cppflags-y) ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__ ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls ASFLAGS += -mno-save-restore -mstrict-align @@ -33,6 +31,3 @@ index ae68f55..10851fc 100644 ASFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) ASFLAGS += $(GENFLAGS) ASFLAGS += $(platform-asflags-y) --- -2.20.1 - -- cgit 1.2.3-korg