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

[UNIKRAFT/MUSL PATCH 1/7] Makefile.*, Config.uk: Sub-componentize MUSL



From: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>

This commit introduces the ability to select paticular subcomponents
within the MUSL standard library framework through Unikraft's KConfig
system.  In order to achieve distinction between libraries, additional
rules were created to copy the necessary headers from the
subcomponents into the microlibrary's build directory.  This is
achieved by adding to an appropriate subcomponent list of headers
(standarized via `*_HDRS-y`) and then calling a subcomponent
registration macro `_libmusl_import_lib`.

Signed-off-by: Alexander Jung <alexander.jung@xxxxxxxxx>
Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
---
 Config.uk                  | 219 ++++++++-
 Makefile.rules             |  31 ++
 Makefile.uk                | 125 ++++-
 Makefile.uk.musl.aio       |  22 +-
 Makefile.uk.musl.complex   | 142 +++---
 Makefile.uk.musl.conf      |  22 +-
 Makefile.uk.musl.crypt     |  27 +-
 Makefile.uk.musl.ctype     |  90 ++--
 Makefile.uk.musl.dirent    |  42 +-
 Makefile.uk.musl.env       |  38 +-
 Makefile.uk.musl.errno     |  13 +-
 Makefile.uk.musl.exit      |  28 +-
 Makefile.uk.musl.fcntl     |  20 +-
 Makefile.uk.musl.fenv      |  55 ++-
 Makefile.uk.musl.internal  |  66 ++-
 Makefile.uk.musl.ipc       |  41 +-
 Makefile.uk.musl.ldso      |  68 +--
 Makefile.uk.musl.legacy    |  56 ++-
 Makefile.uk.musl.linux     | 152 +++---
 Makefile.uk.musl.locale    |  82 +++-
 Makefile.uk.musl.malloc    |  32 +-
 Makefile.uk.musl.math      | 926 +++++++++++++++++++------------------
 Makefile.uk.musl.misc      | 117 +++--
 Makefile.uk.musl.mman      |  49 +-
 Makefile.uk.musl.mq        |  32 +-
 Makefile.uk.musl.multibyte |  51 +-
 Makefile.uk.musl.network   | 197 +++++---
 Makefile.uk.musl.passwd    |  60 ++-
 Makefile.uk.musl.prng      |  30 +-
 Makefile.uk.musl.process   |  90 ++--
 Makefile.uk.musl.regex     |  34 +-
 Makefile.uk.musl.sched     |  29 +-
 Makefile.uk.musl.search    |  17 +-
 Makefile.uk.musl.select    |  17 +-
 Makefile.uk.musl.setjmp    |  62 +--
 Makefile.uk.musl.signal    | 155 ++++---
 Makefile.uk.musl.stat      |  51 +-
 Makefile.uk.musl.stdio     | 266 ++++++-----
 Makefile.uk.musl.stdlib    |  60 ++-
 Makefile.uk.musl.string    | 189 ++++----
 Makefile.uk.musl.temp      |  26 +-
 Makefile.uk.musl.termios   |  28 +-
 Makefile.uk.musl.thread    | 413 +++++++++--------
 Makefile.uk.musl.time      | 117 +++--
 Makefile.uk.musl.unistd    | 189 ++++----
 45 files changed, 2832 insertions(+), 1744 deletions(-)
 create mode 100644 Makefile.rules

diff --git a/Config.uk b/Config.uk
index 7862da8..8b530c6 100644
--- a/Config.uk
+++ b/Config.uk
@@ -1,9 +1,214 @@
 # hidden
 menuconfig LIBMUSL
-        bool "musl - A C standard library"
-        default n
-        select HAVE_LIBC
-        select LIBKUALLOC
-        select LIBSYSCALL_SHIM
-        select LIBVFSCORE
-        select LIBPOSIX_PROCESS
+  bool "musl: A C standard library"
+  default n
+  select HAVE_LIBC
+  select LIBKUALLOC
+  select LIBSYSCALL_SHIM
+  select LIBVFSCORE
+  select LIBPOSIX_PROCESS
+
+  select LIBMUSL_CTYPE
+  select LIBMUSL_DIRENT
+  select LIBMUSL_ENV
+  select LIBMUSL_ERRNO
+  select LIBMUSL_EXIT
+  select LIBMUSL_INTERNAL
+  select LIBMUSL_LOCALE
+  select LIBMUSL_STAT
+  select LIBMUSL_STDIO
+  select LIBMUSL_STDLIB
+  select LIBMUSL_STRING
+  select LIBMUSL_TERMIOS
+
+if LIBMUSL
+
+config LIBMUSL_AIO
+  bool "libaio"
+  default y
+
+config LIBMUSL_COMPLEX
+  bool "libcomplex"
+  default y
+
+config LIBMUSL_CONF
+  bool "libconf"
+  default y
+
+config LIBMUSL_CRYPT
+  bool "libcrypt"
+  default y
+
+config LIBMUSL_CTYPE
+  bool "libctype"
+  default y
+
+config LIBMUSL_DIRENT
+  bool "libdirent"
+  default y
+
+config LIBMUSL_ENV
+  bool "libenv"
+  default y
+
+config LIBMUSL_ERRNO
+  bool "liberrno"
+  default y
+
+config LIBMUSL_EXIT
+  bool "libexit"
+  default y
+
+config LIBMUSL_FCNTL
+  bool "libfcntl"
+  default y
+
+config LIBMUSL_FENV
+  bool "libfenv"
+  default y
+
+config LIBMUSL_INTERNAL
+  bool "libinternal"
+  default y
+
+config LIBMUSL_IPC
+  bool "libipc"
+  default y
+
+config LIBMUSL_LDSO
+  bool "libldso"
+  default y
+
+config LIBMUSL_LEGACY
+  bool "liblegacy"
+  default y
+
+config LIBMUSL_LINUX
+  bool "liblinux"
+  default y
+
+config LIBMUSL_LOCALE
+  bool "liblocale"
+  default y
+  select LIBMUSL_TIME
+
+config LIBMUSL_MALLOC
+  bool "libmalloc"
+  default y
+
+config LIBMUSL_MATH
+  bool "libmath"
+  default y
+  select LIBMUSL_FENV
+
+config LIBMUSL_MISC
+  bool "libmisc"
+  default y
+  select LIBMUSL_NETWORK
+
+config LIBMUSL_MMAN
+  bool "libmman"
+  default y
+
+config LIBMUSL_MQ
+  bool "libmq"
+  default y
+  select LIBMUSL_NETWORK
+
+config LIBMUSL_MULTIBYTE
+  bool "libmultibyte"
+  default y
+
+config LIBMUSL_NETWORK
+  bool "libnetwork"
+  default y
+
+config LIBMUSL_PASSWD
+  bool "libpasswd"
+  default y
+
+config LIBMUSL_PRNG
+  bool "libprng"
+  default y
+
+config LIBMUSL_PROCESS
+  bool "libprocess"
+  default y
+  select LIBMUSL_THREAD
+
+config LIBMUSL_REGEX
+  bool "libregex"
+  default y
+
+config LIBMUSL_SCHED
+  bool "libsched"
+  default y
+
+config LIBMUSL_SEARCH
+  bool "libsearch"
+  default y
+
+config LIBMUSL_SELECT
+  bool "libselect"
+  default y
+
+config LIBMUSL_SETJMP
+  bool "libsetjmp"
+  default y
+
+config LIBMUSL_SIGNAL
+  bool "libsignal"
+  default y
+  select LIBMUSL_SETJMP
+
+config LIBMUSL_STAT
+  bool "libstat"
+  default y
+
+config LIBMUSL_STDIO
+  bool "libstdio"
+  default y
+  select LIBMUSL_FENV
+  select LIBMUSL_MATH
+  select LIBMUSL_TEMP
+  select LIBMUSL_UNISTD
+
+config LIBMUSL_STDLIB
+  bool "libstdlib"
+  default y
+  select LIBMUSL_SIGNAL
+  select LIBMUSL_MULTIBYTE
+
+config LIBMUSL_STRING
+  bool "libstring"
+  default y
+
+config LIBMUSL_TEMP
+  bool "libtemp"
+  default y
+
+config LIBMUSL_TERMIOS
+  bool "libtermios"
+  default y
+
+config LIBMUSL_THREAD
+  bool "libthread"
+  default y
+  select LIBMUSL_SCHED
+  select LIBMUSL_MMAN
+
+config LIBMUSL_FORCE_THREAD
+  bool
+  default y if LIBUKSCHED
+  default n
+  select LIBMUSL_THREAD
+
+config LIBMUSL_TIME
+  bool "libtime"
+  default y
+  
+config LIBMUSL_UNISTD
+  bool "libunistd"
+  default y
+
+endif
diff --git a/Makefile.rules b/Makefile.rules
new file mode 100644
index 0000000..53e8477
--- /dev/null
+++ b/Makefile.rules
@@ -0,0 +1,31 @@
+#
+# Import a sub-library of musl
+#
+# @param $(1)
+#   The name of the sub-library within musl.
+# @param $(2)
+#   The headers for this sub-library.
+# @param $(3)
+#   The source files for this sub-library.
+#
+define _libmusl_import_lib
+$(LIBMUSL_BUILD)/include/$(1):
+       $(call verbose_cmd,MKDIR,libmusl: $(subst $(LIBMUSL_BUILD),,$(1)): 
$(notdir $$@), mkdir -p $$@)
+
+# Make a symbolic link of the original header file to a sub-library directory
+$(LIBMUSL_BUILD)/include/$(1)/%.h:
+       $$(Q)mkdir -p $$(shell dirname $$@)
+       $(call verbose_cmd,HOSTLN,libmusl: $(1): $$(subst 
$(LIBMUSL_BUILD)/include/$(1)/,,$$@), \
+               ln -sf $$(subst $(LIBMUSL_BUILD)/include/$(1)/,$(LIBMUSL),$$@) 
$$@)
+
+LIBMUSL_$(call uc,$(1))_INCLUDES-y += -I$(LIBMUSL_BUILD)/include/$(1)/include
+LIBMUSL_$(call uc,$(1))_INCLUDES-y += 
-I$(LIBMUSL_BUILD)/include/$(1)/src/internal
+LIBMUSL_$(call uc,$(1))_INCLUDES-y += -I$(LIBMUSL_BUILD)/include/$(1)/src/$(1)
+LIBMUSL_SRCS-y += $(3)
+
+CINCLUDES-y += $$(LIBMUSL_$(call uc,$(1))_INCLUDES-y)
+CXXINCLUDES-y += $$(LIBMUSL_$(call uc,$(1))_INCLUDES-y)
+
+# Append the sub library directory to the include path
+$(LIBMUSL_BUILD)/.prepared: $(subst 
$(LIBMUSL),$(LIBMUSL_BUILD)/include/$(1),$(2))
+endef
diff --git a/Makefile.uk b/Makefile.uk
index 9657bb7..6de0b77 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -1,6 +1,8 @@
 #  libmusl Makefile.uk
 #
 #  Authors: Felipe Huici <felipe.huici@xxxxxxxxx>
+#           Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
+#           Alexander Jung <alexander.jung@xxxxxxxxx>
 #
 #  Copyright (c) 2017, NEC Europe Ltd., NEC Corporation. All rights reserved.
 #
@@ -36,6 +38,7 @@
 # Library registration
 
################################################################################
 $(eval $(call addlib_s,libmusl,$(CONFIG_LIBMUSL)))
+
 # Additionally, build glue code. This is put into a separate library so that we
 # can apply a thick helping of warning suppressions to musl, which throws
 # lots of compilation warnings, but keep our glue code up to our standards.
@@ -56,13 +59,14 @@ $(eval $(call 
patch,libmusl,$(LIBMUSL_PATCHDIR),musl-$(LIBMUSL_VERSION)))
 LIBMUSL_SUBDIR=musl-$(LIBMUSL_VERSION)
 LIBMUSL=$(LIBMUSL_ORIGIN)/$(LIBMUSL_SUBDIR)/
 
+# Additional macros for musl sub-libraries
+include $(LIBMUSL_BASE)/Makefile.rules
+
 
################################################################################
 # Library includes
 
################################################################################
 LIBMUSL_GLOBAL_INCLUDES-y   += -I$(LIBMUSL)/arch/$(ARCH)
 LIBMUSL_GLOBAL_INCLUDES-y   += -I$(LIBMUSL)/arch/generic
-LIBMUSL_GLOBAL_INCLUDES-y   += -I$(LIBMUSL)/src/internal
-LIBMUSL_GLOBAL_INCLUDES-y   += -I$(LIBMUSL)/include
 LIBMUSL_GLOBAL_INCLUDES-y   += -I$(LIBMUSL_BASE)/include
 
 CINCLUDES-y    += $(LIBMUSL_GLOBAL_INCLUDES-y)
@@ -87,15 +91,22 @@ $(LIBMUSL)/src/internal/version.h:
 
 UK_PREPARE += $(LIBMUSL)/arch/$(ARCH)/bits/alltypes.h
 UK_PREPARE += $(LIBMUSL)/src/internal/version.h
+UK_PREPARE += $(LIBMUSL_BUILD)/.prepared
 
 LIBMUSL_CLEAN += $(LIBMUSL)/arch/$(ARCH)/bits/alltypes.h
 LIBMUSL_CLEAN += $(LIBMUSL)/src/internal/version.h
+LIBMUSL_CLEAN += $(LIBMUSL_BUILD)/include
 
 
################################################################################
 # Global flags
 
################################################################################
-LIBMUSL_HEADER_FLAGS-y += -Wno-unused-parameter -Wno-unused-value \
-                         -Wno-parentheses
+LIBMUSL_HDRS_FLAGS-y += -Wno-unused-parameter
+LIBMUSL_HDRS_FLAGS-y += -Wno-unused-value
+LIBMUSL_HDRS_FLAGS-y += -Wno-parentheses
+LIBMUSL_HDRS_FLAGS-y += -Wno-error=sign-compare
+LIBMUSL_HDRS_FLAGS-y += -Wno-builtin-macro-redefined
+LIBMUSL_HDRS_FLAGS-y += -D_POSIX_SOURCE -D_BSD_SOURCE
+
 LIBMUSL_CFLAGS-y += -Wno-implicit-fallthrough
 LIBMUSL_CFLAGS-y += -Wno-restrict
 LIBMUSL_CFLAGS-y += -Wno-unused-but-set-variable
@@ -107,59 +118,159 @@ LIBMUSL_CFLAGS-y += -Wno-missing-braces
 LIBMUSL_CFLAGS-y += -Wno-cast-function-type
 LIBMUSL_CFLAGS-y += -Wno-format-contains-nul
 LIBMUSL_CFLAGS-y += -Wno-type-limits
-LIBMUSL_CFLAGS-y += $(LIBMUSL_HEADER_FLAGS-y)
+LIBMUSL_CFLAGS-y += $(LIBMUSL_HDRS_FLAGS-y)
 
 # We globally switch off warnings that are caused by musl's public headers
-CFLAGS += $(LIBMUSL_HEADER_FLAGS-y)
-CXXFLAGS += $(LIBMUSL_HEADER_FLAGS-y)
+CFLAGS += $(LIBMUSL_HDRS_FLAGS-y)
+CXXFLAGS += $(LIBMUSL_HDRS_FLAGS-y)
 
 
################################################################################
 # OS dependencies code - Glue between Unicore and musl
 
################################################################################
 LIBMUSLGLUE_SRCS-y += $(LIBMUSL_BASE)/mem.c
 
+################################################################################
+# Core Standard Library
+################################################################################
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/types.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/param.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/mount.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/sysmacros.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sys/file.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/alloca.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/stdbool.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/assert.h
+
+$(eval $(call 
_libmusl_import_lib,core,$(LIBMUSL_CORE_HDRS-y),$(LIBMUSL_CORE_SRCS-y)))
+
 
################################################################################
 # musl code -- one external Makefile per sub-lib
 
################################################################################
+ifeq ($(CONFIG_LIBMUSL_MQ),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.mq
+endif
+ifeq ($(CONFIG_LIBMUSL_DIRENT),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.dirent
+endif
+ifeq ($(CONFIG_LIBMUSL_MISC),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.misc
+endif
+ifeq ($(CONFIG_LIBMUSL_TEMP),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.temp
+endif
+ifeq ($(CONFIG_LIBMUSL_MULTIBYTE),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.multibyte
+endif
+ifeq ($(CONFIG_LIBMUSL_PROCESS),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.process
+endif
+ifeq ($(CONFIG_LIBMUSL_MMAN),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.mman
+endif
+ifeq ($(CONFIG_LIBMUSL_STDLIB),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.stdlib
+endif
+ifeq ($(CONFIG_LIBMUSL_FCNTL),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.fcntl
+endif
+ifeq ($(CONFIG_LIBMUSL_STDIO),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.stdio
+endif
+ifeq ($(CONFIG_LIBMUSL_CONF),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.conf
+endif
+ifeq ($(CONFIG_LIBMUSL_MATH),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.math
+endif
+ifeq ($(CONFIG_LIBMUSL_AIO),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.aio
+endif
+ifeq ($(CONFIG_LIBMUSL_STAT),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.stat
+endif
+ifeq ($(CONFIG_LIBMUSL_SEARCH),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.search
+endif
+ifeq ($(CONFIG_LIBMUSL_CRYPT),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.crypt
+endif
+ifeq ($(CONFIG_LIBMUSL_SELECT),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.select
+endif
+ifeq ($(CONFIG_LIBMUSL_MALLOC),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.malloc
+endif
+ifeq ($(CONFIG_LIBMUSL_UNISTD),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.unistd
+endif
+ifeq ($(CONFIG_LIBMUSL_SIGNAL),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.signal
+endif
+ifeq ($(CONFIG_LIBMUSL_THREAD),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.thread
+endif
+ifeq ($(CONFIG_LIBMUSL_LEGACY),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.legacy
+endif
+ifeq ($(CONFIG_LIBMUSL_ENV),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.env
+endif
+ifeq ($(CONFIG_LIBMUSL_TIME),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.time
+endif
+ifeq ($(CONFIG_LIBMUSL_ERRNO),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.errno
+endif
+ifeq ($(CONFIG_LIBMUSL_IPC),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.ipc
+endif
+ifeq ($(CONFIG_LIBMUSL_PRNG),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.prng
+endif
+ifeq ($(CONFIG_LIBMUSL_LDSO),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.ldso
+endif
+ifeq ($(CONFIG_LIBMUSL_PASSWD),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.passwd
+endif
+ifeq ($(CONFIG_LIBMUSL_FENV),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.fenv
+endif
+ifeq ($(CONFIG_LIBMUSL_CTYPE),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.ctype
+endif
+ifeq ($(CONFIG_LIBMUSL_LINUX),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.linux
+endif
+ifeq ($(CONFIG_LIBMUSL_INTERNAL),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.internal
+endif
+ifeq ($(CONFIG_LIBMUSL_NETWORK),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.network
+endif
+ifeq ($(CONFIG_LIBMUSL_SCHED),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.sched
+endif
+ifeq ($(CONFIG_LIBMUSL_STRING),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.string
+endif
+ifeq ($(CONFIG_LIBMUSL_REGEX),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.regex
+endif
+ifeq ($(CONFIG_LIBMUSL_TERMIOS),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.termios
+endif
+ifeq ($(CONFIG_LIBMUSL_EXIT),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.exit
+endif
+ifeq ($(CONFIG_LIBMUSL_SETJMP),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.setjmp
+endif
+ifeq ($(CONFIG_LIBMUSL_LOCALE),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.locale
+endif
+ifeq ($(CONFIG_LIBMUSL_COMPLEX),y)
 include $(LIBMUSL_BASE)/Makefile.uk.musl.complex
+endif
diff --git a/Makefile.uk.musl.aio b/Makefile.uk.musl.aio
index f59397a..ac4ab88 100644
--- a/Makefile.uk.musl.aio
+++ b/Makefile.uk.musl.aio
@@ -1,3 +1,19 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/aio/aio.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/aio/aio_suspend.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/aio/lio_listio.c
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/aio.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/semaphore.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_AIO_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_AIO_SRCS-y += $(LIBMUSL)/src/aio/aio.c
+LIBMUSL_AIO_SRCS-y += $(LIBMUSL)/src/aio/aio_suspend.c
+LIBMUSL_AIO_SRCS-y += $(LIBMUSL)/src/aio/lio_listio.c
+
+$(eval $(call 
_libmusl_import_lib,aio,$(LIBMUSL_AIO_HDRS-y),$(LIBMUSL_AIO_SRCS-y)))
diff --git a/Makefile.uk.musl.complex b/Makefile.uk.musl.complex
index 14ea162..84c8d26 100644
--- a/Makefile.uk.musl.complex
+++ b/Makefile.uk.musl.complex
@@ -1,71 +1,77 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casinh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csinhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/creal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/__cexpf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cabs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cexp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccoshf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccosh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csqrt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cexpf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cprojf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/conjf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catanhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/creall.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacosf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csinh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cimag.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casinf.c
+LIBMUSL_COMPLEX_HDRS-y += $(LIBMUSL)/include/complex.h
+LIBMUSL_COMPLEX_HDRS-y += $(LIBMUSL)/include/float.h
+LIBMUSL_COMPLEX_HDRS-y += $(LIBMUSL)/src/intenal/libm.h
+
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casinh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csinhl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/creal.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/__cexpf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casinl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cabs.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cexp.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctanl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccosl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccoshf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccosh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csqrt.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccos.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacos.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacosl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cexpf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cprojf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/conjf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catanhl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/creall.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catanf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csinl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacosf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csinh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cimag.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctan.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casinf.c
 # TO DO: missing __mulxc3
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cpowl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacoshf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctanhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casinhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casinhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catanl.c
+#LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cpowl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacoshf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctanhl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casinhl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casinhf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catanl.c
 # TO DO: missing __muldc3
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cpow.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catanh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/__cexp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/clogl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacosh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cargl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catanhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cimagl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cprojl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/conj.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cproj.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cargf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/catan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cacoshl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/clogf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csqrtf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/clog.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/casin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctanh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cexpl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cabsf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cimagf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ctanhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/carg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csinhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csinf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/crealf.c
+#LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cpow.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catanh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/__cexp.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/clogl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacosh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cargl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catanhf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cimagl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cprojl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/conj.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cproj.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cargf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/catan.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cacoshl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/clogf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csqrtf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/clog.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/casin.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctanh.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cexpl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csin.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cabsf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctanf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cimagf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ctanhf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/carg.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csinhf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csinf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/crealf.c
 # TO DO: missing __mulsc3
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cpowf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/cabsl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/conjl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccoshl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/csqrtl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/complex/ccosf.c
+#LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cpowf.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/cabsl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/conjl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccoshl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/csqrtl.c
+LIBMUSL_COMPLEX_SRCS-y += $(LIBMUSL)/src/complex/ccosf.c
+
+$(eval $(call 
_libmusl_import_lib,complex,$(LIBMUSL_COMPLEX_HDRS-y),$(LIBMUSL_COMPLEX_SRCS-y)))
diff --git a/Makefile.uk.musl.conf b/Makefile.uk.musl.conf
index 4e89e81..e4e49de 100644
--- a/Makefile.uk.musl.conf
+++ b/Makefile.uk.musl.conf
@@ -1,5 +1,17 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/conf/confstr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/conf/fpathconf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/conf/legacy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/conf/pathconf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/conf/sysconf.c
+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
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/sys/resource.h
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/sys/sysinfo.h
+LIBMUSL_CONF_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_CONF_SRCS-y += $(LIBMUSL)/src/conf/confstr.c
+LIBMUSL_CONF_SRCS-y += $(LIBMUSL)/src/conf/fpathconf.c
+LIBMUSL_CONF_SRCS-y += $(LIBMUSL)/src/conf/legacy.c
+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)))
diff --git a/Makefile.uk.musl.crypt b/Makefile.uk.musl.crypt
index 71ceda6..0d491ac 100644
--- a/Makefile.uk.musl.crypt
+++ b/Makefile.uk.musl.crypt
@@ -1,8 +1,19 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_blowfish.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_des.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_md5.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_sha256.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/crypt_sha512.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/crypt/encrypt.c
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/crypt.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_CRYPT_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_blowfish.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_des.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_md5.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_r.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_sha256.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/crypt_sha512.c
+LIBMUSL_CRYPT_SRCS-y += $(LIBMUSL)/src/crypt/encrypt.c
+
+$(eval $(call 
_libmusl_import_lib,crypt,$(LIBMUSL_CRYPT_HDRS-y),$(LIBMUSL_CRYPT_SRCS-y)))
diff --git a/Makefile.uk.musl.ctype b/Makefile.uk.musl.ctype
index c02dfed..0da9391 100644
--- a/Makefile.uk.musl.ctype
+++ b/Makefile.uk.musl.ctype
@@ -1,37 +1,53 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_b_loc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_get_mb_cur_max.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_tolower_loc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_toupper_loc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isalnum.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isalpha.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isascii.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isblank.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iscntrl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isdigit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isgraph.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/islower.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isprint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/ispunct.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isspace.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isupper.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswalnum.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswalpha.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswblank.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswcntrl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswctype.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswdigit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswgraph.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswlower.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswprint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswpunct.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswspace.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswupper.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/iswxdigit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/isxdigit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/toascii.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/tolower.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/toupper.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/towctrans.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/wcswidth.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/wctrans.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ctype/wcwidth.c
+# LIBMUSL_CTYPE_HDRS-y += alpha.h # not found
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/endian.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/src/ctype/nonspacing.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/src/ctype/punct.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/include/wctype.h
+LIBMUSL_CTYPE_HDRS-y += $(LIBMUSL)/src/ctype/wide.h
+
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_b_loc.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_get_mb_cur_max.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_tolower_loc.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/__ctype_toupper_loc.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isalnum.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isalpha.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isascii.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isblank.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iscntrl.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isdigit.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isgraph.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/islower.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isprint.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/ispunct.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isspace.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isupper.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswalnum.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswalpha.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswblank.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswcntrl.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswctype.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswdigit.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswgraph.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswlower.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswprint.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswpunct.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswspace.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswupper.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/iswxdigit.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/isxdigit.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/toascii.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/tolower.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/toupper.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/towctrans.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/wcswidth.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/wctrans.c
+LIBMUSL_CTYPE_SRCS-y += $(LIBMUSL)/src/ctype/wcwidth.c
+
+$(eval $(call 
_libmusl_import_lib,ctype,$(LIBMUSL_CTYPE_HDRS-y),$(LIBMUSL_CTYPE_SRCS-y)))
diff --git a/Makefile.uk.musl.dirent b/Makefile.uk.musl.dirent
index 3bb54a3..c64b2d7 100644
--- a/Makefile.uk.musl.dirent
+++ b/Makefile.uk.musl.dirent
@@ -1,13 +1,29 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/__getdents.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/alphasort.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/closedir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/dirfd.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/fdopendir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/opendir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/readdir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/readdir_r.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/rewinddir.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/scandir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/seekdir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/telldir.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/dirent/versionsort.c
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/dirent.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/string.h
+
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/src/dirent/__dirent.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_DIRENT_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+
+LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/__getdents.c
+LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/alphasort.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/closedir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/dirfd.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/fdopendir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/opendir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/readdir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/readdir_r.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/rewinddir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/scandir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/seekdir.c
+#LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/telldir.c
+LIBMUSL_DIRENT_SRCS-y += $(LIBMUSL)/src/dirent/versionsort.c
+
+$(eval $(call 
_libmusl_import_lib,dirent,$(LIBMUSL_DIRENT_HDRS-y),$(LIBMUSL_DIRENT_SRCS-y)))
diff --git a/Makefile.uk.musl.env b/Makefile.uk.musl.env
index b724725..cab319e 100644
--- a/Makefile.uk.musl.env
+++ b/Makefile.uk.musl.env
@@ -1,10 +1,28 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/__environ.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/__init_tls.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/__libc_start_main.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/__reset_tls.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/__stack_chk_fail.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/clearenv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/getenv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/putenv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/setenv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/env/unsetenv.c
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/elf.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/poll.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_ENV_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/__environ.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/__init_tls.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/__libc_start_main.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/__reset_tls.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/__stack_chk_fail.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/clearenv.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/getenv.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/putenv.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/setenv.c
+LIBMUSL_ENV_SRCS-y += $(LIBMUSL)/src/env/unsetenv.c
+
+$(eval $(call 
_libmusl_import_lib,env,$(LIBMUSL_ENV_HDRS-y),$(LIBMUSL_ENV_SRCS-y)))
diff --git a/Makefile.uk.musl.errno b/Makefile.uk.musl.errno
index d43226e..985f93a 100644
--- a/Makefile.uk.musl.errno
+++ b/Makefile.uk.musl.errno
@@ -1,2 +1,11 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/errno/__errno_location.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/errno/strerror.c
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/src/errno/__strerror.h
+LIBMUSL_ERRNO_HDRS-y += $(LIBMUSL)/include/string.h
+
+LIBMUSL_ERRNO_SRCS-y += $(LIBMUSL)/src/errno/__errno_location.c
+LIBMUSL_ERRNO_SRCS-y += $(LIBMUSL)/src/errno/strerror.c
+
+$(eval $(call 
_libmusl_import_lib,errno,$(LIBMUSL_ERRNO_HDRS-y),$(LIBMUSL_ERRNO_SRCS-y)))
diff --git a/Makefile.uk.musl.exit b/Makefile.uk.musl.exit
index eea591c..b9386be 100644
--- a/Makefile.uk.musl.exit
+++ b/Makefile.uk.musl.exit
@@ -1,8 +1,20 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/_Exit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/abort.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/arm/__aeabi_atexit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/assert.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/at_quick_exit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/atexit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/exit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/exit/quick_exit.c
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/include/getopt.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_EXIT_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/_Exit.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/abort.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/arm/__aeabi_atexit.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/assert.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/at_quick_exit.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/atexit.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/exit.c
+LIBMUSL_EXIT_SRCS-y += $(LIBMUSL)/src/exit/quick_exit.c
+
+$(eval $(call 
_libmusl_import_lib,exit,$(LIBMUSL_EXIT_HDRS-y),$(LIBMUSL_EXIT_SRCS-y)))
diff --git a/Makefile.uk.musl.fcntl b/Makefile.uk.musl.fcntl
index b2f8d2b..78a94c8 100644
--- a/Makefile.uk.musl.fcntl
+++ b/Makefile.uk.musl.fcntl
@@ -1,6 +1,14 @@
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/creat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/fcntl.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/open.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/openat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/posix_fadvise.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fcntl/posix_fallocate.c
+LIBMUSL_FCNTL_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_FCNTL_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_FCNTL_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_FCNTL_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_FCNTL_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+
+#LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/creat.c
+#LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/fcntl.c
+#LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/open.c
+#LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/openat.c
+#LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/posix_fadvise.c
+LIBMUSL_FCNTL_SRCS-y += $(LIBMUSL)/src/fcntl/posix_fallocate.c
+
+$(eval $(call 
_libmusl_import_lib,fcntl,$(LIBMUSL_FCNTL_HDRS-y),$(LIBMUSL_FCNTL_SRCS-y)))
diff --git a/Makefile.uk.musl.fenv b/Makefile.uk.musl.fenv
index 355beca..62e46b1 100644
--- a/Makefile.uk.musl.fenv
+++ b/Makefile.uk.musl.fenv
@@ -1,32 +1,37 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/__flt_rounds.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/fegetexceptflag.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/feholdexcept.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/fesetexceptflag.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/fesetround.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/feupdateenv.c
+LIBMUSL_FENV_HDRS-y += $(LIBMUSL)/include/fenv.h
+LIBMUSL_FENV_HDRS-y += $(LIBMUSL)/include/float.h
+
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/__flt_rounds.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/fegetexceptflag.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/feholdexcept.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/fesetexceptflag.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/fesetround.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/feupdateenv.c
 
 ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/arm/fenv-hf.S|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/arm/fenv.c|arm
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/arm/fenv-hf.S|arm
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/arm/fenv.c|arm
 else ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/i386/fenv.s|x86_32
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/i386/fenv.s|x86_32
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/x86_64/fenv.s|x86_64
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/x86_64/fenv.s|x86_64
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/fenv.c
+LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/fenv.c
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/aarch64/fenv.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mips/fenv-sf.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mips/fenv.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mips64/fenv-sf.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mips64/fenv.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mipsn32/fenv-sf.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/mipsn32/fenv.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/powerpc/fenv-sf.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/powerpc/fenv.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/powerpc64/fenv.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/s390x/fenv.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/sh/fenv-nofpu.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/sh/fenv.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/fenv/x32/fenv.s
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/aarch64/fenv.s
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mips/fenv-sf.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mips/fenv.S
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mips64/fenv-sf.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mips64/fenv.S
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mipsn32/fenv-sf.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/mipsn32/fenv.S
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/powerpc/fenv-sf.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/powerpc/fenv.S
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/powerpc64/fenv.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/s390x/fenv.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/sh/fenv-nofpu.c
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/sh/fenv.S
+#LIBMUSL_FENV_SRCS-y += $(LIBMUSL)/src/fenv/x32/fenv.s
+
+$(eval $(call 
_libmusl_import_lib,fenv,$(LIBMUSL_FENV_HDRS-y),$(LIBMUSL_FENV_SRCS-y)))
diff --git a/Makefile.uk.musl.internal b/Makefile.uk.musl.internal
index b65b15b..6f909ff 100644
--- a/Makefile.uk.musl.internal
+++ b/Makefile.uk.musl.internal
@@ -1,32 +1,48 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/floatscan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/intscan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/libc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/procfdname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/shgetc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/syscall.c|internal
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/syscall_ret.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/vdso.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/version.c
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/elf.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/float.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/src/internal/floatscan.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/link.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/math.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/src/internal/shgetc.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_INTERNAL_HDRS-y += $(LIBMUSL)/src/internal/version.h
+
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/floatscan.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/intscan.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/libc.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/procfdname.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/shgetc.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/syscall.c|internal
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/syscall_ret.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/vdso.c
+LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/version.c
 
 #ifeq (arm,$(CONFIG_UK_ARCH))
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/arm/syscall.s|arm
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/arm/syscall.s|arm
 #else ifeq (x86_32,$(CONFIG_UK_ARCH))
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/i386/syscall.s|i386
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/i386/syscall.s|i386
 #else ifeq (x86_64,$(CONFIG_UK_ARCH))
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/x86_64/syscall.s|x86_64
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/x86_64/syscall.s|x86_64
 #endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/aarch64/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/microblaze/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/mips/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/mips64/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/mipsn32/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/or1k/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/powerpc/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/powerpc64/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/s390x/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/sh/__shcall.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/sh/syscall.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/internal/x32/syscall.s|x32
-
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/aarch64/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/microblaze/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/mips/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/mips64/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/mipsn32/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/or1k/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/powerpc/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/powerpc64/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/s390x/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/sh/__shcall.c
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/sh/syscall.s
+#LIBMUSL_INTERNAL_SRCS-y += $(LIBMUSL)/src/internal/x32/syscall.s|x32
 
+$(eval $(call 
_libmusl_import_lib,internal,$(LIBMUSL_INTERNAL_HDRS-y),$(LIBMUSL_INTERNAL_SRCS-y)))
diff --git a/Makefile.uk.musl.ipc b/Makefile.uk.musl.ipc
index 02f4c25..a64d38e 100644
--- a/Makefile.uk.musl.ipc
+++ b/Makefile.uk.musl.ipc
@@ -1,13 +1,28 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/ftok.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/msgctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/msgget.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/msgrcv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/msgsnd.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/semctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/semget.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/semop.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/semtimedop.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/shmat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/shmctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/shmdt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ipc/shmget.c
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/src/ipc/ipc.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/sys/ipc.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/sys/msg.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/sys/sem.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/sys/shm.h
+LIBMUSL_IPC_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/ftok.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/msgctl.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/msgget.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/msgrcv.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/msgsnd.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/semctl.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/semget.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/semop.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/semtimedop.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/shmat.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/shmctl.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/shmdt.c
+LIBMUSL_IPC_SRCS-y += $(LIBMUSL)/src/ipc/shmget.c
+
+$(eval $(call 
_libmusl_import_lib,ipc,$(LIBMUSL_IPC_HDRS-y),$(LIBMUSL_IPC_SRCS-y)))
diff --git a/Makefile.uk.musl.ldso b/Makefile.uk.musl.ldso
index a689004..7e1b74b 100644
--- a/Makefile.uk.musl.ldso
+++ b/Makefile.uk.musl.ldso
@@ -1,35 +1,47 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/__dlsym.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dl_iterate_phdr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dladdr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dlclose.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dlerror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dlinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dlopen.c
+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
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/link.h
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_LDSO_HDRS-y += $(LIBMUSL)/include/stdlib.h
+
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/__dlsym.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dl_iterate_phdr.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dladdr.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlclose.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlerror.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlinfo.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlopen.c
 
 ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/arm/dlsym.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/arm/find_exidx.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/tlsdesc.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/arm/dlsym.s|arm
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/arm/find_exidx.c|arm
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/tlsdesc.c
 else ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/i386/dlsym.s|x86_32
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/i386/tlsdesc.s|x86_32
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/i386/dlsym.s|x86_32
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/i386/tlsdesc.s|x86_32
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/x86_64/dlsym.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/x86_64/tlsdesc.s|x86_64
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/x86_64/dlsym.s|x86_64
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/x86_64/tlsdesc.s|x86_64
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/tlsdesc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/dlsym.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/tlsdesc.c
+LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/dlsym.c
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/aarch64/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/aarch64/tlsdesc.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/microblaze/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/mips/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/mips64/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/mipsn32/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/or1k/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/powerpc/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/powerpc64/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/s390x/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/sh/dlsym.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/ldso/x32/dlsym.s
\ No newline at end of file
+#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
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/mips/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/mips64/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/mipsn32/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/or1k/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/powerpc/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/powerpc64/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/s390x/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/sh/dlsym.s
+#LIBMUSL_LDSO_SRCS-y += $(LIBMUSL)/src/ldso/x32/dlsym.s
+
+$(eval $(call 
_libmusl_import_lib,ldso,$(LIBMUSL_LDSO_HDRS-y),$(LIBMUSL_LDSO_SRCS-y)))
diff --git a/Makefile.uk.musl.legacy b/Makefile.uk.musl.legacy
index 9d73217..3671f28 100644
--- a/Makefile.uk.musl.legacy
+++ b/Makefile.uk.musl.legacy
@@ -1,16 +1,40 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/cuserid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/daemon.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/err.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/euidaccess.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/ftw.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/futimes.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/getdtablesize.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/getloadavg.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/getpagesize.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/getpass.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/getusershell.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/isastream.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/lutimes.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/ulimit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/utmpx.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/legacy/valloc.c
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/err.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/ftw.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/pwd.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/stropts.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/sys/resource.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/sys/sysinfo.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/termios.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/ulimit.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_LEGACY_HDRS-y += $(LIBMUSL)/include/utmpx.h
+
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/cuserid.c
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/daemon.c
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/err.c
+#LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/euidaccess.c
+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
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/getpagesize.c
+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
+#LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/lutimes.c
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/ulimit.c
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/utmpx.c
+LIBMUSL_LEGACY_SRCS-y += $(LIBMUSL)/src/legacy/valloc.c
+
+$(eval $(call 
_libmusl_import_lib,legacy,$(LIBMUSL_LEGACY_HDRS-y),$(LIBMUSL_LEGACY_SRCS-y)))
diff --git a/Makefile.uk.musl.linux b/Makefile.uk.musl.linux
index 510f642..50dd483 100644
--- a/Makefile.uk.musl.linux
+++ b/Makefile.uk.musl.linux
@@ -1,57 +1,97 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/adjtime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/adjtimex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/arch_prctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/brk.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/cache.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/cap.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/chroot.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/clock_adjtime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/clone.c|linux
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/epoll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/eventfd.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/fallocate.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/fanotify.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/flock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/inotify.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/ioperm.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/iopl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/klogctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/module.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/mount.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/personality.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/pivot_root.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/ppoll.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/prctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/prlimit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/process_vm.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/ptrace.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/quotactl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/readahead.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/reboot.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/remap_file_pages.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/sbrk.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/sendfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/setfsgid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/setfsuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/setgroups.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/sethostname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/setns.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/settimeofday.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/signalfd.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/splice.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/stime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/swap.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/sync_file_range.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/syncfs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/sysinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/tee.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/timerfd.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/unshare.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/utimes.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/vhangup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/vmsplice.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/wait3.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/wait4.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/xattr.c
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/poll.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sched.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/epoll.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/eventfd.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/fanotify.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/file.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/fsuid.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/inotify.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/io.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/klog.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/mount.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/personality.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/prctl.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/ptrace.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/quota.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/reboot.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/resource.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/sendfile.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/signalfd.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/swap.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/sysinfo.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/timerfd.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/timex.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/uio.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/wait.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/sys/xattr.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_LINUX_HDRS-y += $(LIBMUSL)/include/unistd.h
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/linux/x32/sysinfo.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/adjtime.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/adjtimex.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/arch_prctl.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/brk.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/cache.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/cap.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/chroot.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/clock_adjtime.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/clone.c|linux
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/epoll.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/eventfd.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/fallocate.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/fanotify.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/flock.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/inotify.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/ioperm.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/iopl.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/klogctl.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/module.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/mount.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/personality.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/pivot_root.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/ppoll.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/prctl.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/prlimit.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/process_vm.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/ptrace.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/quotactl.c
+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/setfsgid.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setfsuid.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/setgroups.c
+#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
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/signalfd.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/splice.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/stime.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/swap.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sync_file_range.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/syncfs.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/sysinfo.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/tee.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/timerfd.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/unshare.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/utimes.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/vhangup.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/vmsplice.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/wait3.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/wait4.c
+LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/xattr.c
+#LIBMUSL_LINUX_SRCS-y += $(LIBMUSL)/src/linux/x32/sysinfo.c
+
+$(eval $(call 
_libmusl_import_lib,linux,$(LIBMUSL_LINUX_HDRS-y),$(LIBMUSL_LINUX_SRCS-y)))
diff --git a/Makefile.uk.musl.locale b/Makefile.uk.musl.locale
index fd060d8..bffe0a2 100644
--- a/Makefile.uk.musl.locale
+++ b/Makefile.uk.musl.locale
@@ -1,25 +1,57 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/__lctrans.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/__mo_lookup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/bind_textdomain_codeset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/c_locale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/catclose.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/catgets.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/catopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/dcngettext.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/duplocale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/freelocale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/iconv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/iconv_close.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/langinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/locale_map.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/localeconv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/newlocale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/pleval.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/setlocale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/strcoll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/strfmon.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/strxfrm.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/textdomain.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/uselocale.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/wcscoll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/locale/wcsxfrm.c
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/big5.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/codepages.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/gb18030.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/hkscs.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/iconv.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/jis0208.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/ksc.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/langinfo.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/legacychars.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/libintl.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/locale.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/monetary.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/nl_types.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/src/locale/revjis.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/strings.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_LOCALE_HDRS-y += $(LIBMUSL)/include/wchar.h
+
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/__lctrans.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/__mo_lookup.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/bind_textdomain_codeset.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/c_locale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/catclose.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/catgets.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/catopen.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/dcngettext.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/duplocale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/freelocale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/iconv.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/iconv_close.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/langinfo.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/locale_map.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/localeconv.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/newlocale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/pleval.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/setlocale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/strcoll.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/strfmon.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/strxfrm.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/textdomain.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/uselocale.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/wcscoll.c
+LIBMUSL_LOCALE_SRCS-y += $(LIBMUSL)/src/locale/wcsxfrm.c
+
+$(eval $(call 
_libmusl_import_lib,locale,$(LIBMUSL_LOCALE_HDRS-y),$(LIBMUSL_LOCALE_SRCS-y)))
diff --git a/Makefile.uk.musl.malloc b/Makefile.uk.musl.malloc
index 1d2c4d5..e9c2113 100644
--- a/Makefile.uk.musl.malloc
+++ b/Makefile.uk.musl.malloc
@@ -1,9 +1,23 @@
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/__brk.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/aligned_alloc.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/calloc.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/expand_heap.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/lite_malloc.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/malloc.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/malloc_usable_size.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/memalign.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/malloc/posix_memalign.c
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/malloc.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_MALLOC_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/__brk.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/aligned_alloc.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/calloc.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/expand_heap.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/lite_malloc.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/malloc.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/malloc_usable_size.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/memalign.c
+#LIBMUSL_MALLOC_SRCS-y += $(LIBMUSL)/src/malloc/posix_memalign.c
+
+$(eval $(call 
_libmusl_import_lib,malloc,$(LIBMUSL_MALLOC_HDRS-y),$(LIBMUSL_MALLOC_SRCS-y)))
diff --git a/Makefile.uk.musl.math b/Makefile.uk.musl.math
index 682de34..37a4bb2 100644
--- a/Makefile.uk.musl.math
+++ b/Makefile.uk.musl.math
@@ -1,462 +1,478 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__cos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__cosdf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__cosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__expo2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__expo2f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__fpclassify.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__fpclassifyf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__fpclassifyl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__invtrigl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__polevll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2_large.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__signbit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__signbitf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__signbitl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__sin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__sindf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__sinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__tan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__tandf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/__tanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acosf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acosh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acoshf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acoshl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atan2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atan2f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cbrt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cbrtf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cbrtl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ceil.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ceilf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/copysign.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/copysignf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/copysignl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cosf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cosh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/coshf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/coshl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/cosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/erf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/erff.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/erfl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp10.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp10f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp10l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp2f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expm1.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expm1f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fdim.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fdimf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fdiml.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/finite.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/finitef.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/floor.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/floorf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fma.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmaf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmax.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmaxf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmaxl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fminf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fminl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmod.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmodf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/frexp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/frexpf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/frexpl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/hypot.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/hypotf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/hypotl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalbf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalbln.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalblnf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalblnl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalbn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalbnf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/scalbnl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/signgam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/significand.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/significandf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sincos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sincosf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sincosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sinf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sinh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sinhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sinhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tanh.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tanhf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tanhl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tgamma.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tgammaf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/tgammal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/trunc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/truncf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ilogb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ilogbf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ilogbl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/j0.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/j0f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/j1.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/j1f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/jn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/jnf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ldexp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ldexpf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ldexpl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lgamma.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lgamma_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lgammaf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lgammaf_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lgammal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llround.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llroundf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llroundl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log10.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log10f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log1p.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log1pf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log2f.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logbf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logbl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lround.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lroundf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lroundl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/modf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/modff.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/modfl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nan.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nearbyint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nearbyintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nearbyintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nextafter.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nextafterf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nextafterl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nexttoward.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nexttowardf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/nexttowardl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/pow.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remainder.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remainderf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remquo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remquof.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remquol.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/rint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/rintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/round.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/roundf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/roundl.c
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/fenv.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/float.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/src/math/__invtrigl.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/src/internal/libm.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/math.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/complex.h
+LIBMUSL_MATH_HDRS-y += $(LIBMUSL)/include/endian.h
+
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__cos.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__cosdf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__cosl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__expo2.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__expo2f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__fpclassify.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__fpclassifyf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__fpclassifyl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__invtrigl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__polevll.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2_large.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__rem_pio2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__signbit.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__signbitf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__signbitl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__sin.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__sindf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__sinl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__tan.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__tandf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/__tanl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acos.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acosf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acosh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acoshf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acoshl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asin.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinhf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinhl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atan.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atan2.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atan2f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanhf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanhl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cbrt.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cbrtf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cbrtl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ceil.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ceilf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/copysign.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/copysignf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/copysignl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cos.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cosf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cosh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/coshf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/coshl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/cosl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/erf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/erff.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/erfl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp10.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp10f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp10l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp2.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp2f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expm1.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expm1f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fdim.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fdimf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fdiml.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/finite.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/finitef.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/floor.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/floorf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fma.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmaf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmal.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmax.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmaxf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmaxl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmin.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fminf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fminl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmod.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmodf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/frexp.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/frexpf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/frexpl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/hypot.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/hypotf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/hypotl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalb.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalbf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalbln.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalblnf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalblnl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalbn.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalbnf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/scalbnl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/signgam.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/significand.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/significandf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sin.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sincos.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sincosf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sincosl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sinf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sinh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sinhf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sinhl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sinl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tan.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tanf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tanh.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tanhf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tanhl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tanl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tgamma.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tgammaf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/tgammal.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/trunc.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/truncf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ilogb.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ilogbf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ilogbl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/j0.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/j0f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/j1.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/j1f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/jn.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/jnf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ldexp.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ldexpf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ldexpl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lgamma.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lgamma_r.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lgammaf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lgammaf_r.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lgammal.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llround.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llroundf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llroundl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log10.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log10f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log1p.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log1pf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log2.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log2f.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logb.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logbf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logbl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lround.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lroundf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lroundl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/modf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/modff.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/modfl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nan.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nanf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nanl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nearbyint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nearbyintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nearbyintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nextafter.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nextafterf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nextafterl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nexttoward.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nexttowardf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/nexttowardl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/pow.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remainder.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remainderf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remquo.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remquof.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remquol.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/rint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/rintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/round.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/roundf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/roundl.c
 
 ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/__invtrigl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/acos.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/acosf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/acosl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/asin.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/asinf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/asinl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atan.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atan2.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atan2f.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atan2l.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atanf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/atanl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ceil.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ceilf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ceill.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/exp.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/exp2.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/exp2f.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/exp2l.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/expf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/expl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/expm1.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/expm1f.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/expm1l.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fabs.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fabsf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fabsl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/floor.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/floorf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/floorl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fmod.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fmodf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/fmodl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/hypot.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/hypotf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ldexp.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ldexpf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/ldexpl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/llrint.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/llrintf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/llrintl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log10.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log10f.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log10l.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log1p.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log1pf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log1pl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log2.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log2f.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/log2l.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/logf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/logl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/lrint.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/lrintf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/lrintl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remainder.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remainderf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remainderl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remquo.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remquof.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/remquol.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/rint.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/rintf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/rintl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalbln.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalblnf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalblnl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalbn.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalbnf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/scalbnl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/sqrt.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/sqrtf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/sqrtl.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/trunc.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/truncf.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/i386/truncl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/__invtrigl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/acos.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/acosf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/acosl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/asin.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/asinf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/asinl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atan.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atan2.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atan2f.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atan2l.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atanf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/atanl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ceil.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ceilf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ceill.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/exp.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/exp2.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/exp2f.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/exp2l.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/expf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/expl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/expm1.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/expm1f.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/expm1l.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fabs.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fabsf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fabsl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/floor.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/floorf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/floorl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fmod.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fmodf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/fmodl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/hypot.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/hypotf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ldexp.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ldexpf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/ldexpl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/llrint.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/llrintf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/llrintl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log10.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log10f.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log10l.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log1p.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log1pf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log1pl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log2.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log2f.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/log2l.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/logf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/logl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/lrint.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/lrintf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/lrintl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remainder.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remainderf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remainderl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remquo.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remquof.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/remquol.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/rint.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/rintf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/rintl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalbln.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalblnf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalblnl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalbn.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalbnf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/scalbnl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/sqrt.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/sqrtf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/sqrtl.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/trunc.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/truncf.s|i386
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/i386/truncl.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/__invtrigl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/acosl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/asinl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/atan2l.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/atanl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/ceill.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/exp2l.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/expl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/expm1l.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabs.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabsf.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabsl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/floorl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/fmodl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrint.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrintf.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrintl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/log10l.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/log1pl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/log2l.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/logl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrint.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrintf.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrintl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/remainderl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/rintl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrt.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrtf.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrtl.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x86_64/truncl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/__invtrigl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/acosl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/asinl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/atan2l.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/atanl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/ceill.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/exp2l.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/expl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/expm1l.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabs.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabsf.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/fabsl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/floorl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/fmodl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrint.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrintf.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/llrintl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/log10l.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/log1pl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/log2l.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/logl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrint.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrintf.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/lrintl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/remainderl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/rintl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrt.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrtf.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/sqrtl.s|x86_64
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x86_64/truncl.s|x86_64
 else ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atan2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expm1l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fabsl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/floorl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ceill.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/truncl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmodl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log10l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log1pl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remainderl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/rintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sqrtl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/arm/fabs.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/arm/fabsf.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/arm/sqrt.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/arm/sqrtf.c|arm
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acosl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atan2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expm1l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fabsl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/floorl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ceill.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/truncl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmodl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log10l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log1pl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remainderl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/rintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sqrtl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/arm/fabs.c|arm
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/arm/fabsf.c|arm
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/arm/sqrt.c|arm
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/arm/sqrtf.c|arm
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/acosl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/asinl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atan2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/atanl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expm1l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/exp2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/expl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fabsl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/floorl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/ceill.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/truncl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fmodl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/llrintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log10l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log1pl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/log2l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/logl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrint.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/lrintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/remainderl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/rintl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sqrtl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fabs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/fabsf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sqrt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/sqrtf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/acosl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/asinl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atan2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/atanl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expm1l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/exp2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/expl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fabsl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/floorl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/ceill.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/truncl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fmodl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrintf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/llrintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log10l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log1pl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/log2l.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/logl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrint.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/lrintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/remainderl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/rintl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sqrtl.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fabs.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/fabsf.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sqrt.c
+LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/sqrtf.c
 endif
 
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/ceil.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/ceilf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fabs.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fabsf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/floor.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/floorf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fma.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmaf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmax.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmaxf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmin.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/fminf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/llrint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/llrintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/llround.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/llroundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/lrint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/lrintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/lround.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/lroundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/nearbyint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/nearbyintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/rint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/rintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/round.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/roundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/sqrt.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/sqrtf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/trunc.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/aarch64/truncf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/ceil.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/ceilf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fabs.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fabsf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/floor.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/floorf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fma.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmaf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmax.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmaxf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmin.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fminf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lrint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lrintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lround.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lroundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/round.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/roundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/sqrt.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/sqrtf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/trunc.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/powerpc64/truncf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/ceil.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/ceilf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/ceill.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/fabs.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/fabsf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/fabsl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/floor.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/floorf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/floorl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyintl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/rint.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/rintf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/rintl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/round.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/roundf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/roundl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrt.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrtf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrtl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/trunc.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/truncf.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/s390x/truncl.c
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/__invtrigl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/acosl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/asinl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/atan2l.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/atanl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/ceill.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/exp2l.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/expl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/expm1l.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/fabs.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/fabsf.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/fabsl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/floorl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/fmodl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/llrint.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/llrintf.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/llrintl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/log10l.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/log1pl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/log2l.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/logl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/lrint.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/lrintf.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/lrintl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/remainderl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/rintl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/sqrt.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/sqrtf.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/sqrtl.s|x32
-# LIBMUSL_SRCS-y += $(LIBMUSL)/src/math/x32/truncl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/ceil.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/ceilf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fabs.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fabsf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/floor.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/floorf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fma.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmaf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmax.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmaxf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fmin.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/fminf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/llrint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/llrintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/llround.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/llroundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/lrint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/lrintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/lround.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/lroundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/nearbyint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/nearbyintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/rint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/rintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/round.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/roundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/sqrt.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/sqrtf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/trunc.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/aarch64/truncf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/ceil.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/ceilf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fabs.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fabsf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/floor.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/floorf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fma.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmaf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmax.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmaxf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fmin.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/fminf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lrint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lrintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lround.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/lroundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/round.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/roundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/sqrt.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/sqrtf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/trunc.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/powerpc64/truncf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/ceil.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/ceilf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/ceill.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/fabs.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/fabsf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/fabsl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/floor.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/floorf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/floorl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/nearbyintl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/rint.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/rintf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/rintl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/round.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/roundf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/roundl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrt.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrtf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/sqrtl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/trunc.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/truncf.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/s390x/truncl.c
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/__invtrigl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/acosl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/asinl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/atan2l.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/atanl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/ceill.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/exp2l.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/expl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/expm1l.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/fabs.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/fabsf.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/fabsl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/floorl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/fmodl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/llrint.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/llrintf.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/llrintl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/log10l.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/log1pl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/log2l.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/logl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/lrint.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/lrintf.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/lrintl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/remainderl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/rintl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/sqrt.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/sqrtf.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/sqrtl.s|x32
+# LIBMUSL_MATH_SRCS-y += $(LIBMUSL)/src/math/x32/truncl.s|x32
+
+# CINCLUDES-y += -D_GNU_SOURCE
+
+$(eval $(call 
_libmusl_import_lib,math,$(LIBMUSL_MATH_HDRS-y),$(LIBMUSL_MATH_SRCS-y)))
diff --git a/Makefile.uk.musl.misc b/Makefile.uk.musl.misc
index da54093..d62c1ab 100644
--- a/Makefile.uk.musl.misc
+++ b/Makefile.uk.musl.misc
@@ -1,38 +1,79 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/a64l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/basename.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/dirname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/ffs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/ffsl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/ffsll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/fmtmsg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/forkpty.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/get_current_dir_name.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getauxval.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getdomainname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/gethostid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getopt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getopt_long.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getpriority.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getresgid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getresuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getrlimit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getrusage.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/getsubopt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/initgroups.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/ioctl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/issetugid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/lockf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/login_tty.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/mntent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/nftw.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/openpty.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/ptsname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/pty.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/realpath.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/setdomainname.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/setpriority.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/setrlimit.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/syscall.c|misc
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/syslog.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/uname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/misc/wordexp.c
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/dirent.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/fmtmsg.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/ftw.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/getopt.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/grp.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/libgen.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/mntent.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/pty.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/strings.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/auxv.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/ioctl.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/syslog.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/resource.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/socket.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/utsname.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/sys/wait.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/utmp.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_MISC_HDRS-y += $(LIBMUSL)/include/wordexp.h
+
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/a64l.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/basename.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/dirname.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/ffs.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/ffsl.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/ffsll.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/fmtmsg.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/forkpty.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/get_current_dir_name.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getauxval.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/getdomainname.c
+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
+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
+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
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/nftw.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/openpty.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/ptsname.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/pty.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/realpath.c
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/setdomainname.c
+#LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/setpriority.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
+LIBMUSL_MISC_SRCS-y += $(LIBMUSL)/src/misc/uname.c
+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.mman b/Makefile.uk.musl.mman
index c989771..c64bc9d 100644
--- a/Makefile.uk.musl.mman
+++ b/Makefile.uk.musl.mman
@@ -1,13 +1,36 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/madvise.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mincore.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mlockall.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mmap.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mprotect.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/mremap.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/msync.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/munlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/munlockall.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/munmap.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/posix_madvise.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mman/shm_open.c
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/sys/syscall.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+LIBMUSL_MMAN_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+# ifeq (arm,$(ARCH))
+# LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/arm/syscall_arch.h
+# else ifeq (x86_32,$(ARCH))
+# LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/i386/syscall_arch.h
+# else ifeq (x86_64,$(ARCH))
+# LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/x86_64/syscall_arch.h
+# endif
+
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/madvise.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mincore.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mlock.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mlockall.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mmap.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mprotect.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/mremap.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/msync.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/munlock.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/munlockall.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/munmap.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/posix_madvise.c
+LIBMUSL_MMAN_SRCS-y += $(LIBMUSL)/src/mman/shm_open.c
+
+$(eval $(call 
_libmusl_import_lib,mman,$(LIBMUSL_MMAN_HDRS-y),$(LIBMUSL_MMAN_SRCS-y)))
diff --git a/Makefile.uk.musl.mq b/Makefile.uk.musl.mq
index 24da79c..48ec5f8 100644
--- a/Makefile.uk.musl.mq
+++ b/Makefile.uk.musl.mq
@@ -1,10 +1,22 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_close.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_getattr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_notify.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_open.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_receive.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_send.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_setattr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_timedreceive.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_timedsend.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/mq/mq_unlink.c
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/mqueue.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/sys/socket.h
+LIBMUSL_MQ_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_close.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_getattr.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_notify.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_open.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_receive.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_send.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_setattr.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_timedreceive.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_timedsend.c
+LIBMUSL_MQ_SRCS-y += $(LIBMUSL)/src/mq/mq_unlink.c
+
+$(eval $(call 
_libmusl_import_lib,mq,$(LIBMUSL_MQ_HDRS-y),$(LIBMUSL_MQ_SRCS-y)))
diff --git a/Makefile.uk.musl.multibyte b/Makefile.uk.musl.multibyte
index fed5400..b4418eb 100644
--- a/Makefile.uk.musl.multibyte
+++ b/Makefile.uk.musl.multibyte
@@ -1,20 +1,31 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/btowc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/c16rtomb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/c32rtomb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/internal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mblen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbrlen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtoc16.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtoc32.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtowc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbsinit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbsnrtowcs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbsrtowcs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbstowcs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/mbtowc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wcrtomb.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wcsnrtombs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wcsrtombs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wcstombs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wctob.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/multibyte/wctomb.c
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/src/multibyte/internal.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/uchar.h
+LIBMUSL_MULTIBYTE_HDRS-y += $(LIBMUSL)/include/wchar.h
+
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/btowc.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/c16rtomb.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/c32rtomb.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/internal.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mblen.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbrlen.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtoc16.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtoc32.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbrtowc.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbsinit.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbsnrtowcs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbsrtowcs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbstowcs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/mbtowc.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wcrtomb.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wcsnrtombs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wcsrtombs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wcstombs.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wctob.c
+LIBMUSL_MULTIBYTE_SRCS-y += $(LIBMUSL)/src/multibyte/wctomb.c
+
+$(eval $(call 
_libmusl_import_lib,multibyte,$(LIBMUSL_MULTIBYTE_HDRS-y),$(LIBMUSL_MULTIBYTE_SRCS-y)))
diff --git a/Makefile.uk.musl.network b/Makefile.uk.musl.network
index b0879a3..b934863 100644
--- a/Makefile.uk.musl.network
+++ b/Makefile.uk.musl.network
@@ -1,77 +1,120 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/accept.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/accept4.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/bind.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/connect.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/dn_comp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/dn_expand.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/dn_skipname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/dns_parse.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/ent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/ether.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/freeaddrinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gai_strerror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getaddrinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyaddr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyaddr_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyname2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyname2_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/gethostbyname_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getifaddrs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getnameinfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getpeername.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getservbyname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getservbyname_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getservbyport.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getservbyport_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getsockname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/getsockopt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/h_errno.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/herror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/hstrerror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/htonl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/htons.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/if_freenameindex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/if_indextoname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/if_nameindex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/if_nametoindex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/in6addr_any.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/in6addr_loopback.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_addr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_aton.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_legacy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_ntoa.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_ntop.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/inet_pton.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/listen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/lookup_ipliteral.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/lookup_name.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/lookup_serv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/netlink.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/netname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/ns_parse.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/ntohl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/ntohs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/proto.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/recv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/recvfrom.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/recvmmsg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/recvmsg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_mkquery.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_msend.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_query.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_querydomain.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_send.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/res_state.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/resolvconf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/send.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/sendmmsg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/sendmsg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/sendto.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/serv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/setsockopt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/shutdown.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/sockatmark.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/socket.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/network/socketpair.c
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/arpa/inet.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/arpa/nameser.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/byteswap.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/ifaddrs.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/inttypes.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/network/lookup.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/netdb.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/net/ethernet.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/net/if.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/net/if_arp.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/netinet/ether.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/netinet/if_ether.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/netinet/in.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/netinet/tcp.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/network/netlink.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/poll.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/resolv.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/internal/stdio_impl.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/sys/ioctl.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/sys/un.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+ifneq ($(CONFIG_LIBPOSIX_SOCKET),y)
+LIBMUSL_NETWORK_HDRS-y += $(LIBMUSL)/include/sys/socket.h
+
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/socket.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/accept.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/accept4.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/bind.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/shutdown.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getpeername.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getsockname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getsockopt.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/setsockopt.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/connect.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/listen.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/recv.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/recvfrom.c
+# LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/recvmmsg.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/recvmsg.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/send.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/sendmsg.c
+# LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/sendmmsg.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/sendto.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/socketpair.c
+endif
+
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/dn_comp.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/dn_expand.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/dn_skipname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/dns_parse.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/ent.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/ether.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/freeaddrinfo.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gai_strerror.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getaddrinfo.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyaddr.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyaddr_r.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyname2.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyname2_r.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/gethostbyname_r.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getifaddrs.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getnameinfo.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getservbyname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getservbyname_r.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getservbyport.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/getservbyport_r.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/h_errno.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/herror.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/hstrerror.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/htonl.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/htons.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/if_freenameindex.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/if_indextoname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/if_nameindex.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/if_nametoindex.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/in6addr_any.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/in6addr_loopback.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_addr.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_aton.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_legacy.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_ntoa.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_ntop.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/inet_pton.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/lookup_ipliteral.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/lookup_name.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/lookup_serv.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/netlink.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/netname.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/ns_parse.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/ntohl.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/ntohs.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/proto.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_init.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_mkquery.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_msend.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_query.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_querydomain.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_send.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/res_state.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/resolvconf.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/serv.c
+LIBMUSL_NETWORK_SRCS-y += $(LIBMUSL)/src/network/sockatmark.c
+
+$(eval $(call 
_libmusl_import_lib,network,$(LIBMUSL_NETWORK_HDRS-y),$(LIBMUSL_NETWORK_SRCS-y)))
diff --git a/Makefile.uk.musl.passwd b/Makefile.uk.musl.passwd
index a08cd6f..dbad5fd 100644
--- a/Makefile.uk.musl.passwd
+++ b/Makefile.uk.musl.passwd
@@ -1,20 +1,40 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/fgetgrent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/fgetpwent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/fgetspent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getgr_a.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getgr_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getgrent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getgrent_a.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getgrouplist.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getpw_a.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getpw_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getpwent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getpwent_a.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getspent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getspnam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/getspnam_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/lckpwdf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/nscd_query.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/putgrent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/putpwent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/passwd/putspent.c
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/byteswap.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/grp.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/src/passwd/nscd.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/pwd.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/src/passwd/pwf.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/shadow.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_PASSWD_HDRS-y += $(LIBMUSL)/include/string.h
+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
+
+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/getspent.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getspnam.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/getspnam_r.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/lckpwdf.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/nscd_query.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/putgrent.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/putpwent.c
+LIBMUSL_PASSWD_SRCS-y += $(LIBMUSL)/src/passwd/putspent.c
+
+$(eval $(call 
_libmusl_import_lib,passwd,$(LIBMUSL_PASSWD_HDRS-y),$(LIBMUSL_PASSWD_SRCS-y)))
diff --git a/Makefile.uk.musl.prng b/Makefile.uk.musl.prng
index b4b786c..cfcccc2 100644
--- a/Makefile.uk.musl.prng
+++ b/Makefile.uk.musl.prng
@@ -1,11 +1,19 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/__rand48_step.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/__seed48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/drand48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/lcong48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/lrand48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/mrand48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/rand.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/rand_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/random.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/seed48.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/prng/srand48.c
+LIBMUSL_PRNG_HDRS-y += $(LIBMUSL)/include/inttypes.h
+LIBMUSL_PRNG_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_PRNG_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_PRNG_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_PRNG_HDRS-y += $(LIBMUSL)/include/string.h
+
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/__rand48_step.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/__seed48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/drand48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/lcong48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/lrand48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/mrand48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/rand.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/rand_r.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/random.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/seed48.c
+LIBMUSL_PRNG_SRCS-y += $(LIBMUSL)/src/prng/srand48.c
+
+$(eval $(call 
_libmusl_import_lib,prng,$(LIBMUSL_PRNG_HDRS-y),$(LIBMUSL_PRNG_SRCS-y)))
diff --git a/Makefile.uk.musl.process b/Makefile.uk.musl.process
index 1bc77e7..71b4042 100644
--- a/Makefile.uk.musl.process
+++ b/Makefile.uk.musl.process
@@ -1,42 +1,60 @@
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execl.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execle.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execlp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execv.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execve.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/execvp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/fexecve.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/fork.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn_file_actions_addclose.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn_file_actions_adddup2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn_file_actions_addopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn_file_actions_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawn_file_actions_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getflags.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getpgroup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getsigdefault.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getsigmask.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_sched.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setflags.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setpgroup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setsigdefault.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setsigmask.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/posix_spawnp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/system.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/waitid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/waitpid.c
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/src/process/fdop.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/sched.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/spawn.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/sys/wait.h
+LIBMUSL_PROCESS_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execl.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execle.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execlp.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execv.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execve.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/execvp.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/fexecve.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/fork.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawn.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawn_file_actions_addclose.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawn_file_actions_adddup2.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawn_file_actions_addopen.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawn_file_actions_destroy.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawn_file_actions_init.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_destroy.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getflags.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getpgroup.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawnattr_getsigdefault.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_getsigmask.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_init.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_sched.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setflags.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setpgroup.c
+LIBMUSL_PROCESS_SRCS-y += 
$(LIBMUSL)/src/process/posix_spawnattr_setsigdefault.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnattr_setsigmask.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/posix_spawnp.c
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/system.c
+#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_SRCS-y += $(LIBMUSL)/src/process/i386/vfork.s|i386
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/i386/vfork.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/x86_64/vfork.s|x86_64
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/x86_64/vfork.s|x86_64
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/vfork.c
+LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/vfork.c
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/s390x/vfork.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/sh/vfork.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/process/x32/vfork.s
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/s390x/vfork.s
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/sh/vfork.s
+#LIBMUSL_PROCESS_SRCS-y += $(LIBMUSL)/src/process/x32/vfork.s
+
+$(eval $(call 
_libmusl_import_lib,process,$(LIBMUSL_PROCESS_HDRS-y),$(LIBMUSL_PROCESS_SRCS-y)))
diff --git a/Makefile.uk.musl.regex b/Makefile.uk.musl.regex
index e564903..edd7df1 100644
--- a/Makefile.uk.musl.regex
+++ b/Makefile.uk.musl.regex
@@ -1,6 +1,28 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/fnmatch.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/glob.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/regcomp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/regerror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/regexec.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/regex/tre-mem.c
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/assert.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/dirent.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/fnmatch.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/glob.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/regex.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/src/regex/tre.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_REGEX_HDRS-y += $(LIBMUSL)/include/wctype.h
+
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/fnmatch.c
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/glob.c
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/regcomp.c
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/regerror.c
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/regexec.c
+LIBMUSL_REGEX_SRCS-y += $(LIBMUSL)/src/regex/tre-mem.c
+
+$(eval $(call 
_libmusl_import_lib,regex,$(LIBMUSL_REGEX_HDRS-y),$(LIBMUSL_REGEX_SRCS-y)))
diff --git a/Makefile.uk.musl.sched b/Makefile.uk.musl.sched
index efa511e..4fe268d 100644
--- a/Makefile.uk.musl.sched
+++ b/Makefile.uk.musl.sched
@@ -1,10 +1,19 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/affinity.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_cpucount.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_get_priority_max.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_getcpu.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_getparam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_getscheduler.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_rr_get_interval.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_setparam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_setscheduler.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/sched/sched_yield.c
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/include/sched.h
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_SCHED_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/affinity.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_cpucount.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_get_priority_max.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_getcpu.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_getparam.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_getscheduler.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_rr_get_interval.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_setparam.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_setscheduler.c
+LIBMUSL_SCHED_SRCS-y += $(LIBMUSL)/src/sched/sched_yield.c
+
+$(eval $(call 
_libmusl_import_lib,sched,$(LIBMUSL_SCHED_HDRS-y),$(LIBMUSL_SCHED_SRCS-y)))
diff --git a/Makefile.uk.musl.search b/Makefile.uk.musl.search
index 9b34f3b..d611b93 100644
--- a/Makefile.uk.musl.search
+++ b/Makefile.uk.musl.search
@@ -1,5 +1,12 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/search/hsearch.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/search/insque.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/search/lsearch.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/search/tdestroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/search/tsearch_avl.c
+LIBMUSL_SEARCH_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_SEARCH_HDRS-y += $(LIBMUSL)/include/search.h
+LIBMUSL_SEARCH_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_SEARCH_HDRS-y += $(LIBMUSL)/include/string.h
+
+LIBMUSL_SEARCH_SRCS-y += $(LIBMUSL)/src/search/hsearch.c
+LIBMUSL_SEARCH_SRCS-y += $(LIBMUSL)/src/search/insque.c
+LIBMUSL_SEARCH_SRCS-y += $(LIBMUSL)/src/search/lsearch.c
+LIBMUSL_SEARCH_SRCS-y += $(LIBMUSL)/src/search/tdestroy.c
+LIBMUSL_SEARCH_SRCS-y += $(LIBMUSL)/src/search/tsearch_avl.c
+
+$(eval $(call 
_libmusl_import_lib,search,$(LIBMUSL_SEARCH_HDRS-y),$(LIBMUSL_SEARCH_SRCS-y)))
diff --git a/Makefile.uk.musl.select b/Makefile.uk.musl.select
index 21c1a9a..3ac5a3f 100644
--- a/Makefile.uk.musl.select
+++ b/Makefile.uk.musl.select
@@ -1,3 +1,14 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/select/poll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/select/pselect.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/select/select.c
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/poll.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/sys/select.h
+LIBMUSL_SELECT_HDRS-y += $(LIBMUSL)/include/time.h
+
+LIBMUSL_SELECT_SRCS-y += $(LIBMUSL)/src/select/poll.c
+LIBMUSL_SELECT_SRCS-y += $(LIBMUSL)/src/select/pselect.c
+LIBMUSL_SELECT_SRCS-y += $(LIBMUSL)/src/select/select.c
+
+$(eval $(call 
_libmusl_import_lib,select,$(LIBMUSL_SELECT_HDRS-y),$(LIBMUSL_SELECT_SRCS-y)))
diff --git a/Makefile.uk.musl.setjmp b/Makefile.uk.musl.setjmp
index c4bf289..9a9b267 100644
--- a/Makefile.uk.musl.setjmp
+++ b/Makefile.uk.musl.setjmp
@@ -1,36 +1,38 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/setjmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/longjmp.c
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/setjmp.c
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/longjmp.c
 
 ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/arm/longjmp.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/arm/setjmp.s|arm
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/arm/longjmp.s|arm
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/arm/setjmp.s|arm
 else ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/i386/longjmp.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/i386/setjmp.s|i386
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/i386/longjmp.s|i386
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/i386/setjmp.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/x86_64/longjmp.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/x86_64/setjmp.s|x86_64
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/x86_64/longjmp.s|x86_64
+LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/x86_64/setjmp.s|x86_64
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/aarch64/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/aarch64/setjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/microblaze/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/microblaze/setjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mips/longjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mips/setjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mips64/longjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mips64/setjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mipsn32/longjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/mipsn32/setjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/or1k/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/or1k/setjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc/longjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc/setjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc64/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc64/setjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/s390x/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/s390x/setjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/sh/longjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/sh/setjmp.S
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/x32/longjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/setjmp/x32/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/aarch64/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/aarch64/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/microblaze/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/microblaze/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mips/longjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mips/setjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mips64/longjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mips64/setjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mipsn32/longjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/mipsn32/setjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/or1k/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/or1k/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc/longjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc/setjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc64/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/powerpc64/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/s390x/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/s390x/setjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/sh/longjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/sh/setjmp.S
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/x32/longjmp.s
+#LIBMUSL_SETJMP_SRCS-y += $(LIBMUSL)/src/setjmp/x32/setjmp.s
+
+$(eval $(call 
_libmusl_import_lib,setjmp,$(LIBMUSL_SETJMP_HDRS-y),$(LIBMUSL_SETJMP_SRCS-y)))
diff --git a/Makefile.uk.musl.signal b/Makefile.uk.musl.signal
index 24969ef..a7af11f 100644
--- a/Makefile.uk.musl.signal
+++ b/Makefile.uk.musl.signal
@@ -1,72 +1,97 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/block.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/getitimer.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/kill.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/killpg.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/psiginfo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/psignal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/raise.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/setitimer.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigaction.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigaddset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigaltstack.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigandset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigdelset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigemptyset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigfillset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sighold.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigignore.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/siginterrupt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigisemptyset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigismember.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/siglongjmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/signal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigorset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigpause.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigpending.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigprocmask.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigqueue.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigrelse.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigrtmax.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigrtmin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigset.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigsetjmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigsetjmp_tail.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigsuspend.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigtimedwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sigwaitinfo.c
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/src/internal/ksigaction.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/setjmp.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/sys/syscall.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+ifeq (arm,$(ARCH))
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/arm/bits/signal.h
+else ifeq (x86_32,$(ARCH))
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/i386/bits/signal.h
+else ifeq (x86_64,$(ARCH))
+LIBMUSL_SIGNAL_HDRS-y += $(LIBMUSL)/arch/x86_64/bits/signal.h
+endif
+
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/block.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/getitimer.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/kill.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/killpg.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/psiginfo.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/psignal.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/raise.c
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/setitimer.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigaction.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigaddset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigaltstack.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigandset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigdelset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigemptyset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigfillset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sighold.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigignore.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/siginterrupt.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigisemptyset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigismember.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/siglongjmp.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/signal.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigorset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigpause.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigpending.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigprocmask.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigqueue.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigrelse.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigrtmax.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigrtmin.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigset.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigsetjmp.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigsetjmp_tail.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigsuspend.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigtimedwait.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigwait.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sigwaitinfo.c
 
 ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/i386/restore.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/i386/sigsetjmp.s|i386
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/i386/restore.s|i386
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/i386/sigsetjmp.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/x86_64/restore.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/x86_64/sigsetjmp.s|x86_64
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/x86_64/restore.s|x86_64
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/x86_64/sigsetjmp.s|x86_64
 else ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/arm/restore.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/arm/sigsetjmp.s|arm
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/arm/restore.s|arm
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/arm/sigsetjmp.s|arm
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/restore.c
+LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/restore.c
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/aarch64/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/aarch64/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/microblaze/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/microblaze/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mips/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mips/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mips64/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mips64/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mipsn32/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/mipsn32/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/or1k/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/powerpc/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/powerpc/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/powerpc64/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/powerpc64/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/s390x/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/s390x/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sh/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/sh/sigsetjmp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/x32/restore.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/signal/x32/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/aarch64/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/aarch64/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/microblaze/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/microblaze/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mips/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mips/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mips64/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mips64/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mipsn32/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/mipsn32/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/or1k/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/powerpc/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/powerpc/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/powerpc64/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/powerpc64/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/s390x/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/s390x/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sh/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/sh/sigsetjmp.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/x32/restore.s
+#LIBMUSL_SIGNAL_SRCS-y += $(LIBMUSL)/src/signal/x32/sigsetjmp.s
+
+$(eval $(call 
_libmusl_import_lib,signal,$(LIBMUSL_SIGNAL_HDRS-y),$(LIBMUSL_SIGNAL_SRCS-y)))
diff --git a/Makefile.uk.musl.stat b/Makefile.uk.musl.stat
index c754192..5ecc50b 100644
--- a/Makefile.uk.musl.stat
+++ b/Makefile.uk.musl.stat
@@ -1,20 +1,31 @@
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/__xstat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/chmod.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/fchmod.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/fchmodat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/fstat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/fstatat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/futimens.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/futimesat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/lchmod.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/lstat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mkdir.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mkdirat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mkfifo.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mkfifoat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mknod.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/mknodat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/stat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/statvfs.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/umask.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stat/utimensat.c
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/sys/statfs.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/sys/statvfs.h
+LIBMUSL_STAT_HDRS-y += $(LIBMUSL)/include/sys/time.h
+
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/__xstat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/chmod.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/fchmod.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/fchmodat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/fstat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/fstatat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/futimens.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/futimesat.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/lchmod.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/lstat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mkdir.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mkdirat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mkfifo.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mkfifoat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mknod.c
+LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/mknodat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/stat.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/statvfs.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/umask.c
+#LIBMUSL_STAT_SRCS-y += $(LIBMUSL)/src/stat/utimensat.c
+
+$(eval $(call 
_libmusl_import_lib,stat,$(LIBMUSL_STAT_HDRS-y),$(LIBMUSL_STAT_SRCS-y)))
diff --git a/Makefile.uk.musl.stdio b/Makefile.uk.musl.stdio
index 8a9254e..8e4417e 100644
--- a/Makefile.uk.musl.stdio
+++ b/Makefile.uk.musl.stdio
@@ -1,117 +1,149 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__fclose_ca.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__fdopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__fmodeflags.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__fopen_rb_ca.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__lockfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__overflow.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_close.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_exit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_read.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_seek.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_write.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__stdout_write.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__string_read.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__toread.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__towrite.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/__uflow.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/asprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/clearerr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/dprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ext.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ext2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fclose.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/feof.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ferror.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fflush.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgetc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgetln.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgetpos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgets.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgetwc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fgetws.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fileno.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/flockfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fmemopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fopencookie.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fputc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fputs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fputwc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fputws.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fread.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/freopen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fseek.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fsetpos.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ftell.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ftrylockfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/funlockfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fwide.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fwprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fwrite.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/fwscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getc_unlocked.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getchar.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getchar_unlocked.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getdelim.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getline.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/gets.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getw.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getwc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/getwchar.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ofl.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ofl_add.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/open_memstream.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/open_wmemstream.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/pclose.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/perror.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/popen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/printf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putc_unlocked.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putchar.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putchar_unlocked.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/puts.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putw.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putwc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/putwchar.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/remove.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/rename.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/rewind.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/scanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/setbuf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/setbuffer.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/setlinebuf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/setvbuf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/snprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/sprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/sscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/stderr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/stdin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/stdout.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/swprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/swscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/tempnam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/tmpfile.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/tmpnam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ungetc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/ungetwc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vasprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vdprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vfprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vfscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vfwprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vfwscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vsnprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vsprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vsscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vswprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vswscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vwprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/vwscanf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/wprintf.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdio/wscanf.c
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/float.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/floatscan.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/intscan.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/inttypes.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/math.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/shgetc.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/spawn.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stdio_ext.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/stdio_impl.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/sys/ioctl.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/sys/uio.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wctype.h
+
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__fclose_ca.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__fdopen.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__fmodeflags.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__fopen_rb_ca.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__lockfile.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__overflow.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_close.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_exit.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_read.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_seek.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdio_write.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__stdout_write.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__string_read.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__toread.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__towrite.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/__uflow.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/asprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/clearerr.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/dprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ext.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ext2.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fclose.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/feof.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ferror.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fflush.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgetc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgetln.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgetpos.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgets.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgetwc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fgetws.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fileno.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/flockfile.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fmemopen.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fopen.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fopencookie.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fputc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fputs.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fputwc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fputws.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fread.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/freopen.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fseek.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fsetpos.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ftell.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ftrylockfile.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/funlockfile.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fwide.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fwprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fwrite.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/fwscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getc_unlocked.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getchar.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getchar_unlocked.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getdelim.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getline.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/gets.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getw.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getwc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/getwchar.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ofl.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ofl_add.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/open_memstream.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/open_wmemstream.c
+#LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/pclose.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/perror.c
+#LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/popen.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/printf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putc_unlocked.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putchar.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putchar_unlocked.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/puts.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putw.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putwc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/putwchar.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/remove.c
+#LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/rename.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/rewind.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/scanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/setbuf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/setbuffer.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/setlinebuf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/setvbuf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/snprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/sprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/sscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/stderr.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/stdin.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/stdout.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/swprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/swscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/tempnam.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/tmpfile.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/tmpnam.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ungetc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/ungetwc.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vasprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vdprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vfprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vfscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vfwprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vfwscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vsnprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vsprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vsscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vswprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vswscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vwprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/vwscanf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/wprintf.c
+LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/wscanf.c
+
+$(eval $(call 
_libmusl_import_lib,stdio,$(LIBMUSL_STDIO_HDRS-y),$(LIBMUSL_STDIO_SRCS-y)))
diff --git a/Makefile.uk.musl.stdlib b/Makefile.uk.musl.stdlib
index 21167f1..9529226 100644
--- a/Makefile.uk.musl.stdlib
+++ b/Makefile.uk.musl.stdlib
@@ -1,21 +1,39 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/abs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/atof.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/atoi.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/atol.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/atoll.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/bsearch.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/div.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/ecvt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/fcvt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/gcvt.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/imaxabs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/imaxdiv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/labs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/ldiv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/llabs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/lldiv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/qsort.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/strtod.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/strtol.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/wcstod.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/stdlib/wcstol.c
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/floatscan.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/intscan.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/inttypes.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/shgetc.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/src/internal/stdio_impl.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_STDLIB_HDRS-y += $(LIBMUSL)/include/wctype.h
+
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/abs.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/atof.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/atoi.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/atol.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/atoll.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/bsearch.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/div.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/ecvt.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/fcvt.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/gcvt.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/imaxabs.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/imaxdiv.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/labs.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/ldiv.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/llabs.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/lldiv.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/qsort.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/strtod.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/strtol.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/wcstod.c
+LIBMUSL_STDLIB_SRCS-y += $(LIBMUSL)/src/stdlib/wcstol.c
+
+$(eval $(call 
_libmusl_import_lib,stdlib,$(LIBMUSL_STDLIB_HDRS-y),$(LIBMUSL_STDLIB_SRCS-y)))
diff --git a/Makefile.uk.musl.string b/Makefile.uk.musl.string
index 63794f5..45316b4 100644
--- a/Makefile.uk.musl.string
+++ b/Makefile.uk.musl.string
@@ -1,91 +1,108 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/bcmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/bcopy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/bzero.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/index.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memccpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memcmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memmem.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/mempcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memrchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/rindex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/stpcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/stpncpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcasecmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcasestr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strchrnul.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strcspn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strdup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strerror_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strlcat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strlcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strlen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strncasecmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strncat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strncmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strncpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strndup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strnlen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strpbrk.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strrchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strsep.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strsignal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strspn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strstr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strtok.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strtok_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/strverscmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/swab.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcpcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcpncpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscasecmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscasecmp_l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcschr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcscspn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsdup.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcslen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsncasecmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsncasecmp_l.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsncat.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsncmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsncpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsnlen.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcspbrk.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsrchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsspn.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcsstr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcstok.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wcswcs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wmemchr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wmemcmp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wmemcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wmemmove.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/wmemset.c
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/endian.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/strings.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_STRING_HDRS-y += $(LIBMUSL)/include/wctype.h
+
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/bcmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/bcopy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/bzero.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/index.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memccpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memcmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memmem.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/mempcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memrchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/rindex.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/stpcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/stpncpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcasecmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcasestr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcat.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strchrnul.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strcspn.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strdup.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strerror_r.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strlcat.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strlcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strlen.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strncasecmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strncat.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strncmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strncpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strndup.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strnlen.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strpbrk.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strrchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strsep.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strsignal.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strspn.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strstr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strtok.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strtok_r.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/strverscmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/swab.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcpcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcpncpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscasecmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscasecmp_l.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscat.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcschr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcscspn.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsdup.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcslen.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsncasecmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsncasecmp_l.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsncat.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsncmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsncpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsnlen.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcspbrk.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsrchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsspn.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcsstr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcstok.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wcswcs.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wmemchr.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wmemcmp.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wmemcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wmemmove.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/wmemset.c
 
 ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/arm/__aeabi_memcpy.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/arm/__aeabi_memset.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/arm/memcpy.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/arm/memcpy_le.S|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memmove.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memset.c|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/arm/__aeabi_memcpy.s|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/arm/__aeabi_memset.s|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/arm/memcpy.c|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/arm/memcpy_le.S|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memmove.c|arm
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memset.c|arm
 else ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/i386/memcpy.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/i386/memmove.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/i386/memset.s|i386
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/i386/memcpy.s|i386
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/i386/memmove.s|i386
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/i386/memset.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/x86_64/memcpy.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/x86_64/memmove.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/x86_64/memset.s|x86_64
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/x86_64/memcpy.s|x86_64
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/x86_64/memmove.s|x86_64
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/x86_64/memset.s|x86_64
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memcpy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memmove.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/string/memset.c
-endif
\ No newline at end of file
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memcpy.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memmove.c
+LIBMUSL_STRING_SRCS-y += $(LIBMUSL)/src/string/memset.c
+endif
+
+$(eval $(call 
_libmusl_import_lib,string,$(LIBMUSL_STRING_HDRS-y),$(LIBMUSL_STRING_SRCS-y)))
diff --git a/Makefile.uk.musl.temp b/Makefile.uk.musl.temp
index 1107ffc..3d7f554 100644
--- a/Makefile.uk.musl.temp
+++ b/Makefile.uk.musl.temp
@@ -1,7 +1,19 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/__randname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mkdtemp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mkostemp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mkostemps.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mkstemp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mkstemps.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/temp/mktemp.c
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_TEMP_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/__randname.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mkdtemp.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mkostemp.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mkostemps.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mkstemp.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mkstemps.c
+LIBMUSL_TEMP_SRCS-y += $(LIBMUSL)/src/temp/mktemp.c
+
+$(eval $(call 
_libmusl_import_lib,temp,$(LIBMUSL_TEMP_HDRS-y),$(LIBMUSL_TEMP_SRCS-y)))
diff --git a/Makefile.uk.musl.termios b/Makefile.uk.musl.termios
index 734c13b..318fc92 100644
--- a/Makefile.uk.musl.termios
+++ b/Makefile.uk.musl.termios
@@ -1,10 +1,18 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/cfgetospeed.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/cfmakeraw.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/cfsetospeed.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcdrain.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcflow.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcflush.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcgetattr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcgetsid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcsendbreak.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/termios/tcsetattr.c
+LIBMUSL_TERMIOS_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_TERMIOS_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_TERMIOS_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_TERMIOS_HDRS-y += $(LIBMUSL)/include/sys/ioctl.h
+LIBMUSL_TERMIOS_HDRS-y += $(LIBMUSL)/include/termios.h
+
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/cfgetospeed.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/cfmakeraw.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/cfsetospeed.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcdrain.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcflow.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcflush.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcgetattr.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcgetsid.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcsendbreak.c
+LIBMUSL_TERMIOS_SRCS-y += $(LIBMUSL)/src/termios/tcsetattr.c
+
+$(eval $(call 
_libmusl_import_lib,termios,$(LIBMUSL_TERMIOS_HDRS-y),$(LIBMUSL_TERMIOS_SRCS-y)))
diff --git a/Makefile.uk.musl.thread b/Makefile.uk.musl.thread
index f5e567a..2f2f7be 100644
--- a/Makefile.uk.musl.thread
+++ b/Makefile.uk.musl.thread
@@ -1,197 +1,230 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__futex.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__lock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__syscall_cp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__timedwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__tls_get_addr.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/call_once.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_broadcast.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_signal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_timedwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/cnd_wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/lock_ptc.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_lock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_timedlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_trylock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mtx_unlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_atfork.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_get.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setdetachstate.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setguardsize.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setinheritsched.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setschedparam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setschedpolicy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setscope.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setstack.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setstacksize.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_setpshared.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cancel.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cleanup_push.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_broadcast.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_signal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_timedwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_setclock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_setpshared.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_create.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_detach.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_equal.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_getattr_np.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_getconcurrency.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_getcpuclockid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_getschedparam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_getspecific.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_join.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_key_create.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_kill.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_consistent.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_getprioceiling.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_lock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_setprioceiling.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_timedlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_trylock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_unlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setprotocol.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setpshared.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setrobust.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_settype.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_once.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_rdlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_timedrdlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_timedwrlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_tryrdlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_trywrlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_unlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_wrlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_setpshared.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_self.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setattr_default_np.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setcancelstate.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setcanceltype.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setconcurrency.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setname_np.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setschedparam.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setschedprio.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_setspecific.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_sigmask.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_lock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_trylock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_unlock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/pthread_testcancel.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_destroy.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_getvalue.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_init.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_open.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_post.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_timedwait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_trywait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_unlink.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sem_wait.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/synccall.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/syscall_cp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/thrd_create.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/thrd_exit.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/thrd_join.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/thrd_sleep.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/thrd_yield.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/tls.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/tss_create.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/tss_delete.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/tss_set.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/vmlock.c
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/dirent.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/dynlink.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/elf.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/futex.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/semaphore.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/stdarg.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/stdio_impl.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/sys/prctl.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/sys/select.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/sys/syscall.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/threads.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_THREAD_HDRS-y += $(LIBMUSL)/include/unistd.h
+
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__futex.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__lock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__syscall_cp.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__timedwait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__tls_get_addr.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__wait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/call_once.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_broadcast.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_signal.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_timedwait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/cnd_wait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/lock_ptc.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_lock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_timedlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_trylock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mtx_unlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_atfork.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_get.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setdetachstate.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setguardsize.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setinheritsched.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setschedparam.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setschedpolicy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setscope.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setstack.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_attr_setstacksize.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrier_wait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_barrierattr_setpshared.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cancel.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cleanup_push.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_broadcast.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_signal.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_timedwait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_cond_wait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_setclock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_condattr_setpshared.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_create.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_detach.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_equal.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_getattr_np.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_getconcurrency.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_getcpuclockid.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_getschedparam.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_getspecific.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_join.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_key_create.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_kill.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_consistent.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_getprioceiling.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_lock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_setprioceiling.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_timedlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_trylock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutex_unlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setprotocol.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setpshared.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_setrobust.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_mutexattr_settype.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_once.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_rdlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_timedrdlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_timedwrlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_tryrdlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_trywrlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_unlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlock_wrlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_rwlockattr_setpshared.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_self.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setattr_default_np.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setcancelstate.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setcanceltype.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setconcurrency.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setname_np.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setschedparam.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setschedprio.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_setspecific.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_sigmask.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_lock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_trylock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_spin_unlock.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/pthread_testcancel.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_destroy.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_getvalue.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_init.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_open.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_post.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_timedwait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_trywait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_unlink.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sem_wait.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/synccall.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/syscall_cp.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/thrd_create.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/thrd_exit.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/thrd_join.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/thrd_sleep.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/thrd_yield.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/tls.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/tss_create.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/tss_delete.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/tss_set.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/vmlock.c
 
 ifeq (x86_32,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/i386/__set_thread_area.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/i386/__unmapself.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/i386/clone.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/i386/syscall_cp.s|i386
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/i386/tls.s|i386
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/i386/__set_thread_area.s|i386
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/i386/__unmapself.s|i386
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/i386/clone.s|i386
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/i386/syscall_cp.s|i386
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/i386/tls.s|i386
 else ifeq (x86_64,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x86_64/__set_thread_area.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x86_64/__unmapself.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x86_64/clone.s|x86_64
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x86_64/syscall_cp.s|x86_64
+LIBMUSL_THREAD_SRCS-y += 
$(LIBMUSL)/src/thread/x86_64/__set_thread_area.s|x86_64
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x86_64/__unmapself.s|x86_64
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x86_64/clone.s|x86_64
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x86_64/syscall_cp.s|x86_64
 else ifeq (arm,$(CONFIG_UK_ARCH))
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/__aeabi_read_tp.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/__aeabi_read_tp_c.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/__set_thread_area.c|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/__unmapself.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/atomics.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/clone.s|arm
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/arm/syscall_cp.s|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/__aeabi_read_tp.s|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/__aeabi_read_tp_c.c|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/__set_thread_area.c|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/__unmapself.s|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/atomics.s|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/clone.s|arm
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/arm/syscall_cp.s|arm
 else
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__set_thread_area.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/__unmapself.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/clone.c|thread
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__set_thread_area.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/__unmapself.c
+LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/clone.c|thread
 endif
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/aarch64/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/aarch64/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/aarch64/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/aarch64/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/microblaze/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/microblaze/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/microblaze/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/microblaze/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips64/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips64/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mips64/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/or1k/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/or1k/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/or1k/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/or1k/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/s390x/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/s390x/__tls_get_offset.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/s390x/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/s390x/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/s390x/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/__set_thread_area.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/__unmapself.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/__unmapself_mmu.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/atomics.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/sh/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x32/__set_thread_area.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x32/__unmapself.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x32/clone.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x32/syscall_cp.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/thread/x32/syscall_cp_fixup.c
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/aarch64/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/aarch64/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/aarch64/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/aarch64/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/microblaze/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/microblaze/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/microblaze/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/microblaze/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips64/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips64/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mips64/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/mipsn32/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/or1k/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/or1k/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/or1k/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/or1k/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/powerpc64/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/s390x/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/s390x/__tls_get_offset.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/s390x/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/s390x/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/s390x/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/__set_thread_area.c
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/__unmapself.c
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/__unmapself_mmu.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/atomics.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/sh/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x32/__set_thread_area.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x32/__unmapself.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x32/clone.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x32/syscall_cp.s
+#LIBMUSL_THREAD_SRCS-y += $(LIBMUSL)/src/thread/x32/syscall_cp_fixup.c
+
+$(eval $(call 
_libmusl_import_lib,thread,$(LIBMUSL_THREAD_HDRS-y),$(LIBMUSL_THREAD_SRCS-y)))
diff --git a/Makefile.uk.musl.time b/Makefile.uk.musl.time
index db4a736..ec42edf 100644
--- a/Makefile.uk.musl.time
+++ b/Makefile.uk.musl.time
@@ -1,40 +1,77 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__asctime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__map_file.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__month_to_secs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__secs_to_tm.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__tm_to_secs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__tz.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/__year_to_secs.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/asctime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/asctime_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock_getcpuclockid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock_getres.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock_gettime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock_nanosleep.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/clock_settime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/ctime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/ctime_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/difftime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/ftime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/getdate.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/gettimeofday.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/gmtime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/gmtime_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/localtime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/localtime_r.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/mktime.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/nanosleep.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/strftime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/strptime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/time.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timegm.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timer_create.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timer_delete.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timer_getoverrun.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timer_gettime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timer_settime.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/times.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/timespec_get.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/utime.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/time/wcsftime.c
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/internal/atomic.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/ctype.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/langinfo.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/locale.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/internal/locale_impl.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/pthread.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/setjmp.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/stddef.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/stdint.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/strings.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/sys/mman.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/sys/timeb.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/sys/times.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/src/time/time_impl.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/unistd.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/utime.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/wchar.h
+LIBMUSL_TIME_HDRS-y += $(LIBMUSL)/include/nl_types.h
+
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__asctime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__map_file.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__month_to_secs.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__secs_to_tm.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__tm_to_secs.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__tz.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/__year_to_secs.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/asctime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/asctime_r.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock_getcpuclockid.c
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock_getres.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock_gettime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock_nanosleep.c
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/clock_settime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/ctime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/ctime_r.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/difftime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/ftime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/getdate.c
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/gettimeofday.c
+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/nanosleep.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/strftime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/strptime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/time.c
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timegm.c
+
+ifneq ($(CONFIG_LIBUKTIME),y)
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timer_create.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timer_delete.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timer_gettime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timer_settime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timer_getoverrun.c
+endif
+
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/times.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/timespec_get.c
+#LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/utime.c
+LIBMUSL_TIME_SRCS-y += $(LIBMUSL)/src/time/wcsftime.c
+
+$(eval $(call 
_libmusl_import_lib,time,$(LIBMUSL_TIME_HDRS-y),$(LIBMUSL_TIME_SRCS-y)))
diff --git a/Makefile.uk.musl.unistd b/Makefile.uk.musl.unistd
index 1b02a3b..a4378b4 100644
--- a/Makefile.uk.musl.unistd
+++ b/Makefile.uk.musl.unistd
@@ -1,84 +1,107 @@
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/_exit.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/access.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/acct.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/alarm.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/chdir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/chown.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/close.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/ctermid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/dup.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/dup2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/dup3.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/faccessat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/fchdir.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/fchown.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/fchownat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/fdatasync.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/fsync.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/ftruncate.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getcwd.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getegid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/geteuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getgid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getgroups.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/gethostname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getlogin.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getlogin_r.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getpgid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getpgrp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getpid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getppid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getsid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/getuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/isatty.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/lchown.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/link.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/linkat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/lseek.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/nice.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pause.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pipe.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pipe2.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/posix_close.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pread.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/preadv.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pwrite.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/pwritev.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/read.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/readlink.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/readlinkat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/readv.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/renameat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/rmdir.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setegid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/seteuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setgid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setpgid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setpgrp.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setregid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setresgid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setresuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setreuid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setsid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setuid.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/setxid.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/sleep.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/symlink.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/symlinkat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/sync.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/tcgetpgrp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/tcsetpgrp.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/truncate.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/ttyname.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/ttyname_r.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/ualarm.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/unlink.c
-LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/unlinkat.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/usleep.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/write.c
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/writev.c
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/errno.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/fcntl.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/src/internal/libc.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/limits.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/src/internal/pthread_impl.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/signal.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/stdio.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/stdlib.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/string.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/src/internal/syscall.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/ioctl.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/resource.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/stat.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/time.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/uio.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/utsname.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/sys/wait.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/termios.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/time.h
+LIBMUSL_UNISTD_HDRS-y += $(LIBMUSL)/include/unistd.h
 
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/mips/pipe.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/mips64/pipe.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/mipsn32/pipe.s
-#LIBMUSL_SRCS-y += $(LIBMUSL)/src/unistd/sh/pipe.s
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/_exit.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/access.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/acct.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/alarm.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/chdir.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/chown.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/close.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/ctermid.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/dup.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/dup2.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/dup3.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/faccessat.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fchdir.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fchown.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fchownat.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/fdatasync.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
+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/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
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/linkat.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/lseek.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/nice.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pause.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pipe.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pipe2.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/posix_close.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pread.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/preadv.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pwrite.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/pwritev.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/read.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/readlink.c
+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
+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
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setpgid.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/setpgrp.c
+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/setxid.c
+#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
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/sync.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/tcgetpgrp.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/tcsetpgrp.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/truncate.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/ttyname.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/ttyname_r.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/ualarm.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/unlink.c
+LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/unlinkat.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/usleep.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/write.c
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/writev.c
+
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/mips/pipe.s
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/mips64/pipe.s
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/mipsn32/pipe.s
+#LIBMUSL_UNISTD_SRCS-y += $(LIBMUSL)/src/unistd/sh/pipe.s
+
+$(eval $(call 
_libmusl_import_lib,unistd,$(LIBMUSL_UNISTD_HDRS-y),$(LIBMUSL_UNISTD_SRCS-y)))
-- 
2.17.1




 


Rackspace

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