]> xenbits.xensource.com Git - unikraft/libs/musl.git/log
unikraft/libs/musl.git
2 years agoFix the definition of the prlimit64 syscall
Marco Schlumpp [Tue, 18 Apr 2023 12:55:03 +0000 (14:55 +0200)]
Fix the definition of the prlimit64 syscall

The `sys/resource.h` header adds #define-based redirection from
`prlimit64` to `prlimit` when `_GNU_SOURCE` is set. This causes our
`provided_syscalls` to incorrectly define `uk_syscall_r_prlimit` instead
of `uk_syscall_r_prlimit64`. By reordering, the headers we can side-step
this problem.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoProperly cast the system call input and outputs
Marco Schlumpp [Tue, 18 Apr 2023 12:54:56 +0000 (14:54 +0200)]
Properly cast the system call input and outputs

On clang, this statement caused compiler errors instead of only
warnings.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoForward abort calls to Unikraft's UK_CRASH
Marco Schlumpp [Tue, 18 Apr 2023 12:54:52 +0000 (14:54 +0200)]
Forward abort calls to Unikraft's UK_CRASH

The signals are currently ignored and that causes musl to `exit` the
thread, which doesn't cause any output. Therefore, it's very unclear
what happened. By calling `UK_CRASH` there is a clear indication that
something went wrong.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoInclude stdalign.h header
Marco Schlumpp [Tue, 18 Apr 2023 12:54:14 +0000 (14:54 +0200)]
Include stdalign.h header

This header is deprecated but sometimes still used by software.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoInclude ucontext header files
Marco Schlumpp [Tue, 18 Apr 2023 12:54:06 +0000 (14:54 +0200)]
Include ucontext header files

While musl doesn't provide an actual implementation for the legacy
ucontext API, the header is still useful to compile software against
musl. Also, some software only relies on the definitions in the header.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoFix dependency on fetch step
Marco Schlumpp [Tue, 18 Apr 2023 12:53:56 +0000 (14:53 +0200)]
Fix dependency on fetch step

Because `fetch` was not really a file, make always tried to remake the
version file. Therefore, it also needed to recompile the file as the
mtime of the version file was updated.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

2 years agoMakefile.uk: Add flag to avoid gcc specifc symbol
Maria Sfiraiala [Sat, 11 Mar 2023 15:30:19 +0000 (17:30 +0200)]
Makefile.uk: Add flag to avoid gcc specifc symbol

When building apps with `clang` for `x86`, an asm specific symbol,
`__muldc3`, appears, which results in a undefined reference error, at
link time.

This commit adds the `-ffast-math` flag, when `clang` is used in order
to fix this issue.

Signed-off-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #38

2 years agoFix ioctl signature
Marc Rittinghaus [Thu, 20 Apr 2023 10:20:56 +0000 (12:20 +0200)]
Fix ioctl signature

The signature of ioctl uses a signed int as second argument. This,
however, differs from the definition in Linux, glibc, and our own
implementation in Unikraft, which use an unsigned long. Since using
int has lead to all sorts of problems (e.g., overflow into sign bit),
this commit adopts unsigned long also for the musl imported
header.

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Andra Paraschiv <andra@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #42

2 years agoUpgrade musl to latest version (1.2.3) RELEASE-0.12.0
Eduard Vintilă [Sun, 11 Dec 2022 11:04:19 +0000 (13:04 +0200)]
Upgrade musl to latest version (1.2.3)

Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #34

2 years agoRemove outdated vendored features.h
Marco Schlumpp [Thu, 8 Dec 2022 10:37:06 +0000 (11:37 +0100)]
Remove outdated vendored features.h

The features.h was incomplete and did not include the necessary feature
test macro definitions

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #32

2 years agoMove _XOPEN_SOURCE define to library CFLAGS
Marco Schlumpp [Fri, 9 Dec 2022 12:36:22 +0000 (13:36 +0100)]
Move _XOPEN_SOURCE define to library CFLAGS

Putting it into CFLAGS changes the behavior for all sources files in a
Unikraft build and changes them from the implicit _DEFAULT_SOURCE to
_XOPEN_SOURCE, which can break applications/libraries.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #33

2 years agoUse function declaration for getdents64 RELEASE-0.11.0
Razvan Deaconescu [Tue, 29 Nov 2022 22:26:52 +0000 (00:26 +0200)]
Use function declaration for getdents64

When defining `getdents64` as a macro aliasing `getdents`, the
syscall shim layer complains.

This patch uses a typical C-style declaration of `getdents64()`. This,
combined with the `LFS64(getdents)`, aliasing used in
`src/dirent/__getdents.c` solves the issue with the syscall shim layer.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #31

2 years agoAdd patch to fix definition of environ variable
Razvan Deaconescu [Tue, 29 Nov 2022 20:34:46 +0000 (22:34 +0200)]
Add patch to fix definition of environ variable

The patch properly defines `environ` as an array of pointers, the last
of which is NULL. In the previous definition, `environ` was NULL, which
is not OK. The definition is now replaced to an array of a single NULL
element.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #30

2 years agoAvoid `uk_syscall_set_tid_address()` for main thread
Dragos Iulian Argint [Mon, 28 Nov 2022 20:19:24 +0000 (22:19 +0200)]
Avoid `uk_syscall_set_tid_address()` for main thread

The uk_syscall_set_tid_address call should be used
to set the main thread's tid address within some
internal structures. At the moment, because it is
called before the initialization of the scheduler,
it fails causing the program to crash. A workaround
for this behavior is to set the tid to 0 if the
`__uk_sched_thread_current` variable is NULL, which
means that the scheduler is not initialized.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #29

2 years agoMakefile.uk: Use -Wno-cast-function-type for GCC >= 8
Razvan Deaconescu [Sun, 27 Nov 2022 12:16:32 +0000 (14:16 +0200)]
Makefile.uk: Use -Wno-cast-function-type for GCC >= 8

The build option `-Wno-cast-function-type`, used in `Makefile.uk` is
available from GCC >= 8. When used in GCC <= 7, it issues a warning.

This commit updates the build flags to enable `-Wno-cast-function-type`
only when using GCC >= 8.

GitHub-Fixes: #27

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

2 years agouk_init_tls: Change `uk_thread_tcb_fini` to `uk_thread_uktcb_fini`
Eduard Vintilă [Fri, 25 Nov 2022 11:22:20 +0000 (13:22 +0200)]
uk_init_tls: Change `uk_thread_tcb_fini` to `uk_thread_uktcb_fini`

This commit fixes a typo in which the function`uk_thread_uktcb_fini()`,
as declared in uksched's `tcb_impl.h`, was incorrectly referred to as
`uk_thread_tcb_fini()`.

Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #26

2 years agolinux: Add syscall wrapper for getrandom
Michalis Pappas [Thu, 24 Nov 2022 17:51:50 +0000 (18:51 +0100)]
linux: Add syscall wrapper for getrandom

Import e20658209177667e490c661dfd35b976749ef3f7 from
git://git.musl-libc.org/musl into patches.

This patch adds a syscall wrapper for getrandom, which
is not supported by musl v1.1.19.

Update the Makefile to compile getrandom() conditionally
to UKSWRAND.

Signed-off-by: Michalis Pappas <michalis.pappas@opensynergy.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #25

2 years agoEnable FPSIMD support on ARM64
Razvan Virtan [Thu, 6 Oct 2022 12:52:29 +0000 (15:52 +0300)]
Enable FPSIMD support on ARM64

Some of the functions implemented in musl can't work without the
ARM64 FPSIMD registers. This will fail unikraft build with musl
when FPSIMD is not enabled.
Enable FPSIMD by default when lib-musl is selected in menuconfig.

Signed-off-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #14

2 years agoMakefile.uk/misc: Always include the uname sources
Stefan Jumarea [Thu, 27 Oct 2022 12:01:57 +0000 (15:01 +0300)]
Makefile.uk/misc: Always include the uname sources

When `LIB_POSIX_SYSINFO` is selected, the build fails
when using musl with an undefined reference to `uname`.
This commit removes the uname sources dependency of
the selection of `LIB_POSIX_SYSINFO`.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #18

2 years agoMakefile.uk: Add sources for POSIX_USER functions
Stefan Jumarea [Wed, 2 Nov 2022 10:53:35 +0000 (12:53 +0200)]
Makefile.uk: Add sources for POSIX_USER functions

Since libc style syscall stubs are disabled when using musl, many of the
sources should be always included to avoid `undefined refrence` errors.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #20

2 years agoMakefile.uk: make 'version.h' depend on fetch.
Ulrich Meis [Wed, 31 Aug 2022 11:38:14 +0000 (13:38 +0200)]
Makefile.uk: make 'version.h' depend on fetch.

This becomes necessary when running 'make -jN'.

Signed-off-by: Ulrich Meis <Ulrich.Meis@opensynergy.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #15

2 years agoInclude internal headers only for building musl.
Robert Kuban [Fri, 19 Aug 2022 14:58:26 +0000 (16:58 +0200)]
Include internal headers only for building musl.

Before, musl has exposed internal headers to other code,
now the include paths are added to the appropriate variable.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #13

2 years agoAdd patch for CVE-2020-28928
Robert Kuban [Thu, 18 Aug 2022 16:40:34 +0000 (18:40 +0200)]
Add patch for CVE-2020-28928

This commit patches CVE-2020-28928, which is fixed in v1.2.2 of musl.

Imported from: https://www.openwall.com/lists/musl/2020/11/19/1/1

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #11

2 years agoAdd aarch64 configurations
Robert Kuban [Tue, 25 Oct 2022 14:00:20 +0000 (16:00 +0200)]
Add aarch64 configurations

This updates the sublibrary makefiles to use the appropiate
sourcefiles for aarch64.

It also removes the aarch64 source file for `__set_thread_area` from
the thread sublibrary makefile, as it is provided by lib-muslglue.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #7

2 years agoAdd translation from arm64 to aarch64
Marc Rittinghaus [Mon, 11 Jul 2022 13:27:21 +0000 (15:27 +0200)]
Add translation from arm64 to aarch64

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #7

2 years agoRemove files that depend on fork
Marc Rittinghaus [Mon, 11 Jul 2022 13:26:53 +0000 (15:26 +0200)]
Remove files that depend on fork

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #7

2 years agouk_init_tls: Return tcb pointer in __uk_copy_tls
Robert Kuban [Tue, 16 Aug 2022 18:53:21 +0000 (20:53 +0200)]
uk_init_tls: Return tcb pointer in __uk_copy_tls

Translate the tlsp to the tcb pointer before using as TCB.

On x86_64 both pointer are identical, but in aarch64 the tlsp
points into the last 16 bytes of the TCB.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #6

2 years agoAdd patch to replace open with openat with AT_FDCWD
Robert Kuban [Mon, 15 Aug 2022 13:43:34 +0000 (15:43 +0200)]
Add patch to replace open with openat with AT_FDCWD

This patch replaces calls to the open systemcall with the openat systemcall
with the AT_FDCWD argument if SYS_open is not defined, similar to the
original musl code.

This is necessary as the open systemcall is not available on aarch64.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #6

2 years agoAdd patch to modify clone wrapper.
Robert Kuban [Wed, 27 Jul 2022 11:31:44 +0000 (13:31 +0200)]
Add patch to modify clone wrapper.

This patches substitutes the syscalls in the clone wrapper
with normal function calls.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #6

2 years agoAdd patch to avoid conflict with __unused macro
Robert Kuban [Mon, 18 Jul 2022 17:20:47 +0000 (19:20 +0200)]
Add patch to avoid conflict with __unused macro

The added patch renames `__unused` to `_pad` in `aarch64/bits/stat.h`,
following the pattern of patch 0003.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #6

2 years agoMakefile.uk: Use Musl-build compatible build rule
Razvan Deaconescu [Sun, 6 Nov 2022 16:11:19 +0000 (18:11 +0200)]
Makefile.uk: Use Musl-build compatible build rule

Use `_XOPEN_SOURCE=700` for `LIBMUSL_HDRS_FLAGS-y`, similar to the
original Musl build rule.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #19

2 years agoMakefile: Make Makefile.uk.musl.network compatible with LWIP
Razvan Deaconescu [Sat, 29 Oct 2022 09:27:25 +0000 (12:27 +0300)]
Makefile: Make Makefile.uk.musl.network compatible with LWIP

Remove the lack of presence of `posix-driver`. `posix-driver` needs to
be enabled for Musl to work with networking support.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #19

2 years agoMakefile.uk.musl.complex: Include tgmath.h header 12/head
Florin Postolache [Fri, 11 Nov 2022 10:37:17 +0000 (12:37 +0200)]
Makefile.uk.musl.complex: Include tgmath.h header

Add tgmath.h header when both complex and math sublibs are enabled.
This header unites all types of math trigonometric functions for all
types(float, double, long double and complex) under one definition.
The header is not needed by musl source files but could be required
by applications.

Signed-off-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #24

2 years agoSet tid to 0 for the main thread
Dragos Iulian Argint [Wed, 26 Oct 2022 21:05:59 +0000 (00:05 +0300)]
Set tid to 0 for the main thread

This commit ads in the Config.uk the following default selection:
`LIBPOSIX_PROCESS_INIT_PIDS`, which allows pid,tid assignation
However, there is a bug in the assignment of tids that
makes the tid of the main thread not available when the
LIBC TCB (i.e. pthread structure) is initialized. The
currently adopted solution is to hardcode the tid to 0.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoRemove obsolete patches
Dragos Iulian Argint [Sun, 14 Aug 2022 22:39:58 +0000 (01:39 +0300)]
Remove obsolete patches

This commit reorders the patch numbers used for
musl and deletes those that are not needed as a
result of the changes made in this PR.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agopthread_create: TLS alignment and cleanup
Dragos Iulian Argint [Sun, 14 Aug 2022 22:13:29 +0000 (01:13 +0300)]
pthread_create: TLS alignment and cleanup

This patch replaces 2 function calls from musl with
2 custom ones and introduces an additional size
when allocating the map for a thread, `libc.tls_align`.
It is needed because Unikraft demands that the tls be aligned.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoAdd patch for the `clone()` wrapper for x86_64
Dragos Iulian Argint [Sun, 14 Aug 2022 22:12:03 +0000 (01:12 +0300)]
Add patch for the `clone()` wrapper for x86_64

The clone wrapper is an assembly source file which will
invoke a `syscall` instruction. Since we want just a
function call, we need to change it accordingly.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoAdd custom TLS related functions as glue code
Dragos Iulian Argint [Sun, 14 Aug 2022 22:07:58 +0000 (01:07 +0300)]
Add custom TLS related functions as glue code

The functions related to the TLS layout (like copying content)
are implemented in the unikraft core libraries.
To use them, we need to add glue source code.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoAdd custom `unmapself` function as glue code
Dragos Iulian Argint [Sun, 14 Aug 2022 22:01:17 +0000 (01:01 +0300)]
Add custom `unmapself` function as glue code

`unmapself()` provides a detached thread the ability
to free the memory region allocated for the stack and
TLS. In the original version, this function does
`munmap()', which will deallocate the thread's stack,
after which it executes exit() (NB: SYS_exit). This
works because there is another stack in the Kernel.
Since this does not exist in Unikraft, we implement
our version of unmapself.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoProvide `__set_thread_area()` as glue code
Dragos Iulian Argint [Sun, 14 Aug 2022 21:50:22 +0000 (00:50 +0300)]
Provide `__set_thread_area()` as glue code

`__set_thread_area()` is a function that is usually
architecture dependent, it sets the tls pointer in the
fs register. An `arch_prctl` system call is used. We
are replacing this call with a custom version because
`arch_prctl()` is not implemented in Unikraft at the
moment.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoRemove `__unmapself` and `set_thread_area`
Dragos Iulian Argint [Sun, 14 Aug 2022 21:49:00 +0000 (00:49 +0300)]
Remove `__unmapself` and `set_thread_area`

Comment the sources corresponding to the functions
__unmapself() (for detached threads) and
__set_thread_area() (for setting the fs register
to the tls pointer) because they will be reintroduced
as glue code.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoInitialize TLS and reserve TCB space
Dragos Iulian Argint [Sun, 14 Aug 2022 21:44:54 +0000 (00:44 +0300)]
Initialize TLS and reserve TCB space

This commit adds a call in Makefile.uk to reserve the space
needed for the LIBC TCB (e.g. `pthread` structure)
and adds 3 glue code files:
`__uk_init_tls.c` - initialize an Unikraft TLS
`__uk_unmapself.c` - allows unmapping for detached threads
`__set_thread_area.c` - bypass for arch_prctl() syscall for
setting the tls pointer

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoAdd library dependencies for thread support
Dragos Iulian Argint [Sun, 14 Aug 2022 21:42:48 +0000 (00:42 +0300)]
Add library dependencies for thread support

Select (by default) the core libraries used by musl:
`LIBUKMMAP` - provides mmap() syscall
`LIBPOSIX_PROCESS_PIDS` - provides pid,tid implementation
`LIBPOSIX_PROCESS_CLONE` - provides the clone() syscall
`LIBPOSIX_FUTEX` - provides futex() syscall
`LIBUKSCHED_TCB_INIT` - allows setting the size for the LIBC TCB

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Robert Kuban <robert.kuban@opensynergy.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoAdd script for generating Makefile.uk.musl.* entries
Robert Kuban [Tue, 19 Jul 2022 14:29:41 +0000 (16:29 +0200)]
Add script for generating Makefile.uk.musl.* entries

Adds a script that can find the source files for a given architecture and
sublibrary by emulating the mechanism in the original musl makefile.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #8

2 years agoRemove patch for 'ioctl'
Dragos Iulian Argint [Sat, 7 May 2022 09:05:35 +0000 (12:05 +0300)]
Remove patch for 'ioctl'

This patch was introduced to modify the prototype of the
`ioctl()` function when it was exported directly from vfscore.
Now, since we want to keep the wrapper in musl, we leave the
function prototype unchanged. The patch is no longer needed.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #5

2 years agoAdd patches for system call handling
Dragos Iulian Argint [Sat, 7 May 2022 08:54:09 +0000 (11:54 +0300)]
Add patches for system call handling

Musl wrappers use a binary system call, e.g. for x86_64 the `syscall`
instruction is used which is a trap. In a single-address-space OS as an Unikraft
unikernel this is just overhead. Hence, we changed the way musl deals with
syscall handling by using some syscall shim layer macros.
Those will replace binary system calls with function calls.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #5

2 years agoRe-enable musl-defined wrappers
Dragos Iulian Argint [Sat, 7 May 2022 08:48:18 +0000 (11:48 +0300)]
Re-enable musl-defined wrappers

In the previous version, wrappers over system calls (e.g. `read ()`)
were defined in syscall shim layer. Since we want to maintain musl as
vanilla as possible, we have re-introduced these wrappers.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #5

2 years agoSet `LIBSYSCALL_SHIM_NOWRAPPER` for musl
Dragos Iulian Argint [Sat, 7 May 2022 08:45:29 +0000 (11:45 +0300)]
Set `LIBSYSCALL_SHIM_NOWRAPPER` for musl

We need to set the LIBSYSCALL_SHIM_NOWRAPPER field in the configuration
file to prevent syscall shim layer from creating system call wrappers.
These wrappers are already defined in musl.

Signed-off-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #5

2 years agoMakefile.uk.musl.process: Add wait.c build dependency
Razvan Deaconescu [Wed, 9 Nov 2022 07:11:59 +0000 (09:11 +0200)]
Makefile.uk.musl.process: Add wait.c build dependency

This is required for Python3.

Signed-off-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #23

2 years agoRemove include directory from clean list
Robert Kuban [Tue, 25 Oct 2022 16:41:24 +0000 (18:41 +0200)]
Remove include directory from clean list

The current clean rule in the Unikraft build system can not remove
directories and terminates with an error if there is a directory in
the list of files to clean.

This commit removes the include directory inside the lib-musl build
directory from the clean list.

Since each sublibrary has a separate subdirectories in the include
directory, this change will not make headers accessible which would have
been deleted by the clean rule.

Alternatives considered:

1. Enable the build rule to remove directories.
This would lead to the uk_clean_list not containing a complete
lists of files to remove anymore and makes the potential damage
of errors in the clean list much higher.

2. Add every header file into the `LIBMUSL_CLEAN` variable.
This could be done in `_libmusl_import_lib` and would remove the
linked headers, but would still leave the directory tree.

3. Do not create the links, but include from the origin directory.
This would remove the ability to filter header files in the
sublibrary makefile.

Signed-off-by: Robert Kuban <robert.kuban@opensynergy.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #17

2 years agoMakefile.uk: Add sysexits.h include dependency
Razvan Deaconescu [Wed, 9 Nov 2022 07:09:59 +0000 (09:09 +0200)]
Makefile.uk: Add sysexits.h include dependency

This is required by Python3.

Signed-off-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #22

2 years agoComment macros to stop using VDSO
Florin Postolache [Mon, 15 Aug 2022 09:31:24 +0000 (12:31 +0300)]
Comment macros to stop using VDSO

The VDSO is responsible for the virtual system calls in a basic
linux application and makes so that some system calls will be faster
because the transition between kernel mode and user mode is eliminated.
Therefore, it shouldn't be used in Unikraft. At the moment, in musl
this feature is enabled and functions like __clock_gettime will generate
a segfault.

Signed-off-by: Florin Postolache <florin.postolache80@gmail.com>
Reviewed-by: Dragos Iulian Argint <dragosargint21@gmail.com>
Approved-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #10

3 years agoMake musl initialization work with unikraft RELEASE-0.10.0 RELEASE-0.6 RELEASE-0.7.0 RELEASE-0.8.0 RELEASE-0.9.0
Cyril Soldani [Thu, 10 Dec 2020 08:31:16 +0000 (09:31 +0100)]
Make musl initialization work with unikraft

Work around some syscalls not being implemented in unikraft.

Signed-off-by: Cyril Soldani <cyril.soldani@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoEnable sendfile, used by other modules
Cyril Soldani [Tue, 10 Nov 2020 10:18:05 +0000 (11:18 +0100)]
Enable sendfile, used by other modules

Signed-off-by: Cyril Soldani <cyril.soldani@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoPrevent syscall shim layer libc wrapper generation
Cyril Soldani [Fri, 9 Oct 2020 16:55:50 +0000 (18:55 +0200)]
Prevent syscall shim layer libc wrapper generation

The musl libc provides its own wrappers around syscalls, which we prefer
to the shim-layer-generated ones as they often do additional
bookkeeping. And we can't have both as it would lead to conflicts.

Signed-off-by: Cyril Soldani <cyril.soldani@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoAdd patches that fixes stdout
gaulthier gain [Fri, 9 Oct 2020 16:00:23 +0000 (16:00 +0000)]
Add patches that fixes stdout

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoUpdate README.md
gaulthier gain [Tue, 6 Oct 2020 18:24:10 +0000 (18:24 +0000)]
Update README.md

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoSynchronize musl with POSIX-Process internal libs
gaulthier gain [Tue, 6 Oct 2020 18:23:47 +0000 (18:23 +0000)]
Synchronize musl with POSIX-Process internal libs

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoUse sendfile only if lwip is not enabled
gaulthier gain [Tue, 6 Oct 2020 18:09:24 +0000 (18:09 +0000)]
Use sendfile only if lwip is not enabled

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoAdd gmtime
gaulthier gain [Tue, 6 Oct 2020 13:40:29 +0000 (13:40 +0000)]
Add gmtime

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoSynchronize musl with POSIX internal libs
gaulthier gain [Tue, 6 Oct 2020 10:17:23 +0000 (10:17 +0000)]
Synchronize musl with POSIX internal libs

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoAdd SC_LEVEL1_DCACHE_LINESIZ definition
gaulthier gain [Tue, 6 Oct 2020 08:02:38 +0000 (08:02 +0000)]
Add SC_LEVEL1_DCACHE_LINESIZ definition

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoSubcomponize musl (based on Alex work)
gaulthier gain [Tue, 6 Oct 2020 08:00:25 +0000 (08:00 +0000)]
Subcomponize musl (based on Alex work)

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

3 years agoCorrect license headers introduced by NEC Laboratories Europe GmbH
Simon Kuenzer [Tue, 13 Jul 2021 19:24:08 +0000 (21:24 +0200)]
Correct license headers introduced by NEC Laboratories Europe GmbH

This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits:
 60a1108 - Initial port (Felipe Huici)

On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.

The original author(s) or an authorized representative from
the author's affiliation consents to the change with a
`Reviewed-by` tag to this commit.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #2

4 years agoUpdate __stdout_write to allow flushing on stdout RELEASE-0.5
gaulthier gain [Tue, 3 Mar 2020 10:23:24 +0000 (10:23 +0000)]
Update __stdout_write to allow flushing on stdout

This patch fixes the issue where printing on stdout does nothing
since stdout was not flushed. In that case, we found that the problem
was related to __stdout_write. Indeed f->lbf must be set to '\n' for
line-buffered mode nevertheless, the condition "(!(f->flags & F_SVB)
&& __syscall(SYS_ioctl, f->fd, TIOCGWINSZ, &wsz))" fails on Unikraft.
The variable f->lbf is thus reset to -1 which prevents a correct
display on stdout. With this patch, we "force" f->lbf to be set in
line-buffered mode.

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
4 years agoAdd patch to update mount.h to avoid conflicts with vfscore
gaulthier gain [Tue, 3 Mar 2020 10:23:23 +0000 (10:23 +0000)]
Add patch to update mount.h to avoid conflicts with vfscore

This patch updates "mount.h" in order to avoid ioctl redefinition
error with vfscore. Basically, the musl "mount.h" file includes
<sys/ioctl.h> only if _VFSCORE_SYS_MOUNT_H_ was not defined.

Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
5 years agoUpdate README.md with current status RELEASE-0.4
Gaulthier Gain [Fri, 31 Jan 2020 22:23:43 +0000 (23:23 +0100)]
Update README.md with current status

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUpdate COPYING.md with musl specifications
Gaulthier Gain [Fri, 31 Jan 2020 22:23:42 +0000 (23:23 +0100)]
Update COPYING.md with musl specifications

We updated the license part by considering musl MIT license.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUpdate MAINTAINERS.md
Gaulthier Gain [Wed, 29 Jan 2020 21:18:50 +0000 (22:18 +0100)]
Update MAINTAINERS.md

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUpdate Config.uk with the required micro-libs
Gaulthier Gain [Wed, 29 Jan 2020 21:18:48 +0000 (22:18 +0100)]
Update Config.uk with the required micro-libs

Add libvfscore, libposix_process and syscall_shim layer as required
micro-libraries.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to unistd
Gaulthier Gain [Wed, 29 Jan 2020 21:18:47 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to unistd

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to time
Gaulthier Gain [Wed, 29 Jan 2020 21:18:46 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to time

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to stdio
Gaulthier Gain [Wed, 29 Jan 2020 21:18:45 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to stdio

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to stat
Gaulthier Gain [Wed, 29 Jan 2020 21:18:44 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to stat

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to signal
Gaulthier Gain [Wed, 29 Jan 2020 21:18:43 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to signal

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to process
Gaulthier Gain [Wed, 29 Jan 2020 21:18:42 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to process

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to misc
Gaulthier Gain [Wed, 29 Jan 2020 21:18:41 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to misc

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to linux
Gaulthier Gain [Wed, 29 Jan 2020 21:18:40 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to linux

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to legacy
Gaulthier Gain [Wed, 29 Jan 2020 21:18:39 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to legacy

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to fcntl
Gaulthier Gain [Wed, 29 Jan 2020 21:18:38 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to fcntl

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAvoid multiple definitions by excluding functions related to dirent
Gaulthier Gain [Wed, 29 Jan 2020 21:18:37 +0000 (22:18 +0100)]
Avoid multiple definitions by excluding functions related to dirent

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUpdate __syscall_cp.c to use syscalls from the syscall_shim layer
Gaulthier Gain [Wed, 29 Jan 2020 21:18:36 +0000 (22:18 +0100)]
Update __syscall_cp.c to use syscalls from the syscall_shim layer

This patch updates __syscall_cp.c to use uk_syscall declaration from
the syscall_shim layer.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUse uk/bits/syscall_nrs.h instead of musl internal bits/syscall.h
Gaulthier Gain [Wed, 29 Jan 2020 21:18:35 +0000 (22:18 +0100)]
Use uk/bits/syscall_nrs.h instead of musl internal bits/syscall.h

This patch updates Makefile.uk and include/sys/syscall.h in order to
avoid generating a clone of syscall_nrs.h which is defined within
Unikraft.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUse syscall_shim layer instead of musl internal syscalls
Gaulthier Gain [Wed, 29 Jan 2020 21:18:34 +0000 (22:18 +0100)]
Use syscall_shim layer instead of musl internal syscalls

This commit updates include/syscall.h by including uk_syscall
from the syscall_shim layer. In addition, it redirects syscall,
__syscall, syscall_cp and __syscall_ret to the syscall_shim layer.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd patch to update time.h to avoid conflicts with uktime
Gaulthier Gain [Wed, 29 Jan 2020 21:18:33 +0000 (22:18 +0100)]
Add patch to update time.h to avoid conflicts with uktime

This patch updates time.h in order to avoid redefinition errors with
musl-imported time.h.

Note that we included '<bits/alltypes>' otherwise 'locale_t' type is
unknown. A next task will be to find a cleaner approach.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd patch to rename __unused field to pad
Gaulthier Gain [Wed, 29 Jan 2020 21:18:32 +0000 (22:18 +0100)]
Add patch to rename __unused field to pad

This patch renames __unused in arch/x86_64/bits/stat.h to pad
since __unused is a keyword in Unikraft.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd patch to remove syscall prototype in unistd.h
Gaulthier Gain [Wed, 29 Jan 2020 21:18:31 +0000 (22:18 +0100)]
Add patch to remove syscall prototype in unistd.h

This patch removes the long syscall(long, ...) prototype which
conflicts with Unikraft's syscall_shim layer macros.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd stub for mprotect in mem.c
Gaulthier Gain [Wed, 29 Jan 2020 21:18:30 +0000 (22:18 +0100)]
Add stub for mprotect in mem.c

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd glue code rules for mem.c in Makefile.uk
Gaulthier Gain [Wed, 29 Jan 2020 21:18:29 +0000 (22:18 +0100)]
Add glue code rules for mem.c in Makefile.uk

This commit updates Makefile.uk to support glue code related to
mem.c between musl and Unikraft.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoRemove files related to syscalls management
Gaulthier Gain [Wed, 29 Jan 2020 21:18:28 +0000 (22:18 +0100)]
Remove files related to syscalls management

In this patch, we remove patches, source and header files that are
obsolete with the syscall shim layer. These old files were added at
the time where the syscall shim layer was not implemented.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoUpdate compilation flags with musl namespace
Gaulthier Gain [Wed, 29 Jan 2020 21:18:27 +0000 (22:18 +0100)]
Update compilation flags with musl namespace

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoReview formatting for files generations in Makefile.uk
Gaulthier Gain [Wed, 29 Jan 2020 21:18:26 +0000 (22:18 +0100)]
Review formatting for files generations in Makefile.uk

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoCall configure after patching
Gaulthier Gain [Wed, 29 Jan 2020 21:18:25 +0000 (22:18 +0100)]
Call configure after patching

Update Makefile.uk to run the configure script after patching.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd support for C++ applications
Gaulthier Gain [Wed, 29 Jan 2020 21:18:24 +0000 (22:18 +0100)]
Add support for C++ applications

Update Makefile.uk to provide support to C++ applications.

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoInitial port
Felipe Huici [Mon, 3 Sep 2018 14:11:59 +0000 (16:11 +0200)]
Initial port

Initial port, enough code to compile and run a hello world application.

Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoInitial commit (empty)
Simon Kuenzer [Thu, 30 Jan 2020 09:12:31 +0000 (10:12 +0100)]
Initial commit (empty)

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>