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
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)