From 2479507795bf8fbf78766df15fc40300f2e176b9 Mon Sep 17 00:00:00 2001 From: gaulthier gain Date: Tue, 6 Oct 2020 10:17:23 +0000 Subject: [PATCH] Synchronize musl with POSIX internal libs Signed-off-by: gaulthier gain Tested-by: Unikraft CI GitHub-Pull-Request: #3 --- Makefile.uk.musl.ldso | 2 ++ Makefile.uk.musl.linux | 4 +++- Makefile.uk.musl.misc | 6 ++++-- Makefile.uk.musl.passwd | 7 ++++++- Makefile.uk.musl.time | 2 +- Makefile.uk.musl.unistd | 12 +++++++++--- 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Makefile.uk.musl.ldso b/Makefile.uk.musl.ldso index 7e1b74bd20..497a522105 100644 --- a/Makefile.uk.musl.ldso +++ b/Makefile.uk.musl.ldso @@ -1,3 +1,4 @@ +ifneq ($(CONFIG_LIBPOSIX_LIBDL),y) LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/dlfcn.h LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/elf.h LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/src/internal/libc.h @@ -31,6 +32,7 @@ LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/tlsdesc.c LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlsym.c endif +endif #LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/aarch64/dlsym.s #LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/aarch64/tlsdesc.s #LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/microblaze/dlsym.s diff --git a/Makefile.uk.musl.linux b/Makefile.uk.musl.linux index 50dd48397f..ee3255b9cd 100644 --- a/Makefile.uk.musl.linux +++ b/Makefile.uk.musl.linux @@ -69,10 +69,12 @@ LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/readahead.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/reboot.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/remap_file_pages.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sbrk.c -#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sendfile.c +LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sendfile.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setfsgid.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setfsuid.c +ifneq ($(CONFIG_LIBPOSIX_USER),y) LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setgroups.c +endif #LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sethostname.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setns.c LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/settimeofday.c diff --git a/Makefile.uk.musl.misc b/Makefile.uk.musl.misc index d62c1ab036..acc14abbd1 100644 --- a/Makefile.uk.musl.misc +++ b/Makefile.uk.musl.misc @@ -52,14 +52,16 @@ LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/gethostid.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getopt.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getopt_long.c #LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getpriority.c -LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getresgid.c -LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getresuid.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getrlimit.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getrusage.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getsubopt.c +ifneq ($(CONFIG_LIBPOSIX_USER),y) +LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getresgid.c +LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getresuid.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/initgroups.c #LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/ioctl.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/issetugid.c +endif LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/lockf.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/login_tty.c LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/mntent.c diff --git a/Makefile.uk.musl.passwd b/Makefile.uk.musl.passwd index dbad5fd253..74912f3428 100644 --- a/Makefile.uk.musl.passwd +++ b/Makefile.uk.musl.passwd @@ -16,18 +16,23 @@ LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/sys/socket.h LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/sys/stat.h LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/unistd.h + +ifneq ($(CONFIG_LIBPOSIX_USER),y) LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/fgetgrent.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/fgetpwent.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/fgetspent.c + LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgr_a.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgr_r.c + LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgrent.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgrent_a.c -LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgrouplist.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getpw_a.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getpw_r.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getpwent.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getpwent_a.c +LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getgrouplist.c +endif LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getspent.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getspnam.c LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getspnam_r.c diff --git a/Makefile.uk.musl.time b/Makefile.uk.musl.time index 7330c96c81..92bd772809 100644 --- a/Makefile.uk.musl.time +++ b/Makefile.uk.musl.time @@ -54,7 +54,7 @@ LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/getdate.c LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/gmtime_r.c LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/localtime.c LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/localtime_r.c -#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/mktime.c +LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/mktime.c #LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/nanosleep.c LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/strftime.c LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/strptime.c diff --git a/Makefile.uk.musl.unistd b/Makefile.uk.musl.unistd index a4378b4995..ccf081aae4 100644 --- a/Makefile.uk.musl.unistd +++ b/Makefile.uk.musl.unistd @@ -38,19 +38,23 @@ LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fchownat.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fsync.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/ftruncate.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getcwd.c +ifneq ($(CONFIG_LIBPOSIX_USER),y) LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getegid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/geteuid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getgid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getgroups.c -#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/gethostname.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getlogin.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getlogin_r.c +LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getuid.c +else +LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/gethostname.c +endif + #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getpgid.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getpgrp.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getpid.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getppid.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getsid.c -LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/getuid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/isatty.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/lchown.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/link.c @@ -71,6 +75,7 @@ LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/readlinkat.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/readv.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/renameat.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/rmdir.c +ifneq ($(CONFIG_LIBPOSIX_USER),y) LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setegid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/seteuid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setgid.c @@ -80,9 +85,10 @@ LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setregid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setresgid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setresuid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setreuid.c -#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setsid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setuid.c +#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setsid.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setxid.c +endif #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/sleep.c #LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/symlink.c LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/symlinkat.c