You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/01 21:57:07 UTC

[incubator-nuttx] 01/03: build: Remove 'u' prefix from userspace library

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f2aba8d9b7740f5ca3b1861ce2676879ed2aa3e0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat May 2 03:23:04 2020 +0800

    build: Remove 'u' prefix from userspace library
    
    so user needn't link the different library because the build type change
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 Documentation/NuttxPortingGuide.html |  2 +-
 arch/arm/src/Makefile                | 13 ++++---
 arch/or1k/src/Makefile               | 13 ++++---
 arch/risc-v/src/Makefile             | 14 ++++---
 arch/x86_64/src/Makefile             | 12 ++++--
 include/nuttx/fs/fs.h                |  2 +-
 include/nuttx/mqueue.h               |  4 +-
 include/nuttx/net/net.h              |  2 +-
 include/nuttx/sched.h                |  2 +-
 include/nuttx/semaphore.h            |  2 +-
 include/nuttx/signal.h               |  2 +-
 libs/libc/.gitignore                 |  1 -
 libs/libc/Makefile                   | 20 ++--------
 libs/libc/ubin/.gitignore            |  8 ----
 libs/libc/ubin/Makefile              | 48 ------------------------
 libs/libnx/.gitignore                |  1 -
 libs/libnx/Makefile                  | 20 ++--------
 libs/libnx/ubin/.gitignore           |  8 ----
 libs/libnx/ubin/Makefile             | 48 ------------------------
 mm/.gitignore                        |  1 -
 mm/Makefile                          | 20 ++--------
 mm/ubin/.gitignore                   |  8 ----
 mm/ubin/Makefile                     | 48 ------------------------
 tools/KernelLibs.mk                  |  8 ++--
 tools/LibTargets.mk                  | 72 +++++++++++++-----------------------
 tools/ProtectedLibs.mk               |  8 ++--
 26 files changed, 82 insertions(+), 305 deletions(-)

diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index 06e62cb..1c0c265 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -1358,7 +1358,7 @@ include/
 <p>
   Normally the logic in this file builds to a single library (<code>libc.a</code>).
   However, if NuttX is built as a separately compiled kernel (with <code>CONFIG_BUILD_PROTECTED=y</code> or <code>CONFIG_BUILD_KERNEL=y</code>), then the contents of this directory are built as two libraries:
-  One for use by user programs (<code>libuc.a</code>) and one for use only within the &lt;kernel&gt; space (<code>libkc.a</code>).
+  One for use by user programs (<code>libc.a</code>) and one for use only within the &lt;kernel&gt; space (<code>libkc.a</code>).
 </p>
 <p>
   These user/kernel space libraries (along with the sycalls of <a href="#DirStructSyscall"><code>nuttx/syscall</code></a>) are needed to support the two differing protection domains.
diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile
index c1fd722..ca4b467 100644
--- a/arch/arm/src/Makefile
+++ b/arch/arm/src/Makefile
@@ -107,7 +107,6 @@ USRCS = $(UASRCS) $(UCSRCS)
 UOBJS = $(UAOBJS) $(UCOBJS)
 
 KBIN = libkarch$(LIBEXT)
-UBIN = libuarch$(LIBEXT)
 BIN  = libarch$(LIBEXT)
 
 LDFLAGS += $(ARCHSCRIPT)
@@ -173,11 +172,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S
 $(COBJS) $(UCOBJS): %$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-$(BIN) $(KBIN): $(OBJS)
+ifeq ($(CONFIG_BUILD_FLAT),y)
+$(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
-
-$(UBIN): $(UOBJS)
+else
+$(BIN): $(UOBJS)
 	$(call ARCHIVE, $@, $(UOBJS))
+endif
+
+$(KBIN): $(OBJS)
+	$(call ARCHIVE, $@, $(OBJS))
 
 board$(DELIM)libboard$(LIBEXT):
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
@@ -224,7 +228,6 @@ ifeq ($(BOARDMAKE),y)
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean
 endif
 	$(call DELFILE, $(KBIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(BIN))
 	$(call CLEAN)
 
diff --git a/arch/or1k/src/Makefile b/arch/or1k/src/Makefile
index 22d22e2..808e194 100644
--- a/arch/or1k/src/Makefile
+++ b/arch/or1k/src/Makefile
@@ -98,7 +98,6 @@ USRCS = $(UASRCS) $(UCSRCS)
 UOBJS = $(UAOBJS) $(UCOBJS)
 
 KBIN = libkarch$(LIBEXT)
-UBIN = libuarch$(LIBEXT)
 BIN  = libarch$(LIBEXT)
 
 LDFLAGS += $(ARCHSCRIPT)
@@ -166,11 +165,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S
 $(COBJS) $(UCOBJS): %$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-$(BIN) $(KBIN): $(OBJS)
+ifeq ($(CONFIG_BUILD_FLAT),y)
+$(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
-
-$(UBIN): $(UOBJS)
+else
+$(BIN): $(UOBJS)
 	$(call ARCHIVE, $@, $(UOBJS))
+endif
+
+$(KBIN): $(OBJS)
+	$(call ARCHIVE, $@, $(OBJS))
 
 board$(DELIM)libboard$(LIBEXT):
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
@@ -217,7 +221,6 @@ ifeq ($(BOARDMAKE),y)
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean
 endif
 	$(call DELFILE, $(KBIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(BIN))
 	$(call CLEAN)
 
diff --git a/arch/risc-v/src/Makefile b/arch/risc-v/src/Makefile
index e707898..9ba5ec8 100644
--- a/arch/risc-v/src/Makefile
+++ b/arch/risc-v/src/Makefile
@@ -104,7 +104,6 @@ USRCS = $(UASRCS) $(UCSRCS)
 UOBJS = $(UAOBJS) $(UCOBJS)
 
 KBIN = libkarch$(LIBEXT)
-UBIN = libuarch$(LIBEXT)
 BIN  = libarch$(LIBEXT)
 
 LDFLAGS += $(ARCHSCRIPT)
@@ -165,12 +164,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S
 $(COBJS) $(UCOBJS): %$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-$(BIN) $(KBIN): $(OBJS)
+ifeq ($(CONFIG_BUILD_FLAT),y)
+$(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
-	@$(MAKE) depend
-
-$(UBIN): $(UOBJS)
+else
+$(BIN): $(UOBJS)
 	$(call ARCHIVE, $@, $(UOBJS))
+endif
+
+$(KBIN): $(OBJS)
+	$(call ARCHIVE, $@, $(OBJS))
 
 board/libboard$(LIBEXT):
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
@@ -217,7 +220,6 @@ ifeq ($(BOARDMAKE),y)
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean
 endif
 	$(call DELFILE, $(KBIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(BIN))
 	$(call DELFILE, $(HEAD_OBJ))
 	$(call CLEAN)
diff --git a/arch/x86_64/src/Makefile b/arch/x86_64/src/Makefile
index b95a5f1..702d249 100644
--- a/arch/x86_64/src/Makefile
+++ b/arch/x86_64/src/Makefile
@@ -64,7 +64,6 @@ SRCS = $(ASRCS) $(CSRCS)
 OBJS = $(AOBJS) $(COBJS)
 
 KBIN = libkarch$(LIBEXT)
-UBIN = libuarch$(LIBEXT)
 BIN  = libarch$(LIBEXT)
 
 # Override in Make.defs if linker is not 'ld'
@@ -126,11 +125,16 @@ $(AOBJS): %$(OBJEXT): %.S
 $(COBJS): %$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-$(BIN) $(KBIN): $(OBJS)
+ifeq ($(CONFIG_BUILD_FLAT),y)
+$(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
-
-$(UBIN): $(UOBJS)
+else
+$(BIN): $(UOBJS)
 	$(call ARCHIVE, $@, $(UOBJS))
+endif
+
+$(KBIN): $(OBJS)
+	$(call ARCHIVE, $@, $(OBJS))
 
 board/libboard$(LIBEXT):
 	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h
index d4e1614..3758db4 100644
--- a/include/nuttx/fs/fs.h
+++ b/include/nuttx/fs/fs.h
@@ -54,7 +54,7 @@
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
diff --git a/include/nuttx/mqueue.h b/include/nuttx/mqueue.h
index 04a416c..7cc8bcb 100644
--- a/include/nuttx/mqueue.h
+++ b/include/nuttx/mqueue.h
@@ -65,7 +65,7 @@
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
@@ -179,7 +179,7 @@ struct task_group_s;  /* Forward reference */
  *
  ****************************************************************************/
 
-int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen,\
+int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen,
               unsigned int prio);
 
 /****************************************************************************
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index be16ae6..bf24060 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -51,7 +51,7 @@
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h
index d45f1f0..27b12e4 100644
--- a/include/nuttx/sched.h
+++ b/include/nuttx/sched.h
@@ -141,7 +141,7 @@
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
diff --git a/include/nuttx/semaphore.h b/include/nuttx/semaphore.h
index 03feb2c..ff73e42 100644
--- a/include/nuttx/semaphore.h
+++ b/include/nuttx/semaphore.h
@@ -50,7 +50,7 @@
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h
index 2a33f4d..cf078e6 100644
--- a/include/nuttx/signal.h
+++ b/include/nuttx/signal.h
@@ -66,7 +66,7 @@ struct sigwork_s
  *
  * This is only important when compiling libraries (libc or libnx) that are
  * used both by the OS (libkc.a and libknx.a) or by the applications
- * (libuc.a and libunx.a).  In that case, the correct interface must be
+ * (libc.a and libnx.a).  In that case, the correct interface must be
  * used for the build context.
  *
  * REVISIT:  In the flat build, the same functions must be used both by
diff --git a/libs/libc/.gitignore b/libs/libc/.gitignore
index 458e427..692ab24 100644
--- a/libs/libc/.gitignore
+++ b/libs/libc/.gitignore
@@ -1,5 +1,4 @@
 /Make_bin.dep
-/Make_ubin.dep
 /Make_kbin.dep
 /exec_symtab.c
 /modlib_symtab.c
diff --git a/libs/libc/Makefile b/libs/libc/Makefile
index d8fccf7..2068f66 100644
--- a/libs/libc/Makefile
+++ b/libs/libc/Makefile
@@ -143,7 +143,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
 SRCS = $(ASRCS) $(CSRCS)
 OBJS = $(AOBJS) $(COBJS)
 
-UBIN = libuc$(LIBEXT)
 KBIN = libkc$(LIBEXT)
 BIN ?= libc$(LIBEXT)
 
@@ -156,7 +155,8 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S
 $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-# C library for the flat build
+# C library for the flat build and
+# the user phase of the two-pass kernel build
 
 $(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
@@ -164,13 +164,6 @@ ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y)
 	$(Q) $(MAKE) -C zoneinfo all TOPDIR=$(TOPDIR) BIN=$(BIN)
 endif
 
-# C library for the user phase of the two-pass kernel build
-
-ifneq ($(BIN),$(UBIN))
-$(UBIN):
-	$(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)"
-endif
-
 # C library for the kernel phase of the two-pass kernel build
 
 ifneq ($(BIN),$(KBIN))
@@ -188,10 +181,8 @@ endif
 # Dependencies
 
 .depend: Makefile $(SRCS)
-ifeq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
-else
-	$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep
+ifneq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
 endif
 ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y)
@@ -205,11 +196,9 @@ depend: .depend
 
 clean:
 	$(Q) $(MAKE) -C bin  clean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C zoneinfo clean TOPDIR=$(TOPDIR) BIN=$(BIN)
 	$(call DELFILE, $(BIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(KBIN))
 	$(call CLEAN)
 
@@ -217,15 +206,12 @@ clean:
 
 distclean: clean
 	$(Q) $(MAKE) -C bin  distclean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C zoneinfo distclean TOPDIR=$(TOPDIR) BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
 	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, ubin/Make.dep)
 	$(call DELFILE, kbin/Make.dep)
 	$(call DELFILE, .depend)
 
 -include bin/Make.dep
--include ubin/Make.dep
 -include kbin/Make.dep
diff --git a/libs/libc/ubin/.gitignore b/libs/libc/ubin/.gitignore
deleted file mode 100644
index 4e358a8..0000000
--- a/libs/libc/ubin/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/*.asm
-/*.obj
-/*.rel
-/*.lst
-/*.sym
-/*.adb
-/*.lib
-/*.src
diff --git a/libs/libc/ubin/Makefile b/libs/libc/ubin/Makefile
deleted file mode 100644
index e8aca33..0000000
--- a/libs/libc/ubin/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-############################################################################
-# libs/libc/ubin/Makefile
-#
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
-#   Author: Gregory Nutt <gn...@nuttx.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in
-#    the documentation and/or other materials provided with the
-#    distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-#    used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-###########################################################################
-
--include $(TOPDIR)/Make.defs
-
-all:
-.PHONY: clean distclean
-
-# Clean Targets:
-
-clean:
-	$(call CLEAN)
-
-# Deep clean -- removes all traces of the configuration
-
-distclean: clean
diff --git a/libs/libnx/.gitignore b/libs/libnx/.gitignore
index 77e9ad0..d710724 100644
--- a/libs/libnx/.gitignore
+++ b/libs/libnx/.gitignore
@@ -1,5 +1,4 @@
 /Make_bin.dep
-/Make_ubin.dep
 /Make_kbin.dep
 /.depend
 /*.lib
diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile
index 7625803..ac7268f 100644
--- a/libs/libnx/Makefile
+++ b/libs/libnx/Makefile
@@ -63,7 +63,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
 SRCS = $(ASRCS) $(CSRCS)
 OBJS = $(AOBJS) $(COBJS)
 
-UBIN = libunx$(LIBEXT)
 KBIN = libknx$(LIBEXT)
 BIN ?= libnx$(LIBEXT)
 
@@ -233,18 +232,12 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S
 $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-# NX library for the flat build
+# NX library for the flat build and
+# the user phase of the two-pass kernel build
 
 $(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
 
-# NX library for the user phase of the two-pass kernel build
-
-ifneq ($(BIN),$(UBIN))
-$(UBIN):
-	$(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)"
-endif
-
 # NX library for the kernel phase of the two-pass kernel build
 
 ifneq ($(BIN),$(KBIN))
@@ -255,10 +248,8 @@ endif
 # Dependencies
 
 .depend: Makefile gensources $(SRCS)
-ifeq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
-else
-	$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep
+ifneq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
 endif
 	$(Q) touch $@
@@ -273,11 +264,9 @@ context: gensources
 
 clean:
 	$(Q) $(MAKE) -C bin  clean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C nxfonts -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)"
 	$(call DELFILE, $(BIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(KBIN))
 	$(call CLEAN)
 
@@ -285,14 +274,11 @@ clean:
 
 distclean: clean
 	$(Q) $(MAKE) -C bin  distclean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C nxfonts -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)"
 	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, ubin/Make.dep)
 	$(call DELFILE, kbin/Make.dep)
 	$(call DELFILE, .depend)
 
 -include bin/Make.dep
--include ubin/Make.dep
 -include kbin/Make.dep
diff --git a/libs/libnx/ubin/.gitignore b/libs/libnx/ubin/.gitignore
deleted file mode 100644
index 4e358a8..0000000
--- a/libs/libnx/ubin/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/*.asm
-/*.obj
-/*.rel
-/*.lst
-/*.sym
-/*.adb
-/*.lib
-/*.src
diff --git a/libs/libnx/ubin/Makefile b/libs/libnx/ubin/Makefile
deleted file mode 100644
index d4235ec..0000000
--- a/libs/libnx/ubin/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-############################################################################
-# libs/libnx/ubin/Makefile
-#
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
-#   Author: Gregory Nutt <gn...@nuttx.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in
-#    the documentation and/or other materials provided with the
-#    distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-#    used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-###########################################################################
-
--include $(TOPDIR)/Make.defs
-
-all:
-.PHONY: clean distclean
-
-# Clean Targets:
-
-clean:
-	$(call CLEAN)
-
-# Deep clean -- removes all traces of the configuration
-
-distclean: clean
diff --git a/mm/.gitignore b/mm/.gitignore
index 77e9ad0..d710724 100644
--- a/mm/.gitignore
+++ b/mm/.gitignore
@@ -1,5 +1,4 @@
 /Make_bin.dep
-/Make_ubin.dep
 /Make_kbin.dep
 /.depend
 /*.lib
diff --git a/mm/Makefile b/mm/Makefile
index 5d21edf..32fd3f4 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -67,7 +67,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
 SRCS = $(ASRCS) $(CSRCS)
 OBJS = $(AOBJS) $(COBJS)
 
-UBIN = libumm$(LIBEXT)
 KBIN = libkmm$(LIBEXT)
 BIN ?= libmm$(LIBEXT)
 
@@ -80,18 +79,12 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S
 $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c
 	$(call COMPILE, $<, $@)
 
-# Memory manager for the flat build
+# Memory manager for the flat build and
+# the user phase of the two-pass kernel build
 
 $(BIN):	$(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
 
-# Memory manager for the user phase of the two-pass kernel build
-
-ifneq ($(BIN),$(UBIN))
-$(UBIN):
-	$(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)"
-endif
-
 # Memory manager for the kernel phase of the two-pass kernel build
 
 ifneq ($(BIN),$(KBIN))
@@ -102,10 +95,8 @@ endif
 # Dependencies
 
 .depend: Makefile $(SRCS)
-ifeq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
-else
-	$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep
+ifneq ($(CONFIG_BUILD_FLAT),y)
 	$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
 endif
 	$(Q) touch $@
@@ -116,10 +107,8 @@ depend: .depend
 
 clean:
 	$(Q) $(MAKE) -C bin  clean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR)
 	$(call DELFILE, $(BIN))
-	$(call DELFILE, $(UBIN))
 	$(call DELFILE, $(KBIN))
 	$(call CLEAN)
 
@@ -127,13 +116,10 @@ clean:
 
 distclean: clean
 	$(Q) $(MAKE) -C bin  distclean TOPDIR=$(TOPDIR)
-	$(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR)
 	$(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR)
 	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, ubin/Make.dep)
 	$(call DELFILE, kbin/Make.dep)
 	$(call DELFILE, .depend)
 
 -include bin/Make.dep
--include ubin/Make.dep
 -include kbin/Make.dep
diff --git a/mm/ubin/.gitignore b/mm/ubin/.gitignore
deleted file mode 100644
index 4e358a8..0000000
--- a/mm/ubin/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/*.asm
-/*.obj
-/*.rel
-/*.lst
-/*.sym
-/*.adb
-/*.lib
-/*.src
diff --git a/mm/ubin/Makefile b/mm/ubin/Makefile
deleted file mode 100644
index af29b32..0000000
--- a/mm/ubin/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-############################################################################
-# mm/ubin/Makefile
-#
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
-#   Author: Gregory Nutt <gn...@nuttx.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in
-#    the documentation and/or other materials provided with the
-#    distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-#    used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-###########################################################################
-
--include $(TOPDIR)/Make.defs
-
-all:
-.PHONY: clean distclean
-
-# Clean Targets:
-
-clean:
-	$(call CLEAN)
-
-# Deep clean -- removes all traces of the configuration
-
-distclean: clean
diff --git a/tools/KernelLibs.mk b/tools/KernelLibs.mk
index 16df064..93c4b12 100644
--- a/tools/KernelLibs.mk
+++ b/tools/KernelLibs.mk
@@ -56,8 +56,8 @@ NUTTXLIBS += staging$(DELIM)libboards$(LIBEXT)
 
 NUTTXLIBS += staging$(DELIM)libstubs$(LIBEXT) staging$(DELIM)libkc$(LIBEXT)
 NUTTXLIBS += staging$(DELIM)libkmm$(LIBEXT) staging$(DELIM)libkarch$(LIBEXT)
-USERLIBS  += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libuc$(LIBEXT)
-USERLIBS  += staging$(DELIM)libumm$(LIBEXT) staging$(DELIM)libuarch$(LIBEXT)
+USERLIBS  += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libc$(LIBEXT)
+USERLIBS  += staging$(DELIM)libmm$(LIBEXT) staging$(DELIM)libarch$(LIBEXT)
 
 # Add libraries for C++ support.  CXX, CXXFLAGS, and COMPILEXX must
 # be defined in Make.defs for this to work!
@@ -87,10 +87,10 @@ NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT)
 ifeq ($(CONFIG_NX),y)
 NUTTXLIBS += staging$(DELIM)libgraphics$(LIBEXT)
 NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT)
-USERLIBS  += staging$(DELIM)libunx$(LIBEXT)
+USERLIBS  += staging$(DELIM)libnx$(LIBEXT)
 else ifeq ($(CONFIG_NXFONTS),y)
 NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT)
-USERLIBS  += staging$(DELIM)libunx$(LIBEXT)
+USERLIBS  += staging$(DELIM)libnx$(LIBEXT)
 endif
 
 # Add libraries for the Audio sub-system
diff --git a/tools/LibTargets.mk b/tools/LibTargets.mk
index 60665b2..6760bfc 100644
--- a/tools/LibTargets.mk
+++ b/tools/LibTargets.mk
@@ -136,56 +136,48 @@ wireless$(DELIM)libwireless$(LIBEXT): context
 staging$(DELIM)libwireless$(LIBEXT): wireless$(DELIM)libwireless$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-$(ARCH_SRC)$(DELIM)libarch$(LIBEXT): context
-	$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)"
-
-staging$(DELIM)libarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libarch$(LIBEXT)
-	$(Q) $(call INSTALL_LIB,$<,$@)
-
-libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT): context
-	$(Q) $(MAKE) -C libs$(DELIM)libdsp TOPDIR="$(TOPDIR)" libdsp$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)"
-
-staging$(DELIM)libdsp$(LIBEXT): libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT)
-	$(Q) $(call INSTALL_LIB,$<,$@)
-
 openamp$(DELIM)libopenamp$(LIBEXT): context
 	$(Q) $(MAKE) -C openamp TOPDIR="$(TOPDIR)" libopenamp$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)"
 
 staging$(DELIM)libopenamp$(LIBEXT): openamp$(DELIM)libopenamp$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-# Special case
-
 syscall$(DELIM)libstubs$(LIBEXT): context
 	$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) # EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)"
 
 staging$(DELIM)libstubs$(LIBEXT): syscall$(DELIM)libstubs$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-# Possible user-mode builds
+# Special case
 
-libs$(DELIM)libc$(DELIM)libuc$(LIBEXT): context
-	$(Q) $(MAKE) -C libs$(DELIM)libc TOPDIR="$(TOPDIR)" libuc$(LIBEXT)
+$(ARCH_SRC)$(DELIM)libarch$(LIBEXT): context
+ifeq ($(CONFIG_BUILD_FLAT),y)
+	$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)"
+else
+	$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
+endif
 
-staging$(DELIM)libuc$(LIBEXT): libs$(DELIM)libc$(DELIM)libuc$(LIBEXT)
+staging$(DELIM)libarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libarch$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-libs$(DELIM)libnx$(DELIM)libunx$(LIBEXT): context
-	$(Q) $(MAKE) -C libs$(DELIM)libnx TOPDIR="$(TOPDIR)" libunx$(LIBEXT)
+# Possible user-mode builds
 
-staging$(DELIM)libunx$(LIBEXT): libs$(DELIM)libnx$(DELIM)libunx$(LIBEXT)
+libs$(DELIM)libc$(DELIM)libc$(LIBEXT): context
+	$(Q) $(MAKE) -C libs$(DELIM)libc TOPDIR="$(TOPDIR)" libc$(LIBEXT)
+
+staging$(DELIM)libc$(LIBEXT): libs$(DELIM)libc$(DELIM)libc$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-mm$(DELIM)libumm$(LIBEXT): context
-	$(Q) $(MAKE) -C mm TOPDIR="$(TOPDIR)" libumm$(LIBEXT)
+libs$(DELIM)libnx$(DELIM)libnx$(LIBEXT): context
+	$(Q) $(MAKE) -C libs$(DELIM)libnx TOPDIR="$(TOPDIR)" libnx$(LIBEXT)
 
-staging$(DELIM)libumm$(LIBEXT): mm$(DELIM)libumm$(LIBEXT)
+staging$(DELIM)libnx$(LIBEXT): libs$(DELIM)libnx$(DELIM)libnx$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
-$(ARCH_SRC)$(DELIM)libuarch$(LIBEXT): context
-	$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libuarch$(LIBEXT)
+mm$(DELIM)libmm$(LIBEXT): context
+	$(Q) $(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT)
 
-staging$(DELIM)libuarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libuarch$(LIBEXT)
+staging$(DELIM)libmm$(LIBEXT): mm$(DELIM)libmm$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
 libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT): context
@@ -194,6 +186,12 @@ libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT): context
 staging$(DELIM)libxx$(LIBEXT): libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
 
+libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT): context
+	$(Q) $(MAKE) -C libs$(DELIM)libdsp TOPDIR="$(TOPDIR)" libdsp$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
+
+staging$(DELIM)libdsp$(LIBEXT): libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT)
+	$(Q) $(call INSTALL_LIB,$<,$@)
+
 $(APPDIR)$(DELIM)libapps$(LIBEXT): context
 	$(Q) $(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)"
 
@@ -205,23 +203,3 @@ syscall$(DELIM)libproxies$(LIBEXT): context
 
 staging$(DELIM)libproxies$(LIBEXT): syscall$(DELIM)libproxies$(LIBEXT)
 	$(Q) $(call INSTALL_LIB,$<,$@)
-
-# Possible non-kernel builds
-
-libs$(DELIM)libc$(DELIM)libc$(LIBEXT): context
-	$(Q) $(MAKE) -C libs$(DELIM)libc TOPDIR="$(TOPDIR)" libc$(LIBEXT)
-
-staging$(DELIM)libc$(LIBEXT): libs$(DELIM)libc$(DELIM)libc$(LIBEXT)
-	$(Q) $(call INSTALL_LIB,$<,$@)
-
-libs$(DELIM)libnx$(DELIM)libnx$(LIBEXT): context
-	$(Q) $(MAKE) -C libs$(DELIM)libnx TOPDIR="$(TOPDIR)" libnx$(LIBEXT)
-
-staging$(DELIM)libnx$(LIBEXT): libs$(DELIM)libnx$(DELIM)libnx$(LIBEXT)
-	$(Q) $(call INSTALL_LIB,$<,$@)
-
-mm$(DELIM)libmm$(LIBEXT): context
-	$(Q) $(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT)
-
-staging$(DELIM)libmm$(LIBEXT): mm$(DELIM)libmm$(LIBEXT)
-	$(Q) $(call INSTALL_LIB,$<,$@)
diff --git a/tools/ProtectedLibs.mk b/tools/ProtectedLibs.mk
index 8edf90a..816bd7d 100644
--- a/tools/ProtectedLibs.mk
+++ b/tools/ProtectedLibs.mk
@@ -57,8 +57,8 @@ NUTTXLIBS += staging$(DELIM)libboards$(LIBEXT)
 
 NUTTXLIBS += staging$(DELIM)libstubs$(LIBEXT) staging$(DELIM)libkc$(LIBEXT)
 NUTTXLIBS += staging$(DELIM)libkmm$(LIBEXT) staging$(DELIM)libkarch$(LIBEXT)
-USERLIBS  += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libuc$(LIBEXT)
-USERLIBS  += staging$(DELIM)libumm$(LIBEXT) staging$(DELIM)libuarch$(LIBEXT)
+USERLIBS  += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libc$(LIBEXT)
+USERLIBS  += staging$(DELIM)libmm$(LIBEXT) staging$(DELIM)libarch$(LIBEXT)
 
 # Add libraries for two pass build support.  The special directory pass1
 # may be populated so that application generated logic can be included into
@@ -102,10 +102,10 @@ NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT)
 ifeq ($(CONFIG_NX),y)
 NUTTXLIBS += staging$(DELIM)libgraphics$(LIBEXT)
 NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT)
-USERLIBS  += staging$(DELIM)libunx$(LIBEXT)
+USERLIBS  += staging$(DELIM)libnx$(LIBEXT)
 else ifeq ($(CONFIG_NXFONTS),y)
 NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT)
-USERLIBS  += staging$(DELIM)libunx$(LIBEXT)
+USERLIBS  += staging$(DELIM)libnx$(LIBEXT)
 endif
 
 # Add libraries for the Audio sub-system