[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [UNIKRAFT PATCH v2 1/2] build: Support gcc-10 compilation on Unikraft


  • To: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU <vlad_andrei.badoiu@xxxxxx>
  • Date: Thu, 4 Feb 2021 20:22:06 +0200 (EET)
  • Cc: minios-devel <minios-devel@xxxxxxxxxxxxx>
  • Delivery-date: Thu, 04 Feb 2021 18:22:35 +0000
  • Dkim-filter: OpenDKIM Filter v2.10.3 mx.upb.ro 5EB90B560174
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: MH8FXQOUlQHFmxBFrqdhWcQjPyBEVw==
  • Thread-topic: build: Support gcc-10 compilation on Unikraft

Hi Sharan,

Thanks for the patch. This works on my end and solves the crash under GCC 10.2. 
I've added several references for this patch[1][2].

Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx>

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
[2] 
https://libc-alpha.sourceware.narkive.com/VbyHlBDB/gcc-4-8-and-ftree-loop-distribute-patterns

----- Original Message -----
From: "Sharan Santhanam" <sharan.santhanam@xxxxxxxxx>
To: "minios-devel" <minios-devel@xxxxxxxxxxxxx>
Cc: "Sharan Santhanam" <sharan.santhanam@xxxxxxxxx>
Sent: Thursday, February 4, 2021 8:12:15 PM
Subject: [UNIKRAFT PATCH v2 1/2] build: Support gcc-10 compilation on Unikraft

When compiling Unikraft with gcc-10, the compiler replace the memset
function with a recursive builtin memset call, which result in a
infinite recursive call to the memset causing exhaustion of the stack
memory eventually leading to crash. To fix this the gcc provides
compiler flags -ffreestanding and -fhosted.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 Makefile.uk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile.uk b/Makefile.uk
index e505c04..c3bb361 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -56,3 +56,6 @@ M4FLAGS      += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
 # "--enable-default-pie" by default.
 COMPFLAGS-$(call gcc_version_ge,6,1)   += -fno-PIC
 LDFLAGS-$(call gcc_version_ge,6,1)     += -no-pie
+ifeq ($(call gcc_version_ge,10,0),y)
+COMPFLAGS-y += -fhosted -ffreestanding -fno-tree-loop-distribute-patterns
+endif
-- 
2.7.4



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.