Merge "Remove an awkward #include that is no longer upstream."
diff --git a/libc/arch-sh/syscalls/tgkill.S b/libc/arch-sh/syscalls/tgkill.S
deleted file mode 100644
index 222f836..0000000
--- a/libc/arch-sh/syscalls/tgkill.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* autogenerated by gensyscalls.py */
-#include <sys/linux-syscalls.h>
-
-    .text
-    .type tgkill, @function
-    .globl tgkill
-    .align 4
-
-tgkill:
-
-    /* invoke trap */
-    mov.l   0f, r3  /* trap num */
-    trapa   #(3 + 0x10)
-
-    /* check return value */
-    cmp/pz  r0
-    bt      __NR_tgkill_end
-
-    /* keep error number */
-    sts.l   pr, @-r15
-    mov.l   1f, r1
-    jsr     @r1
-    mov     r0, r4
-    lds.l   @r15+, pr
-
-__NR_tgkill_end:
-    rts
-    nop
-
-    .align  2
-0:  .long   __NR_tgkill
-1:  .long   __set_syscall_errno
diff --git a/libc/arch-x86/bionic/syscall.S b/libc/arch-x86/bionic/syscall.S
index 8370f0b..49d6f8d 100644
--- a/libc/arch-x86/bionic/syscall.S
+++ b/libc/arch-x86/bionic/syscall.S
@@ -1,15 +1,13 @@
 /*
  * Generic syscall call.
- * Upon entry
- *	%eax: system call number
- *	%ebx: arg0 to system call
- *	%ecx: arg..
- *	%edx: arg..
- *	%esi: arg..
- *	%edi: arg..
- * We push these (to save them) load them up with the
- * values from the calling frame (not all will actually be valid)
- * and make the syscall.
+ * Upon entry:
+ *	%eax: system call number  - caller save
+ *	%ebx: arg0 to system call -   callee save
+ *	%ecx: arg1                - caller save
+ *	%edx: arg2                - caller save
+ *	%esi: arg3                -   callee save
+ *	%edi: arg4                -   callee save
+ *	%ebp: arg5                -   callee save
  */
 
 #include <sys/linux-syscalls.h>
@@ -20,26 +18,37 @@
     .align 4
 
 syscall:
+    # Push the callee save registers.
     push    %ebx
     push    %esi
     push    %edi
-    mov     16(%esp),%eax
-    mov     20(%esp),%ebx
-    mov     24(%esp),%ecx
-    mov     28(%esp),%edx
-    mov     32(%esp),%esi
-    mov     36(%esp),%edi
+    push    %ebp
 
+    # Load all the arguments from the calling frame.
+    # (Not all will be valid, depending on the syscall.)
+    mov     20(%esp),%eax
+    mov     24(%esp),%ebx
+    mov     28(%esp),%ecx
+    mov     32(%esp),%edx
+    mov     36(%esp),%esi
+    mov     40(%esp),%edi
+    mov     44(%esp),%ebp
+
+    # Make the system call.
     int     $0x80
 
+    # Error?
     cmpl    $-4095, %eax
     jb      1f
+    # Yes, so set errno.
     negl    %eax
     pushl   %eax
     call    __set_errno
     addl    $4, %esp
     orl     $-1, %eax
 1:
+    # Restore the callee save registers.
+    pop    %ebp
     pop    %edi
     pop    %esi
     pop    %ebx
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 987a5e3..f088e33 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -502,11 +502,18 @@
 #include <android/api-level.h>
 
 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+#if defined(__clang__)
+#define __BIONIC_FORTIFY_INLINE \
+    extern inline \
+    __attribute__ ((always_inline)) \
+    __attribute__ ((artificial))
+#else
 #define __BIONIC_FORTIFY_INLINE \
     extern inline \
     __attribute__ ((always_inline)) \
     __attribute__ ((gnu_inline)) \
     __attribute__ ((artificial))
+#endif
 #define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1)
 #endif
 
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index af19554..4658866 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -127,9 +127,20 @@
 #      define __get_tls() ( *((volatile void **) 0xffff0ff0) )
 #    endif
 #  endif /* !LIBC_STATIC */
-#else /* !ARM */
+#elif defined(__mips__)
+#    define __get_tls() \
+    ({ register unsigned int __val asm("v1");   \
+        asm (                                   \
+            "   .set    push\n"                 \
+            "   .set    mips32r2\n"             \
+            "   rdhwr   %0,$29\n"               \
+            "   .set    pop\n"                  \
+            : "=r"(__val)                       \
+            );                                  \
+        (volatile void*)__val; })
+#else
 extern void*  __get_tls( void );
-#endif /* !ARM */
+#endif
 
 /* return the stack base and size, used by our malloc debugger */
 extern void*  __get_stack_base(int  *p_stack_size);
diff --git a/libc/zoneinfo/zoneinfo.dat b/libc/zoneinfo/zoneinfo.dat
index 82d6b9c..3d0b53c 100644
--- a/libc/zoneinfo/zoneinfo.dat
+++ b/libc/zoneinfo/zoneinfo.dat
Binary files differ
diff --git a/libc/zoneinfo/zoneinfo.idx b/libc/zoneinfo/zoneinfo.idx
index 2268706..ac6bbc9 100644
--- a/libc/zoneinfo/zoneinfo.idx
+++ b/libc/zoneinfo/zoneinfo.idx
Binary files differ
diff --git a/libc/zoneinfo/zoneinfo.version b/libc/zoneinfo/zoneinfo.version
index e606761..f9e9d44 100644
--- a/libc/zoneinfo/zoneinfo.version
+++ b/libc/zoneinfo/zoneinfo.version
@@ -1 +1 @@
-2012d
+2012e