[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT/MUSL PATCH 4/7] Synchronize musl with POSIX internal libs with musl



From: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>

In this commit, we avoid conflicts between POSIX internal libs and
musl by checking if internal libraries are already registered in the
build system.

Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
---
 Makefile.uk.musl.conf   |  2 ++
 Makefile.uk.musl.ldso   |  2 ++
 Makefile.uk.musl.legacy |  2 ++
 Makefile.uk.musl.linux  |  6 +++++-
 Makefile.uk.musl.misc   |  8 ++++++--
 Makefile.uk.musl.passwd |  7 ++++++-
 Makefile.uk.musl.time   |  2 +-
 Makefile.uk.musl.unistd | 13 ++++++++++---
 8 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/Makefile.uk.musl.conf b/Makefile.uk.musl.conf
index e4e49de..54b5301 100644
--- a/Makefile.uk.musl.conf
+++ b/Makefile.uk.musl.conf
@@ -1,3 +1,4 @@
+ifneq ($(CONFIG_LIBPOSIX_SYSINFO),y)
 LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/errno.h
 LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/src/internal/libc.h
 LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/limits.h
@@ -15,3 +16,4 @@ LIBMUSL_CONF_SRCS-y += $(LIBMUSL)/src/conf/pathconf.c
 LIBMUSL_CONF_SRCS-y += $(LIBMUSL)/src/conf/sysconf.c
 
 $(eval $(call 
_libmusl_import_lib,conf,$(LIBMUSL_CONF_HDRS-y),$(LIBMUSL_CONF_SRCS-y)))
+endif
diff --git a/Makefile.uk.musl.ldso b/Makefile.uk.musl.ldso
index 7e1b74b..497a522 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.legacy b/Makefile.uk.musl.legacy
index 3671f28..d9d036c 100644
--- a/Makefile.uk.musl.legacy
+++ b/Makefile.uk.musl.legacy
@@ -28,7 +28,9 @@ LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/ftw.c
 #LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/futimes.c
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getdtablesize.c
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getloadavg.c
+ifneq ($(CONFIG_LIBPOSIX_SYSINFO),y)
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getpagesize.c
+endif
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getpass.c
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getusershell.c
 LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/isastream.c
diff --git a/Makefile.uk.musl.linux b/Makefile.uk.musl.linux
index 50dd483..d797a08 100644
--- a/Makefile.uk.musl.linux
+++ b/Makefile.uk.musl.linux
@@ -69,10 +69,14 @@ 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
+ifneq ($(CONFIG_LIBLWIP),y)
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sendfile.c
+endif
 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 d62c1ab..c82827c 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
@@ -73,7 +75,9 @@ LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/setdomainname.c
 LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/setrlimit.c
 #LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/syscall.c|misc
 LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/syslog.c
+ifneq ($(CONFIG_LIBPOSIX_SYSINFO),y)
 LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/uname.c
+endif
 LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/wordexp.c
 
 $(eval $(call 
_libmusl_import_lib,misc,$(LIBMUSL_MISC_HDRS-y),$(LIBMUSL_MISC_SRCS-y)))
diff --git a/Makefile.uk.musl.passwd b/Makefile.uk.musl.passwd
index dbad5fd..74912f3 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 ec42edf..363c089 100644
--- a/Makefile.uk.musl.time
+++ b/Makefile.uk.musl.time
@@ -54,7 +54,7 @@ LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/gmtime.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 a4378b4..deb96c4 100644
--- a/Makefile.uk.musl.unistd
+++ b/Makefile.uk.musl.unistd
@@ -38,19 +38,24 @@ 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
+endif
+ifneq ($(CONFIG_LIBPOSIX_SYSINFO),y)
+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 +76,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 +86,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
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.