Browse Source

pack up source code

Chia-Che Tsai 9 years ago
parent
commit
bee9e6f390
4 changed files with 211 additions and 211 deletions
  1. 1 1
      LibOS/Makefile
  2. 191 191
      LibOS/glibc-2.17.patch
  3. 1 1
      Pal/Makefile
  4. 18 18
      Pal/linux-3.14.patch

+ 1 - 1
LibOS/Makefile

@@ -27,7 +27,7 @@ $(GLIBC_SRC)/configure:
 	[ -f $(GLIBC_SRC).tar.gz ] || \
 	wget http://ftp.gnu.org/gnu/glibc/$(GLIBC_SRC).tar.gz
 	tar -xzf $(GLIBC_SRC).tar.gz
-	[ ! -f $(GLIBC_SRC).patch ] || git apply $(GLIBC_SRC).patch
+	cd $(GLIBC_SRC) && patch -p1 < ../$(GLIBC_SRC).patch
 
 .PHONY: pack
 pack: $(GLIBC_TARGET)

+ 191 - 191
LibOS/glibc-2.17.patch

@@ -1,7 +1,7 @@
-diff --git a/LibOS/glibc-2.17/Makeconfig b/LibOS/glibc-2.17/Makeconfig
+diff --git a/Makeconfig b/Makeconfig
 index 70a3d9d..2c543c3 100644
---- a/LibOS/glibc-2.17/Makeconfig
-+++ b/LibOS/glibc-2.17/Makeconfig
+--- a/Makeconfig
++++ b/Makeconfig
 @@ -718,7 +718,8 @@ endif	# $(+cflags) == ""
  +sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
  +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
@@ -21,10 +21,10 @@ index 70a3d9d..2c543c3 100644
  	      $(add-on-subdirs) dlfcn elf
  
  ifndef avoid-generated
-diff --git a/LibOS/glibc-2.17/Makefile b/LibOS/glibc-2.17/Makefile
+diff --git a/Makefile b/Makefile
 index 6c1e392..3df0ac6 100644
---- a/LibOS/glibc-2.17/Makefile
-+++ b/LibOS/glibc-2.17/Makefile
+--- a/Makefile
++++ b/Makefile
 @@ -197,6 +197,8 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
  install-others-nosubdir: $(installed-stubs)
  endif
@@ -34,10 +34,10 @@ index 6c1e392..3df0ac6 100644
  
  # Since stubs.h is never needed when building the library, we simplify the
  # hairy installation process by producing it in place only as the last part
-diff --git a/LibOS/glibc-2.17/Versions.def b/LibOS/glibc-2.17/Versions.def
+diff --git a/Versions.def b/Versions.def
 index 3c9e0ae..034ab2b 100644
---- a/LibOS/glibc-2.17/Versions.def
-+++ b/LibOS/glibc-2.17/Versions.def
+--- a/Versions.def
++++ b/Versions.def
 @@ -39,6 +39,7 @@ libc {
    GCC_3.0
  %endif
@@ -77,10 +77,10 @@ index 3c9e0ae..034ab2b 100644
 +liblibos {
 +  GLIBC_2.12
 +}
-diff --git a/LibOS/glibc-2.17/configure b/LibOS/glibc-2.17/configure
+diff --git a/configure b/configure
 index 8799b7d..22e4c2c 100755
---- a/LibOS/glibc-2.17/configure
-+++ b/LibOS/glibc-2.17/configure
+--- a/configure
++++ b/configure
 @@ -636,7 +636,8 @@ SED
  MAKEINFO
  MSGFMT
@@ -280,10 +280,10 @@ index 8799b7d..22e4c2c 100755
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-toplevel-reorder -fno-section-anchors" >&5
  $as_echo_n "checking for -fno-toplevel-reorder -fno-section-anchors... " >&6; }
  if ${libc_cv_fno_toplevel_reorder+:} false; then :
-diff --git a/LibOS/glibc-2.17/configure.in b/LibOS/glibc-2.17/configure.in
+diff --git a/configure.in b/configure.in
 index d369382..38ff3cd 100644
---- a/LibOS/glibc-2.17/configure.in
-+++ b/LibOS/glibc-2.17/configure.in
+--- a/configure.in
++++ b/configure.in
 @@ -924,9 +924,25 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
  AC_CHECK_PROG_VER(AS, $AS, --version,
  		  [GNU assembler.* \([0-9]*\.[0-9.]*\)],
@@ -347,10 +347,10 @@ index d369382..38ff3cd 100644
  AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
  cat > conftest.c <<EOF
  int foo;
-diff --git a/LibOS/glibc-2.17/dlfcn/Versions b/LibOS/glibc-2.17/dlfcn/Versions
+diff --git a/dlfcn/Versions b/dlfcn/Versions
 index 97902f0..c1874c1 100644
---- a/LibOS/glibc-2.17/dlfcn/Versions
-+++ b/LibOS/glibc-2.17/dlfcn/Versions
+--- a/dlfcn/Versions
++++ b/dlfcn/Versions
 @@ -14,4 +14,7 @@ libdl {
    GLIBC_PRIVATE {
      _dlfcn_hook;
@@ -359,10 +359,10 @@ index 97902f0..c1874c1 100644
 +    syscalldb;
 +  }
  }
-diff --git a/LibOS/glibc-2.17/elf/Makefile b/LibOS/glibc-2.17/elf/Makefile
+diff --git a/elf/Makefile b/elf/Makefile
 index 6c7bc97..b51a799 100644
---- a/LibOS/glibc-2.17/elf/Makefile
-+++ b/LibOS/glibc-2.17/elf/Makefile
+--- a/elf/Makefile
++++ b/elf/Makefile
 @@ -21,7 +21,7 @@ subdir		:= elf
  
  include ../Makeconfig
@@ -382,10 +382,10 @@ index 6c7bc97..b51a799 100644
  ifeq (yes,$(use-ldconfig))
  dl-routines += dl-cache
  endif
-diff --git a/LibOS/glibc-2.17/elf/Versions b/LibOS/glibc-2.17/elf/Versions
+diff --git a/elf/Versions b/elf/Versions
 index 87e27c5..a0e345b 100644
---- a/LibOS/glibc-2.17/elf/Versions
-+++ b/LibOS/glibc-2.17/elf/Versions
+--- a/elf/Versions
++++ b/elf/Versions
 @@ -24,14 +24,15 @@ libc {
      _dl_open_hook;
      __libc_dlopen_mode; __libc_dlsym; __libc_dlclose;
@@ -417,10 +417,10 @@ index 87e27c5..a0e345b 100644
 +    syscalldb; glibc_vers_2_17; register_library;
 +  }
  }
-diff --git a/LibOS/glibc-2.17/elf/circleload1.c b/LibOS/glibc-2.17/elf/circleload1.c
+diff --git a/elf/circleload1.c b/elf/circleload1.c
 index 990ff84..ccf92d3 100644
---- a/LibOS/glibc-2.17/elf/circleload1.c
-+++ b/LibOS/glibc-2.17/elf/circleload1.c
+--- a/elf/circleload1.c
++++ b/elf/circleload1.c
 @@ -5,7 +5,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -430,10 +430,10 @@ index 990ff84..ccf92d3 100644
  
  static int
  check_loaded_objects (const char **loaded)
-diff --git a/LibOS/glibc-2.17/elf/dl-close.c b/LibOS/glibc-2.17/elf/dl-close.c
+diff --git a/elf/dl-close.c b/elf/dl-close.c
 index cda0e71..580e1e2 100644
---- a/LibOS/glibc-2.17/elf/dl-close.c
-+++ b/LibOS/glibc-2.17/elf/dl-close.c
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
 @@ -468,7 +468,7 @@ _dl_close_worker (struct link_map *map)
    /* Notify the debugger we are about to remove some loaded objects.  */
    struct r_debug *r = _dl_debug_initialize (0, nsid);
@@ -452,10 +452,10 @@ index cda0e71..580e1e2 100644
    LIBC_PROBE (unmap_complete, 2, nsid, r);
  
    /* Recheck if we need to retry, release the lock.  */
-diff --git a/LibOS/glibc-2.17/elf/dl-debug.c b/LibOS/glibc-2.17/elf/dl-debug.c
+diff --git a/elf/dl-debug.c b/elf/dl-debug.c
 index 4106e42..b95bd27 100644
---- a/LibOS/glibc-2.17/elf/dl-debug.c
-+++ b/LibOS/glibc-2.17/elf/dl-debug.c
+--- a/elf/dl-debug.c
++++ b/elf/dl-debug.c
 @@ -35,7 +35,7 @@ extern const int verify_link_map_members[(VERIFY_MEMBER (l_addr)
     normally finds it via the DT_DEBUG entry in the dynamic section, but in
     a statically-linked program there is no dynamic section for the debugger
@@ -496,10 +496,10 @@ index 4106e42..b95bd27 100644
  }
 -rtld_hidden_def (_dl_debug_state)
 +__attribute__((weak));
-diff --git a/LibOS/glibc-2.17/elf/dl-load.c b/LibOS/glibc-2.17/elf/dl-load.c
+diff --git a/elf/dl-load.c b/elf/dl-load.c
 index 70fe78f..4ec655a 100644
---- a/LibOS/glibc-2.17/elf/dl-load.c
-+++ b/LibOS/glibc-2.17/elf/dl-load.c
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
 @@ -39,6 +39,8 @@
  
  #include <dl-dst.h>
@@ -537,10 +537,10 @@ index 70fe78f..4ec655a 100644
    /* Now that the object is fully initialized add it to the object list.  */
    _dl_add_to_namespace_list (l, nsid);
  
-diff --git a/LibOS/glibc-2.17/elf/dl-open.c b/LibOS/glibc-2.17/elf/dl-open.c
+diff --git a/elf/dl-open.c b/elf/dl-open.c
 index 9c39a34..a21f51e 100644
---- a/LibOS/glibc-2.17/elf/dl-open.c
-+++ b/LibOS/glibc-2.17/elf/dl-open.c
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
 @@ -294,7 +294,7 @@ dl_open_worker (void *a)
    /* Notify the debugger all new objects are now ready to go.  */
    struct r_debug *r = _dl_debug_initialize (0, args->nsid);
@@ -550,10 +550,10 @@ index 9c39a34..a21f51e 100644
    LIBC_PROBE (map_complete, 3, args->nsid, r, new);
  
    /* Print scope information.  */
-diff --git a/LibOS/glibc-2.17/elf/link.h b/LibOS/glibc-2.17/elf/link.h
+diff --git a/elf/link.h b/elf/link.h
 index 11136cc..db5c4e3 100644
---- a/LibOS/glibc-2.17/elf/link.h
-+++ b/LibOS/glibc-2.17/elf/link.h
+--- a/elf/link.h
++++ b/elf/link.h
 @@ -64,7 +64,7 @@ struct r_debug
    };
  
@@ -563,10 +563,10 @@ index 11136cc..db5c4e3 100644
  
  /* This symbol refers to the "dynamic structure" in the `.dynamic' section
     of whatever module refers to `_DYNAMIC'.  So, to find its own
-diff --git a/LibOS/glibc-2.17/elf/loadtest.c b/LibOS/glibc-2.17/elf/loadtest.c
+diff --git a/elf/loadtest.c b/elf/loadtest.c
 index 727469b..568ddef 100644
---- a/LibOS/glibc-2.17/elf/loadtest.c
-+++ b/LibOS/glibc-2.17/elf/loadtest.c
+--- a/elf/loadtest.c
++++ b/elf/loadtest.c
 @@ -70,7 +70,7 @@ static const struct
  
  #include <include/link.h>
@@ -576,10 +576,10 @@ index 727469b..568ddef 100644
  
  #define OUT \
    for (map = MAPS; map != NULL; map = map->l_next)		      \
-diff --git a/LibOS/glibc-2.17/elf/neededtest.c b/LibOS/glibc-2.17/elf/neededtest.c
+diff --git a/elf/neededtest.c b/elf/neededtest.c
 index 3cea499..e098d48 100644
---- a/LibOS/glibc-2.17/elf/neededtest.c
-+++ b/LibOS/glibc-2.17/elf/neededtest.c
+--- a/elf/neededtest.c
++++ b/elf/neededtest.c
 @@ -5,7 +5,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -589,10 +589,10 @@ index 3cea499..e098d48 100644
  
  static int
  check_loaded_objects (const char **loaded)
-diff --git a/LibOS/glibc-2.17/elf/neededtest2.c b/LibOS/glibc-2.17/elf/neededtest2.c
+diff --git a/elf/neededtest2.c b/elf/neededtest2.c
 index 17c75f2..5a73a95 100644
---- a/LibOS/glibc-2.17/elf/neededtest2.c
-+++ b/LibOS/glibc-2.17/elf/neededtest2.c
+--- a/elf/neededtest2.c
++++ b/elf/neededtest2.c
 @@ -5,7 +5,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -602,10 +602,10 @@ index 17c75f2..5a73a95 100644
  
  static int
  check_loaded_objects (const char **loaded)
-diff --git a/LibOS/glibc-2.17/elf/neededtest3.c b/LibOS/glibc-2.17/elf/neededtest3.c
+diff --git a/elf/neededtest3.c b/elf/neededtest3.c
 index 41970cf..5126615 100644
---- a/LibOS/glibc-2.17/elf/neededtest3.c
-+++ b/LibOS/glibc-2.17/elf/neededtest3.c
+--- a/elf/neededtest3.c
++++ b/elf/neededtest3.c
 @@ -5,7 +5,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -615,10 +615,10 @@ index 41970cf..5126615 100644
  
  static int
  check_loaded_objects (const char **loaded)
-diff --git a/LibOS/glibc-2.17/elf/neededtest4.c b/LibOS/glibc-2.17/elf/neededtest4.c
+diff --git a/elf/neededtest4.c b/elf/neededtest4.c
 index 0ae0b7f..f883910 100644
---- a/LibOS/glibc-2.17/elf/neededtest4.c
-+++ b/LibOS/glibc-2.17/elf/neededtest4.c
+--- a/elf/neededtest4.c
++++ b/elf/neededtest4.c
 @@ -5,7 +5,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -628,10 +628,10 @@ index 0ae0b7f..f883910 100644
  
  static int
  check_loaded_objects (const char **loaded)
-diff --git a/LibOS/glibc-2.17/elf/rtld.c b/LibOS/glibc-2.17/elf/rtld.c
+diff --git a/elf/rtld.c b/elf/rtld.c
 index b0126e5..2fb4fe9 100644
---- a/LibOS/glibc-2.17/elf/rtld.c
-+++ b/LibOS/glibc-2.17/elf/rtld.c
+--- a/elf/rtld.c
++++ b/elf/rtld.c
 @@ -356,6 +356,23 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
    return start_addr;
  }
@@ -739,10 +739,10 @@ index b0126e5..2fb4fe9 100644
    LIBC_PROBE (init_complete, 2, LM_ID_BASE, r);
  
  #if defined USE_LDCONFIG && !defined MAP_COPY
-diff --git a/LibOS/glibc-2.17/elf/unload.c b/LibOS/glibc-2.17/elf/unload.c
+diff --git a/elf/unload.c b/elf/unload.c
 index 4566f22..73046de 100644
---- a/LibOS/glibc-2.17/elf/unload.c
-+++ b/LibOS/glibc-2.17/elf/unload.c
+--- a/elf/unload.c
++++ b/elf/unload.c
 @@ -9,7 +9,7 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -752,10 +752,10 @@ index 4566f22..73046de 100644
  
  #define OUT \
    for (map = MAPS; map != NULL; map = map->l_next)			      \
-diff --git a/LibOS/glibc-2.17/elf/unload2.c b/LibOS/glibc-2.17/elf/unload2.c
+diff --git a/elf/unload2.c b/elf/unload2.c
 index eef2bfd..a21d2ac 100644
---- a/LibOS/glibc-2.17/elf/unload2.c
-+++ b/LibOS/glibc-2.17/elf/unload2.c
+--- a/elf/unload2.c
++++ b/elf/unload2.c
 @@ -6,7 +6,7 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -765,10 +765,10 @@ index eef2bfd..a21d2ac 100644
  
  #define OUT \
    for (map = MAPS; map != NULL; map = map->l_next)			      \
-diff --git a/LibOS/glibc-2.17/nptl/Makefile b/LibOS/glibc-2.17/nptl/Makefile
+diff --git a/nptl/Makefile b/nptl/Makefile
 index e33432e..8ec263f 100644
---- a/LibOS/glibc-2.17/nptl/Makefile
-+++ b/LibOS/glibc-2.17/nptl/Makefile
+--- a/nptl/Makefile
++++ b/nptl/Makefile
 @@ -20,7 +20,7 @@
  #
  subdir	:= nptl
@@ -778,10 +778,10 @@ index e33432e..8ec263f 100644
  
  extra-libs := libpthread
  extra-libs-others := $(extra-libs)
-diff --git a/LibOS/glibc-2.17/nptl/Versions b/LibOS/glibc-2.17/nptl/Versions
+diff --git a/nptl/Versions b/nptl/Versions
 index 6a10375..4a1eb35 100644
---- a/LibOS/glibc-2.17/nptl/Versions
-+++ b/LibOS/glibc-2.17/nptl/Versions
+--- a/nptl/Versions
++++ b/nptl/Versions
 @@ -31,6 +31,9 @@ libc {
      # Internal libc interface to libpthread
      __libc_dl_error_tsd;
@@ -801,10 +801,10 @@ index 6a10375..4a1eb35 100644
 +    syscalldb;
 +  }
  }
-diff --git a/LibOS/glibc-2.17/nptl/pthread_create.c b/LibOS/glibc-2.17/nptl/pthread_create.c
+diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
 index 197dfa7..6cf8fa6 100644
---- a/LibOS/glibc-2.17/nptl/pthread_create.c
-+++ b/LibOS/glibc-2.17/nptl/pthread_create.c
+--- a/nptl/pthread_create.c
++++ b/nptl/pthread_create.c
 @@ -398,8 +398,11 @@ start_thread (void *arg)
  # error "to do"
  #endif
@@ -817,10 +817,10 @@ index 197dfa7..6cf8fa6 100644
  
    /* If the thread is detached free the TCB.  */
    if (IS_DETACHED (pd))
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
 index 31bb08b..4729064 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
 @@ -111,7 +111,8 @@ ENTRY(__pthread_disable_asynccancel)
  	xorq	%r10, %r10
  	addq	$CANCELHANDLING, %rdi
@@ -831,10 +831,10 @@ index 31bb08b..4729064 100644
  	movl	%fs:CANCELHANDLING, %eax
  	jmp	3b
  END(__pthread_disable_asynccancel)
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c b/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
 index dedbabd..5bd873e 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c
 @@ -21,10 +21,20 @@
  #include <sysdep.h>
  #include <tls.h>
@@ -858,10 +858,10 @@ index dedbabd..5bd873e 100644
 +#endif
  
  #include "../fork.c"
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
 index dc95421..a772f66 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
 @@ -90,7 +90,7 @@ __lll_lock_wait_private:
  
  1:	LIBC_PROBE (lll_lock_wait_private, 1, %rdi)
@@ -925,10 +925,10 @@ index dc95421..a772f66 100644
  
  	cmpl	$0, (%rdi)
  	jne	1f
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
 index 5a80ddd..f7319ca 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
 @@ -214,7 +214,7 @@ LLL_STUB_UNWIND_INFO_END
      register const struct timespec *__to __asm ("r10") = timeout;	      \
      int __status;							      \
@@ -974,10 +974,10 @@ index 5a80ddd..f7319ca 100644
  			"cmpl $0, (%%rdi)\n\t"				      \
  			"jne 1b"					      \
  			: "=&a" (__ignore)				      \
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
 index 0b4ef71..36c5572 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
 @@ -80,7 +80,7 @@ __lll_robust_lock_wait:
  	jnz	2f
  
@@ -1005,10 +1005,10 @@ index 0b4ef71..36c5572 100644
  	movq	%rax, %rcx
  
  	movl	(%r12), %eax
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
 index 61c2f54..e70362c 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
 @@ -62,7 +62,7 @@ pthread_barrier_wait:
  #endif
  	xorq	%r10, %r10
@@ -1027,10 +1027,10 @@ index 61c2f54..e70362c 100644
  
  	/* Increment LEFT.  If this brings the count back to the
  	   initial count unlock the object.  */
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
 index 67ff5fc..a95f808 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
 @@ -90,7 +90,7 @@ __pthread_cond_broadcast:
  	movl	$SYS_futex, %eax
  	movl	$1, %edx
@@ -1058,10 +1058,10 @@ index 67ff5fc..a95f808 100644
  	jmp	10b
  	.size	__pthread_cond_broadcast, .-__pthread_cond_broadcast
  versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
 index 3bff19b..80f4b47 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
 @@ -82,7 +82,7 @@ __pthread_cond_signal:
  	addq	$cond_lock, %r8
  #endif
@@ -1089,10 +1089,10 @@ index 3bff19b..80f4b47 100644
  
  	/* Unlock.  */
  4:	LOCK
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
 index 15e451a..14b768a 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
 @@ -188,7 +188,7 @@ __pthread_cond_timedwait:
  	movq	%r12, %rdx
  	addq	$cond_futex, %rdi
@@ -1164,10 +1164,10 @@ index 15e451a..14b768a 100644
  
  	/* Lock the mutex only if we don't own it already.  This only happens
  	   in case of PI mutexes, if we got cancelled after a successful
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
 index 2c6b515..296659c 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
 @@ -138,7 +138,7 @@ __pthread_cond_wait:
  
  	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
@@ -1213,10 +1213,10 @@ index 2c6b515..296659c 100644
  
  	/* Lock the mutex only if we don't own it already.  This only happens
  	   in case of PI mutexes, if we got cancelled after a successful
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
 index 7f5c081..38ecb12 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
 @@ -90,7 +90,7 @@ __pthread_once:
  # endif
  #endif
@@ -1244,10 +1244,10 @@ index 7f5c081..38ecb12 100644
  
  	movq	%r8, %rdi
  .LcallUR:
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
 index 264ba58..c54f316 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
 @@ -82,7 +82,7 @@ __pthread_rwlock_rdlock:
  #endif
  	addq	$READERS_WAKEUP, %rdi
@@ -1257,10 +1257,10 @@ index 264ba58..c54f316 100644
  
  	subq	$READERS_WAKEUP, %rdi
  
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
 index f60530e..fb7894a 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
 @@ -109,7 +109,7 @@ pthread_rwlock_timedrdlock:
  #endif
  21:	leaq	READERS_WAKEUP(%r12), %rdi
@@ -1270,10 +1270,10 @@ index f60530e..fb7894a 100644
  	movq	%rax, %rdx
  
  #ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
 index 7870733..f9eee96 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
 @@ -107,7 +107,7 @@ pthread_rwlock_timedwrlock:
  #endif
  21:	leaq	WRITERS_WAKEUP(%r12), %rdi
@@ -1283,10 +1283,10 @@ index 7870733..f9eee96 100644
  	movq	%rax, %rdx
  
  #ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
 index e971529..bdd1f4d 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
 @@ -79,7 +79,7 @@ __pthread_rwlock_unlock:
  #endif
  	movl	$SYS_futex, %eax
@@ -1296,10 +1296,10 @@ index e971529..bdd1f4d 100644
  
  	xorl	%eax, %eax
  	retq
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
 index ff5392c..1afe769 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
 @@ -80,7 +80,7 @@ __pthread_rwlock_wrlock:
  #endif
  	addq	$WRITERS_WAKEUP, %rdi
@@ -1309,10 +1309,10 @@ index ff5392c..1afe769 100644
  
  	subq	$WRITERS_WAKEUP, %rdi
  
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
 index 65e715d..7152395 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
 @@ -52,7 +52,7 @@ sem_post:
  	movl	$FUTEX_WAKE, %esi
  	orl	PRIVATE(%rdi), %esi
@@ -1322,10 +1322,10 @@ index 65e715d..7152395 100644
  
  	testq	%rax, %rax
  	js	1f
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
 index acb79db..f9db4d1 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
 @@ -97,7 +97,7 @@ sem_timedwait:
  	orl	PRIVATE(%rdi), %esi
  	movl	$SYS_futex, %eax
@@ -1344,10 +1344,10 @@ index acb79db..f9db4d1 100644
  	movq	%rax, %r14
  
  	movl	16(%rsp), %edi
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
+diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
 index 7f91148..ac4b8e8 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
+--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
++++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
 @@ -81,7 +81,7 @@ sem_wait:
  	orl	PRIVATE(%rdi), %esi
  #endif
@@ -1357,10 +1357,10 @@ index 7f91148..ac4b8e8 100644
  	movq	%rax, %rcx
  
  	xchgq	%r8, %rdi
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/x86_64/pthreaddef.h b/LibOS/glibc-2.17/nptl/sysdeps/x86_64/pthreaddef.h
+diff --git a/nptl/sysdeps/x86_64/pthreaddef.h b/nptl/sysdeps/x86_64/pthreaddef.h
 index 50587b8..374b553 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/x86_64/pthreaddef.h
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/x86_64/pthreaddef.h
+--- a/nptl/sysdeps/x86_64/pthreaddef.h
++++ b/nptl/sysdeps/x86_64/pthreaddef.h
 @@ -48,4 +48,5 @@
  
  /* While there is no such syscall.  */
@@ -1368,10 +1368,10 @@ index 50587b8..374b553 100644
 -  asm volatile ("syscall" :: "a" (__NR_exit), "D" (val))
 +  asm volatile ("pushq %%rbx\n\tmovq syscalldb@GOTPCREL(%%rip), %%rbx\n\t" \
 +		"call %%rbx\n\t" :: "a" (__NR_exit), "D" (val) : "bx" )
-diff --git a/LibOS/glibc-2.17/nptl/sysdeps/x86_64/tls.h b/LibOS/glibc-2.17/nptl/sysdeps/x86_64/tls.h
+diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
 index f3b7649..433b8c9 100644
---- a/LibOS/glibc-2.17/nptl/sysdeps/x86_64/tls.h
-+++ b/LibOS/glibc-2.17/nptl/sysdeps/x86_64/tls.h
+--- a/nptl/sysdeps/x86_64/tls.h
++++ b/nptl/sysdeps/x86_64/tls.h
 @@ -28,6 +28,7 @@
  # include <sysdep.h>
  # include <libc-internal.h>
@@ -1413,10 +1413,10 @@ index f3b7649..433b8c9 100644
  		   : "=a" (_result)					      \
  		   : "0" ((unsigned long int) __NR_arch_prctl),		      \
  		     "D" ((unsigned long int) ARCH_SET_FS),		      \
-diff --git a/LibOS/glibc-2.17/scripts/mkinstalldirs b/LibOS/glibc-2.17/scripts/mkinstalldirs
+diff --git a/scripts/mkinstalldirs b/scripts/mkinstalldirs
 index f945dbf..3c0e48c 100755
---- a/LibOS/glibc-2.17/scripts/mkinstalldirs
-+++ b/LibOS/glibc-2.17/scripts/mkinstalldirs
+--- a/scripts/mkinstalldirs
++++ b/scripts/mkinstalldirs
 @@ -20,9 +20,9 @@ do
       esac
  
@@ -1429,20 +1429,20 @@ index f945dbf..3c0e48c 100755
  
          if test ! -d "$pathcomp"; then
    	  errstatus=$lasterr
-diff --git a/LibOS/glibc-2.17/shlib-versions b/LibOS/glibc-2.17/shlib-versions
+diff --git a/shlib-versions b/shlib-versions
 index 9344590..4edb370 100644
---- a/LibOS/glibc-2.17/shlib-versions
-+++ b/LibOS/glibc-2.17/shlib-versions
+--- a/shlib-versions
++++ b/shlib-versions
 @@ -107,3 +107,5 @@ sparc64.*-.*-.*		libBrokenLocale=1	GLIBC_2.2
  # This defines the libgcc soname version this glibc is to load for
  # asynchronous cancellation to work correctly.
  .*-.*-.*		libgcc_s=1
 +
 +.*-.*-.*		liblibos=1
-diff --git a/LibOS/glibc-2.17/sysdeps/generic/ldsodefs.h b/LibOS/glibc-2.17/sysdeps/generic/ldsodefs.h
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
 index c667e34..9803b8a 100644
---- a/LibOS/glibc-2.17/sysdeps/generic/ldsodefs.h
-+++ b/LibOS/glibc-2.17/sysdeps/generic/ldsodefs.h
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
 @@ -854,8 +854,7 @@ extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,
     any shared object mappings.  The `r_state' member of `struct r_debug'
     says what change is taking place.  This function's address is
@@ -1453,10 +1453,10 @@ index c667e34..9803b8a 100644
  
  /* Initialize `struct r_debug' if it has not already been done.  The
     argument is the run-time load address of the dynamic linker, to be put
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/_exit.c b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/_exit.c
+diff --git a/sysdeps/unix/sysv/linux/_exit.c b/sysdeps/unix/sysv/linux/_exit.c
 index 18c4fce..a21fb32 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/_exit.c
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/_exit.c
+--- a/sysdeps/unix/sysv/linux/_exit.c
++++ b/sysdeps/unix/sysv/linux/_exit.c
 @@ -29,9 +29,9 @@ _exit (status)
    while (1)
      {
@@ -1469,10 +1469,10 @@ index 18c4fce..a21fb32 100644
  
  #ifdef ABORT_INSTRUCTION
        ABORT_INSTRUCTION;
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
 index d9bdb67..9719699 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
++++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
 @@ -84,7 +84,8 @@ ENTRY(____longjmp_chk)
  	xorl	%edi, %edi
  	lea	-sizeSS(%rsp), %RSI_LP
@@ -1483,10 +1483,10 @@ index d9bdb67..9719699 100644
  	/* Without working sigaltstack we cannot perform the test.  */
  	testl	%eax, %eax
  	jne	.Lok2
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
+diff --git a/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
 index f712110..f6bad14 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
+--- a/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
++++ b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
 @@ -1,5 +1,6 @@
  #include "bits/libc-vdso.h"
  
@@ -1501,10 +1501,10 @@ index f712110..f6bad14 100644
 +#endif
  
  #include "../clock_gettime.c"
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clone.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clone.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/clone.S b/sysdeps/unix/sysv/linux/x86_64/clone.S
 index 53f9fbd..80d28b5 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clone.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/clone.S
+--- a/sysdeps/unix/sysv/linux/x86_64/clone.S
++++ b/sysdeps/unix/sysv/linux/x86_64/clone.S
 @@ -61,11 +61,15 @@ ENTRY (BP_SYM (__clone))
  	jz	SYSCALL_ERROR_LABEL
  
@@ -1550,10 +1550,10 @@ index 53f9fbd..80d28b5 100644
  	popq	%rax		/* Function to call.  */
  	popq	%rdi		/* Argument.  */
  	call	*%rax
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
 index 5f2b64c..df57736 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/getcontext.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S
++++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
 @@ -75,7 +75,7 @@ ENTRY(__getcontext)
  #endif
  	movl	$_NSIG8,%r10d
@@ -1563,10 +1563,10 @@ index 5f2b64c..df57736 100644
  	cmpq	$-4095, %rax		/* Check %rax for error.  */
  	jae	SYSCALL_ERROR_LABEL	/* Jump to error handler if error.  */
  
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
 index d52f938..d75b502 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
++++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
 @@ -17,6 +17,7 @@
  
  #include <sys/time.h>
@@ -1592,10 +1592,10 @@ index d52f938..d75b502 100644
 -#endif
  weak_alias (__gettimeofday, gettimeofday)
  libc_hidden_weak (gettimeofday)
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
 index 3b319d7..98d8612 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+--- a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
++++ b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
 @@ -30,6 +30,7 @@ ENTRY (sched_getcpu)
  	sub	$0x8, %rsp
  	cfi_adjust_cfa_offset(8)
@@ -1631,10 +1631,10 @@ index 3b319d7..98d8612 100644
  	movq	$VSYSCALL_ADDR_vgetcpu, %rax
  	callq	*%rax
  1:
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/setcontext.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
 index adcb243..0d662e3 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/setcontext.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/setcontext.S
+--- a/sysdeps/unix/sysv/linux/x86_64/setcontext.S
++++ b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
 @@ -43,7 +43,7 @@ ENTRY(__setcontext)
  	movl	$SIG_SETMASK, %edi
  	movl	$_NSIG8,%r10d
@@ -1644,10 +1644,10 @@ index adcb243..0d662e3 100644
  	popq	%rdi			/* Reload %rdi, adjust stack.  */
  	cfi_adjust_cfa_offset(-8)
  	cmpq	$-4095, %rax		/* Check %rax for error.  */
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
 index 5a3ad18..9ac8b6e 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sigaction.c
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
++++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
 @@ -129,7 +129,8 @@ asm									\
     "	.type __" #name ",@function\n"					\
     "__" #name ":\n"							\
@@ -1658,10 +1658,10 @@ index 5a3ad18..9ac8b6e 100644
     ".LEND_" #name ":\n"							\
     ".section .eh_frame,\"a\",@progbits\n"				\
     ".LSTARTFRAME_" #name ":\n"						\
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/swapcontext.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
 index 0d04a01..e8483db 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
+--- a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
++++ b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
 @@ -75,7 +75,7 @@ ENTRY(__swapcontext)
  	movl	$SIG_SETMASK, %edi
  	movl	$_NSIG8,%r10d
@@ -1671,10 +1671,10 @@ index 0d04a01..e8483db 100644
  	cmpq	$-4095, %rax		/* Check %rax for error.  */
  	jae	SYSCALL_ERROR_LABEL	/* Jump to error handler if error.  */
  
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/syscall.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/syscall.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/syscall.S b/sysdeps/unix/sysv/linux/x86_64/syscall.S
 index 87dfd8c..c144b42 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/syscall.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/syscall.S
+--- a/sysdeps/unix/sysv/linux/x86_64/syscall.S
++++ b/sysdeps/unix/sysv/linux/x86_64/syscall.S
 @@ -34,7 +34,7 @@ ENTRY (syscall)
  	movq %r8, %r10
  	movq %r9, %r8
@@ -1684,10 +1684,10 @@ index 87dfd8c..c144b42 100644
  	cmpq $-4095, %rax	/* Check %rax for error.  */
  	jae SYSCALL_ERROR_LABEL	/* Jump to error handler if error.  */
  	ret			/* Return to caller.  */
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
 index 5323104..d466181 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sysdep.h
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
++++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
 @@ -23,6 +23,7 @@
  #include <bp-sym.h>
  #include <bp-asm.h>
@@ -1816,10 +1816,10 @@ index 5323104..d466181 100644
  
  # define LOAD_ARGS_0()
  # define LOAD_REGS_0
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/time.c b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/time.c
+diff --git a/sysdeps/unix/sysv/linux/x86_64/time.c b/sysdeps/unix/sysv/linux/x86_64/time.c
 deleted file mode 100644
 index 65703ca..0000000
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/time.c
+--- a/sysdeps/unix/sysv/linux/x86_64/time.c
 +++ /dev/null
 @@ -1,60 +0,0 @@
 -/* Copyright (C) 2001,02,2003,2011 Free Software Foundation, Inc.
@@ -1882,10 +1882,10 @@ index 65703ca..0000000
 -}
 -
 -#endif
-diff --git a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/vfork.S b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/vfork.S
+diff --git a/sysdeps/unix/sysv/linux/x86_64/vfork.S b/sysdeps/unix/sysv/linux/x86_64/vfork.S
 index c28087d..ea4ff9f 100644
---- a/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/vfork.S
-+++ b/LibOS/glibc-2.17/sysdeps/unix/sysv/linux/x86_64/vfork.S
+--- a/sysdeps/unix/sysv/linux/x86_64/vfork.S
++++ b/sysdeps/unix/sysv/linux/x86_64/vfork.S
 @@ -38,7 +38,7 @@ ENTRY (__vfork)
  
  	/* Stuff the syscall number in RAX and enter into the kernel.  */
@@ -1895,10 +1895,10 @@ index c28087d..ea4ff9f 100644
  
  	/* Push back the return PC.  */
  	pushq	%rdi
-diff --git a/LibOS/glibc-2.17/sysdeps/x86_64/dl-machine.h b/LibOS/glibc-2.17/sysdeps/x86_64/dl-machine.h
+diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
 index d2654aa..9bd840f 100644
---- a/LibOS/glibc-2.17/sysdeps/x86_64/dl-machine.h
-+++ b/LibOS/glibc-2.17/sysdeps/x86_64/dl-machine.h
+--- a/sysdeps/x86_64/dl-machine.h
++++ b/sysdeps/x86_64/dl-machine.h
 @@ -511,7 +511,8 @@ elf_machine_lazy_rel (struct link_map *map,
  	value = ((ElfW(Addr) (*) (void)) value) ();
        *reloc_addr = value;

+ 1 - 1
Pal/Makefile

@@ -30,7 +30,7 @@ $(LINUX_SRC)/Makefile:
 	[ -f $(LINUX_SRC).tar.gz ] || \
 	wget https://www.kernel.org/pub/linux/kernel/v$(LINUX_GEN)/$(LINUX_SRC).tar.gz
 	tar -xzf $(LINUX_SRC).tar.gz
-	[ ! -f $(LINUX_SRC).patch ] || git apply $(LINUX_SRC).patch
+	cd $(LINUX_SRC) && patch -p1 < ../$(LINUX_SRC).patch
 
 $(LINUX_SRC)/graphene: linux-kernel/graphene
 	cd $(LINUX_SRC) && ln -s ../linux-kernel/graphene graphene

+ 18 - 18
Pal/linux-3.14.patch

@@ -1,16 +1,16 @@
-diff --git a/Pal/linux-3.14/Kconfig b/Pal/linux-3.14/Kconfig
+diff --git a/Kconfig b/Kconfig
 index c13f48d..e18713e 100644
---- a/Pal/linux-3.14/Kconfig
-+++ b/Pal/linux-3.14/Kconfig
+--- a/Kconfig
++++ b/Kconfig
 @@ -9,3 +9,4 @@ config SRCARCH
  	option env="SRCARCH"
  
  source "arch/$SRCARCH/Kconfig"
 +source "graphene/Kconfig"
-diff --git a/Pal/linux-3.14/Makefile b/Pal/linux-3.14/Makefile
+diff --git a/Makefile b/Makefile
 index e5ac8a6..116ac82 100644
---- a/Pal/linux-3.14/Makefile
-+++ b/Pal/linux-3.14/Makefile
+--- a/Makefile
++++ b/Makefile
 @@ -779,7 +779,7 @@ export mod_sign_cmd
  
  
@@ -20,10 +20,10 @@ index e5ac8a6..116ac82 100644
  
  vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
  		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-diff --git a/Pal/linux-3.14/include/linux/miscdevice.h b/Pal/linux-3.14/include/linux/miscdevice.h
+diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
 index 3737f72..f7a4aba 100644
---- a/Pal/linux-3.14/include/linux/miscdevice.h
-+++ b/Pal/linux-3.14/include/linux/miscdevice.h
+--- a/include/linux/miscdevice.h
++++ b/include/linux/miscdevice.h
 @@ -3,6 +3,7 @@
  #include <linux/major.h>
  #include <linux/list.h>
@@ -32,10 +32,10 @@ index 3737f72..f7a4aba 100644
  
  /*
   *	These allocations are managed by device@lanana.org. If you use an
-diff --git a/Pal/linux-3.14/include/linux/sched.h b/Pal/linux-3.14/include/linux/sched.h
+diff --git a/include/linux/sched.h b/include/linux/sched.h
 index a781dec..3381137 100644
---- a/Pal/linux-3.14/include/linux/sched.h
-+++ b/Pal/linux-3.14/include/linux/sched.h
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
 @@ -1161,6 +1161,11 @@ enum perf_event_task_context {
  	perf_nr_task_contexts,
  };
@@ -60,10 +60,10 @@ index a781dec..3381137 100644
  };
  
  /* Future-safe accessor for struct task_struct's cpus_allowed. */
-diff --git a/Pal/linux-3.14/kernel/fork.c b/Pal/linux-3.14/kernel/fork.c
+diff --git a/kernel/fork.c b/kernel/fork.c
 index a17621c..41d5958 100644
---- a/Pal/linux-3.14/kernel/fork.c
-+++ b/Pal/linux-3.14/kernel/fork.c
+--- a/kernel/fork.c
++++ b/kernel/fork.c
 @@ -11,6 +11,7 @@
   * management can be a bitch. See 'mm/memory.c': 'copy_page_range()'
   */
@@ -111,10 +111,10 @@ index a17621c..41d5958 100644
  	/*
  	 * One for us, one for whoever does the "release_task()" (usually
  	 * parent)
-diff --git a/Pal/linux-3.14/security/apparmor/lsm.c b/Pal/linux-3.14/security/apparmor/lsm.c
+diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
 index 4257b7e..b21c19d 100644
---- a/Pal/linux-3.14/security/apparmor/lsm.c
-+++ b/Pal/linux-3.14/security/apparmor/lsm.c
+--- a/security/apparmor/lsm.c
++++ b/security/apparmor/lsm.c
 @@ -36,6 +36,10 @@
  #include "include/policy.h"
  #include "include/procattr.h"