]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Apply -ffreestanding for the musl source code
authorMarco Schlumpp <marco.schlumpp@gmail.com>
Fri, 3 Feb 2023 14:52:34 +0000 (15:52 +0100)
committerUnikraft <monkey@unikraft.io>
Sun, 7 May 2023 13:01:48 +0000 (13:01 +0000)
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 <marco@unikraft.io>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #35

Makefile.uk

index e419fead867c4b4ab9b23834566da47d395e1e4c..11f39714a653035258586089993d3500d437e744 100644 (file)
@@ -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)