Just like we did on other architectures. ok?
Index: lib/libc/arch/aarch64/sys/cerror.S =================================================================== RCS file: /cvs/src/lib/libc/arch/aarch64/sys/cerror.S,v retrieving revision 1.2 diff -u -p -r1.2 cerror.S --- lib/libc/arch/aarch64/sys/cerror.S 25 Jan 2017 10:43:37 -0000 1.2 +++ lib/libc/arch/aarch64/sys/cerror.S 18 Mar 2017 14:45:58 -0000 @@ -28,17 +28,13 @@ #include "SYS.h" +/* offsetof(struct tib, tib_errno) - offsetof(struct tib, __tib_tcb) */ +#define TCB_OFFSET_ERRNO (-12) + _ENTRY(CERROR) - stp x0, x30, [sp,#-16]! - bl _C_LABEL(__errno) - ldp x1, x30, [sp],#16 - str w1, [x0] + mrs x1, tpidr_el0 + str w0, [x1, #TCB_OFFSET_ERRNO] movn x0, #0 movn x1, #0 ret END(CERROR) - -#if !defined(__PIC__) -.Lerrno: - .word errno -#endif