From: Marco Schlumpp Date: Fri, 3 Feb 2023 14:52:34 +0000 (+0100) Subject: Apply -ffreestanding for the musl source code X-Git-Tag: RELEASE-0.13.0~5 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=112035f99161ceedd86a72e00fd35aaa94959162;p=unikraft%2Flibs%2Fmusl.git Apply -ffreestanding for the musl source code This is the corresponding commit for unikraft/unikraft#740. This prevents a self dependency caused by compiler optimizations, because the libc implementation cannot rely on underlying presence of a libc. Signed-off-by: Marco Schlumpp Reviewed-by: Maria Sfiraiala Reviewed-by: Eduard Vintilă Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #35 --- diff --git a/Makefile.uk b/Makefile.uk index e419fea..11f3971 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -148,6 +148,10 @@ LIBMUSL_CFLAGS-y += -DUK_LIBC_SYSCALL=0 LIBMUSL_CFLAGS-y += -D_XOPEN_SOURCE=700 LIBMUSL_CFLAGS-y += $(LIBMUSL_HDRS_FLAGS-y) +# musl cannot rely on a libc library. Therefore, compile it as freestanding +# code. +LIBMUSL_CFLAGS-y += -ffreestanding + # We globally switch off warnings that are caused by musl's public headers CFLAGS += $(LIBMUSL_HDRS_FLAGS-y) CXXFLAGS += $(LIBMUSL_HDRS_FLAGS-y)