Removes user symlinks from the sysroot (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Jun 2015 14:49:58 +0000 (10:49 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Jun 2015 19:15:52 +0000 (15:15 -0400)
And installs user headers into sysroot/usr/include/libname/.  Now all
programs must include user libraries with #include <libname/header.h>.
I fixed up all of our tests, but external programs will need to be
changed manually.

To be sure these changes kicked in, remove your existing toolchain
installation and rebuild.  Then rebuild all other programs.

$ cd tools/compilers/gcc-glibc/
$ make inst-clean
$ make x86_64

tools/compilers/gcc-glibc/Makefile
user/Makefrag-user-lib

index ab6da32..ee3bcae 100644 (file)
@@ -396,8 +396,9 @@ $(BINARY_PREFIX)gcc-stage2-builddir: gcc-$(GCC_VERSION)
        mkdir $(SYSROOT)/usr/include/ros/arch
        cp -r $(ROSDIR)/kern/arch/$(ROS_ARCH_DIR)/ros/* \
            $(SYSROOT)/usr/include/ros/arch/
+       mkdir -p $(SYSROOT)/usr/include/parlib
        cp -r $(ROSDIR)/user/parlib/include/* \
-           $(SYSROOT)/usr/include/
+           $(SYSROOT)/usr/include/parlib/
        cp -r $(ROSDIR)/user/pthread/*.h \
            $(SYSROOT)/usr/include/
        rm -rf $(SYSROOT)/usr/include/arch
index c920ae5..8af4829 100644 (file)
@@ -44,11 +44,13 @@ $(FINALLIB): $(OBJS)
        @mkdir -p $(@D)
        $(Q)$(AR) rc $@ $(OBJS)
 
+# The last rm is for the symlink
 $(FINALLIB-INSTALL): $(FINALLIB)
        @cp $(FINALLIB) $@
-       @cp -R $(INCDIR)/* $(XCC_TARGET_INCLUDE)/
        @rm -rf $(XCC_TARGET_INCLUDE)/$(LIBNAME)
-       @ln -fs . $(XCC_TARGET_INCLUDE)/$(LIBNAME)
+       @mkdir $(XCC_TARGET_INCLUDE)/$(LIBNAME)
+       @cp -r $(INCDIR)/* $(XCC_TARGET_INCLUDE)/$(LIBNAME)/
+       @rm $(XCC_TARGET_INCLUDE)/$(LIBNAME)/$(LIBNAME)
 
 install: $(FINALLIB-INSTALL)
        @echo > /dev/null