]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Remove `musl`'s `vfork` functionality and use our own asm wrappers
authorSergiu Moga <sergiu@unikraft.io>
Mon, 24 Mar 2025 17:27:26 +0000 (19:27 +0200)
committerMichalis Pappas <michalis@unikraft.io>
Tue, 22 Apr 2025 08:18:53 +0000 (10:18 +0200)
We are now using our own `vfork` assembly wrappers in the unikernel
so drop current `vfork` assembly functions that we cannot use anyway
for native syscalls and instead copy/reuse those defined by
us in the core repository.

Do this copy-paste so that in case if int the future there will appear
differences between what we do in the core in those wrappers and what
we need for musl, the musl wrappers stay the same.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
GitHub-Closes: #86

Makefile.uk
Makefile.uk.musl.process
arch/arm64/vfork.S [new file with mode: 0644]
arch/x86_64/vfork.S [new file with mode: 0644]

index 33fdab5d0b5467a9074e66805f07dea8532efe88..5a984f33932436640ff8b8464941736dde4d7686 100644 (file)
@@ -170,6 +170,7 @@ LIBMUSLGLUE_SRCS-y += $(LIBMUSL_BASE)/__uk_init_tls.c
 LIBMUSLGLUE_SRCS-y += $(LIBMUSL_BASE)/__uk_unmapself.c
 LIBMUSLGLUE_SRCS-y += $(LIBMUSL_BASE)/__set_thread_area.c
 LIBMUSLGLUE_SRCS-y += $(LIBMUSL_BASE)/arch/$(CONFIG_UK_ARCH)/__clone.S
+LIBMUSLGLUE_SRCS-$(CONFIG_LIBPOSIX_PROCESS_VFORK) += $(LIBMUSL_BASE)/arch/$(CONFIG_UK_ARCH)/vfork.S
 LIBMUSLGLUE_COMPFLAGS-y += -I$(LIBMUSL)/src/include
 LIBMUSLGLUE_COMPFLAGS-y += -I$(LIBMUSL)/src/internal
 LIBMUSLGLUE_CINCLUDES += -I$(LIBMUSL)/src/internal
index 891fa3da683b47527cf91c2256caaf5e2f5fc8fd..aed8d9da4e67a54fb759a94df0ed632fa88eb5e3 100644 (file)
@@ -44,13 +44,4 @@ LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/wait.c
 LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/waitid.c
 LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/waitpid.c
 
-ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/i386/vfork.s|i386
-else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/x86_64/vfork.s|x86_64
-else
-LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/vfork.c
-endif
-
-
 $(eval $(call _libmusl_import_lib,process,$(LIBMUSL_PROCESS_HDRS-y),$(LIBMUSL_PROCESS_SRCS-y)))
diff --git a/arch/arm64/vfork.S b/arch/arm64/vfork.S
new file mode 100644 (file)
index 0000000..09a1f86
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2025, Unikraft GmbH and The Unikraft Authors.
+ * Licensed under the BSD-3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ */
+
+/*
+ * NOTE: This code here is replicated from the core Unikraft repository,
+ * since we can't use musl's vfork wrapper.
+ */
+.global vfork
+vfork:
+       b       uk_syscall_e_vfork
diff --git a/arch/x86_64/vfork.S b/arch/x86_64/vfork.S
new file mode 100644 (file)
index 0000000..9015ae4
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2025, Unikraft GmbH and The Unikraft Authors.
+ * Licensed under the BSD-3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ */
+
+/*
+ * NOTE: This code here is replicated from the core Unikraft repository,
+ * since we can't use musl's vfork wrapper.
+ */
+.global vfork
+vfork:
+       jmp     uk_syscall_e_vfork