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

[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®.