public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4 01/13] C-SKY: ABI related code
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
  2018-09-12  2:56   ` [PATCH v4 02/13] C-SKY: TLS support Mao Han
  2018-09-12  2:56   ` [PATCH v4 03/13] C-SKY: Math support Mao Han
@ 2018-09-12  2:56   ` Mao Han
  2018-09-12  4:16     ` H.J. Lu
  2018-09-17 21:46     ` Joseph Myers
  2018-09-12  2:56   ` [PATCH v4 05/13] C-SKY: Linux Syscall Interface Mao Han
                     ` (9 subsequent siblings)
  12 siblings, 2 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:56 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

Codes in this patch contains lots of C-SKY ABI related code.  They are
written accroding to the registers assgnments, relocations, assemblly
described in C-SKY CPU ABI Standards and C-SKY architercure user guide.
Available from: https://github.com/c-sky/csky-doc
This does not contain any linux related code.

	* sysdeps/csky/abiv2/__longjmp.S: New file.
	* sysdeps/csky/abiv2/crti.S: Likewise.
	* sysdeps/csky/abiv2/crtn.S: Likewise.
	* sysdeps/csky/abiv2/csky-mcount.S: Likewise.
	* sysdeps/csky/abiv2/dl-trampoline.S: Likewise.
	* sysdeps/csky/abiv2/memcmp.S: Likewise.
	* sysdeps/csky/abiv2/memcpy.S: Likewise.
	* sysdeps/csky/abiv2/memmove.S: Likewise.
	* sysdeps/csky/abiv2/memset.S: Likewise.
	* sysdeps/csky/abiv2/setjmp.S: Likewise.
	* sysdeps/csky/abiv2/start.S: Likewise.
	* sysdeps/csky/abiv2/strcmp.S: Likewise.
	* sysdeps/csky/abiv2/strcpy.S: Likewise.
	* sysdeps/csky/abiv2/strlen.S: Likewise.
	* sysdeps/csky/abort-instr.h: Likewise.
	* sysdeps/csky/bits/endian.h: Likewise.
	* sysdeps/csky/bits/link.h: Likewise.
	* sysdeps/csky/bits/setjmp.h: Likewise.
	* sysdeps/csky/bsd-_setjmp.S: Likewise.
	* sysdeps/csky/bsd-setjmp.S: Likewise.
	* sysdeps/csky/gccframe.h: Likewise.
	* sysdeps/csky/jmpbuf-unwind.h: Likewise.
	* sysdeps/csky/machine-gmon.h: Likewise.
	* sysdeps/csky/memusage.h: Likewise.
	* sysdeps/csky/stackinfo.h: Likewise.
	* sysdeps/csky/sysdep.h: Likewise.
---
 sysdeps/csky/abiv2/__longjmp.S     |  61 ++++++++++
 sysdeps/csky/abiv2/crti.S          |  99 ++++++++++++++++
 sysdeps/csky/abiv2/crtn.S          |  50 +++++++++
 sysdeps/csky/abiv2/csky-mcount.S   |  72 ++++++++++++
 sysdeps/csky/abiv2/dl-trampoline.S |  50 +++++++++
 sysdeps/csky/abiv2/memcmp.S        | 142 +++++++++++++++++++++++
 sysdeps/csky/abiv2/memcpy.S        | 224 +++++++++++++++++++++++++++++++++++++
 sysdeps/csky/abiv2/memmove.S       |   1 +
 sysdeps/csky/abiv2/memset.S        |  98 ++++++++++++++++
 sysdeps/csky/abiv2/setjmp.S        |  77 +++++++++++++
 sysdeps/csky/abiv2/start.S         | 109 ++++++++++++++++++
 sysdeps/csky/abiv2/strcmp.S        | 156 ++++++++++++++++++++++++++
 sysdeps/csky/abiv2/strcpy.S        | 127 +++++++++++++++++++++
 sysdeps/csky/abiv2/strlen.S        | 102 +++++++++++++++++
 sysdeps/csky/abort-instr.h         |   2 +
 sysdeps/csky/bits/endian.h         |   6 +
 sysdeps/csky/bits/link.h           |  55 +++++++++
 sysdeps/csky/bits/setjmp.h         |  34 ++++++
 sysdeps/csky/bsd-_setjmp.S         |   1 +
 sysdeps/csky/bsd-setjmp.S          |   1 +
 sysdeps/csky/gccframe.h            |  21 ++++
 sysdeps/csky/jmpbuf-unwind.h       |  48 ++++++++
 sysdeps/csky/machine-gmon.h        |  32 ++++++
 sysdeps/csky/memusage.h            |  21 ++++
 sysdeps/csky/stackinfo.h           |  29 +++++
 sysdeps/csky/sysdep.h              |  88 +++++++++++++++
 26 files changed, 1706 insertions(+)
 create mode 100644 sysdeps/csky/abiv2/__longjmp.S
 create mode 100644 sysdeps/csky/abiv2/crti.S
 create mode 100644 sysdeps/csky/abiv2/crtn.S
 create mode 100644 sysdeps/csky/abiv2/csky-mcount.S
 create mode 100644 sysdeps/csky/abiv2/dl-trampoline.S
 create mode 100644 sysdeps/csky/abiv2/memcmp.S
 create mode 100644 sysdeps/csky/abiv2/memcpy.S
 create mode 100644 sysdeps/csky/abiv2/memmove.S
 create mode 100644 sysdeps/csky/abiv2/memset.S
 create mode 100644 sysdeps/csky/abiv2/setjmp.S
 create mode 100644 sysdeps/csky/abiv2/start.S
 create mode 100644 sysdeps/csky/abiv2/strcmp.S
 create mode 100644 sysdeps/csky/abiv2/strcpy.S
 create mode 100644 sysdeps/csky/abiv2/strlen.S
 create mode 100644 sysdeps/csky/abort-instr.h
 create mode 100644 sysdeps/csky/bits/endian.h
 create mode 100644 sysdeps/csky/bits/link.h
 create mode 100644 sysdeps/csky/bits/setjmp.h
 create mode 100644 sysdeps/csky/bsd-_setjmp.S
 create mode 100644 sysdeps/csky/bsd-setjmp.S
 create mode 100644 sysdeps/csky/gccframe.h
 create mode 100644 sysdeps/csky/jmpbuf-unwind.h
 create mode 100644 sysdeps/csky/machine-gmon.h
 create mode 100644 sysdeps/csky/memusage.h
 create mode 100644 sysdeps/csky/stackinfo.h
 create mode 100644 sysdeps/csky/sysdep.h

diff --git a/sysdeps/csky/abiv2/__longjmp.S b/sysdeps/csky/abiv2/__longjmp.S
new file mode 100644
index 0000000..b30245c
--- /dev/null
+++ b/sysdeps/csky/abiv2/__longjmp.S
@@ -0,0 +1,61 @@
+/* longjmp for C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (__longjmp)
+	mov	a2, a0
+	mov	a0, a1		/* Get the return value in place.  */
+	cmpnei	a0, 0
+	bt	have_return
+	movi	a0, 1		/* Can't let setjmp() return zero! */
+have_return:
+#ifdef CHECK_SP
+	ldw	r10, (a2, 0)	/* jmpbuf's sp */
+# ifdef PTR_MANGLE
+	PTR_DEMANGLE (r10, r10, a3)
+# endif
+	CHECK_SP (r10)
+#endif
+	ldw	sp, (a2, 0)
+	ldw	lr, (a2, 4)
+	ldw	r4, (a2, 8)
+	ldw	r5, (a2, 12)
+	ldw	r6, (a2, 16)
+	ldw	r7, (a2, 20)
+	ldw	r8, (a2, 24)
+	ldw	r9, (a2, 28)
+	ldw	r10, (a2, 32)
+	ldw	r11, (a2, 36)
+	ldw	r16, (a2, 40)
+	ldw	r17, (a2, 44)
+	ldw	r26, (a2, 48)
+	ldw	r27, (a2, 52)
+	ldw	r28, (a2, 56)
+	ldw	r29, (a2, 60)
+	ldw	r30, (a2, 64)
+	ldw	r31, (a2, 68)
+	addi	a2, 72
+
+#ifdef PTR_MANGLE
+	PTR_DEMANGLE (sp, sp, a3)
+	PTR_DEMANGLE2 (lr, lr, a3)
+#endif
+	jmp	lr
+
+END (__longjmp)
diff --git a/sysdeps/csky/abiv2/crti.S b/sysdeps/csky/abiv2/crti.S
new file mode 100644
index 0000000..4526a9e
--- /dev/null
+++ b/sysdeps/csky/abiv2/crti.S
@@ -0,0 +1,99 @@
+/* Special .init and .fini section support for C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* crti.S puts a function prologue at the beginning of the .init and
+   .fini sections and defines global symbols for those addresses, so
+   they can be called as functions.  The symbols _init and _fini are
+   magic and cause the linker to emit DT_INIT and DT_FINI.  */
+
+#include <libc-symbols.h>
+#include <sysdep.h>
+
+#ifndef PREINIT_FUNCTION
+# define PREINIT_FUNCTION __gmon_start__
+#endif
+
+#ifndef PREINIT_FUNCTION_WEAK
+# define PREINIT_FUNCTION_WEAK 1
+#endif
+
+#if PREINIT_FUNCTION_WEAK
+	weak_extern (PREINIT_FUNCTION)
+#else
+	.hidden PREINIT_FUNCTION
+#endif
+
+	.section .init,"ax",@progbits
+	.align 4
+	.globl _init
+	.hidden _init
+	.type _init, @function
+_init:
+	subi	sp, 8
+	stw	lr, (sp, 0)
+	stw	gb, (sp, 4)
+	grs	t0, .Lgetpc
+.Lgetpc:
+	lrw	gb, .Lgetpc@GOTPC
+	add	gb, t0
+#if PREINIT_FUNCTION_WEAK
+	lrw	a2, PREINIT_FUNCTION@GOT
+	ldr.w	a2, (gb, a2 << 0)
+	cmpnei	a2, 0
+	bf	1f
+	jsr	a2
+1:
+#else
+	lrw	a2, PREINIT_FUNCTION@GOT
+	ldr.w	a2, (gb, a2 << 0)
+	jsr	a2
+#endif /* PREINIT_FUNCTION_WEAK */
+	br	2f
+	.literals
+	.align 4
+2:
+
+	.section .fini,"ax",@progbits
+	.align 4
+	.globl _fini
+	.hidden _fini
+	.type _fini, @function
+_fini:
+	subi	sp, 4
+	stw	lr, (sp, 0)
+	br	2f
+	.literals
+	.align 4
+2:
diff --git a/sysdeps/csky/abiv2/crtn.S b/sysdeps/csky/abiv2/crtn.S
new file mode 100644
index 0000000..9c7ecbf
--- /dev/null
+++ b/sysdeps/csky/abiv2/crtn.S
@@ -0,0 +1,50 @@
+/* Special .init and .fini section support for C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* crtn.S puts function epilogues in the .init and .fini sections
+   corresponding to the prologues in crti.S.  */
+
+	.section .init,"ax",@progbits
+	ldw	lr, (sp, 0)
+	ldw	gb, (sp, 4)
+	addi	sp, 8
+	rts
+
+	.section .fini,"ax",@progbits
+	ldw	lr, (sp, 0)
+	addi	sp, 4
+	rts
diff --git a/sysdeps/csky/abiv2/csky-mcount.S b/sysdeps/csky/abiv2/csky-mcount.S
new file mode 100644
index 0000000..e77ec4f
--- /dev/null
+++ b/sysdeps/csky/abiv2/csky-mcount.S
@@ -0,0 +1,72 @@
+/* Implementation of profiling support.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* Use an assembly stub with a special ABI.  The calling lr has been
+   pushed to the stack (which will be misaligned).  We should preserve
+   all registers except ip and pop a word off the stack.
+
+   NOTE: This assumes mcount_internal does not clobber any non-core
+   (coprocessor) registers.  Currently this is true, but may require
+   additional attention in the future.
+
+   The calling sequence looks something like:
+func:
+   push lr
+   jbsr _mount
+   <function body>
+*/
+
+/* Don't call mcount when calling mcount...  */
+#undef PROF
+
+ENTRY (_mcount)
+	subi	sp, 20
+	stw	a0, (sp, 0)
+	stw	a1, (sp, 4)
+	stw	a2, (sp, 8)
+	stw	a3, (sp, 12)
+	stw	lr, (sp, 16)
+	mov	a1, lr
+	ldw	a0, (sp, 20)
+#ifdef __PIC__
+	grs	t1, .Lgetpc
+.Lgetpc:
+	lrw	t0, .Lgetpc@GOTPC
+	addu	t1, t0
+	lrw	t0, __mcount_internal@PLT
+	ldr.w	t0, (t1, t0 << 0)
+	jsr	t0
+#else
+	jsri    __mcount_internal
+#endif /* !__PIC__ */
+	ldw	a0, (sp, 0)
+	ldw	a1, (sp, 4)
+	ldw	a2, (sp, 8)
+	ldw	a3, (sp, 12)
+	ldw	t1, (sp, 16)
+	ldw	lr, (sp, 20)
+	addi	sp, 24
+	jmp	t1
+END (_mcount)
+
+/* The canonical name for the function is `_mcount' in both C and asm,
+   but some old asm code might assume it's `mcount'.  */
+#undef mcount
+weak_alias (_mcount, mcount)
diff --git a/sysdeps/csky/abiv2/dl-trampoline.S b/sysdeps/csky/abiv2/dl-trampoline.S
new file mode 100644
index 0000000..1dbe2e1
--- /dev/null
+++ b/sysdeps/csky/abiv2/dl-trampoline.S
@@ -0,0 +1,50 @@
+/* PLT trampolines.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This function is not called directly.  It is jumped when attempting to
+   use a symbol that has not yet been resolved.
+
+   .plt*:
+     subi r0, 32
+     stw r2, (r0, 0)
+     stw r3, (r0, 4)
+     lrw r3, #offset
+     ldw r2, (gb, 8)
+     jmp r2
+ */
+
+#include <sysdep.h>
+
+	.globl _dl_runtime_resolve;
+	.type _dl_runtime_resolve,@function;
+	.align 4;
+_dl_runtime_resolve:
+	subi	sp, 20
+	stm	a0-a3, (sp)
+	stw	lr, (sp, 16)
+	/* a0 = id, a1 = offset(do it in plt*) */
+	ldw	a0,  (gb, 4)
+	movi	a1, 12
+	mult	a1, t1
+	bsr	_dl_fixup
+	mov	t0, a0
+	ldw	lr, (sp, 16)
+	ldm	a0-a3, (sp)
+	addi	sp, 20
+	jmp	t0
+	.size _dl_runtime_resolve,.-_dl_runtime_resolve
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
new file mode 100644
index 0000000..d23f7e7
--- /dev/null
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -0,0 +1,142 @@
+/* The assembly function for memory compare.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (memcmp)
+	/* Test if len less than 4 bytes.  */
+	mov	r3, r0
+	movi	r0, 0
+	mov	r12, r4
+	cmplti	r2, 4
+	jbt	.L_compare_by_byte
+
+	andi	r13, r0, 3
+	movi	r19, 4
+	/* Test if s1 is not 4 bytes aligned.  */
+	bnez	r13, .L_s1_not_aligned
+
+	LABLE_ALIGN
+.L_s1_aligned:
+	/* If dest is aligned, then copy.  */
+	zext	r18, r2, 31, 4
+	/* Test if len less than 16 bytes.  */
+	bez	r18, .L_compare_by_word
+
+.L_compare_by_4word:
+	/* If aligned, load word each time.  */
+	ldw	r20, (r3, 0)
+	ldw	r21, (r1, 0)
+	/* If s1[i] != s2[i], goto .L_byte_check.  */
+	cmpne	r20, r21
+	bt	.L_byte_check
+
+	ldw	r20, (r3, 4)
+	ldw	r21, (r1, 4)
+	cmpne	r20, r21
+	bt	.L_byte_check
+
+	ldw	r20, (r3, 8)
+	ldw	r21, (r1, 8)
+	cmpne	r20, r21
+	bt	.L_byte_check
+
+	ldw	r20, (r3, 12)
+	ldw	r21, (r1, 12)
+	cmpne	r20, r21
+	bt	.L_byte_check
+
+	PRE_BNEZAD (r18)
+	addi	a3, 16
+	addi	a1, 16
+
+	BNEZAD (r18, .L_compare_by_4word)
+
+.L_compare_by_word:
+	zext	r18, r2, 3, 2
+	bez	r18, .L_compare_by_byte
+.L_compare_by_word_loop:
+	ldw	r20, (r3, 0)
+	ldw	r21, (r1, 0)
+	addi	r3, 4
+	PRE_BNEZAD (r18)
+	cmpne	r20, r21
+	addi	r1, 4
+	bt	.L_byte_check
+	BNEZAD (r18, .L_compare_by_word_loop)
+
+.L_compare_by_byte:
+	zext	r18, r2, 1, 0
+	bez	r18, .L_return
+.L_compare_by_byte_loop:
+	ldb	r0, (r3, 0)
+	ldb	r4, (r1, 0)
+	addi	r3, 1
+	subu	r0, r4
+	PRE_BNEZAD (r18)
+	addi	r1, 1
+	bnez	r0, .L_return
+	BNEZAD (r18, .L_compare_by_byte_loop)
+
+.L_return:
+	mov	r4, r12
+	rts
+
+	/* s1[i] != s2[i] in word, so we check byte 3.  */
+.L_byte_check:
+	xtrb3	r0, r20
+	xtrb3	r2, r21
+	subu	r0, r2
+	bnez	r0, .L_return
+
+	/* check byte 2 */
+	xtrb2	r0, r20
+	xtrb2	r2, r21
+	subu	r0, r2
+	bnez	r0, .L_return
+
+	/* check byte 1 */
+	xtrb1	r0, r20
+	xtrb1	r2, r21
+	subu	r0, r2
+	bnez	r0, .L_return
+
+	/* check byte 0 */
+	xtrb0	r0, r20
+	xtrb0	r2, r21
+	subu	r0, r2
+	br	.L_return
+
+	/* Compare when s1 is not aligned.  */
+.L_s1_not_aligned:
+	sub	r13, r19, r13
+	sub	r2, r13
+.L_s1_not_aligned_loop:
+	ldb	r0, (r3, 0)
+	ldb	r4, (r1, 0)
+	addi	r3, 1
+	subu	r0, r4
+	PRE_BNEZAD (r13)
+	addi	r1, 1
+	bnez	r0, .L_return
+	BNEZAD (r13, .L_s1_not_aligned_loop)
+	br	.L_s1_aligned
+END (memcmp)
+weak_alias (memcmp, bcmp)
+libc_hidden_def (memcmp)
+.weak memcmp
diff --git a/sysdeps/csky/abiv2/memcpy.S b/sysdeps/csky/abiv2/memcpy.S
new file mode 100644
index 0000000..739d220
--- /dev/null
+++ b/sysdeps/csky/abiv2/memcpy.S
@@ -0,0 +1,224 @@
+/* The assembly function for memcpy.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (memcpy)
+	/* Test if len less than 4 bytes.  */
+	mov	r12, r0
+	cmplti	r2, 4
+	bt	.L_copy_by_byte
+
+	andi	r13, r0, 3
+	movi	r19, 4
+	/* Test if dest is not 4 bytes aligned.  */
+	bnez	r13, .L_dest_not_aligned
+.L_dest_aligned:
+	/* If dest is aligned, then copy.  */
+	zext	r18, r2, 31, 4
+	/* Test if len less than 16 bytes.  */
+	bez	r18, .L_len_less_16bytes
+	movi	r19, 0
+
+	LABLE_ALIGN
+.L_len_larger_16bytes:
+#if defined (__CSKY_VDSPV2__)
+	vldx.8	vr0, (r1), r19
+	PRE_BNEZAD (r18)
+	addi	r1, 16
+	vstx.8	vr0, (r0), r19
+	addi	r0, 16
+#elif defined (__CK860__)
+	ldw	r3, (r1, 0)
+	stw	r3, (r0, 0)
+	ldw	r3, (r1, 4)
+	stw	r3, (r0, 4)
+	ldw	r3, (r1, 8)
+	stw	r3, (r0, 8)
+	ldw	r3, (r1, 12)
+	addi	r1, 16
+	stw	r3, (r0, 12)
+	addi	r0, 16
+#else
+	ldw	r20, (r1, 0)
+	ldw	r21, (r1, 4)
+	ldw	r22, (r1, 8)
+	ldw	r23, (r1, 12)
+	stw	r20, (r0, 0)
+	stw	r21, (r0, 4)
+	stw	r22, (r0, 8)
+	stw	r23, (r0, 12)
+	PRE_BNEZAD (r18)
+	addi	r1, 16
+	addi	r0, 16
+#endif
+	BNEZAD (r18, .L_len_larger_16bytes)
+
+.L_len_less_16bytes:
+	zext	r18, r2, 3, 2
+	bez	r18, .L_copy_by_byte
+.L_len_less_16bytes_loop:
+	ldw	r3, (r1, 0)
+	PRE_BNEZAD (r18)
+	addi	r1, 4
+	stw	r3, (r0, 0)
+	addi	r0, 4
+	BNEZAD (r18, .L_len_less_16bytes_loop)
+
+	/* Test if len less than 4 bytes.  */
+.L_copy_by_byte:
+	zext	r18, r2, 1, 0
+	bez	r18, .L_return
+.L_copy_by_byte_loop:
+	ldb	r3, (r1, 0)
+	PRE_BNEZAD (r18)
+	addi	r1, 1
+	stb	r3, (r0, 0)
+	addi	r0, 1
+	BNEZAD (r18, .L_copy_by_byte_loop)
+
+.L_return:
+	mov	r0, r12
+	rts
+
+	/* If dest is not aligned, just copying some bytes makes the dest
+	   align.  */
+
+.L_dest_not_aligned:
+	sub	r13, r19, r13
+	mov	r19, r13
+.L_dest_not_aligned_loop:
+	/* Makes the dest align.  */
+	ldb	r3, (r1, 0)
+	PRE_BNEZAD (r13)
+	addi	r1, 1
+	stb	r3, (r0, 0)
+	addi	r0, 1
+	BNEZAD (r13, .L_dest_not_aligned_loop)
+	sub	r2, r19
+	cmplti	r2, 4
+	bt	.L_copy_by_byte
+	/* Check whether the src is aligned.  */
+	br	.L_dest_aligned
+END (memcpy)
+
+libc_hidden_builtin_def (memcpy)
+.weak memcpy
+
+
+ENTRY (memmove)
+	subu	r3, r0, r1
+	cmphs	r3, r2
+	bt	memcpy
+
+	mov	r12, r0
+	addu	r0, r0, r2
+	addu	r1, r1, r2
+
+	/* Test if len less than 4 bytes.  */
+	cmplti	r2, 4
+	bt	.L_copy_by_byte_m
+
+	andi	r13, r0, 3
+	/* Test if dest is not 4 bytes aligned.  */
+	bnez	r13, .L_dest_not_aligned_m
+.L_dest_aligned_m:
+	/* If dest is aligned, then copy.  */
+	zext	r18, r2, 31, 4
+	/* Test if len less than 16 bytes.  */
+	bez	r18, .L_len_less_16bytes_m
+	movi	r19, 0
+
+	/* len > 16 bytes */
+	LABLE_ALIGN
+.L_len_larger_16bytes_m:
+	subi	r1, 16
+	subi	r0, 16
+#if defined (__CSKY_VDSPV2__)
+	vldx.8	vr0, (r1), r19
+	PRE_BNEZAD (r18)
+	vstx.8	vr0, (r0), r19
+#elif defined (__CK860__)
+	ldw	r3, (r1, 12)
+	stw	r3, (r0, 12)
+	ldw	r3, (r1, 8)
+	stw	r3, (r0, 8)
+	ldw	r3, (r1, 4)
+	stw	r3, (r0, 4)
+	ldw	r3, (r1, 0)
+	stw	r3, (r0, 0)
+#else
+	ldw	r20, (r1, 0)
+	ldw	r21, (r1, 4)
+	ldw	r22, (r1, 8)
+	ldw	r23, (r1, 12)
+	stw	r20, (r0, 0)
+	stw	r21, (r0, 4)
+	stw	r22, (r0, 8)
+	stw	r23, (r0, 12)
+	PRE_BNEZAD (r18)
+#endif
+	BNEZAD (r18, .L_len_larger_16bytes_m)
+
+.L_len_less_16bytes_m:
+	zext	r18, r2, 3, 2
+	bez	r18, .L_copy_by_byte_m
+.L_len_less_16bytes_loop_m:
+	subi	r1, 4
+	subi	r0, 4
+	ldw	r3, (r1, 0)
+	PRE_BNEZAD (r18)
+	stw	r3, (r0, 0)
+	BNEZAD (r18, .L_len_less_16bytes_loop_m)
+
+	/* Test if len less than 4 bytes.  */
+.L_copy_by_byte_m:
+	zext	r18, r2, 1, 0
+	bez	r18, .L_return_m
+.L_copy_by_byte_loop_m:
+	subi	r1, 1
+	subi	r0, 1
+	ldb	r3, (r1, 0)
+	PRE_BNEZAD (r18)
+	stb	r3, (r0, 0)
+	BNEZAD (r18, .L_copy_by_byte_loop_m)
+
+.L_return_m:
+	mov	r0, r12
+	rts
+
+	/* If dest is not aligned, just copying some bytes makes the dest
+	   align.  */
+.L_dest_not_aligned_m:
+	sub	r2, r13
+.L_dest_not_aligned_loop_m:
+	subi	r1, 1
+	subi	r0, 1
+	/* Makes the dest align.  */
+	ldb	r3, (r1, 0)
+	PRE_BNEZAD (r13)
+	stb	r3, (r0, 0)
+	BNEZAD (r13, .L_dest_not_aligned_loop_m)
+	cmplti	r2, 4
+	bt	.L_copy_by_byte_m
+	/* Check whether the src is aligned.  */
+	br	.L_dest_aligned_m
+END (memmove)
+
+libc_hidden_builtin_def (memmove)
+.weak memmove
diff --git a/sysdeps/csky/abiv2/memmove.S b/sysdeps/csky/abiv2/memmove.S
new file mode 100644
index 0000000..8ba4418
--- /dev/null
+++ b/sysdeps/csky/abiv2/memmove.S
@@ -0,0 +1 @@
+/* memmove is in memcpy.S  */
diff --git a/sysdeps/csky/abiv2/memset.S b/sysdeps/csky/abiv2/memset.S
new file mode 100644
index 0000000..dd54a4e
--- /dev/null
+++ b/sysdeps/csky/abiv2/memset.S
@@ -0,0 +1,98 @@
+/* The assembly function for memset.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (memset)
+	/* Test if len less than 4 bytes.  */
+	mov	r12, r0
+	cmplti	r2, 8
+	bt	.L_set_by_byte
+
+	andi	r13, r0, 3
+	movi	r19, 4
+	/* Test if dest is not 4 bytes aligned.  */
+	bnez	r13, .L_dest_not_aligned
+	/* Hardware can handle unaligned access directly.  */
+.L_dest_aligned:
+	zextb	r1, r1
+	mov	r3, r1
+	lsli	r1, 8
+	or	r1, r3
+	lsli	r3, r1, 16
+	or	r3, r1
+
+	/* If dest is aligned, then copy.  */
+	zext	r18, r2, 31, 4
+	/* Test if len less than 16 bytes.  */
+	bez	r18, .L_len_less_16bytes
+
+	LABLE_ALIGN
+.L_len_larger_16bytes:
+	stw	r3, (r0, 0)
+	stw	r3, (r0, 4)
+	stw	r3, (r0, 8)
+	stw	r3, (r0, 12)
+	PRE_BNEZAD (r18)
+	addi	r0, 16
+	BNEZAD (r18, .L_len_larger_16bytes)
+
+.L_len_less_16bytes:
+	zext	r18, r2, 3, 2
+	andi	r2, 3
+	bez	r18, .L_set_by_byte
+.L_len_less_16bytes_loop:
+	stw	r3, (r0, 0)
+	PRE_BNEZAD (r18)
+	addi	r0, 4
+	BNEZAD (r18, .L_len_less_16bytes_loop)
+
+	/* Test if len less than 4 bytes.  */
+.L_set_by_byte:
+	zext	r18, r2, 2, 0
+	bez	r18, .L_return
+.L_set_by_byte_loop:
+	stb	r1, (r0, 0)
+	PRE_BNEZAD (r18)
+	addi	r0, 1
+	BNEZAD (r18, .L_set_by_byte_loop)
+
+.L_return:
+	mov	r0, r12
+	rts
+
+	/* If dest is not aligned, just set some bytes makes the dest
+	   align.  */
+
+.L_dest_not_aligned:
+	sub	r13, r19, r13
+	sub	r2, r13
+.L_dest_not_aligned_loop:
+	/* Makes the dest align.  */
+	stb	r1, (r0, 0)
+	PRE_BNEZAD (r13)
+	addi	r0, 1
+	BNEZAD (r13, .L_dest_not_aligned_loop)
+	cmplti	r2, 8
+	bt	.L_set_by_byte
+	/* Check whether the src is aligned.  */
+	br	.L_dest_aligned
+END (memset)
+
+libc_hidden_builtin_def (memset)
+.weak memset
diff --git a/sysdeps/csky/abiv2/setjmp.S b/sysdeps/csky/abiv2/setjmp.S
new file mode 100644
index 0000000..a6cc7e5
--- /dev/null
+++ b/sysdeps/csky/abiv2/setjmp.S
@@ -0,0 +1,77 @@
+/* setjmp for C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (setjmp)
+	movi	a1, 1
+	br	__sigsetjmp
+END (setjmp)
+
+ENTRY (_setjmp)
+	movi	a1, 0
+	br	__sigsetjmp
+END (_setjmp)
+
+libc_hidden_def (_setjmp)
+
+ENTRY (__sigsetjmp)
+	mov	a2, a0
+	/* Save registers.  */
+
+#ifdef PTR_MANGLE
+	PTR_MANGLE (t0, sp, a3)
+	stw	t0, (a2, 0)
+	PTR_MANGLE2 (t0, lr, a3)
+	stw	t0, (a2, 4)
+#else
+	stw	sp, (a2, 0)
+	stw	lr, (a2, 4)
+#endif
+	stw	r4, (a2, 8)
+	stw	r5, (a2, 12)
+	stw	r6, (a2, 16)
+	stw	r7, (a2, 20)
+	stw	r8, (a2, 24)
+	stw	r9, (a2, 28)
+	stw	r10, (a2, 32)
+	stw	r11, (a2, 36)
+	stw	r16, (a2, 40)
+	stw	r17, (a2, 44)
+	stw	r26, (a2, 48)
+	stw	r27, (a2, 52)
+	stw	r28, (a2, 56)
+	stw	r29, (a2, 60)
+	stw	r30, (a2, 64)
+	stw	r31, (a2, 68)
+	addi	a2, 72
+
+#ifdef __PIC__
+	grs	t1, .Lgetpc
+.Lgetpc:
+	lrw	t0, .Lgetpc@GOTPC
+	addu	t1, t0
+	lrw	a2, __sigjmp_save@PLT
+	ldr.w	a2, (t1, a2 << 0)
+	jmp	a2
+#else
+	jmpi	__sigjmp_save
+#endif /* !__PIC__ */
+END (__sigsetjmp)
+
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/csky/abiv2/start.S b/sysdeps/csky/abiv2/start.S
new file mode 100644
index 0000000..ca20d6a
--- /dev/null
+++ b/sysdeps/csky/abiv2/start.S
@@ -0,0 +1,109 @@
+/* Startup code compliant to the ELF C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* We need to call:
+   __libc_start_main (int (*main) (int, char **, char **), int argc,
+		      char **argv, void (*init) (void), void (*fini) (void),
+		      void (*rtld_fini) (void), void *stack_end)
+*/
+
+#include <sysdep.h>
+
+	.text
+	.globl _start;
+	.type _start,@function;
+	.align 4;
+_start:
+	subi	sp, 8
+	/* Clear the link register since this is the outermost frame.  */
+	movi	lr, 0
+	/* Pop argc off the stack and save a pointer to argv.  */
+	ldw	a1, (sp, 8)	/* __libc_start_main(arg1): argc */
+	addi	a2, sp, 12	/* __libc_start_main(arg2): argv */
+
+	/* Push stack limit.  */
+	stw	a2, (sp, 8)
+	/* Push rtld_fini.  */
+	stw	a0, (sp, 4)
+
+#ifdef SHARED
+	grs	t0, .Lgetpc
+.Lgetpc:
+	lrw	gb, .Lgetpc@GOTPC
+	addu	gb, t0
+	lrw	a3, __libc_csu_fini@GOT
+	ldr.w	a3, (gb, a3 << 0)
+	stw	a3, (sp, 0)
+
+	lrw	a3, __libc_csu_init@GOT
+	addu	a3, gb
+	ldw	a3, (a3, 0)
+
+	lrw	t0, main@GOT
+	addu	t0, gb
+	ldw	a0, (t0, 0)
+	lrw	t1, __libc_start_main@PLT
+	ldr.w	t1, (gb, t1 << 0)
+	jsr	t1
+
+	/* Should never get here.  */
+	lrw	t1, abort@PLT
+	ldr.w	t1, (gb, t1 << 0)
+	jsr	t1
+#else
+	/* Fetch address of __libc_csu_fini.  */
+	lrw	a0, __libc_csu_fini
+	/* Push __libc_csu_fini */
+	stw	a0, (sp, 0)
+
+	/* Set up the other arguments in registers.  */
+	lrw	a0, main
+	lrw	a3, __libc_csu_init
+	/* Let the libc call main and exit with its return code.  */
+	jsri	__libc_start_main
+	/* Should never get here.  */
+	jsri	abort
+#endif /* !SHARED */
+
+	.size _start,.-_start
+
+
+	/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start
diff --git a/sysdeps/csky/abiv2/strcmp.S b/sysdeps/csky/abiv2/strcmp.S
new file mode 100644
index 0000000..26719e2
--- /dev/null
+++ b/sysdeps/csky/abiv2/strcmp.S
@@ -0,0 +1,156 @@
+/* The assembly function for string compare.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (strcmp)
+	mov	a3, a0
+	/* Check if the s1 addr is aligned.  */
+	xor	a2, a3, a1
+	andi	a2, 0x3
+	bnez	a2, 7f
+	andi	t1, a0, 0x3
+	bnez	t1, 5f
+
+1:
+	/* If aligned, load word each time.  */
+	ldw	t0, (a3, 0)
+	ldw	t1, (a1, 0)
+	/* If s1[i] != s2[i], goto 2f.  */
+	cmpne	t0, t1
+	bt	2f
+	/* If s1[i] == s2[i], check if s1 or s2 is at the end.  */
+	tstnbz	t0
+	/* If at the end, goto 3f (finish comparing).  */
+	bf	3f
+
+	ldw	t0, (a3, 4)
+	ldw	t1, (a1, 4)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 8)
+	ldw	t1, (a1, 8)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 12)
+	ldw	t1, (a1, 12)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 16)
+	ldw	t1, (a1, 16)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 20)
+	ldw	t1, (a1, 20)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 24)
+	ldw	t1, (a1, 24)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	ldw	t0, (a3, 28)
+	ldw	t1, (a1, 28)
+	cmpne	t0, t1
+	bt	2f
+	tstnbz	t0
+	bf	3f
+
+	addi	a3, 32
+	addi	a1, 32
+
+	br	1b
+
+	/* s1[i] != s2[i] in word, so we check byte 3.  */
+2:
+	xtrb3	a0, t0
+	xtrb3	a2, t1
+	subu	a0, a2
+	bez	a2, 4f
+	bnez	a0, 4f
+
+	/* check byte 2 */
+	xtrb2	a0, t0
+	xtrb2	a2, t1
+	subu	a0, a2
+	bez	a2, 4f
+	bnez	a0, 4f
+
+	/* check byte 1 */
+	xtrb1	a0, t0
+	xtrb1	a2, t1
+	subu	a0, a2
+	bez	a2, 4f
+	bnez	a0, 4f
+
+	/* check byte 0 */
+	xtrb0	a0, t0
+	xtrb0	a2, t1
+	subu	a0, a2
+
+	jmp	lr
+3:
+	movi	a0, 0
+4:
+	jmp	lr
+
+	/* Compare when s1 or s2 is not aligned.  */
+5:
+	subi	t1, 4
+6:
+	ldb	a0, (a3, 0)
+	ldb	a2, (a1, 0)
+	subu	a0, a2
+	bnez	a0, 4b
+	addi	t1, 1
+	bez	a2, 4b
+	addi	a1, 1
+	addi	a3, 1
+	bez	t1, 1b
+	br	6b
+
+7:
+	ldb	a0, (a3, 0)
+	addi	a3, 1
+	ldb	a2, (a1, 0)
+	addi	a1, 1
+	subu	a0, a2
+	bnez	a0, 4b
+	bnez	a2, 7b
+	jmp	r15
+END (strcmp)
+
+libc_hidden_def (strcmp)
+.weak strcmp
diff --git a/sysdeps/csky/abiv2/strcpy.S b/sysdeps/csky/abiv2/strcpy.S
new file mode 100644
index 0000000..3da4fbe
--- /dev/null
+++ b/sysdeps/csky/abiv2/strcpy.S
@@ -0,0 +1,127 @@
+/* The assembly function for string copy.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (strcpy)
+	mov	a3, a0
+	/* Check if the src addr is aligned.  */
+	andi	t0, a1, 3
+	bnez	t0, 11f
+1:
+	/* Check if all the bytes in the word are not zero.  */
+	ldw	a2, (a1)
+	tstnbz	a2
+	bf	9f
+	stw	a2, (a3)
+
+	ldw	a2, (a1, 4)
+	tstnbz	a2
+	bf	2f
+	stw	a2, (a3, 4)
+
+	ldw	a2, (a1, 8)
+	tstnbz	a2
+	bf	3f
+	stw	a2, (a3, 8)
+
+	ldw	a2, (a1, 12)
+	tstnbz	a2
+	bf	4f
+	stw	a2, (a3, 12)
+
+	ldw	a2, (a1, 16)
+	tstnbz	a2
+	bf	5f
+	stw	a2, (a3, 16)
+
+	ldw	a2, (a1, 20)
+	tstnbz	a2
+	bf	6f
+	stw	a2, (a3, 20)
+
+	ldw	a2, (a1, 24)
+	tstnbz	a2
+	bf	7f
+	stw	a2, (a3, 24)
+
+	ldw	a2, (a1, 28)
+	tstnbz	a2
+	bf	8f
+	stw	a2, (a3, 28)
+
+	addi	a3, 32
+	addi	a1, 32
+	br	1b
+
+2:
+	addi	a3, 4
+	br	9f
+
+3:
+	addi	a3, 8
+	br	9f
+
+4:
+	addi	a3, 12
+	br	9f
+
+5:
+	addi	a3, 16
+	br	9f
+
+6:
+	addi	a3, 20
+	br	9f
+
+7:
+	addi	a3, 24
+	br	9f
+
+8:
+	addi	a3, 28
+9:
+	xtrb3	t0, a2
+	st.b	t0, (a3)
+	bez	t0, 10f
+	xtrb2	t0, a2
+	st.b	t0, (a3, 1)
+	bez	t0, 10f
+	xtrb1	t0, a2
+	st.b	t0, (a3, 2)
+	bez	t0, 10f
+	stw	a2, (a3)
+10:
+	jmp	lr
+
+11:
+	subi	t0, 4
+12:
+	ld.b	a2, (a1)
+	st.b	a2, (a3)
+	bez	a2, 10b
+	addi	t0, 1
+	addi	a1, a1, 1
+	addi	a3, a3, 1
+	bnez	t0, 12b
+	br	1b
+
+END (strcpy)
+
+libc_hidden_def (strcpy)
+.weak strcpy
diff --git a/sysdeps/csky/abiv2/strlen.S b/sysdeps/csky/abiv2/strlen.S
new file mode 100644
index 0000000..96083c3
--- /dev/null
+++ b/sysdeps/csky/abiv2/strlen.S
@@ -0,0 +1,102 @@
+/* The assembly function for string length.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (strlen)
+	/* Check if the start addr is aligned.  */
+	mov	r3, r0
+	andi	r1, r0, 3
+	movi	r2, 4
+	movi	r0, 0
+	bnez	r1, .L_start_not_aligned
+
+	LABLE_ALIGN
+.L_start_addr_aligned:
+	/* Check if all the bytes in the word are not zero.  */
+	ldw	r1, (r3)
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 4)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 8)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 12)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 16)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 20)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 24)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	ldw	r1, (r3, 28)
+	addi	r0, 4
+	tstnbz	r1
+	bf	.L_string_tail
+
+	addi	r0, 4
+	addi	r3, 32
+	br	.L_start_addr_aligned
+
+.L_string_tail:
+	xtrb3	r3, r1
+	bez	r3, .L_return
+	addi	r0, 1
+	xtrb2	r3, r1
+	bez	r3, .L_return
+	addi	r0, 1
+	xtrb1	r3, r1
+	bez	r3, .L_return
+	addi	r0, 1
+
+.L_return:
+	rts
+
+.L_start_not_aligned:
+	sub	r2, r2, r1
+.L_start_not_aligned_loop:
+	ldb	r1, (r3)
+	PRE_BNEZAD (r2)
+	addi	r3, 1
+	bez	r1, .L_return
+	addi	r0, 1
+	BNEZAD (r2, .L_start_not_aligned_loop)
+	br	.L_start_addr_aligned
+END (strlen)
+
+libc_hidden_def (strlen)
+.weak strlen
diff --git a/sysdeps/csky/abort-instr.h b/sysdeps/csky/abort-instr.h
new file mode 100644
index 0000000..27a3536
--- /dev/null
+++ b/sysdeps/csky/abort-instr.h
@@ -0,0 +1,2 @@
+/* An instruction which should crash any program is a breakpoint.  */
+#define ABORT_INSTRUCTION asm ("bkpt")
diff --git a/sysdeps/csky/bits/endian.h b/sysdeps/csky/bits/endian.h
new file mode 100644
index 0000000..f5a2dbd
--- /dev/null
+++ b/sysdeps/csky/bits/endian.h
@@ -0,0 +1,6 @@
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/* Only support little endian at present.  */
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/csky/bits/link.h b/sysdeps/csky/bits/link.h
new file mode 100644
index 0000000..13155ac
--- /dev/null
+++ b/sysdeps/csky/bits/link.h
@@ -0,0 +1,55 @@
+/* Machine-specific declarations for dynamic linker interface.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+/* Registers for entry into PLT on C-SKY.  */
+typedef struct La_csky_regs
+{
+  uint32_t lr_reg[4];
+  uint32_t lr_sp;
+  uint32_t lr_lr;
+} La_csky_regs;
+
+/* Return values for calls from PLT on C-SKY.  */
+typedef struct La_csky_retval
+{
+  /* Up to four integer registers can be used for a return value.  */
+  uint32_t lrv_reg[4];
+  uint32_t lrv_v0;
+} La_csky_retval;
+
+__BEGIN_DECLS
+
+extern Elf32_Addr la_csky_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
+					uintptr_t *__refcook,
+					uintptr_t *__defcook,
+					La_csky_regs *__regs,
+					unsigned int *__flags,
+					const char *__symname,
+					long int *__framesizep);
+extern unsigned int la_csky_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
+					 uintptr_t *__refcook,
+					 uintptr_t *__defcook,
+					 const La_csky_regs *__inregs,
+					 La_csky_retval *__outregs,
+					 const char *__symname);
+
+__END_DECLS
diff --git a/sysdeps/csky/bits/setjmp.h b/sysdeps/csky/bits/setjmp.h
new file mode 100644
index 0000000..6f0cace
--- /dev/null
+++ b/sysdeps/csky/bits/setjmp.h
@@ -0,0 +1,34 @@
+/* Define the machine-dependent type `jmp_buf'.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _CSKY_BITS_SETJMP_H
+#define _CSKY_BITS_SETJMP_H 1
+
+typedef struct __jmp_buf_str
+  {
+    /* Stack pointer.  */
+    int __sp;
+    int __lr;
+    /* The actual core defines which registers should be saved.  The
+       buffer contains 32 words, keep space for future growth.
+       Callee-saved registers:
+       r4 ~ r11, r16 ~ r17, r26 ~r31 for abiv2; r8 ~ r14 for abiv1.  */
+    int __regs[32];
+  } __jmp_buf[1];
+
+#endif
diff --git a/sysdeps/csky/bsd-_setjmp.S b/sysdeps/csky/bsd-_setjmp.S
new file mode 100644
index 0000000..4e6a2da
--- /dev/null
+++ b/sysdeps/csky/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/sysdeps/csky/bsd-setjmp.S b/sysdeps/csky/bsd-setjmp.S
new file mode 100644
index 0000000..1da848d
--- /dev/null
+++ b/sysdeps/csky/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/sysdeps/csky/gccframe.h b/sysdeps/csky/gccframe.h
new file mode 100644
index 0000000..9451101
--- /dev/null
+++ b/sysdeps/csky/gccframe.h
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define FIRST_PSEUDO_REGISTER 71
+
+#include <sysdeps/generic/gccframe.h>
diff --git a/sysdeps/csky/jmpbuf-unwind.h b/sysdeps/csky/jmpbuf-unwind.h
new file mode 100644
index 0000000..954d7e0
--- /dev/null
+++ b/sysdeps/csky/jmpbuf-unwind.h
@@ -0,0 +1,48 @@
+/* Examine __jmp_buf for unwinding frames.  C-SkY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+#include <sysdep.h>
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)		\
+  ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj)		      \
+  _JMPBUF_UNWINDS_ADJ (_jmpbuf,						      \
+		       (void *) (_Unwind_Ptr) _Unwind_GetCFA (_context),      \
+		       _adj)
+
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = (uintptr_t) regs[0].__sp;
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
+
+/* We use the normal longjmp for unwinding.  */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/sysdeps/csky/machine-gmon.h b/sysdeps/csky/machine-gmon.h
new file mode 100644
index 0000000..4ef9ca7
--- /dev/null
+++ b/sysdeps/csky/machine-gmon.h
@@ -0,0 +1,32 @@
+/* Machine-dependent definitions for profiling support.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* GCC for the C-SKY cannot compile __builtin_return_address (N) for N != 0,
+   so we must use an assembly stub.  */
+
+/* We must not pollute the global namespace.  */
+#define mcount_internal __mcount_internal
+
+extern void mcount_internal (u_long frompc, u_long selfpc);
+#define _MCOUNT_DECL(frompc, selfpc) \
+  void mcount_internal (u_long frompc, u_long selfpc)
+
+/* Define MCOUNT as empty since we have the implementation in another file.  */
+#define MCOUNT
diff --git a/sysdeps/csky/memusage.h b/sysdeps/csky/memusage.h
new file mode 100644
index 0000000..67f36cc
--- /dev/null
+++ b/sysdeps/csky/memusage.h
@@ -0,0 +1,21 @@
+/* Machine-specific definitions for memory usage profiling, C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; })
+
+#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/csky/stackinfo.h b/sysdeps/csky/stackinfo.h
new file mode 100644
index 0000000..9b915ba
--- /dev/null
+++ b/sysdeps/csky/stackinfo.h
@@ -0,0 +1,29 @@
+/* Stack environment definitions.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+#include <elf.h>
+
+/* On C-SKY the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#define DEFAULT_STACK_PERMS (PF_R|PF_W)
+
+#endif	/* stackinfo.h */
diff --git a/sysdeps/csky/sysdep.h b/sysdeps/csky/sysdep.h
new file mode 100644
index 0000000..b18337d
--- /dev/null
+++ b/sysdeps/csky/sysdep.h
@@ -0,0 +1,88 @@
+/* Assembler macros for C-SKY.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/sysdep.h>
+#include <features.h>
+
+#ifdef __CSKYABIV1__
+# error "No support for C-SKY ABIV1"
+#endif
+
+#ifdef __ASSEMBLER__
+
+# define ASM_SIZE_DIRECTIVE(name) .size name,.-name
+
+/* Define an entry point visible from C.  */
+# define ENTRY(name)		\
+	.globl name;		\
+	.type name,@function;	\
+	.align 4;		\
+	name##:;		\
+	cfi_startproc;		\
+	CALL_MCOUNT
+
+# undef  END
+# define END(name)		\
+	cfi_endproc;		\
+	ASM_SIZE_DIRECTIVE(name)
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+# ifdef PROF
+#  ifdef __PIC__
+#   define CALL_MCOUNT				\
+	subi	sp, 4;				\
+	stw	lr, (sp, 0);			\
+	grs	t0, .Lgetpc;			\
+.Lgetpc:					\
+	lrw	gb, .Lgetpc@GOTPC;		\
+	addu	gb, t0;				\
+	lrw	t1, _mcount@PLT;		\
+	ldr.w	t0, (gb, t1 << 0);		\
+	jmp	t0;
+#  else
+#   define CALL_MCOUNT				\
+	subi	sp, 4;				\
+	stw	lr, (sp, 0);			\
+	jbsr	_mcount;
+#  endif
+# else
+#  define CALL_MCOUNT	/* Do nothing.  */
+# endif
+
+# if defined (__CK860__)
+/* Instruction fetch will be faster when the label is 16 bytes aligned.
+   Filling with nop instruction to avoid extra jump. */
+#  define LABLE_ALIGN	\
+	.balignw 16, 0x6c03
+
+#  define PRE_BNEZAD(R)
+
+#  define BNEZAD(R, L)	\
+	bnezad	R, L
+# else
+#  define LABLE_ALIGN	\
+	.balignw 8, 0x6c03
+
+#  define PRE_BNEZAD(R)	\
+	subi	R, 1
+
+#  define BNEZAD(R, L)	\
+	bnez	R, L
+# endif
+
+#endif
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 02/13] C-SKY: TLS support
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
@ 2018-09-12  2:56   ` Mao Han
  2018-09-12  2:56   ` [PATCH v4 03/13] C-SKY: Math support Mao Han
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:56 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

This patch implements TLS support for C-SKY.  We support all four
standard TLS addressing modes (LE, IE, LD, and GD) when running on
Linux via NPTL.

	* sysdeps/csky/abiv2/tls-macros.h: New file.
	* sysdeps/csky/dl-tls.h: Likewise.
	* sysdeps/csky/libc-tls.c: Likewise.
	* sysdeps/csky/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/csky/nptl/tls.h: Likewise.
---
 sysdeps/csky/abiv2/tls-macros.h   |  55 ++++++++++++++
 sysdeps/csky/dl-tls.h             |  26 +++++++
 sysdeps/csky/libc-tls.c           |  32 ++++++++
 sysdeps/csky/nptl/tcb-offsets.sym |  10 +++
 sysdeps/csky/nptl/tls.h           | 156 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 279 insertions(+)
 create mode 100644 sysdeps/csky/abiv2/tls-macros.h
 create mode 100644 sysdeps/csky/dl-tls.h
 create mode 100644 sysdeps/csky/libc-tls.c
 create mode 100644 sysdeps/csky/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/csky/nptl/tls.h

diff --git a/sysdeps/csky/abiv2/tls-macros.h b/sysdeps/csky/abiv2/tls-macros.h
new file mode 100644
index 0000000..59af059
--- /dev/null
+++ b/sysdeps/csky/abiv2/tls-macros.h
@@ -0,0 +1,55 @@
+/* Macros for accessing thread-local storage.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+# define TLS_LE(x)					\
+  ({ int *__result;					\
+     __asm__ ("lrw %0, " #x "@TPOFF\n\t"		\
+	      "add %0, tls, %0"				\
+	      : "=&r" (__result));			\
+     __result; })
+
+# define TLS_IE(x)					\
+  ({ int *__result;					\
+     __asm__ ("grs a1, 1f\n"				\
+	      "1:\tlrw %0, " #x "@GOTTPOFF\n\t"		\
+	      "ldr.w %0, (a1, %0 << 0)\n\t"		\
+	      "add %0, tls, %0"				\
+	      : "=&r" (__result): : "a1");		\
+     __result; })
+
+# define TLS_LD(x)					\
+  ({ char *__result;					\
+     int __offset;					\
+     extern void *__tls_get_addr (void *);		\
+     __asm__ ("grs a1, 1f\n"				\
+	      "1:\tlrw %0, " #x "@TLSLDM32;\n\t"	\
+	      "add %0, a1, %0"				\
+	      : "=r" (__result) : : "a1");		\
+     __result = (char *)__tls_get_addr (__result);	\
+     __asm__ ("lrw %0, " #x "@TLSLDO32"			\
+	      : "=r" (__offset));			\
+     (int *) (__result + __offset); })
+
+# define TLS_GD(x)					\
+  ({ int *__result;					\
+     extern void *__tls_get_addr (void *);		\
+     __asm__ ("grs a1, 1f\n"				\
+	      "1:\tlrw %0, " #x "@TLSGD32\n\t"		\
+	      "add %0, a1, %0"				\
+	      : "=r" (__result) : : "a1");		\
+     (int *)__tls_get_addr (__result); })
diff --git a/sysdeps/csky/dl-tls.h b/sysdeps/csky/dl-tls.h
new file mode 100644
index 0000000..d44fc18
--- /dev/null
+++ b/sysdeps/csky/dl-tls.h
@@ -0,0 +1,26 @@
+/* Thread-local storage handling in the ELF dynamic linker.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Type used for the representation of TLS information in the GOT.  */
+typedef struct
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
+
+extern void *__tls_get_addr (tls_index *ti);
diff --git a/sysdeps/csky/libc-tls.c b/sysdeps/csky/libc-tls.c
new file mode 100644
index 0000000..30baf62
--- /dev/null
+++ b/sysdeps/csky/libc-tls.c
@@ -0,0 +1,32 @@
+/* Thread-local storage handling in the ELF dynamic linker.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <csu/libc-tls.c>
+#include <dl-tls.h>
+
+/* On C-SKY, linker optimizations are not required, so __tls_get_addr
+   can be called even in statically linked binaries.  In this case module
+   must be always 1 and PT_TLS segment exist in the binary, otherwise it
+   would not link.  */
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+  dtv_t *dtv = THREAD_DTV ();
+  return (char *) dtv[1].pointer.val + ti->ti_offset;
+}
diff --git a/sysdeps/csky/nptl/tcb-offsets.sym b/sysdeps/csky/nptl/tcb-offsets.sym
new file mode 100644
index 0000000..f110520
--- /dev/null
+++ b/sysdeps/csky/nptl/tcb-offsets.sym
@@ -0,0 +1,10 @@
+#include <sysdep.h>
+#include <tls.h>
+
+--
+
+-- Derive offsets relative to the thread register.
+#define thread_offsetof(mem)	(long)(offsetof (struct pthread, mem) - sizeof (struct pthread))
+
+MULTIPLE_THREADS_OFFSET		thread_offsetof (header.multiple_threads)
+TID_OFFSET			thread_offsetof (tid)
diff --git a/sysdeps/csky/nptl/tls.h b/sysdeps/csky/nptl/tls.h
new file mode 100644
index 0000000..14dbf94
--- /dev/null
+++ b/sysdeps/csky/nptl/tls.h
@@ -0,0 +1,156 @@
+/* Definitions for thread-local data handling.  NPTL/C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _TLS_H
+#define _TLS_H 1
+
+#ifndef __ASSEMBLER__
+
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
+# include <dl-dtv.h>
+
+/* Define r31 as thread pointer register.  */
+# define READ_THREAD_POINTER() \
+  ({ void *__result;						\
+     __asm__ __volatile__ ("mov %0, r31"			\
+                           : "=r" (__result));			\
+     __result; })
+
+#else
+# include <tcb-offsets.h>
+/* Define r31 as thread pointer register.  */
+# define READ_THREAD_POINTER() \
+	mov r0, r31;
+#endif /* __ASSEMBLER__ */
+
+#ifndef __ASSEMBLER__
+
+/* Get system call information.  */
+# include <sysdep.h>
+
+/* The TP points to the start of the thread blocks.  */
+# define TLS_DTV_AT_TP	1
+# define TLS_TCB_AT_TP	0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
+
+typedef struct
+{
+  dtv_t *dtv;
+  void *private;
+} tcbhead_t;
+
+/* This is the size of the initial TCB.  */
+# define TLS_INIT_TCB_SIZE	sizeof (tcbhead_t)
+
+/* Alignment requirements for the initial TCB.  */
+# define TLS_INIT_TCB_ALIGN	8
+
+/* This is the size of the TCB.  */
+# define TLS_TCB_SIZE		sizeof (tcbhead_t)
+
+/* Alignment requirements for the TCB.  */
+# define TLS_TCB_ALIGN		8
+
+/* This is the size we need before TCB.  */
+# define TLS_PRE_TCB_SIZE	sizeof (struct pthread)
+
+/* The thread pointer tp points to the end of the TCB.
+   The pthread_descr structure is immediately in front of the TCB.  */
+# define TLS_TCB_OFFSET		0
+
+/* Install the dtv pointer.  The pointer passed is to the element with
+   index -1 which contain the length.  */
+# define INSTALL_DTV(tcbp, dtvp) \
+  (((tcbhead_t *) (tcbp))->dtv = (dtvp) + 1)
+
+/* Install new dtv for current thread.  */
+# define INSTALL_NEW_DTV(dtv) \
+  (THREAD_DTV() = (dtv))
+
+/* Return dtv of given thread descriptor.  */
+# define GET_DTV(tcbp) \
+  (((tcbhead_t *) (tcbp))->dtv)
+
+# define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
+
+/* Code to initially initialize the thread pointer.  This might need
+   special attention since 'errno' is not yet available and if the
+   operation can cause a failure 'errno' must not be touched.  */
+# define TLS_INIT_TP(tcbp) \
+  ({ INTERNAL_SYSCALL_DECL (err);					\
+     long result_var;							\
+     result_var = INTERNAL_SYSCALL (set_thread_area, err, 1,		\
+                    (char *) (tcbp) + TLS_TCB_OFFSET);			\
+     INTERNAL_SYSCALL_ERROR_P (result_var, err)				\
+       ? "unknown error" : NULL; })
+
+/* Return the address of the dtv for the current thread.  */
+# define THREAD_DTV() \
+  (((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))->dtv)
+
+/* Return the thread descriptor for the current thread.  */
+# undef THREAD_SELF
+# define THREAD_SELF \
+  ((struct pthread *) (READ_THREAD_POINTER ()				\
+		       - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
+# define DB_THREAD_SELF \
+  CONST_THREAD_AREA (32, sizeof (struct pthread))
+
+/* Access to data in the thread descriptor is easy.  */
+# define THREAD_GETMEM(descr, member) \
+  descr->member
+# define THREAD_GETMEM_NC(descr, member, idx) \
+  descr->member[idx]
+# define THREAD_SETMEM(descr, member, value) \
+  descr->member = (value)
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
+  descr->member[idx] = (value)
+
+/* Get and set the global scope generation counter in struct pthread.  */
+# define THREAD_GSCOPE_IN_TCB      1
+# define THREAD_GSCOPE_FLAG_UNUSED 0
+# define THREAD_GSCOPE_FLAG_USED   1
+# define THREAD_GSCOPE_FLAG_WAIT   2
+# define THREAD_GSCOPE_RESET_FLAG() \
+  do									      \
+    { int __res								      \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	      \
+			       THREAD_GSCOPE_FLAG_UNUSED);		      \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				      \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);    \
+    }									      \
+  while (0)
+# define THREAD_GSCOPE_SET_FLAG() \
+  do									      \
+    {									      \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	      \
+      atomic_write_barrier ();						      \
+    }									      \
+  while (0)
+# define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* tls.h */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 05/13] C-SKY: Linux Syscall Interface
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (2 preceding siblings ...)
  2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
@ 2018-09-12  2:56   ` Mao Han
  2018-09-12  2:57   ` [PATCH v4 09/13] C-SKY: Add dynamic relocations to elf.h Mao Han
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:56 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

Contains the Linux system call interface.

	* sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S: New file.
	* sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/syscall.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/csky/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/csky/pt-vfork.S: Likewise.
---
 .../unix/sysv/linux/csky/abiv2/____longjmp_chk.S   | 81 ++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/clone.S         | 94 +++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S    | 73 ++++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S    | 96 ++++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S   | 78 ++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/syscall.S       | 67 +++++++++++++++
 sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S        | 65 +++++++++++++++
 sysdeps/unix/sysv/linux/csky/pt-vfork.S            |  1 +
 sysdeps/unix/sysv/linux/csky/syscalls.list         |  2 +
 9 files changed, 557 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/syscalls.list

diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S b/sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S
new file mode 100644
index 0000000..88cb310
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S
@@ -0,0 +1,81 @@
+/* longjmp with sp check for C-SKY ABIV2.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	.section .rodata.str1.8,"aMS",@progbits,1
+	.align  2
+	.type   longjmp_msg,@object
+longjmp_msg:
+	.string "longjmp causes uninitialized stack frame"
+	.size   longjmp_msg, .-longjmp_msg
+
+	.text
+#define __longjmp ____longjmp_chk
+
+#ifdef __PIC__
+# define CALL_FAIL	\
+	subi	sp, 8;						\
+	stw	gb, (sp, 0);					\
+	grs	gb, .Lgetpc1;					\
+.Lgetpc1:							\
+	lrw	t0, .Lgetpc1@GOTPC;				\
+	addu	gb, gb, t0;					\
+	lrw	a0, longjmp_msg@GOTOFF;				\
+	addu	a0, a0, gb;					\
+	lrw	t0, (HIDDEN_JUMPTARGET (__fortify_fail))@PLT;	\
+	ldr.w	t0, (gb, t0 << 0);				\
+	jsr	t0;						\
+	ldw	gb, (sp, 0);					\
+	addi	sp, 8;
+#else /* __PIC__ */
+# define CALL_FAIL	\
+	lrw	a0, longjmp_msg;				\
+	jsri	HIDDEN_JUMPTARGET (__fortify_fail);
+#endif /* __PIC__ */
+
+# define CHECK_SP(reg)	\
+	cmplt	sp, reg;					\
+	bt	.Lok1;						\
+	mov	r9, a0;						\
+	mov	t0, r7;						\
+	lrw	r7, __NR_sigaltstack;				\
+	movi	a0, 0;						\
+	subi	sp, 12;	/* sizeof (stack_t) */			\
+	mov	a1, sp;						\
+	trap	0;						\
+	mov	r7, t0;						\
+	cmpnei	a0, 0;						\
+	bt	.Lok;						\
+	ldw	a1, (sp, 4);					\
+	btsti	a1, 1;						\
+	bt	.Lfail;						\
+	ldw	a1, (sp, 0);					\
+	ldw	a3, (sp, 8);					\
+	add	a1, a3;						\
+	sub	a1, reg;					\
+	cmphs	a1, a3;						\
+	bt	.Lok;						\
+.Lfail:								\
+	addi	sp, 12;						\
+	CALL_FAIL						\
+.Lok:								\
+	mov	a0, r9;						\
+.Lok1:
+
+#include <__longjmp.S>
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/clone.S b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S
new file mode 100644
index 0000000..f83b396
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S
@@ -0,0 +1,94 @@
+/* Wrapper around clone system call.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <sysdep.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* int clone (int (*fn) (void *arg), void *child_stack, int flags, void *arg,
+	      pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
+
+        .text
+ENTRY (__clone)
+	/* Sanity check arguments.  */
+	cmpnei	a0, 0		/* no NULL function pointers */
+	bf	__error_arg
+	cmpnei	a1, 0		/* no NULL stack pointers */
+	bf	__error_arg
+
+	subi	a1, 8
+	stw	a0, (a1, 0)	/* insert the function into the new stack */
+	stw	a3, (a1, 4)	/* insert the args into the new stack */
+
+	mov	t1, r7		/* save r7 */
+	mov	t2, r4		/* save r4 */
+
+	mov	a0, a2		/* arg1 = flags */
+	ldw	a2, (sp, 0)	/* arg3 = ptid */
+	ldw	a3, (sp, 8)	/* arg4 = ctid */
+	ldw	r4, (sp, 4)	/* arg5 = tls */
+	lrw	r7, __NR_clone
+	trap	0
+
+	mov	r7, t1		/* restore r7 */
+	mov	r4, t2		/* restore r4 */
+	btsti	a0, 31		/* is a0 less than zero? */
+	bt	__do_syscall_error
+	cmpnei	a0, 0
+	bf	__child
+	rts
+
+__error_arg:
+	lrw	a0, -EINVAL
+
+__do_syscall_error:
+#ifdef __PIC__
+	subi	sp, 8
+	stw	gb, (sp, 0)
+	stw	r15, (sp, 4)
+	grs	gb, .Lgetpc
+.Lgetpc:
+	lrw	t0, .Lgetpc@GOTPC
+	addu	gb, gb, t0
+	lrw	t0, __syscall_error@PLT
+	ldr.w	t0, (gb, t0 << 0)
+	jsr	t0
+	ldw	gb, (sp, 0)
+	ldw	r15, (sp, 4)
+	addi	sp, 8
+#else
+	jmpi	__syscall_error
+#endif /* __PIC__ */
+	rts
+PSEUDO_END (__clone)
+
+__child:
+	ldw	a0, (sp, 4)	/* restore args from new sp */
+	ldw	a1, (sp, 0)	/* restore function from new sp */
+	addi	sp, 8
+	jsr	a1
+
+	/* exit */
+	lrw	r7, __NR_exit
+	trap	0
+
+libc_hidden_def (__clone)
+weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S b/sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S
new file mode 100644
index 0000000..4f77413
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S
@@ -0,0 +1,73 @@
+/* Save current context.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+/* int getcontext (ucontext_t *ucp) */
+
+ENTRY (__getcontext)
+	/* No need to save r2-r7 or a0-a3.  */
+	mov	t0, a0
+
+	addi	a0, MCONTEXT_CSKY_R4
+
+	stm	r4-r13, (a0)			/* save r4-r13 */
+	stw	sp, (t0, MCONTEXT_CSKY_SP)	/* save sp */
+	stw	r15, (t0, MCONTEXT_CSKY_LR)	/* save lr */
+	stw	r15, (t0, MCONTEXT_CSKY_PC)	/* return to PC */
+	addi	a0, t0, MCONTEXT_CSKY_R16
+	stm	r16-r31, (a0)			/* save r16-r31 */
+	movi	a0, 0
+	stw	a0, (t0, MCONTEXT_CSKY_A0)	/* return zero */
+
+	subi	sp, 8
+	stw	t0, (sp, 0)			/* save t0 after "save sp" */
+
+	/* __sigprocmask (SIG_BLOCK, NULL, &(ucontext->uc_sigmask)) */
+	movi	a0, SIG_BLOCK
+	movi	a1, 0
+	addi	a2, t0, UCONTEXT_SIGMASK
+
+	/* do sigprocmask syscall */
+#ifdef __PIC__
+	subi	sp, 8
+	stw	gb, (sp, 0)
+	grs	gb, .Lgetpc
+.Lgetpc:
+	lrw	a3, .Lgetpc@GOTPC
+	addu	gb, gb, a3
+	lrw	a3, __sigprocmask@PLT
+	ldr.w	a3, (gb, a3 << 0)
+	jsr	a3
+	ldw	gb, (sp, 0)
+	addi	sp, 8
+#else
+	jsri	__sigprocmask
+#endif
+
+	ldw	t0, (sp, 0)
+	addi	sp, 8
+	/* restore r15 for sigprocmask changes */
+	ldw	r15, (t0, MCONTEXT_CSKY_LR)
+	movi	a0, 0				/* return 0 */
+	jmp	r15
+END (__getcontext)
+
+weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S
new file mode 100644
index 0000000..1ceb928
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S
@@ -0,0 +1,96 @@
+/* Set saved user context to current context.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+/* int setcontext (const ucontext_t *ucp) */
+
+ENTRY (__setcontext)
+	mov	t0, a0
+	subi	sp, 8
+	stw	a0, (sp, 0)
+
+	/* set sigmask */
+	movi	a0, SIG_SETMASK
+	addi	a1, t0, UCONTEXT_SIGMASK
+	movi	a2, 0
+
+	/* do sigprocmask syscall */
+#ifdef __PIC__
+	subi	sp, 8
+	stw	gb, (sp, 0)
+	grs	gb, .Lgetpc1
+.Lgetpc1:
+	lrw	a3, .Lgetpc1@GOTPC
+	addu	gb, gb, a3
+	lrw	a3, __sigprocmask@PLT
+	ldr.w	a3, (gb, a3 << 0)
+	jsr	a3
+	ldw	gb, (sp, 0)
+	addi	sp, 8
+#else
+	jsri	__sigprocmask
+#endif /* __PIC__ */
+
+	ldw	t0, (sp, 0)
+	addi	sp, 8
+	/* set r0-r11. Load a0-a3, for makecontext requires */
+	addi	t1, t0, MCONTEXT_CSKY_A0
+	ldm	r0-r11, (t1)
+	ldw	sp, (t0, MCONTEXT_CSKY_SP)	/* load sp */
+	ldw	r15, (t0, MCONTEXT_CSKY_LR)	/* load lr */
+	ldw	t0, (t0, MCONTEXT_CSKY_PC)	/* load start addr */
+	jmp	t0
+END (setcontext)
+weak_alias (__setcontext, setcontext)
+
+ENTRY (__startcontext)
+	mov	a0, r9
+	cmpnei	r9, 0	/* r9 was set in makecontext */
+	bf	1f	/* null, then exit */
+
+	/* call setcontext */
+#ifdef __PIC__
+	grs	t1, .Lgetpc2
+.Lgetpc2:
+	lrw	t0, .Lgetpc2@GOTPC
+	addu	t1, t1, t0
+	lrw	t0, __setcontext@GOT
+	ldr.w	t0, (t1, t0 << 0)
+#else
+	lrw	t0, __setcontext
+#endif
+	jsr	t0
+
+1:
+	/* call _exit */
+#ifdef __PIC__
+	grs	t1, .Lgetpc3
+.Lgetpc3:
+	lrw	t0, .Lgetpc3@GOTPC
+	addu	t1, t1, t0
+	lrw	t0, _exit@GOT
+	ldr.w	t0, (t1, t0 << 0)
+#else
+	lrw	t0, _exit
+#endif
+	jsr	t0
+
+END (__startcontext)
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S b/sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S
new file mode 100644
index 0000000..a1e0144
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S
@@ -0,0 +1,78 @@
+/* Save and set current context.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
+
+ENTRY (swapcontext)
+	/* save params and lr */
+	subi	sp, 16
+	stw	a0, (sp, 0)
+	stw	a1, (sp, 4)
+	stw	r15, (sp, 8)
+
+	/* call getcontext */
+#ifdef __PIC__
+	grs	t1, .Lgetpc1
+.Lgetpc1:
+	lrw	t0, .Lgetpc1@GOTPC
+	addu	t1, t1, t0
+	lrw	t0, __getcontext@GOT
+	ldr.w	t0, (t1, t0 << 0)
+	jsr	t0
+#else /* no pic */
+	jsri	__getcontext
+#endif
+
+	mov	a3, a0	/* save return value */
+
+	/* restore params and lr */
+	ldw	a0, (sp, 0)
+	ldw	a1, (sp, 4)
+	ldw	r15, (sp, 8)
+	addi	sp, 16
+
+	cmpnei	a3, 0
+	bt	error_exit
+
+	/* Fix up LR and the PC */
+	stw	sp, (a0, MCONTEXT_CSKY_SP)
+	stw	r15, (a0, MCONTEXT_CSKY_LR)
+	stw	r15, (a0, MCONTEXT_CSKY_PC)
+
+	/* set setcontext's arg */
+	mov	a0, a1
+
+#ifdef __PIC__
+	grs	t1, .Lgetpc2
+.Lgetpc2:
+	lrw	a3, .Lgetpc2@GOTPC
+	addu	t1, t1, a3
+	lrw	a3, __setcontext@GOT
+	ldr.w	a3, (t1, a3 << 0)
+#else /* __PIC__ */
+	lrw	a3, __setcontext
+#endif /* __PIC__ */
+	jmp	a3
+
+error_exit:
+	jmp	r15
+END (swapcontext)
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/syscall.S b/sysdeps/unix/sysv/linux/csky/abiv2/syscall.S
new file mode 100644
index 0000000..bdfaef3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/syscall.S
@@ -0,0 +1,67 @@
+/* System call interface.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* long syscall(long sysnum, long a, long b, long c, long d, long e, long f) */
+
+ENTRY (syscall)
+	subi	sp, 8
+	stw	r4, (sp, 0)
+	stw	r5, (sp, 4)
+
+	mov	t0, r7
+	mov	r7, a0		/* r7 = sysnum */
+
+	mov	a0, a1		/* arg1 = a */
+	mov	a1, a2		/* arg2 = b */
+	mov	a2, a3		/* arg3 = c */
+	ldw	a3, (sp, 8)	/* arg4 = d */
+	ldw	r4, (sp, 12)	/* arg5 = e */
+	ldw	r5, (sp, 16)	/* arg6 = f */
+	trap	0
+
+	mov	r7, t0
+
+	ldw	r4, (sp, 0)
+	ldw	r5, (sp, 4)
+	addi	sp, 8
+
+	lrw	t0, 0xfffff000
+	cmphs	a0, t0
+	bf	1f
+#ifdef __PIC__
+	subi	sp, 8
+	stw	gb, (sp, 0)
+	stw	lr, (sp, 4)
+	grs	gb, .Lgetpc
+.Lgetpc:
+	lrw	t0, .Lgetpc@GOTPC
+	addu	gb, gb, t0
+	lrw	t0, __syscall_error@PLT
+	ldr.w	t0, (gb, t0 << 0)
+	jsr	t0
+	ldw	gb, (sp, 0)
+	ldw	lr, (sp, 4)
+	addi	sp, 8
+#else
+	jmpi	__syscall_error
+#endif /* __PIC__ */
+1:
+	rts
+PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S b/sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S
new file mode 100644
index 0000000..280c41a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S
@@ -0,0 +1,65 @@
+/* syscall error handlers.  C-SKY ABIV2 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* The syscall stubs jump here when they detect an error.
+   The code for Linux is almost identical to the canonical Unix
+   code, except that the error number in R0 is negated.  */
+
+#undef CALL_MCOUNT
+#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers R0.  */
+
+	.text
+ENTRY (__syscall_error)
+	movi	a1, 0
+	rsub	a0, a0, a1
+
+#if !IS_IN (rtld)
+	mov	a1, a0
+	mov	a0, tls
+
+	grs	t1, .Lgetpc1
+.Lgetpc1:
+	lrw	t0, errno@gottpoff
+	add	t1, t1, t0
+	ldw	t1, (t1)
+	add	t1, a0
+	stw	a1, (t1)
+	bmaski	a0, 0
+	rts
+#elif RTLD_PRIVATE_ERRNO /* !IS_IN (rtld) */
+# ifdef  __PIC__
+	grs	t1, .Lgetpc2
+.Lgetpc2:
+	lrw	t0, .Lgetpc2@GOTPC
+	addu	t1, t1, t0
+	lrw	t0, rtld_errno@PLT
+	ldr.w	t0, (t1, t0 << 0)
+# else
+	lrw	t0, rtld_errno
+# endif /* __PIC__ */
+	stw	a0, (t0)
+	bmaski	a0, 0
+	rts
+#else
+# error "Unsupported non-TLS case"
+#endif /* RTLD_PRIVATE_ERRNO */
+
+#undef __syscall_error
+END (__syscall_error)
diff --git a/sysdeps/unix/sysv/linux/csky/pt-vfork.S b/sysdeps/unix/sysv/linux/csky/pt-vfork.S
new file mode 100644
index 0000000..1cc8931
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/pt-vfork.S
@@ -0,0 +1 @@
+/* Not needed.  */
diff --git a/sysdeps/unix/sysv/linux/csky/syscalls.list b/sysdeps/unix/sysv/linux/csky/syscalls.list
new file mode 100644
index 0000000..2a8feb1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/syscalls.list
@@ -0,0 +1,2 @@
+# File name	Caller	Syscall name	Args	Strong name	Weak names
+cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 00/13] port C-SKY to glibc
@ 2018-09-12  2:56 Mao Han
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:56 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

It is the fourth patchset for C-SKY port. Base on commit
38245425a9add7bd22f8732219e0085432f223b6 (6 sep). Two abi combinations
are supported with this patch: C-SKY ABIV2 with (soft float & little endian,
hard float & little endian). CK807(ef), CK810(ef), CK860 are the
accroding supported processor cores to the C-SKY V2 abi;
f stands for FPU co-processor; e stands for DSP co-processor. Our
gcc and binutils support have already been merge to the gnu trunck.
The fourth linux csky support patchset has been post to kernel.org last
week, seems will ready in several weeks. This patchset is tested
with gcc(9.0), binutil(2.31), linux(4.18), GCC and Binutils are from
the official respository:
 
1. GCC commit:
be2d111a878e1422c921226bc7714131a5c470fa
2. Binutils commit:
316828699127cc855cf06cbfaee096f6fa75bba4
3. Linux git repo path
https://github.com/c-sky/csky-linux

CSKY V2 ABI manual:
https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf

CSKY architecture user guide:
https://github.com/c-sky/csky-doc/blob/master/CSKY%20Architecture%20user_guide.pdf

IFUNC, ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA, static PIE is not support
with this patchset.

Several patches will be post to GCC and Binutils to fix some testcase fail
later this month, while the follow results have these patches applied.
 
The patchset is cross-tested with qemu system mode as I have no board
with enough memory or can caculate subnormal.

C-SKY ABIV2 soft float little endian:
UNSUPPORTED: crypt/cert
FAIL: malloc/tst-malloc-usable-tunables
UNSUPPORTED: malloc/tst-mallocstate
UNSUPPORTED: math/test-fesetexcept-traps
UNSUPPORTED: math/test-fexcept-traps
UNSUPPORTED: math/test-matherr
UNSUPPORTED: math/test-matherr-2
UNSUPPORTED: math/test-nearbyint-except
UNSUPPORTED: math/test-nearbyint-except-2
UNSUPPORTED: misc/tst-ofdlocks-compat
UNSUPPORTED: misc/tst-pkey
UNSUPPORTED: misc/tst-ttyname
UNSUPPORTED: nptl/test-cond-printers
UNSUPPORTED: nptl/test-condattr-printers
UNSUPPORTED: nptl/test-mutex-printers
UNSUPPORTED: nptl/test-mutexattr-printers
UNSUPPORTED: nptl/test-rwlock-printers
UNSUPPORTED: nptl/test-rwlockattr-printers
FAIL: nptl/tst-_res1
FAIL: nptl/tst-thread_local1
UNSUPPORTED: nss/tst-nss-test3
UNSUPPORTED: posix/tst-glob_lstat_compat
UNSUPPORTED: posix/tst-spawn4-compat
UNSUPPORTED: posix/tst-sysconf-empty-chroot
UNSUPPORTED: resolv/tst-p_secstodate
UNSUPPORTED: resolv/tst-resolv-ai_idn
UNSUPPORTED: resolv/tst-resolv-ai_idn-latin1
UNSUPPORTED: resolv/tst-resolv-res_init
UNSUPPORTED: resolv/tst-resolv-res_init-thread
UNSUPPORTED: resolv/tst-resolv-threads
UNSUPPORTED: stdlib/test-bz22786
UNSUPPORTED: string/test-bcopy
UNSUPPORTED: string/test-memmove
FAIL: sunrpc/bug20790
UNSUPPORTED: time/tst-y2039
Summary of test results:
      4 FAIL
   5004 PASS
     31 UNSUPPORTED
     19 XFAIL

C-SKY ABIV2 hard float little endian:
UNSUPPORTED: crypt/cert
FAIL: malloc/tst-malloc-usable-tunables
UNSUPPORTED: malloc/tst-mallocstate
FAIL: math/test-double-tgamma
FAIL: math/test-float-tgamma
FAIL: math/test-float32-tgamma
FAIL: math/test-float32x-tgamma
FAIL: math/test-float64-tgamma
FAIL: math/test-ldouble-tgamma
UNSUPPORTED: math/test-matherr
UNSUPPORTED: math/test-matherr-2
UNSUPPORTED: misc/tst-ofdlocks-compat
UNSUPPORTED: misc/tst-pkey
UNSUPPORTED: misc/tst-ttyname
UNSUPPORTED: nptl/test-cond-printers
UNSUPPORTED: nptl/test-condattr-printers
UNSUPPORTED: nptl/test-mutex-printers
UNSUPPORTED: nptl/test-mutexattr-printers
UNSUPPORTED: nptl/test-rwlock-printers
UNSUPPORTED: nptl/test-rwlockattr-printers
FAIL: nptl/tst-_res1
FAIL: nptl/tst-thread_local1
UNSUPPORTED: nss/tst-nss-test3
UNSUPPORTED: posix/tst-glob_lstat_compat
UNSUPPORTED: posix/tst-spawn4-compat
UNSUPPORTED: posix/tst-sysconf-empty-chroot
UNSUPPORTED: resolv/tst-p_secstodate
UNSUPPORTED: resolv/tst-resolv-ai_idn
UNSUPPORTED: resolv/tst-resolv-ai_idn-latin1
UNSUPPORTED: resolv/tst-resolv-res_init
UNSUPPORTED: resolv/tst-resolv-res_init-thread
UNSUPPORTED: resolv/tst-resolv-threads
UNSUPPORTED: stdlib/test-bz22786
UNSUPPORTED: string/test-bcopy
UNSUPPORTED: string/test-memmove
FAIL: sunrpc/bug20790
UNSUPPORTED: time/tst-y2039
Summary of test results:
     10 FAIL
   5001 PASS
     27 UNSUPPORTED
     19 XFAIL

Detail result:
https://github.com/c-sky/test-result/blob/master/glibc/glibc_2.28_patch_v4_807_test_result.tar.gz
https://github.com/c-sky/test-result/blob/master/glibc/glibc_2.28_patch_v4_807f_test_result.tar.gz
https://github.com/c-sky/test-result/blob/master/glibc/glibc_2.28_patch_v4_build_many_log.tar.gz
 
FAIL cases:
1. nptl/tst-thread_local1
   seems lack c++ support, the gcc frountend can not generate constructor
   and destructor for static, anonymous_namespace and extern variables.

2. sunrpc/bug20790
   It fails because the testing environment lacks native cpp.

3. malloc/tst-malloc-usable-tunables
   It fails because liunx use mmap to alloc space for vdso and cause brk
   fail. Wait for our linux kernel to fix it.

4. nptl/tst-_res1
   It fails because symbol _res is incorrect linked.

5. The following cases fail due to gcc optimize change the sequence of
   -a * b to -(a * b) and got 1ulps error.
   math/test-double-tgamma
   math/test-float-tgamma
   math/test-float32-tgamma
   math/test-float32x-tgamma
   math/test-float64-tgamma
   math/test-ldouble-tgamma

6. The following three cases some time get into deadlock when the child
   return before the parent thread start to wait. I don know what is
   the expect behaviour under this condition.
   misc/tst-clone3
   tst-mallocfork
   tst-mallocfork2
 
Changes since v3:
  - update the abilist
  - update ulps
  - update version to 2.29
  - coding style and conventions
  - cleanup unnecessary linux syscall
  - remove support for big endian
  - fix hard float exception handle
  - assembly optimize memcopy, memmove, ...  with vdsp and byte extract
    instruction. our hardware can ld/st word form unalign address directly.

Changes since v2:
  - update the abilist
  - update ulps
  - cleanup unnecessary linux syscall
  - remove support for ABIV1
  - add one-line description for many files
  - put ABIV2 code into seperate folder
  - cleanup ucontext.h namespace
  - cleanup linux/csky/Version
  - add with_fp_cond support to distinguish soft float
  - remove PF_X in stackinfo
  - add abi check in preconfigure
  - support build-many-glibcs.py
  - fix pointer guard acquisition
 
Changes since v1:
  - update the changelog format
  - clean up unnecessary legacy code and odd comments
  - add rel description and fix EM_CSKY check
  - remove some arch-specific implementation
  - remove DEPRECATED linux syscall support
  - support pointer mangling
 
Mao Han (12):
  C-SKY: ABI related code
  C-SKY: TLS support
  C-SKY: Generic math Routines
  C-SKY: Hard Float Support
  C-SKY: Atomic and Locking Routines
  C-SKY: Linux Syscall Interface
  C-SKY: Linux ABI
  C-SKY: ABI Lists
  C-SKY: Linux Startup and Dynamic Loading Code
  C-SKY: Build Infastructure
  C-SKY: Add build-many-glibcs.py support
  C-SKY: Skeleton documentation

Mao Han (13):
  C-SKY: ABI related code
  C-SKY: TLS support
  C-SKY: Math support
  C-SKY: NPTL support and Atomic
  C-SKY: Linux Syscall Interface
  C-SKY: Linux ABI
  C-SKY: ABI Lists
  C-SKY: Linux Startup and Dynamic Loading Code
  C-SKY: Add dynamic relocations to elf.h
  C-SKY: Build Infastructure
  C-SKY: Add ABI definitions in config.h.in
  C-SKY: Add build-many-glibcs.py support
  C-SKY: Skeleton documentation

 ChangeLog                                          |  154 ++
 NEWS                                               |    6 +
 README                                             |    1 +
 config.h.in                                        |    6 +
 elf/elf.h                                          |   67 +-
 scripts/build-many-glibcs.py                       |    8 +
 sysdeps/csky/Implies                               |    4 +
 sysdeps/csky/Makefile                              |   13 +
 sysdeps/csky/abiv2/__longjmp.S                     |   61 +
 sysdeps/csky/abiv2/crti.S                          |   99 +
 sysdeps/csky/abiv2/crtn.S                          |   50 +
 sysdeps/csky/abiv2/csky-mcount.S                   |   72 +
 sysdeps/csky/abiv2/dl-trampoline.S                 |   50 +
 sysdeps/csky/abiv2/memcmp.S                        |  142 ++
 sysdeps/csky/abiv2/memcpy.S                        |  224 +++
 sysdeps/csky/abiv2/memmove.S                       |    1 +
 sysdeps/csky/abiv2/memset.S                        |   98 +
 sysdeps/csky/abiv2/setjmp.S                        |   77 +
 sysdeps/csky/abiv2/start.S                         |  109 +
 sysdeps/csky/abiv2/strcmp.S                        |  156 ++
 sysdeps/csky/abiv2/strcpy.S                        |  127 ++
 sysdeps/csky/abiv2/strlen.S                        |  102 +
 sysdeps/csky/abiv2/tls-macros.h                    |   55 +
 sysdeps/csky/abort-instr.h                         |    2 +
 sysdeps/csky/atomic-machine.h                      |   77 +
 sysdeps/csky/bits/endian.h                         |    6 +
 sysdeps/csky/bits/fenv.h                           |   92 +
 sysdeps/csky/bits/link.h                           |   55 +
 sysdeps/csky/bits/setjmp.h                         |   34 +
 sysdeps/csky/bsd-_setjmp.S                         |    1 +
 sysdeps/csky/bsd-setjmp.S                          |    1 +
 sysdeps/csky/configure                             |    4 +
 sysdeps/csky/configure.ac                          |    4 +
 sysdeps/csky/dl-machine.h                          |  362 ++++
 sysdeps/csky/dl-procinfo.c                         |   62 +
 sysdeps/csky/dl-procinfo.h                         |   59 +
 sysdeps/csky/dl-sysdep.h                           |   23 +
 sysdeps/csky/dl-tls.h                              |   26 +
 sysdeps/csky/fpu/fclrexcpt.c                       |   42 +
 sysdeps/csky/fpu/fedisblxcpt.c                     |   41 +
 sysdeps/csky/fpu/feenablxcpt.c                     |   40 +
 sysdeps/csky/fpu/fegetenv.c                        |   37 +
 sysdeps/csky/fpu/fegetexcept.c                     |   32 +
 sysdeps/csky/fpu/fegetmode.c                       |   28 +
 sysdeps/csky/fpu/fegetround.c                      |   34 +
 sysdeps/csky/fpu/feholdexcpt.c                     |   34 +
 sysdeps/csky/fpu/fenv_libc.h                       |   30 +
 sysdeps/csky/fpu/fenv_private.h                    |  280 +++
 sysdeps/csky/fpu/fesetenv.c                        |   59 +
 sysdeps/csky/fpu/fesetexcept.c                     |   33 +
 sysdeps/csky/fpu/fesetmode.c                       |   33 +
 sysdeps/csky/fpu/fesetround.c                      |   32 +
 sysdeps/csky/fpu/feupdateenv.c                     |   46 +
 sysdeps/csky/fpu/fgetexcptflg.c                    |   32 +
 sysdeps/csky/fpu/fix-fp-int-convert-overflow.h     |   33 +
 sysdeps/csky/fpu/fpu_control.h                     |  109 +
 sysdeps/csky/fpu/fraiseexcpt.c                     |  126 ++
 sysdeps/csky/fpu/fsetexcptflg.c                    |   43 +
 sysdeps/csky/fpu/ftestexcept.c                     |   30 +
 sysdeps/csky/fpu/libm-test-ulps                    | 1640 +++++++++++++++
 sysdeps/csky/fpu/libm-test-ulps-name               |    1 +
 sysdeps/csky/gccframe.h                            |   21 +
 sysdeps/csky/jmpbuf-unwind.h                       |   48 +
 sysdeps/csky/ldsodefs.h                            |   42 +
 sysdeps/csky/libc-tls.c                            |   32 +
 sysdeps/csky/linkmap.h                             |    4 +
 sysdeps/csky/machine-gmon.h                        |   32 +
 sysdeps/csky/math-tests-trap.h                     |   26 +
 sysdeps/csky/memusage.h                            |   21 +
 sysdeps/csky/nofpu/Implies                         |    1 +
 sysdeps/csky/nofpu/libm-test-ulps                  | 1694 ++++++++++++++++
 sysdeps/csky/nofpu/libm-test-ulps-name             |    1 +
 sysdeps/csky/nofpu/math-tests-exceptions.h         |   27 +
 sysdeps/csky/nofpu/math-tests-rounding.h           |   27 +
 sysdeps/csky/nptl/Makefile                         |   20 +
 sysdeps/csky/nptl/bits/pthreadtypes-arch.h         |   70 +
 sysdeps/csky/nptl/bits/semaphore.h                 |   35 +
 sysdeps/csky/nptl/pthread-offsets.h                |    5 +
 sysdeps/csky/nptl/pthreaddef.h                     |   32 +
 sysdeps/csky/nptl/tcb-offsets.sym                  |   10 +
 sysdeps/csky/nptl/tls.h                            |  156 ++
 sysdeps/csky/preconfigure                          |   33 +
 sysdeps/csky/sfp-machine.h                         |   50 +
 sysdeps/csky/sotruss-lib.c                         |   49 +
 sysdeps/csky/stackinfo.h                           |   29 +
 sysdeps/csky/sysdep.h                              |   88 +
 sysdeps/csky/tininess.h                            |    1 +
 sysdeps/csky/tst-audit.h                           |   23 +
 sysdeps/unix/sysv/linux/csky/Implies               |    3 +
 sysdeps/unix/sysv/linux/csky/Makefile              |    8 +
 sysdeps/unix/sysv/linux/csky/Versions              |    5 +
 .../unix/sysv/linux/csky/abiv2/____longjmp_chk.S   |   81 +
 sysdeps/unix/sysv/linux/csky/abiv2/clone.S         |   94 +
 sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S    |   73 +
 sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S    |   96 +
 sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S   |   78 +
 sysdeps/unix/sysv/linux/csky/abiv2/syscall.S       |   67 +
 sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S        |   65 +
 sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym  |   32 +
 sysdeps/unix/sysv/linux/csky/bits/mman.h           |   44 +
 sysdeps/unix/sysv/linux/csky/bits/shm.h            |  104 +
 sysdeps/unix/sysv/linux/csky/c++-types.data        |   67 +
 sysdeps/unix/sysv/linux/csky/configure             |    4 +
 sysdeps/unix/sysv/linux/csky/configure.ac          |    5 +
 sysdeps/unix/sysv/linux/csky/ipc_priv.h            |   21 +
 sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h      |    6 +
 sysdeps/unix/sysv/linux/csky/kernel-features.h     |   23 +
 sysdeps/unix/sysv/linux/csky/ld.abilist            |    9 +
 sysdeps/unix/sysv/linux/csky/ldconfig.h            |   31 +
 .../unix/sysv/linux/csky/libBrokenLocale.abilist   |    1 +
 sysdeps/unix/sysv/linux/csky/libanl.abilist        |    4 +
 sysdeps/unix/sysv/linux/csky/libc.abilist          | 2086 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/libcrypt.abilist      |    2 +
 sysdeps/unix/sysv/linux/csky/libdl.abilist         |    9 +
 sysdeps/unix/sysv/linux/csky/libm.abilist          |  753 +++++++
 sysdeps/unix/sysv/linux/csky/libnsl.abilist        |  120 ++
 sysdeps/unix/sysv/linux/csky/libpthread.abilist    |  235 +++
 sysdeps/unix/sysv/linux/csky/libresolv.abilist     |   79 +
 sysdeps/unix/sysv/linux/csky/librt.abilist         |   35 +
 sysdeps/unix/sysv/linux/csky/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/csky/libutil.abilist       |    6 +
 sysdeps/unix/sysv/linux/csky/localplt.data         |   19 +
 sysdeps/unix/sysv/linux/csky/makecontext.c         |   74 +
 sysdeps/unix/sysv/linux/csky/profil-counter.h      |   31 +
 sysdeps/unix/sysv/linux/csky/pt-vfork.S            |    1 +
 sysdeps/unix/sysv/linux/csky/register-dump.h       |  193 ++
 sysdeps/unix/sysv/linux/csky/shlib-versions        |    7 +
 sysdeps/unix/sysv/linux/csky/sigcontextinfo.h      |   32 +
 sysdeps/unix/sysv/linux/csky/sys/cachectl.h        |   38 +
 sysdeps/unix/sysv/linux/csky/sys/procfs.h          |  123 ++
 sysdeps/unix/sysv/linux/csky/sys/ucontext.h        |   89 +
 sysdeps/unix/sysv/linux/csky/sys/user.h            |   60 +
 sysdeps/unix/sysv/linux/csky/syscalls.list         |    2 +
 sysdeps/unix/sysv/linux/csky/sysdep.h              |  534 +++++
 134 files changed, 13370 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/csky/Implies
 create mode 100644 sysdeps/csky/Makefile
 create mode 100644 sysdeps/csky/abiv2/__longjmp.S
 create mode 100644 sysdeps/csky/abiv2/crti.S
 create mode 100644 sysdeps/csky/abiv2/crtn.S
 create mode 100644 sysdeps/csky/abiv2/csky-mcount.S
 create mode 100644 sysdeps/csky/abiv2/dl-trampoline.S
 create mode 100644 sysdeps/csky/abiv2/memcmp.S
 create mode 100644 sysdeps/csky/abiv2/memcpy.S
 create mode 100644 sysdeps/csky/abiv2/memmove.S
 create mode 100644 sysdeps/csky/abiv2/memset.S
 create mode 100644 sysdeps/csky/abiv2/setjmp.S
 create mode 100644 sysdeps/csky/abiv2/start.S
 create mode 100644 sysdeps/csky/abiv2/strcmp.S
 create mode 100644 sysdeps/csky/abiv2/strcpy.S
 create mode 100644 sysdeps/csky/abiv2/strlen.S
 create mode 100644 sysdeps/csky/abiv2/tls-macros.h
 create mode 100644 sysdeps/csky/abort-instr.h
 create mode 100644 sysdeps/csky/atomic-machine.h
 create mode 100644 sysdeps/csky/bits/endian.h
 create mode 100644 sysdeps/csky/bits/fenv.h
 create mode 100644 sysdeps/csky/bits/link.h
 create mode 100644 sysdeps/csky/bits/setjmp.h
 create mode 100644 sysdeps/csky/bsd-_setjmp.S
 create mode 100644 sysdeps/csky/bsd-setjmp.S
 create mode 100644 sysdeps/csky/configure
 create mode 100644 sysdeps/csky/configure.ac
 create mode 100644 sysdeps/csky/dl-machine.h
 create mode 100644 sysdeps/csky/dl-procinfo.c
 create mode 100644 sysdeps/csky/dl-procinfo.h
 create mode 100644 sysdeps/csky/dl-sysdep.h
 create mode 100644 sysdeps/csky/dl-tls.h
 create mode 100644 sysdeps/csky/fpu/fclrexcpt.c
 create mode 100644 sysdeps/csky/fpu/fedisblxcpt.c
 create mode 100644 sysdeps/csky/fpu/feenablxcpt.c
 create mode 100644 sysdeps/csky/fpu/fegetenv.c
 create mode 100644 sysdeps/csky/fpu/fegetexcept.c
 create mode 100644 sysdeps/csky/fpu/fegetmode.c
 create mode 100644 sysdeps/csky/fpu/fegetround.c
 create mode 100644 sysdeps/csky/fpu/feholdexcpt.c
 create mode 100644 sysdeps/csky/fpu/fenv_libc.h
 create mode 100644 sysdeps/csky/fpu/fenv_private.h
 create mode 100644 sysdeps/csky/fpu/fesetenv.c
 create mode 100644 sysdeps/csky/fpu/fesetexcept.c
 create mode 100644 sysdeps/csky/fpu/fesetmode.c
 create mode 100644 sysdeps/csky/fpu/fesetround.c
 create mode 100644 sysdeps/csky/fpu/feupdateenv.c
 create mode 100644 sysdeps/csky/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/csky/fpu/fix-fp-int-convert-overflow.h
 create mode 100644 sysdeps/csky/fpu/fpu_control.h
 create mode 100644 sysdeps/csky/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/csky/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/csky/fpu/ftestexcept.c
 create mode 100644 sysdeps/csky/fpu/libm-test-ulps
 create mode 100644 sysdeps/csky/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/csky/gccframe.h
 create mode 100644 sysdeps/csky/jmpbuf-unwind.h
 create mode 100644 sysdeps/csky/ldsodefs.h
 create mode 100644 sysdeps/csky/libc-tls.c
 create mode 100644 sysdeps/csky/linkmap.h
 create mode 100644 sysdeps/csky/machine-gmon.h
 create mode 100644 sysdeps/csky/math-tests-trap.h
 create mode 100644 sysdeps/csky/memusage.h
 create mode 100644 sysdeps/csky/nofpu/Implies
 create mode 100644 sysdeps/csky/nofpu/libm-test-ulps
 create mode 100644 sysdeps/csky/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/csky/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/csky/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/csky/nptl/Makefile
 create mode 100644 sysdeps/csky/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/csky/nptl/bits/semaphore.h
 create mode 100644 sysdeps/csky/nptl/pthread-offsets.h
 create mode 100644 sysdeps/csky/nptl/pthreaddef.h
 create mode 100644 sysdeps/csky/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/csky/nptl/tls.h
 create mode 100644 sysdeps/csky/preconfigure
 create mode 100644 sysdeps/csky/sfp-machine.h
 create mode 100644 sysdeps/csky/sotruss-lib.c
 create mode 100644 sysdeps/csky/stackinfo.h
 create mode 100644 sysdeps/csky/sysdep.h
 create mode 100644 sysdeps/csky/tininess.h
 create mode 100644 sysdeps/csky/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/Implies
 create mode 100644 sysdeps/unix/sysv/linux/csky/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/csky/Versions
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/csky/bits/mman.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/bits/shm.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/csky/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libnsl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/csky/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/csky/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/csky/register-dump.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/csky/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/csky/sysdep.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 03/13] C-SKY: Math support
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
  2018-09-12  2:56   ` [PATCH v4 02/13] C-SKY: TLS support Mao Han
@ 2018-09-12  2:56   ` Mao Han
  2018-09-17 21:49     ` Joseph Myers
  2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
                     ` (10 subsequent siblings)
  12 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:56 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

This patch contains support for both hard-float and soft-float.  Including
exception handler, fpu related definition, test config and ulps.
Long double is treated as double on C-SKY target.

	* sysdeps/csky/bits/fenv.h: New file.
	* sysdeps/csky/fpu/fclrexcpt.c: Likewise.
	* sysdeps/csky/fpu/fedisblxcpt.c: Likewise.
	* sysdeps/csky/fpu/feenablxcpt.c: Likewise.
	* sysdeps/csky/fpu/fegetenv.c: Likewise.
	* sysdeps/csky/fpu/fegetexcept.c: Likewise.
	* sysdeps/csky/fpu/fegetmode.c: Likewise.
	* sysdeps/csky/fpu/fegetround.c: Likewise.
	* sysdeps/csky/fpu/feholdexcpt.c: Likewise.
	* sysdeps/csky/fpu/fenv_libc.h: Likewise.
	* sysdeps/csky/fpu/fenv_private.h: Likewise.
	* sysdeps/csky/fpu/fesetenv.c: Likewise.
	* sysdeps/csky/fpu/fesetexcept.c: Likewise.
	* sysdeps/csky/fpu/fesetmode.c: Likewise.
	* sysdeps/csky/fpu/fesetround.c: Likewise.
	* sysdeps/csky/fpu/feupdateenv.c: Likewise.
	* sysdeps/csky/fpu/fgetexcptflg.c: Likewise.
	* sysdeps/csky/fpu/fix-fp-int-convert-overflow.h: Likewise.
	* sysdeps/csky/fpu/fpu_control.h: Likewise.
	* sysdeps/csky/fpu/fraiseexcpt.c: Likewise.
	* sysdeps/csky/fpu/fsetexcptflg.c: Likewise.
	* sysdeps/csky/fpu/ftestexcept.c: Likewise.
	* sysdeps/csky/fpu/libm-test-ulps: Likewise.
	* sysdeps/csky/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/csky/math-tests-trap.h: Likewise.
	* sysdeps/csky/nofpu/Implies: Likewise.
	* sysdeps/csky/nofpu/libm-test-ulps: Likewise.
	* sysdeps/csky/nofpu/libm-test-ulps-name: Likewise.
	* sysdeps/csky/nofpu/math-tests-exceptions.h: Likewise.
	* sysdeps/csky/nofpu/math-tests-rounding.h: Likewise.
	* sysdeps/csky/sfp-machine.h: Likewise.
	* sysdeps/csky/tininess.h: Likewise.
---
 sysdeps/csky/bits/fenv.h                       |   92 ++
 sysdeps/csky/fpu/fclrexcpt.c                   |   42 +
 sysdeps/csky/fpu/fedisblxcpt.c                 |   41 +
 sysdeps/csky/fpu/feenablxcpt.c                 |   40 +
 sysdeps/csky/fpu/fegetenv.c                    |   37 +
 sysdeps/csky/fpu/fegetexcept.c                 |   32 +
 sysdeps/csky/fpu/fegetmode.c                   |   28 +
 sysdeps/csky/fpu/fegetround.c                  |   34 +
 sysdeps/csky/fpu/feholdexcpt.c                 |   34 +
 sysdeps/csky/fpu/fenv_libc.h                   |   30 +
 sysdeps/csky/fpu/fenv_private.h                |  280 ++++
 sysdeps/csky/fpu/fesetenv.c                    |   59 +
 sysdeps/csky/fpu/fesetexcept.c                 |   33 +
 sysdeps/csky/fpu/fesetmode.c                   |   33 +
 sysdeps/csky/fpu/fesetround.c                  |   32 +
 sysdeps/csky/fpu/feupdateenv.c                 |   46 +
 sysdeps/csky/fpu/fgetexcptflg.c                |   32 +
 sysdeps/csky/fpu/fix-fp-int-convert-overflow.h |   33 +
 sysdeps/csky/fpu/fpu_control.h                 |  109 ++
 sysdeps/csky/fpu/fraiseexcpt.c                 |  126 ++
 sysdeps/csky/fpu/fsetexcptflg.c                |   43 +
 sysdeps/csky/fpu/ftestexcept.c                 |   30 +
 sysdeps/csky/fpu/libm-test-ulps                | 1640 +++++++++++++++++++++++
 sysdeps/csky/fpu/libm-test-ulps-name           |    1 +
 sysdeps/csky/math-tests-trap.h                 |   26 +
 sysdeps/csky/nofpu/Implies                     |    1 +
 sysdeps/csky/nofpu/libm-test-ulps              | 1694 ++++++++++++++++++++++++
 sysdeps/csky/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/csky/nofpu/math-tests-exceptions.h     |   27 +
 sysdeps/csky/nofpu/math-tests-rounding.h       |   27 +
 sysdeps/csky/sfp-machine.h                     |   50 +
 sysdeps/csky/tininess.h                        |    1 +
 32 files changed, 4734 insertions(+)
 create mode 100644 sysdeps/csky/bits/fenv.h
 create mode 100644 sysdeps/csky/fpu/fclrexcpt.c
 create mode 100644 sysdeps/csky/fpu/fedisblxcpt.c
 create mode 100644 sysdeps/csky/fpu/feenablxcpt.c
 create mode 100644 sysdeps/csky/fpu/fegetenv.c
 create mode 100644 sysdeps/csky/fpu/fegetexcept.c
 create mode 100644 sysdeps/csky/fpu/fegetmode.c
 create mode 100644 sysdeps/csky/fpu/fegetround.c
 create mode 100644 sysdeps/csky/fpu/feholdexcpt.c
 create mode 100644 sysdeps/csky/fpu/fenv_libc.h
 create mode 100644 sysdeps/csky/fpu/fenv_private.h
 create mode 100644 sysdeps/csky/fpu/fesetenv.c
 create mode 100644 sysdeps/csky/fpu/fesetexcept.c
 create mode 100644 sysdeps/csky/fpu/fesetmode.c
 create mode 100644 sysdeps/csky/fpu/fesetround.c
 create mode 100644 sysdeps/csky/fpu/feupdateenv.c
 create mode 100644 sysdeps/csky/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/csky/fpu/fix-fp-int-convert-overflow.h
 create mode 100644 sysdeps/csky/fpu/fpu_control.h
 create mode 100644 sysdeps/csky/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/csky/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/csky/fpu/ftestexcept.c
 create mode 100644 sysdeps/csky/fpu/libm-test-ulps
 create mode 100644 sysdeps/csky/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/csky/math-tests-trap.h
 create mode 100644 sysdeps/csky/nofpu/Implies
 create mode 100644 sysdeps/csky/nofpu/libm-test-ulps
 create mode 100644 sysdeps/csky/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/csky/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/csky/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/csky/sfp-machine.h
 create mode 100644 sysdeps/csky/tininess.h

diff --git a/sysdeps/csky/bits/fenv.h b/sysdeps/csky/bits/fenv.h
new file mode 100644
index 0000000..dbfc5b9
--- /dev/null
+++ b/sysdeps/csky/bits/fenv.h
@@ -0,0 +1,92 @@
+/* Floating point environment.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate bits in the FPU control word.  */
+enum
+  {
+    FE_INVALID =
+#define FE_INVALID	0x01
+      FE_INVALID,
+    FE_DIVBYZERO =
+#define FE_DIVBYZERO	0x02
+      FE_DIVBYZERO,
+    FE_OVERFLOW =
+#define FE_OVERFLOW	0x04
+      FE_OVERFLOW,
+    FE_UNDERFLOW =
+#define FE_UNDERFLOW	0x08
+      FE_UNDERFLOW,
+    FE_INEXACT =
+#define FE_INEXACT	0x10
+      FE_INEXACT,
+    __FE_DENORMAL = 0x20
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The C-SKY FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST =
+#define FE_TONEAREST	(0x0 << 24)
+      FE_TONEAREST,
+    FE_TOWARDZERO =
+#define FE_TOWARDZERO	(0x1 << 24)
+      FE_TOWARDZERO,
+    FE_UPWARD =
+#define FE_UPWARD	(0x2 << 24)
+      FE_UPWARD,
+    FE_DOWNWARD =
+#define FE_DOWNWARD	(0x3 << 24)
+      FE_DOWNWARD,
+    __FE_ROUND_MASK = (0x3 << 24)
+  };
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef struct
+{
+  unsigned int __fpcr;
+  unsigned int __fpsr;
+} fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+# define FE_NOMASK_ENV	((const fenv_t *) -2)
+#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes.  */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes.  */
+# define FE_DFL_MODE	((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/csky/fpu/fclrexcpt.c b/sysdeps/csky/fpu/fclrexcpt.c
new file mode 100644
index 0000000..de3326b
--- /dev/null
+++ b/sysdeps/csky/fpu/fclrexcpt.c
@@ -0,0 +1,42 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  int fpsr;
+
+  /* Mask out unsupported bits/exceptions.  */
+  excepts &= FE_ALL_EXCEPT;
+
+  /* Read the complete control word.  */
+  _FPU_GETFPSR (fpsr);
+
+  /* Clear the relevant bits.  */
+  fpsr &= ~(excepts | (excepts << CAUSE_SHIFT));
+
+  /* Put the new data in effect.  */
+  _FPU_SETFPSR (fpsr);
+
+  return 0;
+}
+libm_hidden_def (feclearexcept)
diff --git a/sysdeps/csky/fpu/fedisblxcpt.c b/sysdeps/csky/fpu/fedisblxcpt.c
new file mode 100644
index 0000000..6b51611
--- /dev/null
+++ b/sysdeps/csky/fpu/fedisblxcpt.c
@@ -0,0 +1,41 @@
+/* Disable floating-point exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+#include <fpu_control.h>
+
+int
+fedisableexcept (int excepts)
+{
+  unsigned int new_exc, old_exc;
+
+  /* Get the current control word.  */
+  _FPU_GETCW (new_exc);
+
+  old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT;
+
+  /* Get the except disable mask.  */
+  excepts &= FE_ALL_EXCEPT;
+  new_exc &= ~(excepts << ENABLE_SHIFT);
+
+  /* Put the new data in effect.  */
+  _FPU_SETCW (new_exc);
+
+  return old_exc;
+}
diff --git a/sysdeps/csky/fpu/feenablxcpt.c b/sysdeps/csky/fpu/feenablxcpt.c
new file mode 100644
index 0000000..feafdb6
--- /dev/null
+++ b/sysdeps/csky/fpu/feenablxcpt.c
@@ -0,0 +1,40 @@
+/* Enable floating-point exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+#include <fpu_control.h>
+
+int
+feenableexcept (int excepts)
+{
+  unsigned int new_exc, old_exc;
+
+  /* Get the current control word.  */
+  _FPU_GETCW (new_exc);
+
+  old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT;
+
+  excepts &= FE_ALL_EXCEPT;
+
+  new_exc |= excepts << ENABLE_SHIFT;
+
+  _FPU_SETCW (new_exc);
+
+  return old_exc;
+}
diff --git a/sysdeps/csky/fpu/fegetenv.c b/sysdeps/csky/fpu/fegetenv.c
new file mode 100644
index 0000000..3865839
--- /dev/null
+++ b/sysdeps/csky/fpu/fegetenv.c
@@ -0,0 +1,37 @@
+/* Store current floating-point environment.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  unsigned int fpcr;
+  unsigned int fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+  envp->__fpcr = fpcr;
+  envp->__fpsr = fpsr;
+
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
diff --git a/sysdeps/csky/fpu/fegetexcept.c b/sysdeps/csky/fpu/fegetexcept.c
new file mode 100644
index 0000000..e6e46c0
--- /dev/null
+++ b/sysdeps/csky/fpu/fegetexcept.c
@@ -0,0 +1,32 @@
+/* Get enabled floating-point exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+#include <fpu_control.h>
+
+int
+fegetexcept (void)
+{
+  unsigned int exc;
+
+  /* Get the current control word.  */
+  _FPU_GETCW (exc);
+
+  return (exc & ENABLE_MASK) >> ENABLE_SHIFT;
+}
diff --git a/sysdeps/csky/fpu/fegetmode.c b/sysdeps/csky/fpu/fegetmode.c
new file mode 100644
index 0000000..e229f60
--- /dev/null
+++ b/sysdeps/csky/fpu/fegetmode.c
@@ -0,0 +1,28 @@
+/* Store current floating-point control modes.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  _FPU_GETCW (*modep);
+
+  return 0;
+}
diff --git a/sysdeps/csky/fpu/fegetround.c b/sysdeps/csky/fpu/fegetround.c
new file mode 100644
index 0000000..40bda2d
--- /dev/null
+++ b/sysdeps/csky/fpu/fegetround.c
@@ -0,0 +1,34 @@
+/* Return current rounding direction.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetround (void)
+{
+  unsigned int cw;
+
+  /* Get control word.  */
+  _FPU_GETCW (cw);
+
+  return cw & __FE_ROUND_MASK;
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/csky/fpu/feholdexcpt.c b/sysdeps/csky/fpu/feholdexcpt.c
new file mode 100644
index 0000000..e2b1782
--- /dev/null
+++ b/sysdeps/csky/fpu/feholdexcpt.c
@@ -0,0 +1,34 @@
+/* Store current floating-point environment and clear exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+#include <fenv_private.h>
+
+#include <stdio.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+  libc_feholdexcept_vfp (envp);
+  return 0;
+}
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/csky/fpu/fenv_libc.h b/sysdeps/csky/fpu/fenv_libc.h
new file mode 100644
index 0000000..7904fdb
--- /dev/null
+++ b/sysdeps/csky/fpu/fenv_libc.h
@@ -0,0 +1,30 @@
+/* fpu registers environment.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FENV_LIBC_H
+#define _FENV_LIBC_H	1
+
+/* Mask for enabling exceptions and for the CAUSE bits.  */
+#define ENABLE_MASK	0x0003FU
+#define CAUSE_MASK	0x3F000U
+
+/* Shift for FE_* flags to get up to the ENABLE bits and the CAUSE bits.  */
+#define ENABLE_SHIFT	0
+#define CAUSE_SHIFT	8
+
+#endif /* fenv_libc.h */
diff --git a/sysdeps/csky/fpu/fenv_private.h b/sysdeps/csky/fpu/fenv_private.h
new file mode 100644
index 0000000..d086cfc
--- /dev/null
+++ b/sysdeps/csky/fpu/fenv_private.h
@@ -0,0 +1,280 @@
+/* Private floating point rounding and exceptions handling.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef CSKY_FENV_PRIVATE_H
+#define CSKY_FENV_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+
+static __always_inline void
+libc_feholdexcept_vfp (fenv_t *envp)
+{
+  fpu_control_t fpsr, fpcr;
+
+  _FPU_GETCW (fpcr);
+  envp->__fpcr = fpcr;
+
+  _FPU_GETFPSR (fpsr);
+  envp->__fpsr = fpsr;
+
+  /* Now set all exceptions to non-stop.  */
+  fpcr &= ~FE_ALL_EXCEPT;
+
+  /* And clear all exception flags.  */
+  fpsr &= ~(FE_ALL_EXCEPT << CAUSE_SHIFT);
+
+  _FPU_SETFPSR (fpsr);
+
+  _FPU_SETCW (fpcr);
+}
+
+static __always_inline void
+libc_fesetround_vfp (int round)
+{
+  fpu_control_t fpcr;
+
+  _FPU_GETCW (fpcr);
+
+  /* Set new rounding mode if different.  */
+  if (__glibc_unlikely ((fpcr & FE_DOWNWARD) != round))
+    _FPU_SETCW ((fpcr & ~FE_DOWNWARD) | round);
+}
+
+static __always_inline void
+libc_feholdexcept_setround_vfp (fenv_t *envp, int round)
+{
+  fpu_control_t fpsr, fpcr;
+
+  _FPU_GETCW (fpcr);
+  envp->__fpcr = fpcr;
+
+  _FPU_GETFPSR (fpsr);
+  envp->__fpsr = fpsr;
+
+  /* Clear exception flags, set all exceptions to non-stop,
+     and set new rounding mode.  */
+  fpsr &= ~(FE_ALL_EXCEPT << CAUSE_SHIFT);
+  _FPU_SETFPSR (fpsr);
+
+  fpcr &= ~(FE_ALL_EXCEPT | FE_DOWNWARD);
+  _FPU_SETCW (fpcr | round);
+}
+
+static __always_inline void
+libc_feholdsetround_vfp (fenv_t *envp, int round)
+{
+  fpu_control_t fpcr;
+
+  _FPU_GETCW (fpcr);
+  envp->__fpcr = fpcr;
+
+  /* Set new rounding mode if different.  */
+  if (__glibc_unlikely ((fpcr & FE_DOWNWARD) != round))
+    _FPU_SETCW ((fpcr & ~FE_DOWNWARD) | round);
+}
+
+static __always_inline void
+libc_feresetround_vfp (fenv_t *envp)
+{
+  fpu_control_t fpcr, round;
+
+  _FPU_GETCW (fpcr);
+
+  /* Check whether rounding modes are different.  */
+  round = (envp->__fpcr ^ fpcr) & FE_DOWNWARD;
+
+  /* Restore the rounding mode if it was changed.  */
+  if (__glibc_unlikely (round != 0))
+    _FPU_SETCW (fpcr ^ round);
+}
+
+static __always_inline int
+libc_fetestexcept_vfp (int ex)
+{
+  fpu_control_t fpsr;
+
+  _FPU_GETFPSR (fpsr);
+  fpsr = fpsr >> CAUSE_SHIFT;
+  return fpsr & ex & FE_ALL_EXCEPT;
+}
+
+static __always_inline void
+libc_fesetenv_vfp (const fenv_t *envp)
+{
+  fpu_control_t fpcr, fpsr, new_fpcr, new_fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+
+  new_fpcr = envp->__fpcr;
+  new_fpsr = envp->__fpsr;
+
+  if (__glibc_unlikely (fpsr ^ new_fpsr) != 0)
+    _FPU_SETFPSR (new_fpsr);
+
+  if (__glibc_unlikely (fpcr ^ new_fpcr) != 0)
+    _FPU_SETCW (new_fpcr);
+}
+
+static __always_inline int
+libc_feupdateenv_test_vfp (const fenv_t *envp, int ex)
+{
+  fpu_control_t fpcr, fpsr, new_fpcr, new_fpsr, excepts;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+
+  /* Merge current exception flags with the saved fenv.  */
+  excepts = (fpsr >> CAUSE_SHIFT) & FE_ALL_EXCEPT;
+  new_fpcr = envp->__fpcr;
+  new_fpsr = envp->__fpsr | (excepts << CAUSE_SHIFT);
+
+  /* Write FCR and FESR if different.  */
+  if (__glibc_unlikely (fpsr ^ new_fpsr) != 0)
+    _FPU_SETFPSR (new_fpsr);
+
+  if (__glibc_unlikely (fpcr ^ new_fpcr) != 0)
+    _FPU_SETCW (new_fpcr);
+
+  /* Raise the exceptions if enabled in the new FP state.  */
+  if (__glibc_unlikely (excepts & new_fpcr))
+    __feraiseexcept (excepts);
+
+  return excepts & ex;
+}
+
+static __always_inline void
+libc_feupdateenv_vfp (const fenv_t *envp)
+{
+  libc_feupdateenv_test_vfp (envp, 0);
+}
+
+static __always_inline void
+libc_feholdsetround_vfp_ctx (struct rm_ctx *ctx, int r)
+{
+  fpu_control_t fpcr, fpsr, round;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+  ctx->updated_status = false;
+  ctx->env.__fpcr = fpcr;
+  ctx->env.__fpsr = fpsr;
+
+  /* Check whether rounding modes are different.  */
+  round = (fpcr ^ r) & FE_DOWNWARD;
+
+  /* Set the rounding mode if changed.  */
+  if (__glibc_unlikely (round != 0))
+    {
+      ctx->updated_status = true;
+      _FPU_SETCW (fpcr ^ round);
+    }
+}
+
+static __always_inline void
+libc_feresetround_vfp_ctx (struct rm_ctx *ctx)
+{
+  /* Restore the rounding mode if updated.  */
+  if (__glibc_unlikely (ctx->updated_status))
+    {
+      fpu_control_t fpcr;
+
+      _FPU_GETCW (fpcr);
+      fpcr = (fpcr & ~FE_DOWNWARD) | (ctx->env.__fpcr & FE_DOWNWARD);
+      _FPU_SETCW (fpcr);
+    }
+}
+
+static __always_inline void
+libc_fesetenv_vfp_ctx (struct rm_ctx *ctx)
+{
+  fpu_control_t fpcr, fpsr, new_fpcr, new_fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+
+  new_fpcr = ctx->env.__fpcr;
+  new_fpsr = ctx->env.__fpsr;
+
+  if (__glibc_unlikely (fpsr ^ new_fpsr) != 0)
+    _FPU_SETFPSR (new_fpsr);
+
+  if (__glibc_unlikely (fpcr ^ new_fpcr) != 0)
+    _FPU_SETCW (new_fpcr);
+}
+
+#define libc_feholdexcept  libc_feholdexcept_vfp
+#define libc_feholdexceptf libc_feholdexcept_vfp
+#define libc_feholdexceptl libc_feholdexcept_vfp
+
+#define libc_fesetround  libc_fesetround_vfp
+#define libc_fesetroundf libc_fesetround_vfp
+#define libc_fesetroundl libc_fesetround_vfp
+
+#define libc_feresetround  libc_feresetround_vfp
+#define libc_feresetroundf libc_feresetround_vfp
+#define libc_feresetroundl libc_feresetround_vfp
+
+#define libc_feresetround_noex  libc_fesetenv_vfp
+#define libc_feresetround_noexf libc_fesetenv_vfp
+#define libc_feresetround_noexl libc_fesetenv_vfp
+
+#define libc_feholdexcept_setround  libc_feholdexcept_setround_vfp
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround_vfp
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_vfp
+
+#define libc_feholdsetround  libc_feholdsetround_vfp
+#define libc_feholdsetroundf libc_feholdsetround_vfp
+#define libc_feholdsetroundl libc_feholdsetround_vfp
+
+#define libc_fetestexcept  libc_fetestexcept_vfp
+#define libc_fetestexceptf libc_fetestexcept_vfp
+#define libc_fetestexceptl libc_fetestexcept_vfp
+
+#define libc_fesetenv  libc_fesetenv_vfp
+#define libc_fesetenvf libc_fesetenv_vfp
+#define libc_fesetenvl libc_fesetenv_vfp
+
+#define libc_feupdateenv  libc_feupdateenv_vfp
+#define libc_feupdateenvf libc_feupdateenv_vfp
+#define libc_feupdateenvl libc_feupdateenv_vfp
+
+#define libc_feupdateenv_test  libc_feupdateenv_test_vfp
+#define libc_feupdateenv_testf libc_feupdateenv_test_vfp
+#define libc_feupdateenv_testl libc_feupdateenv_test_vfp
+
+/* We have support for rounding mode context.  */
+#define HAVE_RM_CTX 1
+
+#define libc_feholdsetround_ctx		libc_feholdsetround_vfp_ctx
+#define libc_feresetround_ctx		libc_feresetround_vfp_ctx
+#define libc_feresetround_noex_ctx	libc_fesetenv_vfp_ctx
+
+#define libc_feholdsetroundf_ctx	libc_feholdsetround_vfp_ctx
+#define libc_feresetroundf_ctx		libc_feresetround_vfp_ctx
+#define libc_feresetround_noexf_ctx	libc_fesetenv_vfp_ctx
+
+#define libc_feholdsetroundl_ctx	libc_feholdsetround_vfp_ctx
+#define libc_feresetroundl_ctx		libc_feresetround_vfp_ctx
+#define libc_feresetround_noexl_ctx	libc_fesetenv_vfp_ctx
+
+#include_next <fenv_private.h>
+
+#endif /* CSKY_FENV_PRIVATE_H */
diff --git a/sysdeps/csky/fpu/fesetenv.c b/sysdeps/csky/fpu/fesetenv.c
new file mode 100644
index 0000000..dce6770
--- /dev/null
+++ b/sysdeps/csky/fpu/fesetenv.c
@@ -0,0 +1,59 @@
+/* Install given floating-point environment.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+  unsigned int fpcr;
+  unsigned int fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+
+  fpcr &= _FPU_RESERVED;
+  fpsr &= _FPU_FPSR_RESERVED;
+
+  if (envp == FE_DFL_ENV)
+    {
+      fpcr |= _FPU_DEFAULT;
+      fpsr |= _FPU_FPSR_DEFAULT;
+    }
+  else if (envp == FE_NOMASK_ENV)
+    {
+      fpcr |= _FPU_FPCR_IEEE;
+      fpsr |= _FPU_FPSR_IEEE;
+    }
+  else
+    {
+      fpcr |= envp->__fpcr & ~_FPU_RESERVED;
+      fpsr |= envp->__fpsr & ~_FPU_FPSR_RESERVED;
+    }
+
+  _FPU_SETFPSR (fpsr);
+
+  _FPU_SETCW (fpcr);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__fesetenv)
+weak_alias (__fesetenv, fesetenv)
+libm_hidden_weak (fesetenv)
diff --git a/sysdeps/csky/fpu/fesetexcept.c b/sysdeps/csky/fpu/fesetexcept.c
new file mode 100644
index 0000000..e7cd302
--- /dev/null
+++ b/sysdeps/csky/fpu/fesetexcept.c
@@ -0,0 +1,33 @@
+/* Set given exception flags.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+  fpu_control_t fpsr, new_fpsr;
+  _FPU_GETFPSR (fpsr);
+  new_fpsr = fpsr | ((excepts & FE_ALL_EXCEPT) << CAUSE_SHIFT);
+  if (new_fpsr != fpsr)
+    _FPU_SETFPSR (new_fpsr);
+
+  return 0;
+}
diff --git a/sysdeps/csky/fpu/fesetmode.c b/sysdeps/csky/fpu/fesetmode.c
new file mode 100644
index 0000000..65977ef
--- /dev/null
+++ b/sysdeps/csky/fpu/fesetmode.c
@@ -0,0 +1,33 @@
+/* Install given floating-point control modes.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  femode_t mode;
+  if (modep == FE_DFL_MODE)
+    mode = _FPU_DEFAULT;
+  else
+    mode = *modep;
+  _FPU_SETCW (mode);
+
+  return 0;
+}
diff --git a/sysdeps/csky/fpu/fesetround.c b/sysdeps/csky/fpu/fesetround.c
new file mode 100644
index 0000000..c5c3604
--- /dev/null
+++ b/sysdeps/csky/fpu/fesetround.c
@@ -0,0 +1,32 @@
+/* Set current rounding direction.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+#include <stdio.h>
+int
+__fesetround (int round)
+{
+  libc_fesetround_vfp (round);
+  return 0;
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/csky/fpu/feupdateenv.c b/sysdeps/csky/fpu/feupdateenv.c
new file mode 100644
index 0000000..f7aec63
--- /dev/null
+++ b/sysdeps/csky/fpu/feupdateenv.c
@@ -0,0 +1,46 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+#include <fenv_private.h>
+#include <stdio.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+  int temp;
+
+  /* Save current exceptions.  */
+  _FPU_GETFPSR (temp);
+  temp = (temp >> CAUSE_SHIFT) & FE_ALL_EXCEPT;
+  /* Install new environment.  */
+  __fesetenv (envp);
+
+  /* Raise the safed exception.  Incidently for us the implementation
+     defined format of the values in objects of type fexcept_t is the
+     same as the ones specified using the FE_* constants.  */
+  feraiseexcept (temp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/csky/fpu/fgetexcptflg.c b/sysdeps/csky/fpu/fgetexcptflg.c
new file mode 100644
index 0000000..38c4df3
--- /dev/null
+++ b/sysdeps/csky/fpu/fgetexcptflg.c
@@ -0,0 +1,32 @@
+/* Store current representation for exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+#include <fenv_private.h>
+#include <stdio.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  *flagp = libc_fetestexcept_vfp (excepts);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/csky/fpu/fix-fp-int-convert-overflow.h b/sysdeps/csky/fpu/fix-fp-int-convert-overflow.h
new file mode 100644
index 0000000..b3bf482
--- /dev/null
+++ b/sysdeps/csky/fpu/fix-fp-int-convert-overflow.h
@@ -0,0 +1,33 @@
+/* Fix for conversion of floating point to integer overflow.  C-SKY version.
+   Copyright (C) 2015-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
+#define FIX_FP_INT_CONVERT_OVERFLOW_H	1
+
+/* Define these macros to 1 to workaround conversions of out-of-range
+   floating-point numbers to integer types failing to raise the
+   "invalid" exception, or raising spurious "inexact" or other
+   exceptions.  */
+#define FIX_FLT_LONG_CONVERT_OVERFLOW 1
+#define FIX_FLT_LLONG_CONVERT_OVERFLOW 1
+#define FIX_DBL_LONG_CONVERT_OVERFLOW 1
+#define FIX_DBL_LLONG_CONVERT_OVERFLOW 1
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW 1
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 1
+
+#endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/csky/fpu/fpu_control.h b/sysdeps/csky/fpu/fpu_control.h
new file mode 100644
index 0000000..c7d778a
--- /dev/null
+++ b/sysdeps/csky/fpu/fpu_control.h
@@ -0,0 +1,109 @@
+/* FPU control word bits.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/* C-SKY FPU floating point control register bits.
+
+   31-28  -> reserved (read as 0, write with 0)
+   27     -> 0: flush denormalized results to zero
+             1: flush denormalized results to signed minimal normal number.
+   26     -> reserved (read as 0, write with 0)
+   25-24  -> rounding control
+   23-6   -> reserved (read as 0, write with 0)
+    5     -> enable exception for input denormalized exception
+    4     -> enable exception for inexact exception
+    3     -> enable exception for underflow exception
+    2     -> enable exception for overflow exception
+    1     -> enable exception for division by zero exception
+    0     -> enable exception for invalid operation exception
+
+   Rounding Control:
+   00 - rounding to nearest (RN)
+   01 - rounding toward zero (RZ)
+   10 - rounding (up) toward plus infinity (RP)
+   11 - rounding (down)toward minus infinity (RM)
+
+   C-SKY FPU floating point exception status register bits.
+
+   15     -> accumulate bit for any exception
+   14     -> reserved (read as 0, write with 0)
+   13     -> cause bit for input denormalized exception
+   12     -> cause bit for inexact exception
+   11     -> cause bit for underflow exception
+   10     -> cause bit for overflow exception
+    9     -> cause bit for division by zero exception
+    8     -> cause bit for invalid operation exception
+    7     -> flag bit for any exception
+    6     -> reserved (read as 0, write with 0)
+    5     -> flag exception for input denormalized exception
+    4     -> flag exception for inexact exception
+    3     -> flag exception for underflow exception
+    2     -> flag exception for overflow exception
+    1     -> flag exception for division by zero exception
+    0     -> flag exception for invalid operation exception  */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IDE     (1 << 5)  /* input denormalized exception */
+#define _FPU_MASK_IXE     (1 << 4)  /* inexact exception            */
+#define _FPU_MASK_UFE     (1 << 3)  /* underflow exception          */
+#define _FPU_MASK_OFE     (1 << 2)  /* overflow exception           */
+#define _FPU_MASK_DZE     (1 << 1)  /* division by zero exception   */
+#define _FPU_MASK_IOE     (1 << 0)  /* invalid operation exception  */
+
+#define _FPU_MASK_FEA     (1 << 15) /* case for any exception */
+#define _FPU_MASK_FEC     (1 << 7)  /* flag for any exception */
+
+/* flush denormalized numbers to zero */
+#define _FPU_FLUSH_TZ   0x8000000
+
+/* rounding control */
+#define _FPU_RC_NEAREST (0x0 << 24)     /* RECOMMENDED */
+#define _FPU_RC_ZERO    (0x1 << 24)
+#define _FPU_RC_UP      (0x2 << 24)
+#define _FPU_RC_DOWN    (0x3 << 24)
+
+#define _FPU_RESERVED      0xf460ffc0  /* Reserved bits in cw */
+#define _FPU_FPSR_RESERVED 0xffff4040
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT        0x00000000
+#define _FPU_FPSR_DEFAULT   0x00000000
+
+/* IEEE:  same as above, but exceptions */
+#define _FPU_FPCR_IEEE     0x0000001F
+#define _FPU_FPSR_IEEE     0x00000000
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word.  */
+# define _FPU_GETCW(cw) __asm__ volatile ("mfcr %0, cr<1, 2>" : "=a" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("mtcr %0, cr<1, 2>" : : "a" (cw))
+# define _FPU_GETFPSR(cw) __asm__ volatile ("mfcr %0, cr<2, 2>" : "=a" (cw))
+# define _FPU_SETFPSR(cw) __asm__ volatile ("mtcr %0, cr<2, 2>" : : "a" (cw))
+
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+
+#endif /* fpu_control.h */
diff --git a/sysdeps/csky/fpu/fraiseexcpt.c b/sysdeps/csky/fpu/fraiseexcpt.c
new file mode 100644
index 0000000..3419ac7
--- /dev/null
+++ b/sysdeps/csky/fpu/fraiseexcpt.c
@@ -0,0 +1,126 @@
+/* Raise given exceptions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+#include <fpu_control.h>
+#include <float.h>
+#include <math.h>
+
+int
+__feraiseexcept (int excepts)
+{
+    /* Raise exceptions represented by EXCEPTS.  But we must raise only one
+     signal at a time.  It is important that if the overflow/underflow
+     exception and the divide by zero exception are given at the same
+     time, the overflow/underflow exception follows the divide by zero
+     exception.  */
+
+# ifndef __csky_fpuv1__
+    /* First: invalid exception.  */
+    if (FE_INVALID & excepts)
+    {
+      /* One example of a invalid operation is 0 * Infinity.  */
+      float x = HUGE_VALF, y = 0.0f;
+      __asm__ __volatile__ ("fmuls %0, %0, %1" : "+v" (x) : "v" (y));
+    }
+
+    /* Next: division by zero.  */
+    if (FE_DIVBYZERO & excepts)
+    {
+      float x = 1.0f, y = 0.0f;
+      __asm__ __volatile__ ("fdivs %0, %0, %1" : "+v" (x) : "v" (y));
+    }
+
+    /* Next: overflow.  */
+    if (FE_OVERFLOW & excepts)
+    {
+      float x = FLT_MAX;
+      __asm__ __volatile__ ("fmuls %0, %0, %0" : "+v" (x));
+    }
+    /* Next: underflow.  */
+    if (FE_UNDERFLOW & excepts)
+    {
+      float x = -FLT_MIN;
+
+      __asm__ __volatile__ ("fmuls %0, %0, %0" : "+v" (x));
+    }
+
+    /* Last: inexact.  */
+    if (FE_INEXACT & excepts)
+    {
+      float x = 1.0f, y = 3.0f;
+      __asm__ __volatile__ ("fdivs %0, %0, %1" : "+v" (x) : "v" (y));
+    }
+
+    if (__FE_DENORMAL & excepts)
+    {
+      double x = 4.9406564584124654e-324;
+      __asm__ __volatile__ ("fstod %0, %0" : "+v" (x));
+    }
+# else
+     int tmp = 0;
+    /* First: invalid exception.  */
+    if (FE_INVALID & excepts)
+    {
+      /* One example of a invalid operation is 0 * Infinity.  */
+      float x = HUGE_VALF, y = 0.0f;
+      __asm__ __volatile__ ("fmuls %0, %0, %2, %1"
+                    : "+f" (x), "+r"(tmp) : "f" (y));
+    }
+
+    /* Next: division by zero.  */
+    if (FE_DIVBYZERO & excepts)
+    {
+      float x = 1.0f, y = 0.0f;
+      __asm__ __volatile__ ("fdivs %0, %0, %2, %1"
+                    : "+f" (x), "+r"(tmp) : "f" (y));
+    }
+
+    /* Next: overflow.  */
+    if (FE_OVERFLOW & excepts)
+    {
+      float x = FLT_MAX, y = FLT_MAX;
+      __asm__ __volatile__ ("fmuls %0, %0, %2, %1"
+                    : "+f" (x), "+r"(tmp) : "f" (y));
+    }
+
+    /* Next: underflow.  */
+    if (FE_UNDERFLOW & excepts)
+    {
+      float x = -FLT_MIN, y = -FLT_MIN;
+
+      __asm__ __volatile__ ("fmuls %0, %0, %2, %1"
+                    : "+f" (x), "+r"(tmp) : "f" (y));
+    }
+
+    /* Last: inexact.  */
+    if (FE_INEXACT & excepts)
+    {
+      float x = 1.0f, y = 3.0f;
+      __asm__ __volatile__ ("fdivs %0, %0, %2, %1"
+                    : "+f" (x), "+r"(tmp) : "f" (y));
+    }
+# endif /* __csky_fpuv2__ */
+
+    /* Success.  */
+    return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
diff --git a/sysdeps/csky/fpu/fsetexcptflg.c b/sysdeps/csky/fpu/fsetexcptflg.c
new file mode 100644
index 0000000..ca9202d
--- /dev/null
+++ b/sysdeps/csky/fpu/fsetexcptflg.c
@@ -0,0 +1,43 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  fpu_control_t temp;
+
+  /* Get the current exceptions.  */
+   _FPU_GETFPSR (temp);
+
+  /* Make sure the flags we want restored are legal.  */
+  excepts &= FE_ALL_EXCEPT;
+
+  /* Now clear the bits called for, and copy them in from flagp.  Note that
+     we ignore all non-flag bits from *flagp, so they don't matter.  */
+  temp = ((temp >> CAUSE_SHIFT) & ~excepts) | (*flagp & excepts);
+  temp = temp << CAUSE_SHIFT;
+
+  _FPU_SETFPSR (temp);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/csky/fpu/ftestexcept.c b/sysdeps/csky/fpu/ftestexcept.c
new file mode 100644
index 0000000..fee7544
--- /dev/null
+++ b/sysdeps/csky/fpu/ftestexcept.c
@@ -0,0 +1,30 @@
+/* Test exception in current environment.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+#include <fenv_private.h>
+#include <stdio.h>
+
+int
+fetestexcept (int excepts)
+{
+  return libc_fetestexcept_vfp (excepts);
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/csky/fpu/libm-test-ulps b/sysdeps/csky/fpu/libm-test-ulps
new file mode 100644
index 0000000..f80fb8a
--- /dev/null
+++ b/sysdeps/csky/fpu/libm-test-ulps
@@ -0,0 +1,1640 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atan":
+float: 1
+ifloat: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: "cabs_downward":
+double: 1
+idouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+
+Function: "cabs_upward":
+double: 1
+idouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: "carg_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccosh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cexp_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "cos":
+double: 1
+idouble: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+
+Function: Real part of "cpow_downward":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_towardzero":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "ctan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "erfc_downward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "erfc_towardzero":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "erfc_upward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "exp10":
+double: 2
+idouble: 2
+
+Function: "exp10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp2":
+double: 1
+idouble: 1
+
+Function: "exp2_downward":
+double: 1
+idouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+idouble: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "expm1_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "gamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "hypot":
+double: 1
+idouble: 1
+
+Function: "hypot_downward":
+double: 1
+idouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+idouble: 1
+
+Function: "hypot_upward":
+double: 1
+idouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "j0_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: "j0_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j0_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "j1_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1_upward":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "jn_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "lgamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "lgamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "log10_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "log1p_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log2":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "log2_downward":
+double: 3
+idouble: 3
+
+Function: "log2_towardzero":
+double: 2
+idouble: 2
+
+Function: "log2_upward":
+double: 3
+idouble: 3
+
+Function: "pow":
+double: 1
+idouble: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin":
+double: 1
+idouble: 1
+
+Function: "sin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos":
+double: 1
+idouble: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tan":
+float: 1
+ifloat: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "y0_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "y0_upward":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_upward":
+double: 7
+float: 2
+idouble: 7
+ifloat: 2
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+
+# end of automatic generation
diff --git a/sysdeps/csky/fpu/libm-test-ulps-name b/sysdeps/csky/fpu/libm-test-ulps-name
new file mode 100644
index 0000000..236b0fb
--- /dev/null
+++ b/sysdeps/csky/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+CSKY
diff --git a/sysdeps/csky/math-tests-trap.h b/sysdeps/csky/math-tests-trap.h
new file mode 100644
index 0000000..07e5fd4
--- /dev/null
+++ b/sysdeps/csky/math-tests-trap.h
@@ -0,0 +1,26 @@
+/* Configuration for math tests: support for enabling exception traps.
+   C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef CSKY_MATH_TESTS_TRAP_H
+#define CSKY_MATH_TESTS_TRAP_H 1
+
+/* Trapping exceptions are not supported on C-SKY.  */
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)	((EXCEPT) == 0)
+
+#endif /* math-tests-trap.h.  */
diff --git a/sysdeps/csky/nofpu/Implies b/sysdeps/csky/nofpu/Implies
new file mode 100644
index 0000000..abcbadb
--- /dev/null
+++ b/sysdeps/csky/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/csky/nofpu/libm-test-ulps b/sysdeps/csky/nofpu/libm-test-ulps
new file mode 100644
index 0000000..4e0cee8
--- /dev/null
+++ b/sysdeps/csky/nofpu/libm-test-ulps
@@ -0,0 +1,1694 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atan":
+float: 1
+ifloat: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: "cabs_downward":
+double: 1
+idouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+
+Function: "cabs_upward":
+double: 1
+idouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacos_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "cacos_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacos_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cacosh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "cacosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacosh_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "cacosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: "carg_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "casin_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "casin_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Real part of "casinh_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Real part of "casinh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "casinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "catan_upward":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "catan_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "catanh_upward":
+float: 1
+ifloat: 1
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccosh_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Imaginary part of "ccosh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cexp_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "cos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+
+Function: Real part of "cpow_downward":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_towardzero":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csinh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "ctan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "erfc_downward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "erfc_towardzero":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "erfc_upward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "exp":
+float: 1
+ifloat: 1
+
+Function: "exp10":
+double: 2
+idouble: 2
+
+Function: "exp10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp2_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp2_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_downward":
+double: 1
+idouble: 1
+
+Function: "exp_towardzero":
+double: 1
+idouble: 1
+
+Function: "exp_upward":
+double: 1
+idouble: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "expm1_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "gamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "hypot":
+double: 1
+idouble: 1
+
+Function: "hypot_downward":
+double: 1
+idouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+idouble: 1
+
+Function: "hypot_upward":
+double: 1
+idouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "j0_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "j0_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j0_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "j1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1_upward":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "jn_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "lgamma":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "lgamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "log":
+float: 1
+ifloat: 1
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log10_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "log1p_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log2":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "log2_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "log2_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log2_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "log_downward":
+float: 2
+ifloat: 2
+
+Function: "log_towardzero":
+float: 2
+ifloat: 2
+
+Function: "log_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "pow":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow10":
+double: 2
+idouble: 2
+
+Function: "pow10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "pow10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "pow10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "sincos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tan":
+float: 1
+ifloat: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "y0_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "y0_upward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_upward":
+double: 7
+float: 2
+idouble: 7
+ifloat: 2
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+# end of automatic generation
diff --git a/sysdeps/csky/nofpu/libm-test-ulps-name b/sysdeps/csky/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000..d9b35a9
--- /dev/null
+++ b/sysdeps/csky/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+CSKY soft-float
diff --git a/sysdeps/csky/nofpu/math-tests-exceptions.h b/sysdeps/csky/nofpu/math-tests-exceptions.h
new file mode 100644
index 0000000..842e081
--- /dev/null
+++ b/sysdeps/csky/nofpu/math-tests-exceptions.h
@@ -0,0 +1,27 @@
+/* Configuration for math tests: support for exceptions.  C-SKY no-FPU version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef CSKY_NOFPU_MATH_TESTS_EXCEPTIONS_H
+#define CSKY_NOFPU_MATH_TESTS_EXCEPTIONS_H
+
+/* C-SKY soft float does not support exceptions.  */
+# define EXCEPTION_TESTS_float	0
+# define EXCEPTION_TESTS_double	0
+# define EXCEPTION_TESTS_long_double	0
+
+#endif /* math-tests-exceptions.h.  */
diff --git a/sysdeps/csky/nofpu/math-tests-rounding.h b/sysdeps/csky/nofpu/math-tests-rounding.h
new file mode 100644
index 0000000..d3c9795
--- /dev/null
+++ b/sysdeps/csky/nofpu/math-tests-rounding.h
@@ -0,0 +1,27 @@
+/* Configuration for math tests: rounding mode support.  C-SKY no-FPU version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef CSKY_NOFPU_MATH_TESTS_ROUNDING_H
+#define CSKY_NOFPU_MATH_TESTS_ROUNDING_H 1
+
+/* C-SKY soft float does not support rounding modes.  */
+# define ROUNDING_TESTS_float(MODE)	((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_double(MODE)	((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_long_double(MODE)	((MODE) == FE_TONEAREST)
+
+#endif /* math-tests-rounding.h.  */
diff --git a/sysdeps/csky/sfp-machine.h b/sysdeps/csky/sfp-machine.h
new file mode 100644
index 0000000..69c6f33
--- /dev/null
+++ b/sysdeps/csky/sfp-machine.h
@@ -0,0 +1,50 @@
+#define _FP_W_TYPE_SIZE		32
+#define _FP_W_TYPE		unsigned long
+#define _FP_WS_TYPE		signed long
+#define _FP_I_TYPE		long
+
+#define _FP_MUL_MEAT_S(R,X,Y)				\
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y)				\
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)				\
+  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_loop(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S		_FP_QNANBIT_S
+#define _FP_NANFRAC_D		_FP_QNANBIT_D, 0
+#define _FP_NANFRAC_Q		_FP_QNANBIT_Q, 0, 0, 0
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+  do {								\
+    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
+	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
+      {								\
+	R##_s = Y##_s;						\
+	_FP_FRAC_COPY_##wc(R,Y);				\
+      }								\
+    else							\
+      {								\
+	R##_s = X##_s;						\
+	_FP_FRAC_COPY_##wc(R,X);				\
+      }								\
+    R##_c = FP_CLS_NAN;						\
+  } while (0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
diff --git a/sysdeps/csky/tininess.h b/sysdeps/csky/tininess.h
new file mode 100644
index 0000000..1db3779
--- /dev/null
+++ b/sysdeps/csky/tininess.h
@@ -0,0 +1 @@
+#define TININESS_AFTER_ROUNDING	1
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 06/13] C-SKY: Linux ABI
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (6 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 12/13] C-SKY: Add build-many-glibcs.py support Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12 13:40     ` Arnd Bergmann
  2018-09-12  2:57   ` [PATCH v4 13/13] C-SKY: Skeleton documentation Mao Han
                     ` (4 subsequent siblings)
  12 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

Linux-specific code that is required for maintaining ABI compatibility.
This doesn't contain the actual system call interface.

	* sysdeps/unix/sysv/linux/csky/Versions: Likewise.
	* sysdeps/unix/sysv/linux/csky/bits/mman.h: New file.
	* sysdeps/unix/sysv/linux/csky/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/c++-types.data: Likewise.
	* sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym: Likewise.
	* sysdeps/unix/sysv/linux/csky/ipc_priv.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/kernel-features.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/localplt.data: Likewise.
	* sysdeps/unix/sysv/linux/csky/makecontext.c: Likewise.
	* sysdeps/unix/sysv/linux/csky/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/register-dump.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/csky/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sys/cachectl.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sys/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sys/user.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sysdep.h: Likewise.
---
 sysdeps/unix/sysv/linux/csky/Versions             |   5 +
 sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym |  32 ++
 sysdeps/unix/sysv/linux/csky/bits/mman.h          |  44 ++
 sysdeps/unix/sysv/linux/csky/bits/shm.h           | 104 +++++
 sysdeps/unix/sysv/linux/csky/c++-types.data       |  67 +++
 sysdeps/unix/sysv/linux/csky/ipc_priv.h           |  21 +
 sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h     |   6 +
 sysdeps/unix/sysv/linux/csky/kernel-features.h    |  23 +
 sysdeps/unix/sysv/linux/csky/localplt.data        |  19 +
 sysdeps/unix/sysv/linux/csky/makecontext.c        |  74 +++
 sysdeps/unix/sysv/linux/csky/profil-counter.h     |  31 ++
 sysdeps/unix/sysv/linux/csky/register-dump.h      | 193 ++++++++
 sysdeps/unix/sysv/linux/csky/shlib-versions       |   7 +
 sysdeps/unix/sysv/linux/csky/sigcontextinfo.h     |  32 ++
 sysdeps/unix/sysv/linux/csky/sys/cachectl.h       |  38 ++
 sysdeps/unix/sysv/linux/csky/sys/procfs.h         | 123 +++++
 sysdeps/unix/sysv/linux/csky/sys/ucontext.h       |  89 ++++
 sysdeps/unix/sysv/linux/csky/sys/user.h           |  60 +++
 sysdeps/unix/sysv/linux/csky/sysdep.h             | 534 ++++++++++++++++++++++
 19 files changed, 1502 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/csky/Versions
 create mode 100644 sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/csky/bits/mman.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/bits/shm.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/csky/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/csky/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/csky/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/register-dump.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/csky/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/sysdep.h

diff --git a/sysdeps/unix/sysv/linux/csky/Versions b/sysdeps/unix/sysv/linux/csky/Versions
new file mode 100644
index 0000000..b61b3b2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/Versions
@@ -0,0 +1,5 @@
+libc {
+  GLIBC_2.29 {
+    cacheflush;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym b/sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
new file mode 100644
index 0000000..4581b65
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
@@ -0,0 +1,32 @@
+#include <inttypes.h>
+#include <signal.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+SIG_BLOCK
+SIG_SETMASK
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member)	offsetof (ucontext_t, member)
+#define mcontext(member)	ucontext (uc_mcontext.member)
+#define greg(member)		mcontext (__gregs.member)
+#define fpreg(member)		mcontext (__fpregs.member)
+
+UCONTEXT_FLAGS			ucontext (__uc_flags)
+UCONTEXT_LINK			ucontext (uc_link)
+UCONTEXT_STACK			ucontext (uc_stack)
+UCONTEXT_MCONTEXT		ucontext (uc_mcontext)
+UCONTEXT_SIGMASK		ucontext (uc_sigmask)
+
+MCONTEXT_CSKY_PC		greg (__pc)
+MCONTEXT_CSKY_SP		greg (__usp)
+MCONTEXT_CSKY_LR		greg (__lr)
+MCONTEXT_CSKY_A0		greg (__a0)
+MCONTEXT_CSKY_R8		greg (__regs[2])
+MCONTEXT_CSKY_R16		greg (__exregs[0])
+MCONTEXT_CSKY_HI		greg (__rhi)
+MCONTEXT_CSKY_LO		greg (__rlo)
+MCONTEXT_CSKY_R4		greg (__regs[0])
+MCONTEXT_CSKY_FESR		fpreg (__fesr)
+MCONTEXT_CSKY_FCR		fpreg (__fcr)
+MCONTEXT_CSKY_FR0		fpreg (__vr[0])
diff --git a/sysdeps/unix/sysv/linux/csky/bits/mman.h b/sysdeps/unix/sysv/linux/csky/bits/mman.h
new file mode 100644
index 0000000..cbb16dc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/bits/mman.h
@@ -0,0 +1,44 @@
+/* Definitions for POSIX memory map interface.  Linux/C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x00100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x00800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x01000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x02000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x04000		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
+# define MAP_SYNC	0x80000		/* Perform synchronous page
+					   faults for the mapping.  */
+# define MAP_FIXED_NOREPLACE 0x100000   /* MAP_FIXED but do not unmap
+                                           underlying mapping.  */
+#endif
+
+/* Include generic Linux declarations.  */
+#include <bits/mman-linux.h>
diff --git a/sysdeps/unix/sysv/linux/csky/bits/shm.h b/sysdeps/unix/sysv/linux/csky/bits/shm.h
new file mode 100644
index 0000000..cc4347e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/bits/shm.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget.  */
+#define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
+#define SHM_W		0200		/* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'.  */
+#define SHM_RDONLY	010000		/* attach read-only else read-write */
+#define SHM_RND		020000		/* round attach address to SHMLBA */
+#define SHM_REMAP	040000		/* take-over region on attach */
+#define SHM_EXEC	0100000		/* execution access */
+
+/* Commands for `shmctl'.  */
+#define SHM_LOCK	11		/* lock segment (root only) */
+#define SHM_UNLOCK	12		/* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		(__getpagesize () << 2)
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches.  */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a shared memory segment.  */
+struct shmid_ds
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    size_t shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    unsigned long int __glibc_reserved1;
+    __time_t shm_dtime;			/* time of last shmdt() */
+    unsigned long int __glibc_reserved2;
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    unsigned long int __glibc_reserved3;
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    unsigned long int __glibc_reserved4;
+    unsigned long int __glibc_reserved5;
+  };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 	13
+# define SHM_INFO 	14
+# define SHM_STAT_ANY   15
+
+/* shm_mode upper byte flags */
+# define SHM_DEST	01000	/* segment will be destroyed on last detach */
+# define SHM_LOCKED	02000   /* segment will not be swapped */
+# define SHM_HUGETLB	04000	/* segment is mapped via hugetlb */
+# define SHM_NORESERVE	010000	/* don't check for reservations */
+
+struct	shminfo
+  {
+    unsigned long int shmmax;
+    unsigned long int shmmin;
+    unsigned long int shmmni;
+    unsigned long int shmseg;
+    unsigned long int shmall;
+    unsigned long int __glibc_reserved1;
+    unsigned long int __glibc_reserved2;
+    unsigned long int __glibc_reserved3;
+    unsigned long int __glibc_reserved4;
+  };
+
+struct shm_info
+  {
+    int used_ids;
+    unsigned long int shm_tot;	/* total allocated shm */
+    unsigned long int shm_rss;	/* total resident shm */
+    unsigned long int shm_swp;	/* total swapped shm */
+    unsigned long int swap_attempts;
+    unsigned long int swap_successes;
+  };
+
+#endif /* __USE_MISC */
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/csky/c++-types.data b/sysdeps/unix/sysv/linux/csky/c++-types.data
new file mode 100644
index 0000000..303f457
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:i
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/sysdeps/unix/sysv/linux/csky/ipc_priv.h b/sysdeps/unix/sysv/linux/csky/ipc_priv.h
new file mode 100644
index 0000000..56ded89
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux.  C-SKY version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/ipc.h>  /* For __key_t  */
+
+#define __IPC_64	0x0
diff --git a/sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h
new file mode 100644
index 0000000..5a390c7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 268
+#define SIGJMP_BUF_SIZE 268
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 136
+#define SAVED_MASK_OFFSET 140
diff --git a/sysdeps/unix/sysv/linux/csky/kernel-features.h b/sysdeps/unix/sysv/linux/csky/kernel-features.h
new file mode 100644
index 0000000..854865b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/kernel-features.h
@@ -0,0 +1,23 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include_next <kernel-features.h>
+
+/* fadvise64_64 reorganize the syscall arguments.  */
+#define __ASSUME_FADVISE64_64_6ARG	1
diff --git a/sysdeps/unix/sysv/linux/csky/localplt.data b/sysdeps/unix/sysv/linux/csky/localplt.data
new file mode 100644
index 0000000..14c02cb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/localplt.data
@@ -0,0 +1,19 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/csky/makecontext.c b/sysdeps/unix/sysv/linux/csky/makecontext.c
new file mode 100644
index 0000000..c0d7d1e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/makecontext.c
@@ -0,0 +1,74 @@
+/* Create new context.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <ucontext.h>
+
+/* Number of arguments that go in registers.  */
+#define NREG_ARGS  4
+
+/* Take a context previously prepared via getcontext() and set to
+   call func() with the given int only args.  */
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
+{
+  extern void __startcontext (void);
+  unsigned long *funcstack;
+  va_list vl;
+  unsigned long *regptr;
+  unsigned int reg;
+  int misaligned;
+
+  /* Start at the top of stack.  */
+  funcstack = (unsigned long *) (ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
+
+  /* Ensure the stack stays eight byte aligned.  */
+  misaligned = ((unsigned long) funcstack & 4) != 0;
+
+  if ((argc > NREG_ARGS) && (argc & 1) != 0)
+    misaligned = !misaligned;
+
+  if (misaligned)
+    funcstack -= 1;
+
+  va_start (vl, argc);
+
+  /* Reserve space for the on-stack arguments.  */
+  if (argc > NREG_ARGS)
+    funcstack -= (argc - NREG_ARGS);
+
+  ucp->uc_mcontext.__gregs.__usp = (unsigned long) funcstack;
+  ucp->uc_mcontext.__gregs.__pc = (unsigned long) func;
+
+  /* Exit to startcontext() with the next context in R9.  */
+  ucp->uc_mcontext.__gregs.__regs[5] = (unsigned long) ucp->uc_link;
+  ucp->uc_mcontext.__gregs.__lr = (unsigned long) __startcontext;
+
+  /* The first four arguments go into registers.  */
+  regptr = &(ucp->uc_mcontext.__gregs.__a0);
+
+  for (reg = 0; (reg < argc) && (reg < NREG_ARGS); reg++)
+    *regptr++ = va_arg (vl, unsigned long);
+
+  /* And the remainder on the stack.  */
+  for (; reg < argc; reg++)
+    *funcstack++ = va_arg (vl, unsigned long);
+
+  va_end (vl);
+}
+weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/csky/profil-counter.h b/sysdeps/unix/sysv/linux/csky/profil-counter.h
new file mode 100644
index 0000000..1f7ec7a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/profil-counter.h
@@ -0,0 +1,31 @@
+/* Low-level statistical profiling support function.  Linux/C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <signal.h>
+#include <sigcontextinfo.h>
+
+void
+__profil_counter (int signo, const SIGCONTEXT scp)
+{
+  profil_count ((void *) GET_PC (scp));
+
+  /* This is a hack to prevent the compiler from implementing the
+     above function call as a sibcall.  The sibcall would overwrite
+     the signal context.  */
+  asm volatile ("");
+}
diff --git a/sysdeps/unix/sysv/linux/csky/register-dump.h b/sysdeps/unix/sysv/linux/csky/register-dump.h
new file mode 100644
index 0000000..9abe87a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/register-dump.h
@@ -0,0 +1,193 @@
+/* Dump registers.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/uio.h>
+#include <_itoa.h>
+#include <bits/sigcontext.h>
+#include <sys/ucontext.h>
+
+/* abiv1 register dump in this format:
+
+ PSR: XXXXXXXX  PC: XXXXXXXX   SP: XXXXXXXX   LR: XXXXXXXX
+ MASK: XXXXXXXX
+
+ A0: XXXXXXXX   A1: XXXXXXXX   A2: XXXXXXXX   A3: XXXXXXXX
+ R6: XXXXXXXX   R7: XXXXXXXX   R8: XXXXXXXX   R9: XXXXXXXX
+ R10: XXXXXXXX  R11: XXXXXXXX  R12: XXXXXXXX  R13: XXXXXXXX
+ R14: XXXXXXXX  R1: XXXXXXXX
+
+ abiv2 register dump in this format:
+
+ PSR: XXXXXXXX  PC: XXXXXXXX   SP: XXXXXXXX   LR: XXXXXXXX
+ MASK: XXXXXXXX
+
+ A0: XXXXXXXX   A1: XXXXXXXX   A2: XXXXXXXX   A3: XXXXXXXX
+ R4: XXXXXXXX   R5: XXXXXXXX   R6: XXXXXXXX   R7: XXXXXXXX
+ R8: XXXXXXXX   R9: XXXXXXXX   R10: XXXXXXXX  R11: XXXXXXXX
+ R12: XXXXXXXX  R13: XXXXXXXX  R14: XXXXXXXX  R15: XXXXXXXX
+ R16: XXXXXXXX  R17: XXXXXXXX  R18: XXXXXXXX  R19: XXXXXXXX
+ R20: XXXXXXXX  R21: XXXXXXXX  R22: XXXXXXXX  R23: XXXXXXXX
+ R24: XXXXXXXX  R25: XXXXXXXX  R26: XXXXXXXX  R27: XXXXXXXX
+ R28: XXXXXXXX  R29: XXXXXXXX  R30: XXXXXXXX  R31: XXXXXXXX
+
+ */
+
+static void
+hexvalue (unsigned long int value, char *buf, size_t len)
+{
+  char *cp = _itoa_word (value, buf + len, 16, 0);
+  while (cp > buf)
+    *--cp = '0';
+}
+
+static void
+register_dump (int fd, const struct ucontext_t *ctx)
+{
+  char regs[35][8];
+  struct iovec iov[97];
+  size_t nr = 0;
+
+#define ADD_STRING(str) \
+  iov[nr].iov_base = (char *) str;					      \
+  iov[nr].iov_len = strlen (str);					      \
+  ++nr
+#define ADD_MEM(str, len) \
+  iov[nr].iov_base = str;						      \
+  iov[nr].iov_len = len;						      \
+  ++nr
+
+  /* Generate strings of register contents.  */
+  hexvalue (ctx->uc_mcontext.__gregs.__sr, regs[0], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__pc, regs[1], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__usp, regs[2], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__lr, regs[3], 8);
+  hexvalue (ctx->uc_mcontext.__mask, regs[4], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__a0, regs[5], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__a1, regs[6], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__a2, regs[7], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__a3, regs[8], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[0], regs[9], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[1], regs[10], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[2], regs[11], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[3], regs[12], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[4], regs[13], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[5], regs[14], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[6], regs[15], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[7], regs[16], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[8], regs[17], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__regs[9], regs[18], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[0], regs[19], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[1], regs[20], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[2], regs[21], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[3], regs[22], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[4], regs[23], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[5], regs[24], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[6], regs[25], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[7], regs[26], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[8], regs[27], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[9], regs[28], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[10], regs[29], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[11], regs[30], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[12], regs[31], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[13], regs[32], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__exregs[14], regs[33], 8);
+  hexvalue (ctx->uc_mcontext.__gregs.__tls, regs[34], 8);
+
+  /* Generate the output.  */
+  ADD_STRING ("Register dump:\n\n PSR: ");
+  ADD_MEM (regs[0], 8);
+  ADD_STRING ("  PC: ");
+  ADD_MEM (regs[1], 8);
+  ADD_STRING ("   SP: ");
+  ADD_MEM (regs[2], 8);
+  ADD_STRING ("   LR: ");
+  ADD_MEM (regs[3], 8);
+  ADD_STRING ("\n MASK: ");
+  ADD_MEM (regs[4], 8);
+  ADD_STRING ("\n\n A0: ");
+  ADD_MEM (regs[5], 8);
+  ADD_STRING ("   A1: ");
+  ADD_MEM (regs[6], 8);
+  ADD_STRING ("   A2: ");
+  ADD_MEM (regs[7], 8);
+  ADD_STRING ("   A3: ");
+  ADD_MEM (regs[8], 8);
+  ADD_STRING ("\n R4: ");
+  ADD_MEM (regs[9], 8);
+  ADD_STRING ("   r5: ");
+  ADD_MEM (regs[10], 8);
+  ADD_STRING ("   r6: ");
+  ADD_MEM (regs[11], 8);
+  ADD_STRING ("   r7: ");
+  ADD_MEM (regs[12], 8);
+  ADD_STRING ("\n R8: ");
+  ADD_MEM (regs[13], 8);
+  ADD_STRING ("   R9: ");
+  ADD_MEM (regs[14], 8);
+  ADD_STRING ("   R10: ");
+  ADD_MEM (regs[15], 8);
+  ADD_STRING ("  R11: ");
+  ADD_MEM (regs[16], 8);
+  ADD_STRING ("\n R12: ");
+  ADD_MEM (regs[17], 8);
+  ADD_STRING ("  R13: ");
+  ADD_MEM (regs[18], 8);
+  ADD_STRING ("  R14: ");
+  ADD_MEM (regs[19], 8);
+  ADD_STRING ("  R15: ");
+  ADD_MEM (regs[20], 8);
+  ADD_STRING ("\n R16: ");
+  ADD_MEM (regs[21], 8);
+  ADD_STRING ("  R17: ");
+  ADD_MEM (regs[22], 8);
+  ADD_STRING ("  R18: ");
+  ADD_MEM (regs[23], 8);
+  ADD_STRING ("  R19: ");
+  ADD_MEM (regs[24], 8);
+  ADD_STRING ("\n R20: ");
+  ADD_MEM (regs[25], 8);
+  ADD_STRING ("  R21: ");
+  ADD_MEM (regs[26], 8);
+  ADD_STRING ("  R22: ");
+  ADD_MEM (regs[27], 8);
+  ADD_STRING ("  R23: ");
+  ADD_MEM (regs[28], 8);
+  ADD_STRING ("\n R24: ");
+  ADD_MEM (regs[29], 8);
+  ADD_STRING ("  R25: ");
+  ADD_MEM (regs[30], 8);
+  ADD_STRING ("  R26: ");
+  ADD_MEM (regs[31], 8);
+  ADD_STRING ("  R27: ");
+  ADD_MEM (regs[32], 8);
+  ADD_STRING ("\n R28: ");
+  ADD_MEM (regs[33], 8);
+  ADD_STRING ("  R29: ");
+  ADD_MEM (regs[34], 8);
+  ADD_STRING ("  R30: ");
+  ADD_MEM (regs[33], 8);
+  ADD_STRING ("  TP: ");
+  ADD_MEM (regs[34], 8);
+
+  ADD_STRING ("\n");
+
+  /* Write the stuff out.  */
+  writev (fd, iov, nr);
+}
+
+#define REGISTER_DUMP register_dump (fd, ctx)
diff --git a/sysdeps/unix/sysv/linux/csky/shlib-versions b/sysdeps/unix/sysv/linux/csky/shlib-versions
new file mode 100644
index 0000000..1451971
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/shlib-versions
@@ -0,0 +1,7 @@
+DEFAULT			GLIBC_2.29
+
+%if CSKYABI == 2
+ld=ld-linux-cskyv2-le.so.1
+%else
+%error cannot determine ABI
+%endif
diff --git a/sysdeps/unix/sysv/linux/csky/sigcontextinfo.h b/sysdeps/unix/sysv/linux/csky/sigcontextinfo.h
new file mode 100644
index 0000000..b9054d3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sigcontextinfo.h
@@ -0,0 +1,32 @@
+/* C-SKY definitions for signal handling calling conventions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define SIGCONTEXT siginfo_t *_si, struct ucontext_t *
+#define GET_PC(ctx)     ((void *) (ctx)->uc_mcontext.__gregs.__pc)
+
+/* There is no reliable way to get the sigcontext unless we use a
+   three-argument signal handler.  */
+#define __sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (__sigaction) (sig, act, oact); \
+})
+
+#define sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (sigaction) (sig, act, oact); \
+})
diff --git a/sysdeps/unix/sysv/linux/csky/sys/cachectl.h b/sysdeps/unix/sysv/linux/csky/sys/cachectl.h
new file mode 100644
index 0000000..bdc7dbb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sys/cachectl.h
@@ -0,0 +1,38 @@
+/* C-SKY cache flushing interface.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/* Get the kernel definition for the op bits.  */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+extern int cacheflush (void *__addr, const int __nbytes,
+		       const int __op) __THROW;
+#endif
+extern int _flush_cache (char *__addr, const int __nbytes,
+		         const int __op) __THROW;
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/sysdeps/unix/sysv/linux/csky/sys/procfs.h b/sysdeps/unix/sysv/linux/csky/sys/procfs.h
new file mode 100644
index 0000000..e48eaba
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sys/procfs.h
@@ -0,0 +1,123 @@
+/* Core image file related definitions, C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  It doesn't have anything to do with the /proc file
+   system, even though Linux has one.
+
+   Anyway, the whole purpose of this file is for GDB and GDB only.
+   Don't read too much into it.  Don't use it for anything other than
+   GDB unless you know what you are doing.  */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* Type for a general-purpose register.  */
+typedef unsigned long elf_greg_t;
+
+/* And the whole bunch of them.  We could have used `struct
+   user_regs' directly in the typedef, but tradition says that
+   the register set is an array, which does have some peculiar
+   semantics, so leave it that way.  */
+#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_fpregs elf_fpregset_t;
+
+/* Signal info.  */
+struct elf_siginfo
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
+
+/* Definitions to generate Intel SVR4-like core files.  These mostly
+   have the same names as the SVR4 types with "elf_" tacked on the
+   front to prevent clashes with Linux definitions, and the typedef
+   forms have been avoided.  This is mostly like the SVR4 structure,
+   but more Linuxy, with things that Linux does not support and which
+   GDB doesn't really use excluded.  */
+
+struct elf_prstatus
+  {
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned long int pr_sigpend;	/* Set of pending signals.  */
+    unsigned long int pr_sighold;	/* Set of held signals.  */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct timeval pr_utime;		/* User time.  */
+    struct timeval pr_stime;		/* System time.  */
+    struct timeval pr_cutime;		/* Cumulative user time.  */
+    struct timeval pr_cstime;		/* Cumulative system time.  */
+    elf_gregset_t pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
+
+
+#define ELF_PRARGSZ     (80)    /* Number of chars for args.  */
+
+struct elf_prpsinfo
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned long int pr_flag;		/* Flags.  */
+    unsigned short int pr_uid;
+    unsigned short int pr_gid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];			/* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
+  };
+
+/* The rest of this file provides the types for emulation of the
+   Solaris <proc_service.h> interfaces that should be implemented by
+   users of libthread_db.  */
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore have only one PID type.  */
+typedef __pid_t lwpid_t;
+
+/* Process status and info.  In the end we do provide typedefs for them.  */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/csky/sys/ucontext.h b/sysdeps/unix/sysv/linux/csky/sys/ucontext.h
new file mode 100644
index 0000000..b784ddd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sys/ucontext.h
@@ -0,0 +1,89 @@
+/* struct ucontext definition, C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+typedef struct
+  {
+    unsigned long __tls;
+    unsigned long __lr;
+    unsigned long __pc;
+    unsigned long __sr;
+    unsigned long __usp;
+
+    /*
+     * a0, a1, a2, a3:
+     * abiv2: r0, r1, r2, r3
+     */
+
+    unsigned long __orig_a0;
+    unsigned long __a0;
+    unsigned long __a1;
+    unsigned long __a2;
+    unsigned long __a3;
+
+    /*
+     * ABIV2: r4 ~ r13
+     */
+    unsigned long __regs[10];
+
+    /* r16 ~ r30 */
+    unsigned long __exregs[15];
+
+    unsigned long __rhi;
+    unsigned long __rlo;
+    unsigned long __glibc_reserved;
+  } gregset_t;
+
+typedef struct
+  {
+    unsigned long __vr[64];
+    unsigned long __fcr;
+    unsigned long __fesr;
+    unsigned long __fid;
+    unsigned long __glibc_reserved;
+  } fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    unsigned long __mask;
+    gregset_t __gregs;
+    fpregset_t __fpregs;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext_t
+  {
+    unsigned long int __uc_flags;
+    struct ucontext_t *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    sigset_t uc_sigmask;
+  } ucontext_t;
+
+#undef __ctx
+
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/csky/sys/user.h b/sysdeps/unix/sysv/linux/csky/sys/user.h
new file mode 100644
index 0000000..6064734
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sys/user.h
@@ -0,0 +1,60 @@
+/* ptrace register data format definitions.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H  1
+
+struct user_fpregs {
+  unsigned long fsr;		/* fpu status reg */
+  unsigned long fesr;		/* fpu exception status reg */
+  unsigned long fp[32];		/* fpu general regs */
+};
+
+struct user_regs {
+  unsigned long int uregs[34];	/* CSKY V2 has 32 general rgister.  */
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use.  */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+  struct user_regs    regs;        /* The registers are actually stored.  */
+  int                 u_fpvalid;   /* True if math co-processor being used.  */
+
+/* The rest of this junk is to help gdb figure out what goes where.  */
+  unsigned long int   u_tsize;     /* Text segment size (pages).  */
+  unsigned long int   u_dsize;     /* Data segment size (pages).  */
+  unsigned long int   u_ssize;     /* Stack segment size (pages).  */
+  unsigned long       start_code;  /* Starting virtual address of text.  */
+  unsigned long       start_stack; /* Starting virtual address of stack area.
+				      This is actually the bottom of the stack
+				      the top of the stack is always found in
+				      the esp register.  */
+  long int            signal;      /* Signal that caused the core dump.  */
+  int                 reserved;    /* No longer used.  */
+  struct user_regs *  u_ar0;       /* Used by gdb to help find the values
+				      for the registers.  */
+  unsigned long       magic;       /* To uniquely identify a core file.  */
+  char                u_comm[32];  /* User command that was responsible.  */
+  struct user_fpregs  u_fp;
+  struct user_fpregs* u_fpstate;   /* Math Co-processor pointer.  */
+};
+
+#endif /* _SYS_USER_H */
diff --git a/sysdeps/unix/sysv/linux/csky/sysdep.h b/sysdeps/unix/sysv/linux/csky/sysdep.h
new file mode 100644
index 0000000..3fd456f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/sysdep.h
@@ -0,0 +1,534 @@
+/* Assembly macros for C-SKY.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LINUX_CSKY_SYSDEP_H
+#define _LINUX_CSKY_SYSDEP_H 1
+
+/* There is some commonality.  */
+#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
+#include <sysdeps/unix/sysv/linux/sysdep.h>
+#include <sysdeps/csky/sysdep.h>
+
+/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
+#include <dl-sysdep.h>
+
+#include <tls.h>
+
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+# include <errno.h>
+#endif
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
+
+#ifdef __ASSEMBLER__
+/* Linux uses a negative return value to indicate syscall errors,
+   unlike most Unices, which use the condition codes' carry flag.
+
+   Since version 2.1 the return value of a system call might be
+   negative even if the call succeeded.  E.g., the `lseek' system call
+   might return a large offset.  Therefore we must not anymore test
+   for < 0, but test for a real error by making sure the value in R0
+   is a real error number.  Linus said he will make sure the no syscall
+   returns a value in -1 .. -4095 as a valid result so we can safely
+   test with -4095.  */
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)	\
+  .text;					\
+  ENTRY (name);					\
+  DO_CALL (syscall_name, args);
+
+# define GETGB				\
+	grs	t0, .Lgetpc;		\
+.Lgetpc:				\
+	lrw	gb, .Lgetpc@GOTPC;	\
+	addu	gb, t0;
+
+# if IS_IN (libc)
+#  ifdef __PIC__
+#   define PSEUDO_RET			\
+	btsti	a0, 31;			\
+	bf	1f;			\
+	subi	sp, 8;			\
+	st.w	lr, (sp);		\
+	st.w	gb, (sp, 4);		\
+	GETGB;				\
+	lrw	a2, SYSCALL_ERROR@PLT;	\
+	add	a2, gb;			\
+	ld.w	a2, (a2);		\
+	jsr	a2;			\
+	ld.w	lr, (sp);		\
+	ld.w	gb, (sp, 4);		\
+	addi	sp, 8;			\
+1:					\
+	rts
+#  else
+#   define PSEUDO_RET			\
+	btsti	a0, 31;			\
+	bf	1f;			\
+	jmpi	SYSCALL_ERROR;		\
+1:					\
+	rts
+#  endif
+# else
+#  ifdef __PIC__
+#   define PSEUDO_RET			\
+	btsti	a0, 31;			\
+	bf	1f;			\
+	subi	sp, 8;			\
+	st.w	lr, (sp);		\
+	st.w	gb, (sp, 4);		\
+	GETGB;				\
+	bsr	SYSCALL_ERROR;		\
+	ld.w	lr, (sp);		\
+	ld.w	gb, (sp, 4);		\
+	addi	sp, 8;			\
+1:					\
+	rts
+#  else
+#   define PSEUDO_RET			\
+	btsti	a0, 31;			\
+	bt	SYSCALL_ERROR;		\
+	rts
+#  endif
+# endif
+
+# undef ret
+# define ret PSEUDO_RET
+
+# undef PSEUDO_END
+# define PSEUDO_END(name)		\
+  .align 4;				\
+  SYSCALL_ERROR_HANDLER;		\
+  END (name)
+
+# undef PSEUDO_NOERRNO
+# define PSEUDO_NOERRNO(name, syscall_name, args)	\
+  .text;						\
+  ENTRY (name);						\
+  DO_CALL (syscall_name, args)
+
+# define PSEUDO_RET_NOERRNO rts
+
+# undef ret_NOERRNO
+# define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+# undef PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name) END (name)
+
+/* The function has to return the error code.  */
+# undef PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args)	\
+  .text;						\
+  ENTRY (name)						\
+  DO_CALL (syscall_name, args);				\
+  not	a0;						\
+  addi	a0, 1
+
+# undef PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(name) END (name)
+
+# define ret_ERRVAL rts
+
+# if !IS_IN (libc)
+#  define SYSCALL_ERROR __local_syscall_error
+#  if RTLD_PRIVATE_ERRNO
+#   ifdef __PIC__
+#    define SYSCALL_ERROR_HANDLER	\
+__local_syscall_error:			\
+	lrw	a1, rtld_errno@PLT; 	\
+	addu	a1, gb;			\
+	ldw	a1, (a1);		\
+	rsubi	a0, 0;			\
+	stw	a0, (a1);		\
+	bmaski	a0, 0;			\
+	rts
+#   else /* __PIC__ */
+#    define SYSCALL_ERROR_HANDLER	\
+__local_syscall_error:			\
+	lrw	a1, rtld_errno;		\
+	rsubi	a0, 0;			\
+	stw	a0, (a1);		\
+	bmaski	a0, 0;			\
+	rts
+#   endif /* __PIC__ */
+#  else /* !RTLD_PRIVATE_ERRNO */
+#   ifdef __PIC__
+#    define SYSCALL_ERROR_HANDLER		\
+__local_syscall_error:				\
+	subi	sp, 8;				\
+	stw	a0, (sp, 0);			\
+	stw	r15, (sp, 4);			\
+	lrw	a1, __errno_location@PLT;	\
+	add	a1, gb;				\
+	ldw	a1, (a1);			\
+	jsr	a1;				\
+	ldw	a1, (sp, 0); /* load errno*/	\
+	ldw	r15, (sp, 4);			\
+	addi	sp, 8;				\
+	movi	a2, 0;				\
+	rsub	a1, a1, a2;			\
+	stw	a1, (a0);			\
+	bmaski	a0, 0;				\
+	rts
+#    else
+#     define SYSCALL_ERROR_HANDLER 		\
+__local_syscall_error:				\
+	subi	sp, 8;				\
+	stw	a0, (sp, 0);			\
+	stw	r15, (sp, 4);			\
+	lrw	a1, __errno_location;		\
+	jsr	a1;				\
+	ldw	a1, (sp, 0); /* load errno */	\
+	ldw	r15, (sp, 4);			\
+	addi	sp, 8;				\
+	movi	a2, 0;				\
+	rsub	a1, a1, a2;			\
+	stw	a1, (a0);			\
+	bmaski	a0, 0;				\
+	rts
+#   endif /* __PIC__ */
+#  endif/* RTLD_PRIVATE_ERROR */
+# else
+#  define SYSCALL_ERROR_HANDLER  /* Nothing here; code in sysdep.S is used.  */
+#  define SYSCALL_ERROR __syscall_error
+# endif/* IS_IN (libc) */
+
+/* define DO_CALL */
+# undef DO_CALL
+# define DO_CALL(syscall_name, args)	\
+  DOARGS_##args;			\
+  lrw	r7, SYS_ify(syscall_name);	\
+  trap	0;				\
+  UNDOARGS_##args
+
+# undef  DOARGS_0
+# define DOARGS_0			\
+	subi	sp, 8;			\
+	cfi_adjust_cfa_offset (8);	\
+	stw	r7, (sp, 0);		\
+	cfi_rel_offset (r7, 0);
+
+# undef  DOARGS_1
+# define DOARGS_1 DOARGS_0
+# undef  DOARGS_2
+# define DOARGS_2 DOARGS_0
+# undef  DOARGS_3
+# define DOARGS_3 DOARGS_0
+# undef  DOARGS_4
+# define DOARGS_4 DOARGS_0
+# undef  DOARGS_5
+# define DOARGS_5			\
+	subi	sp, 8;			\
+	cfi_adjust_cfa_offset (8);	\
+	stw	r7, (sp, 0);		\
+	cfi_rel_offset (7, 0);		\
+	stw	r4, (sp, 4);		\
+	cfi_rel_offset (4, 4);		\
+	ldw	r4, (sp, 8)
+# undef  DOARGS_6
+# define DOARGS_6			\
+	subi	sp, 16;			\
+	cfi_adjust_cfa_offset (16);	\
+	stw	r7, (sp, 0);		\
+	cfi_rel_offset (7, 0);		\
+	stw	r4, (sp, 4);		\
+	cfi_rel_offset (4, 4);		\
+	stw	r5, (sp, 8);		\
+	cfi_rel_offset (5, 8);		\
+	ldw	r4, (sp, 16);		\
+	ldw	r5, (sp, 20)
+
+# undef  UNDOARGS_0
+# define UNDOARGS_0 \
+  ldw  r7, (sp, 0); \
+  cfi_restore (r7); \
+  addi sp, 8;   \
+  cfi_adjust_cfa_offset (-8);
+
+# undef  UNDOARGS_1
+# define UNDOARGS_1 UNDOARGS_0
+# undef  UNDOARGS_2
+# define UNDOARGS_2 UNDOARGS_0
+# undef  UNDOARGS_3
+# define UNDOARGS_3 UNDOARGS_0
+# undef  UNDOARGS_4
+# define UNDOARGS_4 UNDOARGS_0
+# undef  UNDOARGS_5
+# define UNDOARGS_5			\
+	ldw	r7, (sp, 0);		\
+	cfi_restore (r4);		\
+	ldw	r4, (sp, 4);		\
+	cfi_restore (r4);		\
+	addi	sp, 8;			\
+	cfi_adjust_cfa_offset (-8);
+
+# undef  UNDOARGS_6
+# define UNDOARGS_6			\
+	ldw	r7, (sp, 0);		\
+	cfi_restore (r7);		\
+	ldw	r4, (sp, 4);		\
+	cfi_restore (r4);		\
+	ldw	r5, (sp, 8);		\
+	cfi_restore (r5);		\
+	addi	sp, 16;			\
+	cfi_adjust_cfa_offset (-16);
+
+#else /* not __ASSEMBLER__ */
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+# undef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...)				\
+  ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args);	\
+     if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result,), 0))	\
+       {								\
+	 __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, ));		\
+	 _sys_result = (unsigned int) -1;				\
+       }								\
+     (int) _sys_result; })
+
+# undef INTERNAL_SYSCALL_DECL
+# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+# undef INTERNAL_SYSCALL_ERROR_P
+# define INTERNAL_SYSCALL_ERROR_P(val, err) \
+  ((unsigned int) (val) >= 0xffffff01u)
+
+# undef INTERNAL_SYSCALL_ERRNO
+# define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
+# undef INTERNAL_SYSCALL_RAW
+# define INTERNAL_SYSCALL_RAW0(name, err, dummy...)			\
+  ({unsigned int __sys_result;						\
+     {									\
+       register int _a1 __asm__ ("a0"), _nr __asm__ ("r7");		\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr)				\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW1(name, err, arg1)			\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1);				\
+     {									\
+       register int _a1 __asm__ ("a0"), _nr __asm__ ("r7");		\
+       _a1 = _tmp_arg1;							\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1)			\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW2(name, err, arg1, arg2)			\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       _a1 = _tmp_arg1, _a2 = _tmp_arg2;				\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2)		\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW3(name, err, arg1, arg2, arg3)		\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+    register int _tmp_arg3 = (int)(arg3);				\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       register int _a3 __asm__ ("a2");					\
+       _a1 = _tmp_arg1;							\
+       _a2 = _tmp_arg2;							\
+       _a3 = _tmp_arg3;							\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2),		\
+			       "r" (_a3)				\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW4(name, err, arg1, arg2, arg3, arg4)	\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+    register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\
+       _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\
+       _a4 = _tmp_arg4;							\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2),		\
+			       "r" (_a3), "r" (_a4)			\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW5(name, err, arg1, arg2, arg3, arg4,	\
+			      arg5)					\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+    register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\
+    register int _tmp_arg5 = (int)(arg5);				\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\
+       register int _a5 __asm__ ("r4");					\
+       _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\
+       _a4 = _tmp_arg4, _a5 = _tmp_arg5;				\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2),		\
+			       "r" (_a3), "r" (_a4), "r" (_a5)		\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW6(name, err, arg1, arg2, arg3, arg4,	\
+			      arg5, arg6)				\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+    register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\
+    register int _tmp_arg5 = (int)(arg5), _tmp_arg6 = (int)(arg6);	\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\
+       register int _a5 __asm__ ("r4"), _a6 __asm__ ("r5");		\
+       _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\
+       _a4 = _tmp_arg4, _a5 = _tmp_arg5, _a6 = _tmp_arg6;		\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2),		\
+			       "r" (_a3), "r" (_a4), "r" (_a5),		\
+			       "r" (_a6)				\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# define INTERNAL_SYSCALL_RAW7(name, err, arg1, arg2, arg3, arg4,	\
+			      arg5, arg6, arg7)				\
+  ({unsigned int __sys_result;						\
+    register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\
+    register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\
+    register int _tmp_arg5 = (int)(arg5), _tmp_arg6 = (int)(arg6);	\
+    register int _tmp_arg7 = (int)(arg7);				\
+     {									\
+       register int _nr __asm__ ("r7");					\
+       register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\
+       register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\
+       register int _a5 __asm__ ("r4"), _a6 __asm__ ("r5");		\
+       register int _a7 __asm__ ("r6");					\
+       _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\
+       _a4 = _tmp_arg4, _a5 = _tmp_arg5, _a6 = _tmp_arg6;		\
+       _a7 = _tmp_arg7;							\
+       _nr = name;							\
+       __asm__ __volatile__ ("trap  0 \n\t"				\
+			     : "=r" (_a1)				\
+			     : "r" (_nr), "r" (_a1), "r" (_a2),		\
+			       "r" (_a3), "r" (_a4), "r" (_a5),		\
+			       "r" (_a6), "r" (_a7)			\
+			     : "memory");				\
+	       __sys_result = _a1;					\
+     }									\
+     (int) __sys_result; })
+
+# undef INTERNAL_SYSCALL
+# define INTERNAL_SYSCALL(name, err, nr, args...)		\
+  INTERNAL_SYSCALL_RAW##nr(SYS_ify(name), err, args)
+
+# undef INTERNAL_SYSCALL_NCS
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...)		\
+  INTERNAL_SYSCALL_RAW##nr (number, err, args)
+
+#endif /* __ASSEMBLER__ */
+
+/* Pointer mangling support.  */
+#if (IS_IN (rtld) || \
+     (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(dst, src, guard)			\
+	grs	t0, 1f;					\
+1:							\
+	lrw	guard, 1b@GOTPC;			\
+	addu	t0, guard;				\
+	lrw	guard, __pointer_chk_guard_local@GOT;	\
+	ldr.w	guard, (t0, guard << 0);		\
+	ldw	guard, (guard, 0);			\
+	xor	dst, src, guard;
+#  define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard)
+#  define PTR_MANGLE2(dst, src, guard) \
+	xor	dst, src, guard
+#  define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard)
+# else
+extern uintptr_t __pointer_chk_guard_local;
+#  define PTR_MANGLE(var) \
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+#  define PTR_DEMANGLE(var) PTR_MANGLE (var)
+# endif
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(dst, src, guard)		\
+	grs	t0, 1f;				\
+1:						\
+	lrw	guard, 1b@GOTPC;		\
+	addu	t0, guard;			\
+	lrw	guard, __pointer_chk_guard@GOT;	\
+	ldr.w	guard, (t0, guard << 0);	\
+	ldw	guard, (guard, 0);		\
+	xor	dst, src, guard;
+#  define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard)
+#  define PTR_MANGLE2(dst, src, guard) \
+	xor	dst, src, guard
+#  define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard)
+# else
+extern uintptr_t __pointer_chk_guard;
+#  define PTR_MANGLE(var) \
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
+#  define PTR_DEMANGLE(var) PTR_MANGLE (var)
+# endif
+#endif
+
+#endif /* linux/csky/sysdep.h */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 09/13] C-SKY: Add dynamic relocations to elf.h
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (3 preceding siblings ...)
  2018-09-12  2:56   ` [PATCH v4 05/13] C-SKY: Linux Syscall Interface Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12  2:57   ` [PATCH v4 11/13] C-SKY: Add ABI definitions in config.h.in Mao Han
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

	* elf/elf.h (EM_CSKY, R_CKCORE_NONE, R_CKCORE_ADDR32)
	(R_CKCORE_PCRELIMM8BY4, R_CKCORE_PCRELIMM11BY2, R_CKCORE_PCREL32)
	(R_CKCORE_PCRELJSR_IMM11BY2, R_CKCORE_RELATIVE, R_CKCORE_COPY)
	(R_CKCORE_GLOB_DAT, R_CKCORE_JUMP_SLOT, R_CKCORE_GOTOFF)
	(R_CKCORE_GOTPC, R_CKCORE_GOT32, R_CKCORE_PLT32, R_CKCORE_ADDRGOT)
	(R_CKCORE_ADDRPLT, R_CKCORE_PCREL_IMM26BY2, R_CKCORE_PCREL_IMM16BY2)
	(R_CKCORE_PCREL_IMM16BY4, R_CKCORE_PCREL_IMM10BY2)
	(R_CKCORE_PCREL_IMM10BY4, R_CKCORE_ADDR_HI16, R_CKCORE_ADDR_LO16)
	(R_CKCORE_GOTPC_HI16, R_CKCORE_GOTPC_LO16, R_CKCORE_GOTOFF_HI16)
	(R_CKCORE_GOTOFF_LO16, R_CKCORE_GOT12, R_CKCORE_GOT_HI16)
	(R_CKCORE_GOT_LO16, R_CKCORE_PLT12, R_CKCORE_PLT_HI16)
	(R_CKCORE_PLT_LO16, R_CKCORE_ADDRGOT_HI16, R_CKCORE_ADDRGOT_LO16)
	(R_CKCORE_ADDRPLT_HI16, R_CKCORE_ADDRPLT_LO16)
	(R_CKCORE_PCREL_JSR_IMM26BY2, R_CKCORE_TOFFSET_LO16)
	(R_CKCORE_DOFFSET_LO16, R_CKCORE_PCREL_IMM18BY2)
	(R_CKCORE_DOFFSET_IMM18, R_CKCORE_DOFFSET_IMM18BY2)
	(R_CKCORE_DOFFSET_IMM18BY4, R_CKCORE_GOT_IMM18BY4)
	(R_CKCORE_PLT_IMM18BY4, R_CKCORE_PCREL_IMM7BY4, R_CKCORE_TLS_LE32)
	(R_CKCORE_TLS_IE32, R_CKCORE_TLS_GD32, R_CKCORE_TLS_LDM32)
	(R_CKCORE_TLS_LDO32, R_CKCORE_TLS_DTPMOD32, R_CKCORE_TLS_DTPOFF32)
	(R_CKCORE_TLS_TPOFF32): New Define.
---
 elf/elf.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)

diff --git a/elf/elf.h b/elf/elf.h
index 226e538..9ff927b 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -360,8 +360,9 @@ typedef struct
 #define EM_RISCV	243	/* RISC-V */
 
 #define EM_BPF		247	/* Linux BPF -- in-kernel virtual machine */
+#define EM_CSKY         252     /* C_SKY */
 
-#define EM_NUM		248
+#define EM_NUM		253
 
 /* Old spellings/synonyms.  */
 
@@ -3019,6 +3020,70 @@ enum
 /* Keep this the last entry.  */
 #define R_ARM_NUM		256
 
+/* csky */
+#define R_CKCORE_NONE               0	/* no reloc */
+#define R_CKCORE_ADDR32             1	/* direct 32 bit (S + A) */
+#define R_CKCORE_PCRELIMM8BY4       2	/* disp ((S + A - P) >> 2) & 0xff   */
+#define R_CKCORE_PCRELIMM11BY2      3	/* disp ((S + A - P) >> 1) & 0x7ff  */
+#define R_CKCORE_PCREL32            5	/* 32-bit rel (S + A - P)           */
+#define R_CKCORE_PCRELJSR_IMM11BY2  6	/* disp ((S + A - P) >>1) & 0x7ff   */
+#define R_CKCORE_RELATIVE           9	/* 32 bit adjust program base(B + A)*/
+#define R_CKCORE_COPY               10	/* 32 bit adjust by program base    */
+#define R_CKCORE_GLOB_DAT           11	/* off between got and sym (S)      */
+#define R_CKCORE_JUMP_SLOT          12	/* PLT entry (S) */
+#define R_CKCORE_GOTOFF             13	/* offset to GOT (S + A - GOT)      */
+#define R_CKCORE_GOTPC              14	/* PC offset to GOT (GOT + A - P)   */
+#define R_CKCORE_GOT32              15	/* 32 bit GOT entry (G) */
+#define R_CKCORE_PLT32              16	/* 32 bit PLT entry (G) */
+#define R_CKCORE_ADDRGOT            17	/* GOT entry in GLOB_DAT (GOT + G)  */
+#define R_CKCORE_ADDRPLT            18	/* PLT entry in GLOB_DAT (GOT + G)  */
+#define R_CKCORE_PCREL_IMM26BY2     19	/* ((S + A - P) >> 1) & 0x3ffffff   */
+#define R_CKCORE_PCREL_IMM16BY2     20	/* disp ((S + A - P) >> 1) & 0xffff */
+#define R_CKCORE_PCREL_IMM16BY4     21	/* disp ((S + A - P) >> 2) & 0xffff */
+#define R_CKCORE_PCREL_IMM10BY2     22	/* disp ((S + A - P) >> 1) & 0x3ff  */
+#define R_CKCORE_PCREL_IMM10BY4     23	/* disp ((S + A - P) >> 2) & 0x3ff  */
+#define R_CKCORE_ADDR_HI16          24	/* high & low 16 bit ADDR */
+                                        /* ((S + A) >> 16) & 0xffff */
+#define R_CKCORE_ADDR_LO16          25	/* (S + A) & 0xffff */
+#define R_CKCORE_GOTPC_HI16         26	/* high & low 16 bit GOTPC */
+                                        /* ((GOT + A - P) >> 16) & 0xffff */
+#define R_CKCORE_GOTPC_LO16         27	/* (GOT + A - P) & 0xffff */
+#define R_CKCORE_GOTOFF_HI16        28	/* high & low 16 bit GOTOFF */
+                                        /* ((S + A - GOT) >> 16) & 0xffff */
+#define R_CKCORE_GOTOFF_LO16        29	/* (S + A - GOT) & 0xffff */
+#define R_CKCORE_GOT12              30	/* 12 bit disp GOT entry (G) */
+#define R_CKCORE_GOT_HI16           31	/* high & low 16 bit GOT */
+                                        /* (G >> 16) & 0xffff */
+#define R_CKCORE_GOT_LO16           32	/* (G & 0xffff) */
+#define R_CKCORE_PLT12              33	/* 12 bit disp PLT entry (G) */
+#define R_CKCORE_PLT_HI16           34	/* high & low 16 bit PLT */
+                                        /* (G >> 16) & 0xffff */
+#define R_CKCORE_PLT_LO16           35	/* G & 0xffff */
+#define R_CKCORE_ADDRGOT_HI16       36	/* high & low 16 bit ADDRGOT */
+                                        /* (GOT + G * 4) & 0xffff */
+#define R_CKCORE_ADDRGOT_LO16       37	/* (GOT + G * 4) & 0xffff */
+#define R_CKCORE_ADDRPLT_HI16       38	/* high & low 16 bit ADDRPLT */
+                                        /* ((GOT + G * 4) >> 16) & 0xFFFF */
+#define R_CKCORE_ADDRPLT_LO16       39	/* (GOT+G*4) & 0xffff */
+#define R_CKCORE_PCREL_JSR_IMM26BY2 40	/* disp ((S+A-P) >>1) & x3ffffff */
+#define R_CKCORE_TOFFSET_LO16       41	/* (S+A-BTEXT) & 0xffff */
+#define R_CKCORE_DOFFSET_LO16       42	/* (S+A-BTEXT) & 0xffff */
+#define R_CKCORE_PCREL_IMM18BY2     43	/* disp ((S+A-P) >>1) & 0x3ffff */
+#define R_CKCORE_DOFFSET_IMM18      44	/* disp (S+A-BDATA) & 0x3ffff */
+#define R_CKCORE_DOFFSET_IMM18BY2   45	/* disp ((S+A-BDATA)>>1) & 0x3ffff */
+#define R_CKCORE_DOFFSET_IMM18BY4   46	/* disp ((S+A-BDATA)>>2) & 0x3ffff */
+#define R_CKCORE_GOT_IMM18BY4       48	/* disp (G >> 2) */
+#define R_CKCORE_PLT_IMM18BY4       49	/* disp (G >> 2) */
+#define R_CKCORE_PCREL_IMM7BY4      50	/* disp ((S+A-P) >>2) & 0x7f */
+#define R_CKCORE_TLS_LE32           51  /* 32 bit offset to TLS block */
+#define R_CKCORE_TLS_IE32           52
+#define R_CKCORE_TLS_GD32           53
+#define R_CKCORE_TLS_LDM32          54
+#define R_CKCORE_TLS_LDO32          55
+#define R_CKCORE_TLS_DTPMOD32       56
+#define R_CKCORE_TLS_DTPOFF32       57
+#define R_CKCORE_TLS_TPOFF32        58
+
 /* IA-64 specific declarations.  */
 
 /* Processor specific flags for the Ehdr e_flags field.  */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 08/13] C-SKY: Linux Startup and Dynamic Loading Code
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (8 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 13/13] C-SKY: Skeleton documentation Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12  3:05   ` [PATCH v4 10/13] C-SKY: Build Infastructure Mao Han
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

This contains the Linux-specific code for loading programs on C-SKY.

	* sysdeps/csky/dl-machine.h: New file.
	* sysdeps/csky/dl-procinfo.c: Likewise.
	* sysdeps/csky/dl-procinfo.h: Likewise.
	* sysdeps/csky/dl-sysdep.h: Likewise.
	* sysdeps/csky/ldsodefs.h: Likewise.
	* sysdeps/csky/linkmap.h: Likewise.
	* sysdeps/csky/sotruss-lib.c: Likewise.
	* sysdeps/csky/tst-audit.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/ldconfig.h: Likewise.
---
 sysdeps/csky/dl-machine.h               | 362 ++++++++++++++++++++++++++++++++
 sysdeps/csky/dl-procinfo.c              |  62 ++++++
 sysdeps/csky/dl-procinfo.h              |  59 ++++++
 sysdeps/csky/dl-sysdep.h                |  23 ++
 sysdeps/csky/ldsodefs.h                 |  42 ++++
 sysdeps/csky/linkmap.h                  |   4 +
 sysdeps/csky/sotruss-lib.c              |  49 +++++
 sysdeps/csky/tst-audit.h                |  23 ++
 sysdeps/unix/sysv/linux/csky/ldconfig.h |  31 +++
 9 files changed, 655 insertions(+)
 create mode 100644 sysdeps/csky/dl-machine.h
 create mode 100644 sysdeps/csky/dl-procinfo.c
 create mode 100644 sysdeps/csky/dl-procinfo.h
 create mode 100644 sysdeps/csky/dl-sysdep.h
 create mode 100644 sysdeps/csky/ldsodefs.h
 create mode 100644 sysdeps/csky/linkmap.h
 create mode 100644 sysdeps/csky/sotruss-lib.c
 create mode 100644 sysdeps/csky/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/ldconfig.h

diff --git a/sysdeps/csky/dl-machine.h b/sysdeps/csky/dl-machine.h
new file mode 100644
index 0000000..451c8f7
--- /dev/null
+++ b/sysdeps/csky/dl-machine.h
@@ -0,0 +1,362 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef dl_machine_h
+#define dl_machine_h
+
+#define ELF_MACHINE_NAME "csky"
+
+#include <sys/param.h>
+#include <sysdep.h>
+#include <dl-tls.h>
+
+/* Return nonzero if ELF header is compatible with the running host.  */
+static inline int
+elf_machine_matches_host (const Elf32_Ehdr *ehdr)
+{
+  return ehdr->e_machine == EM_CSKY;
+}
+
+/* Return the link-time address of _DYNAMIC.
+   This must be inlined in a function which uses global data.  */
+static inline Elf32_Addr
+elf_machine_dynamic (void)
+{
+  register Elf32_Addr *got __asm__ ("gb");
+  return *got;
+}
+
+/* Return the run-time load address ,of the shared object.  */
+static inline Elf32_Addr
+elf_machine_load_address (void)
+{
+  extern Elf32_Addr __dl_start (void *) asm ("_dl_start");
+  Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
+  Elf32_Addr pcrel_addr;
+  asm  ("grs %0,_dl_start\n" : "=r" (pcrel_addr));
+
+  return pcrel_addr - got_addr;
+}
+
+
+/* Set up the loaded object described by L so its unrelocated PLT
+   entries will jump to the on-demand fixup code in dl-runtime.c.  */
+
+static inline int __attribute__ ((always_inline))
+elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+{
+  Elf32_Addr *got;
+  extern void _dl_runtime_resolve (Elf32_Word);
+
+  if (l->l_info[DT_JMPREL] && lazy)
+    {
+      /* The GOT entries for functions in the PLT have not yet been
+	 filled in.  Their initial contents will arrange when called
+	 to push an offset into the .rela.plt section, push
+	 _GLOBAL_OFFSET_TABLE_[1], and then jump to
+	 _GLOBAL_OFFSET_TABLE_[2].  */
+      got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
+
+      if (got[1])
+	l->l_mach.plt = got[1] + l->l_addr;
+      got[1] = (Elf32_Addr) l; /* Identify this shared object.  */
+
+      /* The got[2] entry contains the address of a function which gets
+	 called to get the address of a so far unresolved function and
+	 jump to it.  The profiling extension of the dynamic linker allows
+	 to intercept the calls to collect information.  In this case we
+	 don't store the address in the GOT so that all future calls also
+	 end in this function.  */
+	got[2] = (Elf32_Addr) &_dl_runtime_resolve;
+    }
+  return lazy;
+}
+
+/* Mask identifying addresses reserved for the user program,
+   where the dynamic linker should not map anything.  */
+#define ELF_MACHINE_USER_ADDRESS_MASK 0x80000000UL
+
+/* Initial entry point code for the dynamic linker.
+   The C function `_dl_start' is the real entry point;
+   its return value is the user program's entry point.  */
+#define RTLD_START asm ("\
+.text\n\
+.globl _start\n\
+.type _start, @function\n\
+.globl _dl_start_user\n\
+.type _dl_start_user, @function\n\
+_start:\n\
+	grs	gb, .Lgetpc1\n\
+.Lgetpc1:\n\
+	lrw	t0, .Lgetpc1@GOTPC\n\
+	addu	gb, t0\n\
+	mov	a0, sp\n\
+	lrw	t1, _dl_start@GOTOFF\n\
+	addu	t1, gb\n\
+	jsr	t1\n\
+_dl_start_user:\n\
+	/* get _dl_skip_args */    \n\
+	lrw	r11, _dl_skip_args@GOTOFF\n\
+	addu	r11, gb\n\
+	ldw	r11, (r11, 0)\n\
+	/* store program entry address in r11 */ \n\
+	mov	r10, a0\n\
+	/* Get argc */\n\
+	ldw	a1, (sp, 0)\n\
+	/* Get **argv */\n\
+	mov	a2, sp\n\
+	addi	a2, 4\n\
+	cmpnei	r11, 0\n\
+	bt	.L_fixup_stack\n\
+.L_done_fixup:\n\
+	mov	a3, a1\n\
+	lsli	a3, 2\n\
+	add	a3, a2\n\
+	addi	a3, 4\n\
+	lrw	a0, _rtld_local@GOTOFF\n\
+	addu	a0, gb\n\
+	ldw	a0, (a0, 0)\n\
+	lrw	t1, _dl_init@PLT\n\
+	addu	t1, gb\n\
+	ldw	t1, (t1)\n\
+	jsr	t1\n\
+	lrw	a0, _dl_fini@GOTOFF\n\
+	addu	a0, gb\n\
+	jmp	r10\n\
+.L_fixup_stack:\n\
+	subu	a1, r11\n\
+	lsli	r11, 2\n\
+	addu	sp, r11\n\
+	stw	a1, (sp, 0)\n\
+	mov	a2, sp\n\
+	addi	a2, 4\n\
+	lrw	a3, _dl_argv@GOTOFF\n\
+	addu	a3, gb\n\
+	stw	a2, (a3, 0)\n\
+	br	.L_done_fixup\n\
+");
+
+/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
+   TLS variable, so undefined references should not be allowed to
+   define the value.
+   ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
+   of the main executable's symbols, as for a COPY reloc.  */
+#ifndef RTLD_BOOTSTRAP
+# define elf_machine_type_class(type) \
+  ((((type) == R_CKCORE_JUMP_SLOT || (type) == R_CKCORE_TLS_DTPMOD32	   \
+     || (type) == R_CKCORE_TLS_DTPOFF32 || (type) == R_CKCORE_TLS_TPOFF32) \
+    * ELF_RTYPE_CLASS_PLT)						   \
+   | (((type) == R_CKCORE_COPY) * ELF_RTYPE_CLASS_COPY))
+#else
+# define elf_machine_type_class(type) \
+  ((((type) == R_CKCORE_JUMP_SLOT     \
+   | (((type) == R_CKCORE_COPY) * ELF_RTYPE_CLASS_COPY))
+#endif
+
+/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
+#define ELF_MACHINE_JMP_SLOT R_CKCORE_JUMP_SLOT
+
+/* C-SKY never uses Elf32_Rel relocations.  */
+#define ELF_MACHINE_NO_REL 1
+#define ELF_MACHINE_NO_RELA 0
+
+/* We define an initialization functions.  This is called very early in
+   _dl_sysdep_start.  */
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+  if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+    /* Avoid an empty string which would disturb us.  */
+    GLRO(dl_platform) = NULL;
+}
+
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+		       const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+		       const Elf32_Rela *reloc,
+		       Elf32_Addr *reloc_addr, Elf32_Addr value)
+{
+  return *reloc_addr = value;
+}
+
+/* Return the final value of a plt relocation.  On the csky the JMP_SLOT
+   relocation ignores the addend.  */
+static inline Elf32_Addr
+elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
+		       Elf32_Addr value)
+{
+  return value;
+}
+
+/* Names of the architecture-specific auditing callback functions.  */
+#define ARCH_LA_PLTENTER csky_gnu_pltenter
+#define ARCH_LA_PLTEXIT csky_gnu_pltexit
+
+#endif /* !dl_machine_h */
+#ifdef RESOLVE_MAP
+
+/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+   MAP is the object containing the reloc.  */
+
+auto inline void __attribute__ ((unused, always_inline))
+elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+		  const Elf32_Sym *sym, const struct r_found_version *version,
+		  void *const reloc_addr_arg, int skip_ifunc)
+{
+  Elf32_Addr *const reloc_addr = reloc_addr_arg;
+  const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
+  unsigned short __attribute__ ((unused)) *opcode16_addr;
+  Elf32_Addr __attribute__ ((unused)) insn_opcode = 0x0;
+
+  if (__builtin_expect (r_type == R_CKCORE_RELATIVE, 0))
+    *reloc_addr = map->l_addr + reloc->r_addend;
+  else
+    {
+      const Elf32_Sym *const refsym = sym;
+      struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+      ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
+      opcode16_addr = (unsigned short *)reloc_addr;
+
+      switch (r_type)
+	{
+	case R_CKCORE_COPY:
+	  if (sym == NULL)
+	    /* This can happen in trace mode if an object could not be
+	       found.  */
+	    break;
+	  if (sym->st_size > refsym->st_size
+	      || (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
+	    {
+	      const char *strtab;
+
+	      strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+	      _dl_error_printf ("\
+%s: Symbol `%s' has different size in shared object, consider re-linking\n",
+				rtld_progname ?: "<program name unknown>",
+				strtab + refsym->st_name);
+	    }
+	  memcpy (reloc_addr_arg, (void *) value,
+		  MIN (sym->st_size, refsym->st_size));
+	  break;
+	case R_CKCORE_GLOB_DAT:
+	case R_CKCORE_JUMP_SLOT:
+	  *reloc_addr = value;
+	  break;
+	case R_CKCORE_ADDR32:
+	  *reloc_addr = value + reloc->r_addend;
+	  break;
+	case R_CKCORE_PCREL32:
+	  *reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
+	  break;
+#if defined(__CK810__) || defined(__CK807__)
+	case R_CKCORE_ADDR_HI16:
+	  insn_opcode = (*opcode16_addr << 16) | (*(opcode16_addr + 1));
+	  insn_opcode = (insn_opcode & 0xffff0000)
+			    | (((value + reloc->r_addend) >> 16) & 0xffff);
+	  *(opcode16_addr++) = (unsigned short)(insn_opcode >> 16);
+	  *opcode16_addr = (unsigned short)(insn_opcode & 0xffff);
+	  break;
+	case R_CKCORE_ADDR_LO16:
+	  insn_opcode = (*opcode16_addr << 16) | (*(opcode16_addr + 1));
+	  insn_opcode = (insn_opcode & 0xffff0000)
+			    | ((value + reloc->r_addend) & 0xffff);
+	   *(opcode16_addr++) = (unsigned short)(insn_opcode >> 16);
+	   *opcode16_addr = (unsigned short)(insn_opcode & 0xffff);
+	   break;
+	case R_CKCORE_PCREL_IMM26BY2:
+	{
+	  unsigned int offset = ((value + reloc->r_addend -
+				  (unsigned int)reloc_addr) >> 1);
+	  insn_opcode = (*opcode16_addr << 16) | (*(opcode16_addr + 1));
+	  if (offset > 0x3ffffff){
+	    const char *strtab;
+	    strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+
+	    _dl_error_printf ("\
+%s:The reloc R_CKCORE_PCREL_IMM26BY2 cannot reach the symbol '%s'.\n",
+	      rtld_progname ?: "<program name unknown>",
+	      strtab + refsym->st_name);
+	    break;
+	  }
+	  insn_opcode = (insn_opcode & ~0x3ffffff) | offset;
+	  *(opcode16_addr++) = (unsigned short)(insn_opcode >> 16);
+	  *opcode16_addr = (unsigned short)(insn_opcode & 0xffff);
+	  break;
+	}
+	case R_CKCORE_PCREL_JSR_IMM26BY2:
+	  break;
+#endif
+#ifndef RTLD_BOOTSTRAP
+	case R_CKCORE_TLS_DTPMOD32:
+	/* Get the information from the link map returned by the
+	   resolv function.  */
+	  if (sym_map != NULL)
+	    *reloc_addr = sym_map->l_tls_modid;
+	  break;
+	case R_CKCORE_TLS_DTPOFF32:
+	  if (sym != NULL)
+	    *reloc_addr =(sym == NULL ? 0 : sym->st_value) + reloc->r_addend;
+	  break;
+	case R_CKCORE_TLS_TPOFF32:
+	  if (sym != NULL)
+	    {
+	      CHECK_STATIC_TLS (map, sym_map);
+	      *reloc_addr = (sym->st_value + sym_map->l_tls_offset
+			     + reloc->r_addend);
+	    }
+	  break;
+#endif /* !RTLD_BOOTSTRAP */
+	case R_CKCORE_NONE:
+	  break;
+	default:
+	  break;
+	}
+    }
+}
+
+auto inline void __attribute__ ((unused, always_inline))
+elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
+			   void *const reloc_addr_arg)
+{
+  Elf32_Addr *const reloc_addr = reloc_addr_arg;
+  *reloc_addr = l_addr + reloc->r_addend;
+}
+
+auto inline void __attribute__ ((unused, always_inline))
+elf_machine_lazy_rel (struct link_map *map,
+		      Elf32_Addr l_addr, const Elf32_Rela *reloc,
+		      int skip_ifunc)
+{
+  Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
+  const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
+  if (ELF32_R_TYPE (reloc->r_info) == R_CKCORE_JUMP_SLOT)
+    {
+      /* Check for unexpected PLT reloc type.  */
+      if (__builtin_expect (r_type == R_CKCORE_JUMP_SLOT, 1))
+	{
+	  if (__builtin_expect (map->l_mach.plt, 0) == 0)
+	    *reloc_addr = l_addr + reloc->r_addend;
+	  else
+	    *reloc_addr = map->l_mach.plt;
+	}
+    }
+}
+
+#endif /* RESOLVE_MAP */
diff --git a/sysdeps/csky/dl-procinfo.c b/sysdeps/csky/dl-procinfo.c
new file mode 100644
index 0000000..88f16d4
--- /dev/null
+++ b/sysdeps/csky/dl-procinfo.c
@@ -0,0 +1,62 @@
+/* Data for C-SKY version of processor capability information.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This information must be kept in sync with the _DL_PLATFORM_COUNT
+   definitions in procinfo.h.
+
+   If anything should be added here check whether the size of each string
+   is still ok with the given array size.
+
+   All the #ifdefs in the definitions are quite irritating but
+   necessary if we want to avoid duplicating the information.  There
+   are three different modes:
+
+   - PROCINFO_DECL is defined.  This means we are only interested in
+     declarations.
+
+   - PROCINFO_DECL is not defined:
+
+     + if SHARED is defined the file is included in an array
+       initializer.  The .element = { ... } syntax is needed.
+
+     + if SHARED is not defined a normal array initialization is
+       needed.
+  */
+
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+  ._dl_csky_platforms
+#else
+PROCINFO_CLASS const char _dl_csky_platforms[4][6]
+#endif
+#ifndef PROCINFO_DECL
+= {
+    "ck610", "ck807", "ck810", "ck860"
+  }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
diff --git a/sysdeps/csky/dl-procinfo.h b/sysdeps/csky/dl-procinfo.h
new file mode 100644
index 0000000..4e7abe7
--- /dev/null
+++ b/sysdeps/csky/dl-procinfo.h
@@ -0,0 +1,59 @@
+/* C-SKY version of processor capability information handling macros.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#ifndef _DL_PROCINFO_H
+#define _DL_PROCINFO_H	1
+
+#include <ldsodefs.h>
+
+/* Mask to filter out platforms.  */
+#define _DL_HWCAP_PLATFORM    (-1ULL)
+
+#define _DL_PLATFORMS_COUNT   4
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_platform (const char *str)
+{
+  int i;
+
+  if (str != NULL)
+    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
+      {
+        if (strcmp (str, GLRO(dl_csky_platforms)[i]) == 0)
+          return i;
+      }
+  return -1;
+};
+
+/* We cannot provide a general printing function.  */
+#define _dl_procinfo(word, val) -1
+
+/* There are no hardware capabilities defined.  */
+#define _dl_hwcap_string(idx) ""
+
+/* By default there is no important hardware capability.  */
+#define HWCAP_IMPORTANT (0)
+
+/* We don't have any hardware capabilities.  */
+#define _DL_HWCAP_COUNT	0
+
+#define _dl_string_hwcap(str) (-1)
+
+#endif /* dl-procinfo.h */
diff --git a/sysdeps/csky/dl-sysdep.h b/sysdeps/csky/dl-sysdep.h
new file mode 100644
index 0000000..d5dd294
--- /dev/null
+++ b/sysdeps/csky/dl-sysdep.h
@@ -0,0 +1,23 @@
+/* System-specific settings for dynamic linker code.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include_next <dl-sysdep.h>
+
+/* _dl_argv cannot be attribute_relro, because _dl_start_user
+   might write into it after _dl_start returns.  */
+#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/csky/ldsodefs.h b/sysdeps/csky/ldsodefs.h
new file mode 100644
index 0000000..477ca7d
--- /dev/null
+++ b/sysdeps/csky/ldsodefs.h
@@ -0,0 +1,42 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _CSKY_LDSODEFS_H
+#define _CSKY_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_csky_regs;
+struct La_csky_retval;
+
+#define ARCH_PLTENTER_MEMBERS	\
+    Elf32_Addr (*csky_gnu_pltenter) (Elf32_Sym *, unsigned int,		      \
+					 uintptr_t *, uintptr_t *,	      \
+					 struct La_csky_regs *,		      \
+					 unsigned int *, const char *,	      \
+					 long int *);
+
+#define ARCH_PLTEXIT_MEMBERS	\
+    unsigned int (*csky_gnu_pltexit) (Elf32_Sym *, unsigned int,	       \
+					  uintptr_t *, uintptr_t *,	       \
+					  const struct La_csky_regs *,	       \
+					  struct La_csky_retval *,	       \
+					  const char *);
+
+#include_next <ldsodefs.h>
+#endif
diff --git a/sysdeps/csky/linkmap.h b/sysdeps/csky/linkmap.h
new file mode 100644
index 0000000..648976d
--- /dev/null
+++ b/sysdeps/csky/linkmap.h
@@ -0,0 +1,4 @@
+struct link_map_machine
+  {
+    Elf32_Addr plt; /* Address of .plt */
+  };
diff --git a/sysdeps/csky/sotruss-lib.c b/sysdeps/csky/sotruss-lib.c
new file mode 100644
index 0000000..280c371
--- /dev/null
+++ b/sysdeps/csky/sotruss-lib.c
@@ -0,0 +1,49 @@
+/* Override generic sotruss-lib.c to define actual functions for C-SKY.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+ElfW(Addr)
+la_csky_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+		      unsigned int ndx __attribute__ ((unused)),
+		      uintptr_t *refcook, uintptr_t *defcook,
+		      La_csky_regs *regs, unsigned int *flags,
+		      const char *symname, long int *framesizep)
+{
+  print_enter (refcook, defcook, symname,
+	       regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+	       *flags);
+
+  /* No need to copy anything, we will not need the parameters in any case.  */
+  *framesizep = 0;
+
+  return sym->st_value;
+}
+
+unsigned int
+la_csky_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+		     uintptr_t *defcook, const struct La_csky_regs *inregs,
+		     struct La_csky_retval *outregs, const char *symname)
+{
+  print_exit (refcook, defcook, symname, outregs->lrv_v0);
+
+  return 0;
+}
diff --git a/sysdeps/csky/tst-audit.h b/sysdeps/csky/tst-audit.h
new file mode 100644
index 0000000..6c64625
--- /dev/null
+++ b/sysdeps/csky/tst-audit.h
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define pltenter la_csky_gnu_pltenter
+#define pltexit la_csky_gnu_pltexit
+#define La_regs La_csky_regs
+#define La_retval La_csky_retval
+#define int_retval lrv_reg[0]
diff --git a/sysdeps/unix/sysv/linux/csky/ldconfig.h b/sysdeps/unix/sysv/linux/csky/ldconfig.h
new file mode 100644
index 0000000..a1e4d61
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/ldconfig.h
@@ -0,0 +1,31 @@
+/* ldconfig default paths and libraries.  Linux/C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define LD_SO_PREFIX "/lib/ld-linux-"
+#define LD_SO_SUFFIX ".so.1"
+
+# define LD_SO_ABI "cskyv2-le"
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES	\
+  { LD_SO_PREFIX LD_SO_ABI LD_SO_SUFFIX, FLAG_ELF_LIBC6 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES	\
+  { "libc.so.6", FLAG_ELF_LIBC6 },	\
+  { "libm.so.6", FLAG_ELF_LIBC6 },
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 12/13] C-SKY: Add build-many-glibcs.py support
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (5 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 11/13] C-SKY: Add ABI definitions in config.h.in Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12  2:57   ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

	* scripts/build-many-glibcs.py: Add C-SKY targets
---
 scripts/build-many-glibcs.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 6cc9477..fb3cfe7 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -191,6 +191,13 @@ class Context(object):
                         variant='be8',
                         gcc_cfg=['--with-float=hard', '--with-arch=armv7-a',
                                  '--with-fpu=vfpv3'])
+        self.add_config(arch='csky',
+                        os_name='linux-gnuabiv2',
+                        variant='soft',
+                        gcc_cfg=['--disable-multilib'])
+        self.add_config(arch='csky',
+                        os_name='linux-gnuabiv2',
+                        gcc_cfg=['--with-float=hard', '--disable-multilib'])
         self.add_config(arch='hppa',
                         os_name='linux-gnu')
         self.add_config(arch='i686',
@@ -1247,6 +1254,7 @@ class Config(object):
         arch_map = {'aarch64': 'arm64',
                     'alpha': 'alpha',
                     'arm': 'arm',
+                    'csky': 'csky',
                     'hppa': 'parisc',
                     'i486': 'x86',
                     'i586': 'x86',
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 13/13] C-SKY: Skeleton documentation
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (7 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12  2:57   ` [PATCH v4 08/13] C-SKY: Linux Startup and Dynamic Loading Code Mao Han
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

---
 ChangeLog | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 NEWS      |   6 +++
 README    |   1 +
 3 files changed, 161 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 611caf9..670737d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,157 @@
+2018-09-07  Han Mao  <han_mao@c-sky.com>
+
+	* config.h.in (CSKYABI, CSKY_HARD_FLOAT): New Define.
+	* elf/elf.h (EM_CSKY, R_CKCORE_NONE, R_CKCORE_ADDR32)
+	(R_CKCORE_PCRELIMM8BY4, R_CKCORE_PCRELIMM11BY2, R_CKCORE_PCREL32)
+	(R_CKCORE_PCRELJSR_IMM11BY2, R_CKCORE_RELATIVE, R_CKCORE_COPY)
+	(R_CKCORE_GLOB_DAT, R_CKCORE_JUMP_SLOT, R_CKCORE_GOTOFF)
+	(R_CKCORE_GOTPC, R_CKCORE_GOT32, R_CKCORE_PLT32, R_CKCORE_ADDRGOT)
+	(R_CKCORE_ADDRPLT, R_CKCORE_PCREL_IMM26BY2, R_CKCORE_PCREL_IMM16BY2)
+	(R_CKCORE_PCREL_IMM16BY4, R_CKCORE_PCREL_IMM10BY2)
+	(R_CKCORE_PCREL_IMM10BY4, R_CKCORE_ADDR_HI16, R_CKCORE_ADDR_LO16)
+	(R_CKCORE_GOTPC_HI16, R_CKCORE_GOTPC_LO16, R_CKCORE_GOTOFF_HI16)
+	(R_CKCORE_GOTOFF_LO16, R_CKCORE_GOT12, R_CKCORE_GOT_HI16)
+	(R_CKCORE_GOT_LO16, R_CKCORE_PLT12, R_CKCORE_PLT_HI16)
+	(R_CKCORE_PLT_LO16, R_CKCORE_ADDRGOT_HI16, R_CKCORE_ADDRGOT_LO16)
+	(R_CKCORE_ADDRPLT_HI16, R_CKCORE_ADDRPLT_LO16)
+	(R_CKCORE_PCREL_JSR_IMM26BY2, R_CKCORE_TOFFSET_LO16)
+	(R_CKCORE_DOFFSET_LO16, R_CKCORE_PCREL_IMM18BY2)
+	(R_CKCORE_DOFFSET_IMM18, R_CKCORE_DOFFSET_IMM18BY2)
+	(R_CKCORE_DOFFSET_IMM18BY4, R_CKCORE_GOT_IMM18BY4)
+	(R_CKCORE_PLT_IMM18BY4, R_CKCORE_PCREL_IMM7BY4, R_CKCORE_TLS_LE32)
+	(R_CKCORE_TLS_IE32, R_CKCORE_TLS_GD32, R_CKCORE_TLS_LDM32)
+	(R_CKCORE_TLS_LDO32, R_CKCORE_TLS_DTPMOD32, R_CKCORE_TLS_DTPOFF32)
+	(R_CKCORE_TLS_TPOFF32): New Define.
+	* scripts/build-many-glibcs.py: Add C-SKY targets.
+	* sysdeps/csky/Implies: New file.
+	* sysdeps/csky/Makefile: Likewise.
+	* sysdeps/csky/abiv2/__longjmp.S: Likewise.
+	* sysdeps/csky/abiv2/crti.S: Likewise.
+	* sysdeps/csky/abiv2/crtn.S: Likewise.
+	* sysdeps/csky/abiv2/csky-mcount.S: Likewise.
+	* sysdeps/csky/abiv2/dl-trampoline.S: Likewise.
+	* sysdeps/csky/abiv2/memcmp.S: Likewise.
+	* sysdeps/csky/abiv2/memcpy.S: Likewise.
+	* sysdeps/csky/abiv2/memmove.S: Likewise.
+	* sysdeps/csky/abiv2/memset.S: Likewise.
+	* sysdeps/csky/abiv2/setjmp.S: Likewise.
+	* sysdeps/csky/abiv2/start.S: Likewise.
+	* sysdeps/csky/abiv2/strcmp.S: Likewise.
+	* sysdeps/csky/abiv2/strcpy.S: Likewise.
+	* sysdeps/csky/abiv2/strlen.S: Likewise.
+	* sysdeps/csky/abiv2/tls-macros.h: Likewise.
+	* sysdeps/csky/abort-instr.h: Likewise.
+	* sysdeps/csky/atomic-machine.h: Likewise.
+	* sysdeps/csky/bits/endian.h: Likewise.
+	* sysdeps/csky/bits/fenv.h: Likewise.
+	* sysdeps/csky/bits/link.h: Likewise.
+	* sysdeps/csky/bits/setjmp.h: Likewise.
+	* sysdeps/csky/bsd-_setjmp.S: Likewise.
+	* sysdeps/csky/bsd-setjmp.S: Likewise.
+	* sysdeps/csky/configure: Likewise.
+	* sysdeps/csky/configure.ac: Likewise.
+	* sysdeps/csky/dl-machine.h: Likewise.
+	* sysdeps/csky/dl-procinfo.c: Likewise.
+	* sysdeps/csky/dl-procinfo.h: Likewise.
+	* sysdeps/csky/dl-sysdep.h: Likewise.
+	* sysdeps/csky/dl-tls.h: Likewise.
+	* sysdeps/csky/fpu/fclrexcpt.c: Likewise.
+	* sysdeps/csky/fpu/fedisblxcpt.c: Likewise.
+	* sysdeps/csky/fpu/feenablxcpt.c: Likewise.
+	* sysdeps/csky/fpu/fegetenv.c: Likewise.
+	* sysdeps/csky/fpu/fegetexcept.c: Likewise.
+	* sysdeps/csky/fpu/fegetmode.c: Likewise.
+	* sysdeps/csky/fpu/fegetround.c: Likewise.
+	* sysdeps/csky/fpu/feholdexcpt.c: Likewise.
+	* sysdeps/csky/fpu/fenv_libc.h: Likewise.
+	* sysdeps/csky/fpu/fenv_private.h: Likewise.
+	* sysdeps/csky/fpu/fesetenv.c: Likewise.
+	* sysdeps/csky/fpu/fesetexcept.c: Likewise.
+	* sysdeps/csky/fpu/fesetmode.c: Likewise.
+	* sysdeps/csky/fpu/fesetround.c: Likewise.
+	* sysdeps/csky/fpu/feupdateenv.c: Likewise.
+	* sysdeps/csky/fpu/fgetexcptflg.c: Likewise.
+	* sysdeps/csky/fpu/fix-fp-int-convert-overflow.h: Likewise.
+	* sysdeps/csky/fpu/fpu_control.h: Likewise.
+	* sysdeps/csky/fpu/fraiseexcpt.c: Likewise.
+	* sysdeps/csky/fpu/fsetexcptflg.c: Likewise.
+	* sysdeps/csky/fpu/ftestexcept.c: Likewise.
+	* sysdeps/csky/fpu/libm-test-ulps: Likewise.
+	* sysdeps/csky/fpu/libm-test-ulps-name: Likewise.
+	* sysdeps/csky/gccframe.h: Likewise.
+	* sysdeps/csky/jmpbuf-unwind.h: Likewise.
+	* sysdeps/csky/ldsodefs.h: Likewise.
+	* sysdeps/csky/libc-tls.c: Likewise.
+	* sysdeps/csky/linkmap.h: Likewise.
+	* sysdeps/csky/machine-gmon.h: Likewise.
+	* sysdeps/csky/math-tests-trap.h: Likewise.
+	* sysdeps/csky/memusage.h: Likewise.
+	* sysdeps/csky/nofpu/Implies: Likewise.
+	* sysdeps/csky/nofpu/libm-test-ulps: Likewise.
+	* sysdeps/csky/nofpu/libm-test-ulps-name: Likewise.
+	* sysdeps/csky/nofpu/math-tests-exceptions.h: Likewise.
+	* sysdeps/csky/nofpu/math-tests-rounding.h: Likewise.
+	* sysdeps/csky/nptl/Makefile: Likewise.
+	* sysdeps/csky/nptl/bits/pthreadtypes-arch.h: Likewise.
+	* sysdeps/csky/nptl/bits/semaphore.h: Likewise.
+	* sysdeps/csky/nptl/pthread-offsets.h: Likewise.
+	* sysdeps/csky/nptl/pthreaddef.h: Likewise.
+	* sysdeps/csky/nptl/tcb-offsets.sym: Likewise.
+	* sysdeps/csky/nptl/tls.h: Likewise.
+	* sysdeps/csky/preconfigure: Likewise.
+	* sysdeps/csky/sfp-machine.h: Likewise.
+	* sysdeps/csky/sotruss-lib.c: Likewise.
+	* sysdeps/csky/stackinfo.h: Likewise.
+	* sysdeps/csky/sysdep.h: Likewise.
+	* sysdeps/csky/tininess.h: Likewise.
+	* sysdeps/csky/tst-audit.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/csky/Makefile: Likewise.
+	* sysdeps/unix/sysv/linux/csky/Versions: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/syscall.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym: Likewise.
+	* sysdeps/unix/sysv/linux/csky/bits/mman.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/bits/shm.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/c++-types.data: Likewise.
+	* sysdeps/unix/sysv/linux/csky/configure: Likewise.
+	* sysdeps/unix/sysv/linux/csky/configure.ac: Likewise.
+	* sysdeps/unix/sysv/linux/csky/ipc_priv.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/kernel-features.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/ld.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/ldconfig.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libanl.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libc.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libcrypt.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libdl.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libm.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libpthread.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libresolv.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/librt.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libthread_db.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/libutil.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/csky/localplt.data: Likewise.
+	* sysdeps/unix/sysv/linux/csky/makecontext.c: Likewise.
+	* sysdeps/unix/sysv/linux/csky/profil-counter.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/pt-vfork.S: Likewise.
+	* sysdeps/unix/sysv/linux/csky/register-dump.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/shlib-versions: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sigcontextinfo.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sys/cachectl.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sys/procfs.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sys/user.h: Likewise.
+	* sysdeps/unix/sysv/linux/csky/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/csky/sysdep.h: Likewise.
+
 2018-09-06  Stefan Liebler  <stli@linux.ibm.com>
 
 	* sysdeps/s390/fpu/libm-test-ulps: Regenerated.
diff --git a/NEWS b/NEWS
index 085325a..389b8dd 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,12 @@ Major new features:
 * The reallocarray function is now declared under _DEFAULT_SOURCE, not just
   for _GNU_SOURCE, to match BSD environments.
 
+* Support for the C-SKY ABIV2 running on Linux has been added.  This port
+  requires at least binutils-2.32, gcc-9.0, and linux-4.19.  Two ABIs are
+  supported:
+    - C-SKY ABIV2 soft-float little-endian
+    - C-SKY ABIV2 hard-float little-endian
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The glibc.tune tunable namespace has been renamed to glibc.cpu and the
diff --git a/README b/README
index 27a9fd4..eb9b0b3 100644
--- a/README
+++ b/README
@@ -25,6 +25,7 @@ The GNU C Library supports these configurations for using Linux kernels:
 	aarch64*-*-linux-gnu
 	alpha*-*-linux-gnu
 	arm-*-linux-gnueabi
+	csky-*-linux-gnuabiv2
 	hppa-*-linux-gnu
 	i[4567]86-*-linux-gnu
 	x86_64-*-linux-gnu	Can build either x86_64 or x32
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 11/13] C-SKY: Add ABI definitions in config.h.in
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (4 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 09/13] C-SKY: Add dynamic relocations to elf.h Mao Han
@ 2018-09-12  2:57   ` Mao Han
  2018-09-12  2:57   ` [PATCH v4 12/13] C-SKY: Add build-many-glibcs.py support Mao Han
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  2:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

	* config.h.in (CSKYABI, CSKY_HARD_FLOAT): New Define.
---
 config.h.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/config.h.in b/config.h.in
index 141db21..b60dc30 100644
--- a/config.h.in
+++ b/config.h.in
@@ -100,6 +100,12 @@
 /* AArch64 big endian ABI */
 #undef HAVE_AARCH64_BE
 
+/* C-SKY ABI version */
+#undef CSKYABI
+
+/* C-SKY floating-point ABI */
+#undef CSKY_HARD_FLOAT
+
 /* RISC-V integer ABI for ld.so.  */
 #undef RISCV_ABI_XLEN
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH 1/1] Update config.guess and config.sub to current versions.
  2018-09-12  2:56 [PATCH v4 00/13] port C-SKY to glibc Mao Han
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
@ 2018-09-12  3:05 ` Mao Han
  2018-09-12 12:31 ` [PATCH v4 00/13] port C-SKY to glibc Joseph Myers
  2 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  3:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

C-SKY port need new version config.sub.

        * scripts/config.guess: Update to version 2018-08-29.
        * scripts/config.sub: Update to version 2018-08-29.
---
 scripts/config.guess |  564 ++++++------
 scripts/config.sub   | 2504 ++++++++++++++++++++++++--------------------------
 2 files changed, 1515 insertions(+), 1553 deletions(-)

diff --git a/scripts/config.guess b/scripts/config.guess
index 588fe82..b33c9e8 100755
--- a/scripts/config.guess
+++ b/scripts/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-01-01'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
+trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+	,,)    echo "int x;" > "$dummy.c"
+	       for driver in cc gcc c89 c99 ; do
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+		       CC_FOR_BUILD="$driver"
+		       break
+		   fi
+	       done
+	       if test x"$CC_FOR_BUILD" = x ; then
+		   CC_FOR_BUILD=no_compiler_found
+	       fi
+	       ;;
+	,,*)   CC_FOR_BUILD=$CC ;;
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +135,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
 	# If the system lacks a compiler, then just pick glibc.
 	# We could probably try harder.
 	LIBC=gnu
 
-	eval $set_cc_for_build
-	cat <<-EOF > $dummy.c
+	set_cc_for_build
+	cat <<-EOF > "$dummy.c"
 	#include <features.h>
 	#if defined(__UCLIBC__)
 	LIBC=uclibc
@@ -149,13 +152,20 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+	# If ldd exists, use it to detect musl libc.
+	if command -v ldd >/dev/null && \
+		ldd --version 2>&1 | grep -q ^musl
+	then
+	    LIBC=musl
+	fi
 	;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +179,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-	    /sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || \
+	    "/sbin/$sysctl" 2>/dev/null || \
+	    "/usr/sbin/$sysctl" 2>/dev/null || \
 	    echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
 	    earmv*)
-		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-		machine=${arch}${endian}-unknown
+		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine="${arch}${endian}"-unknown
 		;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently (or will in the future) and ABI.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		os=netbsdelf
 		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
+		set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
 		then
@@ -208,10 +218,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		;;
 	esac
 	# Determine ABI tags.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
 		;;
 	esac
 	# The OS release
@@ -219,51 +229,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# thus, need a distinct triplet. However, they do not need
 	# kernel version information, so it can be replaced with a
 	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
+	case "$UNAME_VERSION" in
 	    Debian*)
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}${abi}"
+	echo "$machine-${os}${release}${abi-}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
 	exit ;;
     *:LibertyBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
 	exit ;;
     *:MidnightBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:Sortix:*:*)
-	echo ${UNAME_MACHINE}-unknown-sortix
+	echo "$UNAME_MACHINE"-unknown-sortix
 	exit ;;
     *:Redox:*:*)
-	echo ${UNAME_MACHINE}-unknown-redox
+	echo "$UNAME_MACHINE"-unknown-redox
 	exit ;;
     mips:OSF1:*.*)
         echo mips-dec-osf1
@@ -319,7 +329,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
 	exitcode=$?
 	trap '' 0
@@ -328,10 +338,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo m68k-unknown-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo "$UNAME_MACHINE"-unknown-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo "$UNAME_MACHINE"-unknown-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -343,7 +353,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
+	echo arm-acorn-riscix"$UNAME_RELEASE"
 	exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
@@ -370,38 +380,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
+	echo i386-pc-auroraux"$UNAME_RELEASE"
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH=i386
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH=x86_64
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+	case `isainfo -b` in
+	    32)
+		echo i386-pc-solaris2"$UNAME_REL"
+		;;
+	    64)
+		echo x86_64-pc-solaris2"$UNAME_REL"
+		;;
+	esac
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
@@ -410,25 +415,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		;;
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
 	exit ;;
     sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
+	echo m68k-sun-sunos"$UNAME_RELEASE"
 	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
+		echo m68k-sun-sunos"$UNAME_RELEASE"
 		;;
 	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
+		echo sparc-sun-sunos"$UNAME_RELEASE"
 		;;
 	esac
 	exit ;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
+	echo sparc-auspex-sunos"$UNAME_RELEASE"
 	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +444,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
+	echo m68k-milan-mint"$UNAME_RELEASE"
 	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
+	echo m68k-hades-mint"$UNAME_RELEASE"
 	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
+	echo m68k-unknown-mint"$UNAME_RELEASE"
 	exit ;;
     m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
+	echo m68k-apple-machten"$UNAME_RELEASE"
 	exit ;;
     powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
+	echo powerpc-apple-machten"$UNAME_RELEASE"
 	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
 	exit ;;
     RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
+	echo mips-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
+	echo vax-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
+	echo clipper-intergraph-clix"$UNAME_RELEASE"
 	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
@@ -497,11 +502,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
 	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
+	echo mips-mips-riscos"$UNAME_RELEASE"
 	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
@@ -527,17 +532,17 @@ EOF
     AViiON:dgux:*:*)
 	# DG/UX returns AViiON for all architectures
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
 	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+	       [ "$TARGET_BINARY_INTERFACE"x = x ]
 	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
+		echo m88k-dg-dgux"$UNAME_RELEASE"
 	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
 	    fi
 	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
+	    echo i586-dg-dgux"$UNAME_RELEASE"
 	fi
 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
@@ -554,7 +559,7 @@ EOF
 	echo m68k-tektronix-bsd
 	exit ;;
     *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
 	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -566,14 +571,14 @@ EOF
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
+		set_cc_for_build
+		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
 
 		main()
@@ -584,7 +589,7 @@ EOF
 			exit(0);
 			}
 EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
 		then
 			echo "$SYSTEM_NAME"
 		else
@@ -598,7 +603,7 @@ EOF
 	exit ;;
     *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -607,9 +612,9 @@ EOF
 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
@@ -618,7 +623,7 @@ EOF
 	echo romp-ibm-bsd4.4
 	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
 	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
@@ -633,28 +638,28 @@ EOF
 	echo m68k-hp-bsd4.4
 	exit ;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	case "$UNAME_MACHINE" in
 	    9000/31?)            HP_ARCH=m68000 ;;
 	    9000/[34]??)         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
+		    case "$sc_cpu_version" in
 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
 		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
+			case "$sc_kernel_bits" in
 			  32) HP_ARCH=hppa2.0n ;;
 			  64) HP_ARCH=hppa2.0w ;;
 			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
 			esac ;;
 		    esac
 		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
+		if [ "$HP_ARCH" = "" ]; then
+		    set_cc_for_build
+		    sed 's/^		//' << EOF > "$dummy.c"
 
 		#define _HPUX_SOURCE
 		#include <stdlib.h>
@@ -687,13 +692,13 @@ EOF
 		    exit (0);
 		}
 EOF
-		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
 		fi ;;
 	esac
-	if [ ${HP_ARCH} = hppa2.0w ]
+	if [ "$HP_ARCH" = hppa2.0w ]
 	then
-	    eval $set_cc_for_build
+	    set_cc_for_build
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +717,15 @@ EOF
 		HP_ARCH=hppa64
 	    fi
 	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
 	exit ;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux"$HPUX_REV"
 	exit ;;
     3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
 	int
 	main ()
@@ -745,7 +750,7 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
 		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
 	exit ;;
@@ -766,9 +771,9 @@ EOF
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo "$UNAME_MACHINE"-unknown-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo "$UNAME_MACHINE"-unknown-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -793,109 +798,120 @@ EOF
 	echo c4-convex-bsd
 	exit ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     5000:UNIX_System_V:4.*:*)
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+	exit ;;
+    arm:FreeBSD:*:*)
+	UNAME_PROCESSOR=`uname -p`
+	set_cc_for_build
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_PCS_VFP
+	then
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+	else
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+	fi
 	exit ;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
+	case "$UNAME_PROCESSOR" in
 	    amd64)
 		UNAME_PROCESSOR=x86_64 ;;
 	    i386)
 		UNAME_PROCESSOR=i586 ;;
 	esac
-	echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
+	echo "$UNAME_MACHINE"-pc-cygwin
 	exit ;;
     *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
+	echo "$UNAME_MACHINE"-pc-mingw64
 	exit ;;
     *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
+	echo "$UNAME_MACHINE"-pc-mingw32
 	exit ;;
     *:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
+	echo "$UNAME_MACHINE"-pc-msys
 	exit ;;
     i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
+	echo "$UNAME_MACHINE"-pc-pw32
 	exit ;;
     *:Interix*:*)
-	case ${UNAME_MACHINE} in
+	case "$UNAME_MACHINE" in
 	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
+		echo i586-pc-interix"$UNAME_RELEASE"
 		exit ;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+		echo x86_64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	esac ;;
     i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
+	echo "$UNAME_MACHINE"-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+	echo "$UNAME_MACHINE"-unknown-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -909,63 +925,63 @@ EOF
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arm*:Linux:*:*)
-	eval $set_cc_for_build
+	set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     e2k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     k1om:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
 	#undef ${UNAME_MACHINE}
 	#undef ${UNAME_MACHINE}el
@@ -979,70 +995,70 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
 	;;
     mips64el:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     openrisc*:Linux:*:*)
-	echo or1k-unknown-linux-${LIBC}
+	echo or1k-unknown-linux-"$LIBC"
 	exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-${LIBC}
+	echo sparc-unknown-linux-"$LIBC"
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
+	echo hppa64-unknown-linux-"$LIBC"
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+	  *)    echo hppa-unknown-linux-"$LIBC" ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
+	echo powerpc64-unknown-linux-"$LIBC"
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
+	echo powerpc-unknown-linux-"$LIBC"
 	exit ;;
     ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-${LIBC}
+	echo powerpc64le-unknown-linux-"$LIBC"
 	exit ;;
     ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-${LIBC}
+	echo powerpcle-unknown-linux-"$LIBC"
 	exit ;;
     riscv32:Linux:*:* | riscv64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1056,34 +1072,34 @@ EOF
 	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
 	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
 	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
+	echo "$UNAME_MACHINE"-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo "$UNAME_MACHINE"-unknown-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo "$UNAME_MACHINE"-unknown-atheos
 	exit ;;
     i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
+	echo "$UNAME_MACHINE"-pc-syllable
 	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+	echo i386-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	echo "$UNAME_MACHINE"-pc-msdosdjgpp
 	exit ;;
     i*86:*:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
 	fi
 	exit ;;
     i*86:*:5:[678]*)
@@ -1093,12 +1109,12 @@ EOF
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1108,9 +1124,9 @@ EOF
 			&& UNAME_MACHINE=i686
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv32
+		echo "$UNAME_MACHINE"-pc-sysv32
 	fi
 	exit ;;
     pc:*:*:*)
@@ -1130,9 +1146,9 @@ EOF
 	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1152,9 +1168,9 @@ EOF
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 	  && { echo i486-ncr-sysv4; exit; } ;;
@@ -1163,28 +1179,28 @@ EOF
 	test -r /etc/.relid \
 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
+	echo mips-dde-sysv"$UNAME_RELEASE"
 	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
@@ -1195,7 +1211,7 @@ EOF
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
+		echo "$UNAME_MACHINE"-sni-sysv4
 	else
 		echo ns32k-sni-sysv
 	fi
@@ -1215,23 +1231,23 @@ EOF
 	exit ;;
     i*86:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
+	echo "$UNAME_MACHINE"-stratus-vos
 	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
 	exit ;;
     mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
+	echo m68k-apple-aux"$UNAME_RELEASE"
 	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv"$UNAME_RELEASE"
 	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv"$UNAME_RELEASE"
 	fi
 	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
@@ -1250,39 +1266,39 @@ EOF
 	echo x86_64-unknown-haiku
 	exit ;;
     SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
+	echo sx4-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
+	echo sx5-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
+	echo sx6-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
+	echo sx7-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
+	echo sx8-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
+	echo sx8r-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-ACE:SUPER-UX:*:*)
-	echo sxace-nec-superux${UNAME_RELEASE}
+	echo sxace-nec-superux"$UNAME_RELEASE"
 	exit ;;
     Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval $set_cc_for_build
+	set_cc_for_build
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
 		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -1310,7 +1326,7 @@ EOF
 	    # that Apple uses in portable devices.
 	    UNAME_PROCESSOR=x86_64
 	fi
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
@@ -1318,22 +1334,25 @@ EOF
 		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
 	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
     NEO-*:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
+	echo neo-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
+	echo nse-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSR-*:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
+	echo nsr-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+	echo nsv-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSX-*:NONSTOP_KERNEL:*:*)
-	echo nsx-tandem-nsk${UNAME_RELEASE}
+	echo nsx-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
@@ -1342,18 +1361,19 @@ EOF
 	echo bs2000-siemens-sysv
 	exit ;;
     DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
 	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
 	# operating systems.
+	# shellcheck disable=SC2154
 	if test "$cputype" = 386; then
 	    UNAME_MACHINE=i386
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo "$UNAME_MACHINE"-unknown-plan9
 	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
@@ -1374,14 +1394,14 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux"$UNAME_RELEASE"
 	exit ;;
     *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     *:*VMS:*:*)
 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
+	case "$UNAME_MACHINE" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
 	    V*) echo vax-dec-vms ; exit ;;
@@ -1390,16 +1410,16 @@ EOF
 	echo i386-pc-xenix
 	exit ;;
     i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
 	exit ;;
     i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
+	echo "$UNAME_MACHINE"-pc-rdos
 	exit ;;
     i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
+	echo "$UNAME_MACHINE"-pc-aros
 	exit ;;
     x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
+	echo "$UNAME_MACHINE"-unknown-esx
 	exit ;;
     amd64:Isilon\ OneFS:*:*)
 	echo x86_64-unknown-onefs
@@ -1408,7 +1428,7 @@ esac
 
 echo "$0: unable to guess system type" >&2
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
     mips:Linux | mips64:Linux)
 	# If we got here on MIPS GNU/Linux, output extra information.
 	cat >&2 <<EOF
@@ -1450,16 +1470,16 @@ hostinfo               = `(hostinfo) 2>/dev/null`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff --git a/scripts/config.sub b/scripts/config.sub
index f2632cd..b51fb8c 100755
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-01-01'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -110,1251 +110,1159 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+IFS="-" read -r field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze*)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
+# Separate into logical components for further validation
+case $1 in
+	*-*-*-*-*)
+		echo Invalid configuration \`"$1"\': more than four components >&2
+		exit 1
 		;;
-	-lynx*)
-		os=-lynxos
+	*-*-*-*)
+		basic_machine=$field1-$field2
+		os=$field3-$field4
 		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+	*-*-*)
+		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+		# parts
+		maybe_os=$field2-$field3
+		case $maybe_os in
+			nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+			| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+			| storm-chaos* | os2-emx* | rtmk-nova*)
+				basic_machine=$field1
+				os=$maybe_os
+				;;
+			android-linux)
+				basic_machine=$field1-unknown
+				os=linux-android
+				;;
+			*)
+				basic_machine=$field1-$field2
+				os=$field3
+				;;
+		esac
 		;;
-	-psos*)
-		os=-psos
+	*-*)
+		# A lone config we happen to match not fitting any patern
+		case $field1-$field2 in
+			decstation-3100)
+				basic_machine=mips-dec
+				os=
+				;;
+			*-*)
+				# Second component is usually, but not always the OS
+				case $field2 in
+					# Prevent following clause from handling this valid os
+					sun*os*)
+						basic_machine=$field1
+						os=$field2
+						;;
+					# Manufacturers
+					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
+					| convergent* | ncr* | news | 32* | 3600* | 3100* \
+					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+					| ultra | tti* | harris | dolphin | highlevel | gould \
+					| cbm | ns | masscomp | apple | axis | knuth | cray \
+					| microblaze* | sim | cisco \
+					| oki | wec | wrs | winbond)
+						basic_machine=$field1-$field2
+						os=
+						;;
+					*)
+						basic_machine=$field1
+						os=$field2
+						;;
+				esac
+			;;
+		esac
 		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
+	*)
+		# Convert single-component short-hands not valid as part of
+		# multi-component configurations.
+		case $field1 in
+			386bsd)
+				basic_machine=i386-pc
+				os=bsd
+				;;
+			a29khif)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			adobe68k)
+				basic_machine=m68010-adobe
+				os=scout
+				;;
+			alliant)
+				basic_machine=fx80-alliant
+				os=
+				;;
+			altos | altos3068)
+				basic_machine=m68k-altos
+				os=
+				;;
+			am29k)
+				basic_machine=a29k-none
+				os=bsd
+				;;
+			amdahl)
+				basic_machine=580-amdahl
+				os=sysv
+				;;
+			amiga)
+				basic_machine=m68k-unknown
+				os=
+				;;
+			amigaos | amigados)
+				basic_machine=m68k-unknown
+				os=amigaos
+				;;
+			amigaunix | amix)
+				basic_machine=m68k-unknown
+				os=sysv4
+				;;
+			apollo68)
+				basic_machine=m68k-apollo
+				os=sysv
+				;;
+			apollo68bsd)
+				basic_machine=m68k-apollo
+				os=bsd
+				;;
+			aros)
+				basic_machine=i386-pc
+				os=aros
+				;;
+			aux)
+				basic_machine=m68k-apple
+				os=aux
+				;;
+			balance)
+				basic_machine=ns32k-sequent
+				os=dynix
+				;;
+			blackfin)
+				basic_machine=bfin-unknown
+				os=linux
+				;;
+			cegcc)
+				basic_machine=arm-unknown
+				os=cegcc
+				;;
+			convex-c1)
+				basic_machine=c1-convex
+				os=bsd
+				;;
+			convex-c2)
+				basic_machine=c2-convex
+				os=bsd
+				;;
+			convex-c32)
+				basic_machine=c32-convex
+				os=bsd
+				;;
+			convex-c34)
+				basic_machine=c34-convex
+				os=bsd
+				;;
+			convex-c38)
+				basic_machine=c38-convex
+				os=bsd
+				;;
+			cray)
+				basic_machine=j90-cray
+				os=unicos
+				;;
+			crds | unos)
+				basic_machine=m68k-crds
+				os=
+				;;
+			da30)
+				basic_machine=m68k-da30
+				os=
+				;;
+			decstation | pmax | pmin | dec3100 | decstatn)
+				basic_machine=mips-dec
+				os=
+				;;
+			delta88)
+				basic_machine=m88k-motorola
+				os=sysv3
+				;;
+			dicos)
+				basic_machine=i686-pc
+				os=dicos
+				;;
+			djgpp)
+				basic_machine=i586-pc
+				os=msdosdjgpp
+				;;
+			ebmon29k)
+				basic_machine=a29k-amd
+				os=ebmon
+				;;
+			es1800 | OSE68k | ose68k | ose | OSE)
+				basic_machine=m68k-ericsson
+				os=ose
+				;;
+			gmicro)
+				basic_machine=tron-gmicro
+				os=sysv
+				;;
+			go32)
+				basic_machine=i386-pc
+				os=go32
+				;;
+			h8300hms)
+				basic_machine=h8300-hitachi
+				os=hms
+				;;
+			h8300xray)
+				basic_machine=h8300-hitachi
+				os=xray
+				;;
+			h8500hms)
+				basic_machine=h8500-hitachi
+				os=hms
+				;;
+			harris)
+				basic_machine=m88k-harris
+				os=sysv3
+				;;
+			hp300)
+				basic_machine=m68k-hp
+				;;
+			hp300bsd)
+				basic_machine=m68k-hp
+				os=bsd
+				;;
+			hp300hpux)
+				basic_machine=m68k-hp
+				os=hpux
+				;;
+			hppaosf)
+				basic_machine=hppa1.1-hp
+				os=osf
+				;;
+			hppro)
+				basic_machine=hppa1.1-hp
+				os=proelf
+				;;
+			i386mach)
+				basic_machine=i386-mach
+				os=mach
+				;;
+			vsta)
+				basic_machine=i386-pc
+				os=vsta
+				;;
+			isi68 | isi)
+				basic_machine=m68k-isi
+				os=sysv
+				;;
+			m68knommu)
+				basic_machine=m68k-unknown
+				os=linux
+				;;
+			magnum | m3230)
+				basic_machine=mips-mips
+				os=sysv
+				;;
+			merlin)
+				basic_machine=ns32k-utek
+				os=sysv
+				;;
+			mingw64)
+				basic_machine=x86_64-pc
+				os=mingw64
+				;;
+			mingw32)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			mingw32ce)
+				basic_machine=arm-unknown
+				os=mingw32ce
+				;;
+			monitor)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			morphos)
+				basic_machine=powerpc-unknown
+				os=morphos
+				;;
+			moxiebox)
+				basic_machine=moxie-unknown
+				os=moxiebox
+				;;
+			msdos)
+				basic_machine=i386-pc
+				os=msdos
+				;;
+			msys)
+				basic_machine=i686-pc
+				os=msys
+				;;
+			mvs)
+				basic_machine=i370-ibm
+				os=mvs
+				;;
+			nacl)
+				basic_machine=le32-unknown
+				os=nacl
+				;;
+			ncr3000)
+				basic_machine=i486-ncr
+				os=sysv4
+				;;
+			netbsd386)
+				basic_machine=i386-pc
+				os=netbsd
+				;;
+			netwinder)
+				basic_machine=armv4l-rebel
+				os=linux
+				;;
+			news | news700 | news800 | news900)
+				basic_machine=m68k-sony
+				os=newsos
+				;;
+			news1000)
+				basic_machine=m68030-sony
+				os=newsos
+				;;
+			necv70)
+				basic_machine=v70-nec
+				os=sysv
+				;;
+			nh3000)
+				basic_machine=m68k-harris
+				os=cxux
+				;;
+			nh[45]000)
+				basic_machine=m88k-harris
+				os=cxux
+				;;
+			nindy960)
+				basic_machine=i960-intel
+				os=nindy
+				;;
+			mon960)
+				basic_machine=i960-intel
+				os=mon960
+				;;
+			nonstopux)
+				basic_machine=mips-compaq
+				os=nonstopux
+				;;
+			os400)
+				basic_machine=powerpc-ibm
+				os=os400
+				;;
+			OSE68000 | ose68000)
+				basic_machine=m68000-ericsson
+				os=ose
+				;;
+			os68k)
+				basic_machine=m68k-none
+				os=os68k
+				;;
+			paragon)
+				basic_machine=i860-intel
+				os=osf
+				;;
+			parisc)
+				basic_machine=hppa-unknown
+				os=linux
+				;;
+			pw32)
+				basic_machine=i586-unknown
+				os=pw32
+				;;
+			rdos | rdos64)
+				basic_machine=x86_64-pc
+				os=rdos
+				;;
+			rdos32)
+				basic_machine=i386-pc
+				os=rdos
+				;;
+			rom68k)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			sa29200)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			sei)
+				basic_machine=mips-sei
+				os=seiux
+				;;
+			sequent)
+				basic_machine=i386-sequent
+				os=
+				;;
+			sps7)
+				basic_machine=m68k-bull
+				os=sysv2
+				;;
+			st2000)
+				basic_machine=m68k-tandem
+				os=
+				;;
+			stratus)
+				basic_machine=i860-stratus
+				os=sysv4
+				;;
+			sun2)
+				basic_machine=m68000-sun
+				os=
+				;;
+			sun2os3)
+				basic_machine=m68000-sun
+				os=sunos3
+				;;
+			sun2os4)
+				basic_machine=m68000-sun
+				os=sunos4
+				;;
+			sun3)
+				basic_machine=m68k-sun
+				os=
+				;;
+			sun3os3)
+				basic_machine=m68k-sun
+				os=sunos3
+				;;
+			sun3os4)
+				basic_machine=m68k-sun
+				os=sunos4
+				;;
+			sun4)
+				basic_machine=sparc-sun
+				os=
+				;;
+			sun4os3)
+				basic_machine=sparc-sun
+				os=sunos3
+				;;
+			sun4os4)
+				basic_machine=sparc-sun
+				os=sunos4
+				;;
+			sun4sol2)
+				basic_machine=sparc-sun
+				os=solaris2
+				;;
+			sun386 | sun386i | roadrunner)
+				basic_machine=i386-sun
+				os=
+				;;
+			sv1)
+				basic_machine=sv1-cray
+				os=unicos
+				;;
+			symmetry)
+				basic_machine=i386-sequent
+				os=dynix
+				;;
+			t3e)
+				basic_machine=alphaev5-cray
+				os=unicos
+				;;
+			t90)
+				basic_machine=t90-cray
+				os=unicos
+				;;
+			toad1)
+				basic_machine=pdp10-xkl
+				os=tops20
+				;;
+			tpf)
+				basic_machine=s390x-ibm
+				os=tpf
+				;;
+			udi29k)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			ultra3)
+				basic_machine=a29k-nyu
+				os=sym1
+				;;
+			v810 | necv810)
+				basic_machine=v810-nec
+				os=none
+				;;
+			vaxv)
+				basic_machine=vax-dec
+				os=sysv
+				;;
+			vms)
+				basic_machine=vax-dec
+				os=vms
+				;;
+			vxworks960)
+				basic_machine=i960-wrs
+				os=vxworks
+				;;
+			vxworks68)
+				basic_machine=m68k-wrs
+				os=vxworks
+				;;
+			vxworks29k)
+				basic_machine=a29k-wrs
+				os=vxworks
+				;;
+			xbox)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			ymp)
+				basic_machine=ymp-cray
+				os=unicos
+				;;
+			*)
+				basic_machine=$1
+				os=
+				;;
+		esac
 		;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arceb \
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-	| avr | avr32 \
-	| ba \
-	| be32 | be64 \
-	| bfin \
-	| c4x | c8051 | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| e2k | epiphany \
-	| fido | fr30 | frv | ft32 \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia16 | ia64 \
-	| ip2k | iq2000 \
-	| k1om \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa32r6 | mipsisa32r6el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64r6 | mipsisa64r6el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipsr5900 | mipsr5900el \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 | nios2eb | nios2el \
-	| ns16k | ns32k \
-	| open8 | or1k | or1knd | or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pru \
-	| pyramid \
-	| riscv32 | riscv64 \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| visium \
-	| wasm32 \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
-	leon|leon[3-9])
-		basic_machine=sparc-$basic_machine
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	# Here we handle the default manufacturer of certain CPU types.  It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		cpu=hppa1.1
+		vendor=winbond
 		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+	op50n)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-	ms1)
-		basic_machine=mt-unknown
+	op60c)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
+	ibm*)
+		cpu=i370
+		vendor=ibm
 		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	orion105)
+		cpu=clipper
+		vendor=highlevel
 		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
+	mac | mpw | mac-mpw)
+		cpu=m68k
+		vendor=apple
 		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
+	pmac | pmac-mpw)
+		cpu=powerpc
+		vendor=apple
 		;;
 
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| ba-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| e2k-* | elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| k1om-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-	| microblaze-* | microblazeel-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa32r6-* | mipsisa32r6el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64r6-* | mipsisa64r6el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipsr5900-* | mipsr5900el-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| or1k*-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pru-* \
-	| pyramid-* \
-	| riscv32-* | riscv64-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| visium-* \
-	| wasm32-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
+		cpu=m68000
+		vendor=att
 		;;
 	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	asmjs)
-		basic_machine=asmjs-unknown
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
+		cpu=we32k
+		vendor=att
 		;;
 	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
+		cpu=powerpc
+		vendor=ibm
+		os=cnk
 		;;
 	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
+		cpu=pdp10
+		vendor=dec
+		os=tops10
 		;;
 	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
+		cpu=pdp10
+		vendor=dec
+		os=tops20
 		;;
 	delta | 3300 | motorola-3300 | motorola-delta \
 	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
+		cpu=m68k
+		vendor=motorola
 		;;
 	dpx2*)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	e500v[12])
-		basic_machine=powerpc-unknown
-		os=$os"spe"
-		;;
-	e500v[12]-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=$os"spe"
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
+		cpu=m68k
+		vendor=bull
+		os=sysv3
 		;;
 	encore | umax | mmax)
-		basic_machine=ns32k-encore
+		cpu=ns32k
+		vendor=encore
 		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
+	elxsi)
+		cpu=elxsi
+		vendor=elxsi
+		os=${os:-bsd}
 		;;
 	fx2800)
-		basic_machine=i860-alliant
+		cpu=i860
+		vendor=alliant
 		;;
 	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
+		cpu=ns32k
+		vendor=ns
 		;;
 	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
 		;;
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
+		cpu=m68000
+		vendor=hp
 		;;
 	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
+		cpu=m68k
+		vendor=hp
 		;;
 	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k78[0-9] | hp78[0-9])
 		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv32
 		;;
 	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv4
 		;;
 	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv
 		;;
 	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=solaris2
 		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
+	j90 | j90-cray)
+		cpu=j90
+		vendor=cray
+		os=${os:-unicos}
 		;;
 	iris | iris4d)
-		basic_machine=mips-sgi
+		cpu=mips
+		vendor=sgi
 		case $os in
-		    -irix*)
+		    irix*)
 			;;
 		    *)
-			os=-irix4
+			os=irix4
 			;;
 		esac
 		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	leon-*|leon[3-9]-*)
-		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze*)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
 	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	moxiebox)
-		basic_machine=moxie-unknown
-		os=-moxiebox
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i686-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
+		cpu=m68000
+		vendor=convergent
 		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
+	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		cpu=m68k
+		vendor=atari
+		os=mint
 		;;
 	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
+		cpu=mips
+		vendor=sony
+		os=newsos
 		;;
 	next | m*-next)
-		basic_machine=m68k-next
+		cpu=m68k
+		vendor=next
 		case $os in
-		    -nextstep* )
+		    nextstep* )
 			;;
-		    -ns2*)
-		      os=-nextstep2
+		    ns2*)
+		      os=nextstep2
 			;;
 		    *)
-		      os=-nextstep3
+		      os=nextstep3
 			;;
 		esac
 		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
 	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	nsx-tandem)
-		basic_machine=nsx-tandem
+		cpu=np1
+		vendor=gould
 		;;
 	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
+		cpu=hppa1.1
+		vendor=oki
+		os=proelf
 		;;
 	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
 		;;
 	pbd)
-		basic_machine=sparc-tti
+		cpu=sparc
+		vendor=tti
 		;;
 	pbb)
-		basic_machine=m68k-tti
+		cpu=m68k
+		vendor=tti
 		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+	pc532)
+		cpu=ns32k
+		vendor=pc532
 		;;
 	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle)
-		basic_machine=powerpcle-unknown
+		cpu=pn
+		vendor=gould
 		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+	power)
+		cpu=power
+		vendor=ibm
 		;;
 	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=-rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
+		cpu=i386
+		vendor=ibm
 		;;
 	rm[46]00)
-		basic_machine=mips-siemens
+		cpu=mips
+		vendor=siemens
 		;;
 	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
+		cpu=romp
+		vendor=ibm
 		;;
 	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
+		cpu=mipsisa32
+		vendor=sde
+		os=${os:-elf}
 		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
+	simso-wrs)
+		cpu=sparclite
+		vendor=wrs
+		os=vxworks
 		;;
-	sequent)
-		basic_machine=i386-sequent
+	tower | tower-32)
+		cpu=m68k
+		vendor=ncr
 		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
+	vpp*|vx|vx-*)
+		cpu=f301
+		vendor=fujitsu
 		;;
-	sh5el)
-		basic_machine=sh5le-unknown
+	w65)
+		cpu=w65
+		vendor=wdc
 		;;
-	sh64)
-		basic_machine=sh64-unknown
+	w89k-*)
+		cpu=hppa1.1
+		vendor=winbond
+		os=proelf
 		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
+	none)
+		cpu=none
+		vendor=none
 		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
+	leon|leon[3-9])
+		cpu=sparc
+		vendor=$basic_machine
 		;;
-	spur)
-		basic_machine=spur-unknown
+	leon-*|leon[3-9]-*)
+		cpu=sparc
+		vendor=`echo "$basic_machine" | sed 's/-.*//'`
 		;;
-	st2000)
-		basic_machine=m68k-tandem
+
+	*-*)
+		IFS="-" read -r cpu vendor <<EOF
+$basic_machine
+EOF
 		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+		cpu=$basic_machine
+		vendor=pc
 		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+	# These rules are duplicated from below for sake of the special case above;
+	# i.e. things that normalized to x86 arches should also default to "pc"
+	pc98)
+		cpu=i386
+		vendor=pc
 		;;
-	sun2)
-		basic_machine=m68000-sun
+	x64 | amd64)
+		cpu=x86_64
+		vendor=pc
 		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
+	# Recognize the basic CPU types without company name.
+	*)
+		cpu=$basic_machine
+		vendor=unknown
 		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+	# Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	craynv-unknown)
+		vendor=cray
+		os=${os:-unicosmp}
 		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
+	c90-unknown | c90-cray)
+		vendor=cray
+		os=${os:-unicos}
 		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
+	fx80-unknown)
+		vendor=alliant
 		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
+	romp-unknown)
+		vendor=ibm
 		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
+	mmix-unknown)
+		vendor=knuth
 		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
+	microblaze-unknown | microblazeel-unknown)
+		vendor=xilinx
 		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
+	rs6000-unknown)
+		vendor=ibm
 		;;
-	sun4)
-		basic_machine=sparc-sun
+	vax-unknown)
+		vendor=dec
 		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
+	pdp11-unknown)
+		vendor=dec
 		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
+	we32k-unknown)
+		vendor=att
 		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
+	cydra-unknown)
+		vendor=cydrome
 		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
+	i370-ibm*)
+		vendor=ibm
 		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
+	orion-unknown)
+		vendor=highlevel
 		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
+	xps-unknown | xps100-unknown)
+		cpu=xps100
+		vendor=honeywell
 		;;
-	tx39)
-		basic_machine=mipstx39-unknown
+
+	# Here we normalize CPU types with a missing or matching vendor
+	dpx20-unknown | dpx20-bull)
+		cpu=rs6000
+		vendor=bull
+		os=${os:-bosx}
 		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
+
+	# Here we normalize CPU types irrespective of the vendor
+	amd64-*)
+		cpu=x86_64
 		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
+	blackfin-*)
+		cpu=bfin
+		os=linux
 		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
+	c54x-*)
+		cpu=tic54x
 		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
+	c55x-*)
+		cpu=tic55x
 		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
+	c6x-*)
+		cpu=tic6x
 		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
+	e500v[12]-*)
+		cpu=powerpc
+		os=$os"spe"
 		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
+	mips3*-*)
+		cpu=mips64
 		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
+	ms1-*)
+		cpu=mt
 		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
+	m68knommu-*)
+		cpu=m68k
+		os=linux
 		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
+	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+		cpu=s12z
 		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
+	openrisc-*)
+		cpu=or32
 		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
+	parisc-*)
+		cpu=hppa
+		os=linux
 		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		cpu=i586
 		;;
-	wasm32)
-		basic_machine=wasm32-unknown
+	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+		cpu=i686
 		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		cpu=i686
 		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
+	pentium4-*)
+		cpu=i786
 		;;
-	x64)
-		basic_machine=x86_64-pc
+	pc98-*)
+		cpu=i386
 		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
+	ppc-* | ppcbe-*)
+		cpu=powerpc
 		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
+	ppcle-* | powerpclittle-*)
+		cpu=powerpcle
 		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+	ppc64-*)
+		cpu=powerpc64
 		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
+	ppc64le-* | powerpc64little-*)
+		cpu=powerpc64le
 		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
+	sb1-*)
+		cpu=mipsisa64sb1
 		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
+	sb1el-*)
+		cpu=mipsisa64sb1el
 		;;
-	none)
-		basic_machine=none-none
-		os=-none
+	sh5e[lb]-*)
+		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
 		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
+	spur-*)
+		cpu=spur
 		;;
-	op50n)
-		basic_machine=hppa1.1-oki
+	strongarm-* | thumb-*)
+		cpu=arm
 		;;
-	op60c)
-		basic_machine=hppa1.1-oki
+	tx39-*)
+		cpu=mipstx39
 		;;
-	romp)
-		basic_machine=romp-ibm
+	tx39el-*)
+		cpu=mipstx39el
 		;;
-	mmix)
-		basic_machine=mmix-knuth
+	x64-*)
+		cpu=x86_64
 		;;
-	rs6000)
-		basic_machine=rs6000-ibm
+	xscale-* | xscalee[bl]-*)
+		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
 		;;
-	vax)
-		basic_machine=vax-dec
+
+	# Recognize the cannonical CPU Types that limit and/or modify the
+	# company names they are paired with.
+	cr16-*)
+		os=${os:-elf}
 		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
+	crisv32-* | etraxfs*-*)
+		cpu=crisv32
+		vendor=axis
 		;;
-	pdp11)
-		basic_machine=pdp11-dec
+	cris-* | etrax*-*)
+		cpu=cris
+		vendor=axis
 		;;
-	we32k)
-		basic_machine=we32k-att
+	crx-*)
+		os=${os:-elf}
 		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
+	neo-tandem)
+		cpu=neo
+		vendor=tandem
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
+	nse-tandem)
+		cpu=nse
+		vendor=tandem
 		;;
-	cydra)
-		basic_machine=cydra-cydrome
+	nsr-tandem)
+		cpu=nsr
+		vendor=tandem
 		;;
-	orion)
-		basic_machine=orion-highlevel
+	nsv-tandem)
+		cpu=nsv
+		vendor=tandem
 		;;
-	orion105)
-		basic_machine=clipper-highlevel
+	nsx-tandem)
+		cpu=nsx
+		vendor=tandem
 		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
+	s390-*)
+		cpu=s390
+		vendor=ibm
 		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
+	s390x-*)
+		cpu=s390x
+		vendor=ibm
 		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
+	tile*-*)
+		os=${os:-linux-gnu}
 		;;
+
 	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
+		# Recognize the cannonical CPU types that are allowed with any
+		# company name.
+		case $cpu in
+			1750a | 580 \
+			| a29k \
+			| aarch64 | aarch64_be \
+			| abacus \
+			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+			| alphapca5[67] | alpha64pca5[67] \
+			| am33_2.0 \
+			| arc | arceb \
+			| arm  | arm[lb]e | arme[lb] | armv* \
+			| avr | avr32 \
+			| asmjs \
+			| ba \
+			| be32 | be64 \
+			| bfin | bs2000 \
+			| c[123]* | c30 | [cjt]90 | c4x \
+			| c8051 | clipper | craynv | csky | cydra \
+			| d10v | d30v | dlx | dsp16xx \
+			| e2k | elxsi | epiphany \
+			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+			| h8300 | h8500 \
+			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+			| hexagon \
+			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
+			| ip2k | iq2000 \
+			| k1om \
+			| le32 | le64 \
+			| lm32 \
+			| m32c | m32r | m32rle \
+			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
+			| m88110 | m88k | maxq | mb | mcore | mep | metag \
+			| microblaze | microblazeel \
+			| mips | mipsbe | mipseb | mipsel | mipsle \
+			| mips16 \
+			| mips64 | mips64el \
+			| mips64octeon | mips64octeonel \
+			| mips64orion | mips64orionel \
+			| mips64r5900 | mips64r5900el \
+			| mips64vr | mips64vrel \
+			| mips64vr4100 | mips64vr4100el \
+			| mips64vr4300 | mips64vr4300el \
+			| mips64vr5000 | mips64vr5000el \
+			| mips64vr5900 | mips64vr5900el \
+			| mipsisa32 | mipsisa32el \
+			| mipsisa32r2 | mipsisa32r2el \
+			| mipsisa32r6 | mipsisa32r6el \
+			| mipsisa64 | mipsisa64el \
+			| mipsisa64r2 | mipsisa64r2el \
+			| mipsisa64r6 | mipsisa64r6el \
+			| mipsisa64sb1 | mipsisa64sb1el \
+			| mipsisa64sr71k | mipsisa64sr71kel \
+			| mipsr5900 | mipsr5900el \
+			| mipstx39 | mipstx39el \
+			| mmix \
+			| mn10200 | mn10300 \
+			| moxie \
+			| mt \
+			| msp430 \
+			| nds32 | nds32le | nds32be \
+			| nfp \
+			| nios | nios2 | nios2eb | nios2el \
+			| none | np1 | ns16k | ns32k \
+			| open8 \
+			| or1k* \
+			| or32 \
+			| orion \
+			| pdp10 | pdp11 | pj | pjl | pn | power \
+			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+			| pru \
+			| pyramid \
+			| riscv | riscv32 | riscv64 \
+			| rl78 | romp | rs6000 | rx \
+			| score \
+			| sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+			| sparclite \
+			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+			| spu \
+			| tahoe \
+			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+			| tron \
+			| ubicom32 \
+			| v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+			| vax \
+			| visium \
+			| wasm32 \
+			| we32k \
+			| x86 | x86_64 | xc16x | xgate | xps100 \
+			| xstormy16 | xtensa* \
+			| ymp \
+			| z8k | z80)
+				;;
+
+			*)
+				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+				exit 1
+				;;
+		esac
 		;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+	digital*)
+		vendor=dec
 		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+	commodore*)
+		vendor=cbm
 		;;
 	*)
 		;;
@@ -1362,213 +1270,246 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
 	# First match some system type aliases that might get confused
 	# with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
+	# solaris* is a basic system type, with this one exception.
+	auroraux)
+		os=auroraux
 		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+	bluegene*)
+		os=cnk
 		;;
-	-solaris)
-		os=-solaris2
+	solaris1 | solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
-	-svr4*)
-		os=-sysv4
+	solaris)
+		os=solaris2
 		;;
-	-unixware*)
-		os=-sysv4.2uw
+	unixware*)
+		os=sysv4.2uw
 		;;
-	-gnu/linux*)
+	gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
+	# es1800 is here to avoid being matched by es* (a different OS)
+	es1800*)
+		os=ose
+		;;
+	# Some version numbers need modification
+	chorusos*)
+		os=chorusos
+		;;
+	isc)
+		os=isc2.2
+		;;
+	sco6)
+		os=sco5v6
+		;;
+	sco5)
+		os=sco3.2v5
+		;;
+	sco4)
+		os=sco3.2v4
+		;;
+	sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		;;
+	sco3.2v[4-9]* | sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		;;
+	scout)
+		# Don't match below
+		;;
+	sco*)
+		os=sco3.2v2
+		;;
+	psos*)
+		os=psos
+		;;
 	# Now accept the basic system types.
 	# The portable systems comes first.
 	# Each alternative MUST end in a * to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* | -plan9* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* | -cloudabi* | -sortix* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*)
+	# sysv* is not here because it comes later, after sysvr4.
+	gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+	     | sym* | kopensolaris* | plan9* \
+	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+	     | aos* | aros* | cloudabi* | sortix* \
+	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+	     | knetbsd* | mirbsd* | netbsd* \
+	     | bitrig* | openbsd* | solidbsd* | libertybsd* \
+	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+	     | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+	     | chorusrdb* | cegcc* | glidix* \
+	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+	     | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+	     | linux-newlib* | linux-musl* | linux-uclibc* \
+	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+	     | interix* | uwin* | mks* | rhapsody* | darwin* \
+	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
+	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
+	     | os2* | vos* | palmos* | uclinux* | nucleus* \
+	     | morphos* | superux* | rtmk* | windiss* \
+	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+	     | midnightbsd*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
+	qnx*)
+		case $cpu in
+		    x86 | i*86)
 			;;
 		    *)
-			os=-nto$os
+			os=nto-$os
 			;;
 		esac
 		;;
-	-nto-qnx*)
+	hiux*)
+		os=hiuxwe2
 		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+	nto-qnx*)
 		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+	nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
+	sim | xray | os68k* | v88r* \
+	    | windows* | osx | abug | netware* | os9* \
+	    | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
 		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
+	linux-dietlibc)
+		os=linux-dietlibc
 		;;
-	-linux*)
+	linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+	lynx*178)
+		os=lynxos178
 		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+	lynx*5)
+		os=lynxos5
 		;;
-	-opened*)
-		os=-openedition
+	lynx*)
+		os=lynxos
 		;;
-	-os400*)
-		os=-os400
+	mac*)
+		os=`echo "$os" | sed -e 's|mac|macos|'`
 		;;
-	-wince*)
-		os=-wince
+	opened*)
+		os=openedition
 		;;
-	-osfrose*)
-		os=-osfrose
+	os400*)
+		os=os400
 		;;
-	-osf*)
-		os=-osf
+	sunos5*)
+		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
 		;;
-	-utek*)
-		os=-bsd
+	sunos6*)
+		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
 		;;
-	-dynix*)
-		os=-bsd
+	wince*)
+		os=wince
 		;;
-	-acis*)
-		os=-aos
+	utek*)
+		os=bsd
 		;;
-	-atheos*)
-		os=-atheos
+	dynix*)
+		os=bsd
 		;;
-	-syllable*)
-		os=-syllable
+	acis*)
+		os=aos
 		;;
-	-386bsd)
-		os=-bsd
+	atheos*)
+		os=atheos
 		;;
-	-ctix* | -uts*)
-		os=-sysv
+	syllable*)
+		os=syllable
 		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2)
-		os=-nextstep2
+	386bsd)
+		os=bsd
 		;;
-	-nsk*)
-		os=-nsk
+	ctix* | uts*)
+		os=sysv
 		;;
-	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
+	nova*)
+		os=rtmk-nova
 		;;
-	-sinix*)
-		os=-sysv4
+	ns2)
+		os=nextstep2
 		;;
-	-tpf*)
-		os=-tpf
+	nsk*)
+		os=nsk
 		;;
-	-triton*)
-		os=-sysv3
+	# Preserve the version number of sinix5.
+	sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
 		;;
-	-oss*)
-		os=-sysv3
+	sinix*)
+		os=sysv4
 		;;
-	-svr4)
-		os=-sysv4
+	tpf*)
+		os=tpf
 		;;
-	-svr3)
-		os=-sysv3
+	triton*)
+		os=sysv3
 		;;
-	-sysvr4)
-		os=-sysv4
+	oss*)
+		os=sysv3
 		;;
-	# This must come after -sysvr4.
-	-sysv*)
+	svr4*)
+		os=sysv4
 		;;
-	-ose*)
-		os=-ose
+	svr3)
+		os=sysv3
 		;;
-	-es1800*)
-		os=-ose
+	sysvr4)
+		os=sysv4
 		;;
-	-xenix)
-		os=-xenix
+	# This must come after sysvr4.
+	sysv*)
 		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
+	ose*)
+		os=ose
 		;;
-	-aros*)
-		os=-aros
+	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+		os=mint
 		;;
-	-zvmoe)
-		os=-zvmoe
+	zvmoe)
+		os=zvmoe
 		;;
-	-dicos*)
-		os=-dicos
+	dicos*)
+		os=dicos
 		;;
-	-pikeos*)
+	pikeos*)
 		# Until real need of OS specific support for
 		# particular features comes up, bare metal
 		# configurations are quite functional.
-		case $basic_machine in
+		case $cpu in
 		    arm*)
-			os=-eabi
+			os=eabi
 			;;
 		    *)
-			os=-elf
+			os=elf
 			;;
 		esac
 		;;
-	-nacl*)
+	nacl*)
 		;;
-	-ios)
+	ios)
 		;;
-	-none)
+	none)
+		;;
+	*-eabi)
 		;;
 	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1584,264 +1525,265 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
 	score-*)
-		os=-elf
+		os=elf
 		;;
 	spu-*)
-		os=-elf
+		os=elf
 		;;
 	*-acorn)
-		os=-riscix1.2
+		os=riscix1.2
 		;;
 	arm*-rebel)
-		os=-linux
+		os=linux
 		;;
 	arm*-semi)
-		os=-aout
+		os=aout
 		;;
 	c4x-* | tic4x-*)
-		os=-coff
+		os=coff
 		;;
 	c8051-*)
-		os=-elf
+		os=elf
+		;;
+	clipper-intergraph)
+		os=clix
 		;;
 	hexagon-*)
-		os=-elf
+		os=elf
 		;;
 	tic54x-*)
-		os=-coff
+		os=coff
 		;;
 	tic55x-*)
-		os=-coff
+		os=coff
 		;;
 	tic6x-*)
-		os=-coff
+		os=coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
-		os=-tops20
+		os=tops20
 		;;
 	pdp11-*)
-		os=-none
+		os=none
 		;;
 	*-dec | vax-*)
-		os=-ultrix4.2
+		os=ultrix4.2
 		;;
 	m68*-apollo)
-		os=-domain
+		os=domain
 		;;
 	i386-sun)
-		os=-sunos4.0.2
+		os=sunos4.0.2
 		;;
 	m68000-sun)
-		os=-sunos3
+		os=sunos3
 		;;
 	m68*-cisco)
-		os=-aout
+		os=aout
 		;;
 	mep-*)
-		os=-elf
+		os=elf
 		;;
 	mips*-cisco)
-		os=-elf
+		os=elf
 		;;
 	mips*-*)
-		os=-elf
+		os=elf
 		;;
 	or32-*)
-		os=-coff
+		os=coff
 		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
+		os=sysv3
 		;;
 	sparc-* | *-sun)
-		os=-sunos4.1.1
+		os=sunos4.1.1
 		;;
 	pru-*)
-		os=-elf
+		os=elf
 		;;
 	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
+		os=beos
 		;;
 	*-ibm)
-		os=-aix
+		os=aix
 		;;
 	*-knuth)
-		os=-mmixware
+		os=mmixware
 		;;
 	*-wec)
-		os=-proelf
+		os=proelf
 		;;
 	*-winbond)
-		os=-proelf
+		os=proelf
 		;;
 	*-oki)
-		os=-proelf
+		os=proelf
 		;;
 	*-hp)
-		os=-hpux
+		os=hpux
 		;;
 	*-hitachi)
-		os=-hiux
+		os=hiux
 		;;
 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
+		os=sysv
 		;;
 	*-cbm)
-		os=-amigaos
+		os=amigaos
 		;;
 	*-dg)
-		os=-dgux
+		os=dgux
 		;;
 	*-dolphin)
-		os=-sysv3
+		os=sysv3
 		;;
 	m68k-ccur)
-		os=-rtu
+		os=rtu
 		;;
 	m88k-omron*)
-		os=-luna
+		os=luna
 		;;
 	*-next)
-		os=-nextstep
+		os=nextstep
 		;;
 	*-sequent)
-		os=-ptx
+		os=ptx
 		;;
 	*-crds)
-		os=-unos
+		os=unos
 		;;
 	*-ns)
-		os=-genix
+		os=genix
 		;;
 	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
+		os=mvs
 		;;
 	*-gould)
-		os=-sysv
+		os=sysv
 		;;
 	*-highlevel)
-		os=-bsd
+		os=bsd
 		;;
 	*-encore)
-		os=-bsd
+		os=bsd
 		;;
 	*-sgi)
-		os=-irix
+		os=irix
 		;;
 	*-siemens)
-		os=-sysv4
+		os=sysv4
 		;;
 	*-masscomp)
-		os=-rtu
+		os=rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
+		os=uxpv
 		;;
 	*-rom68k)
-		os=-coff
+		os=coff
 		;;
 	*-*bug)
-		os=-coff
+		os=coff
 		;;
 	*-apple)
-		os=-macos
+		os=macos
 		;;
 	*-atari*)
-		os=-mint
+		os=mint
+		;;
+	*-wrs)
+		os=vxworks
 		;;
 	*)
-		os=-none
+		os=none
 		;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
+case $vendor in
+	unknown)
 		case $os in
-			-riscix*)
+			riscix*)
 				vendor=acorn
 				;;
-			-sunos*)
+			sunos*)
 				vendor=sun
 				;;
-			-cnk*|-aix*)
+			cnk*|-aix*)
 				vendor=ibm
 				;;
-			-beos*)
+			beos*)
 				vendor=be
 				;;
-			-hpux*)
+			hpux*)
 				vendor=hp
 				;;
-			-mpeix*)
+			mpeix*)
 				vendor=hp
 				;;
-			-hiux*)
+			hiux*)
 				vendor=hitachi
 				;;
-			-unos*)
+			unos*)
 				vendor=crds
 				;;
-			-dgux*)
+			dgux*)
 				vendor=dg
 				;;
-			-luna*)
+			luna*)
 				vendor=omron
 				;;
-			-genix*)
+			genix*)
 				vendor=ns
 				;;
-			-mvs* | -opened*)
+			clix*)
+				vendor=intergraph
+				;;
+			mvs* | opened*)
 				vendor=ibm
 				;;
-			-os400*)
+			os400*)
 				vendor=ibm
 				;;
-			-ptx*)
+			ptx*)
 				vendor=sequent
 				;;
-			-tpf*)
+			tpf*)
 				vendor=ibm
 				;;
-			-vxsim* | -vxworks* | -windiss*)
+			vxsim* | vxworks* | windiss*)
 				vendor=wrs
 				;;
-			-aux*)
+			aux*)
 				vendor=apple
 				;;
-			-hms*)
+			hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)
+			mpw* | macos*)
 				vendor=apple
 				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+			*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
 				vendor=atari
 				;;
-			-vos*)
+			vos*)
 				vendor=stratus
 				;;
 		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 04/13] C-SKY: NPTL support and Atomic
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (10 preceding siblings ...)
  2018-09-12  3:05   ` [PATCH v4 10/13] C-SKY: Build Infastructure Mao Han
@ 2018-09-12  3:05   ` Mao Han
  2018-09-12  3:05   ` [PATCH v4 07/13] C-SKY: ABI Lists Mao Han
  12 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  3:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

This patch implements various atomic and pthread routines on C-SKY.

	* sysdeps/csky/atomic-machine.h: New file.
	* sysdeps/csky/nptl/bits/pthreadtypes-arch.h: Likewise.
	* sysdeps/csky/nptl/bits/semaphore.h: Likewise.
	* sysdeps/csky/nptl/pthread-offsets.h: Likewise.
	* sysdeps/csky/nptl/pthreaddef.h: Likewise.
---
 sysdeps/csky/atomic-machine.h              | 77 ++++++++++++++++++++++++++++++
 sysdeps/csky/nptl/bits/pthreadtypes-arch.h | 70 +++++++++++++++++++++++++++
 sysdeps/csky/nptl/bits/semaphore.h         | 35 ++++++++++++++
 sysdeps/csky/nptl/pthread-offsets.h        |  5 ++
 sysdeps/csky/nptl/pthreaddef.h             | 32 +++++++++++++
 5 files changed, 219 insertions(+)
 create mode 100644 sysdeps/csky/atomic-machine.h
 create mode 100644 sysdeps/csky/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/csky/nptl/bits/semaphore.h
 create mode 100644 sysdeps/csky/nptl/pthread-offsets.h
 create mode 100644 sysdeps/csky/nptl/pthreaddef.h

diff --git a/sysdeps/csky/atomic-machine.h b/sysdeps/csky/atomic-machine.h
new file mode 100644
index 0000000..0205f83
--- /dev/null
+++ b/sysdeps/csky/atomic-machine.h
@@ -0,0 +1,77 @@
+/* Atomic operations.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef __CSKY_ATOMIC_H_
+#define __CSKY_ATOMIC_H_
+
+#include <stdint.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define __HAVE_64B_ATOMICS 0
+#define USE_ATOMIC_COMPILER_BUILTINS 1
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
+#define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
+  ({                                                                    \
+    typeof (*mem) __oldval = (oldval);                                  \
+    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,   \
+                                  model, __ATOMIC_RELAXED);             \
+  })
+
+#define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
+  ({                                                                    \
+    typeof (*mem) __oldval = (oldval);                                  \
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,    \
+                                 model, __ATOMIC_RELAXED);              \
+    __oldval;                                                           \
+  })
+
+#define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+  (abort (), (__typeof (*mem)) 0)
+
+#define atomic_compare_and_exchange_bool_acq(mem, new, old)		\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,		\
+			mem, new, old, __ATOMIC_ACQUIRE)
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old)		\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,		\
+		       mem, new, old, __ATOMIC_ACQUIRE)
+
+#endif /* atomic-machine.h */
diff --git a/sysdeps/csky/nptl/bits/pthreadtypes-arch.h b/sysdeps/csky/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000..fa04db0
--- /dev/null
+++ b/sysdeps/csky/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,70 @@
+/* Machine-specific pthread type layouts.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H	1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T			36
+#define __SIZEOF_PTHREAD_MUTEX_T		24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T		4
+#define __SIZEOF_PTHREAD_COND_T			48
+#define __SIZEOF_PTHREAD_CONDATTR_T		4
+#define __SIZEOF_PTHREAD_RWLOCK_T		32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T		8
+#define __SIZEOF_PTHREAD_BARRIER_T		20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T		4
+
+/* Data structure for mutex handling.  */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION		0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND	1
+#define __PTHREAD_MUTEX_USE_UNION		1
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+/* Paddings in this structure are not strictly necessary on C-SKY.
+   They are left for extensibility as most other architecture do so.  */
+struct __pthread_rwlock_arch_t
+{
+  unsigned int __readers;
+  unsigned int __writers;
+  unsigned int __wrphase_futex;
+  unsigned int __writers_futex;
+  unsigned int __pad3;
+  unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+  unsigned char __pad1;
+  unsigned char __pad2;
+  unsigned char __shared;
+  unsigned char __flags;
+#else
+  unsigned char __flags;
+  unsigned char __shared;
+  unsigned char __pad1;
+  unsigned char __pad2;
+#endif
+  int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif
diff --git a/sysdeps/csky/nptl/bits/semaphore.h b/sysdeps/csky/nptl/bits/semaphore.h
new file mode 100644
index 0000000..0b13f59
--- /dev/null
+++ b/sysdeps/csky/nptl/bits/semaphore.h
@@ -0,0 +1,35 @@
+/* Machine-specific POSIX semaphore type layouts.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+
+#define __SIZEOF_SEM_T	16
+
+
+/* Value returned if `sem_open' failed.  */
+#define SEM_FAILED	((sem_t *) 0)
+
+
+typedef union
+{
+  char __size[__SIZEOF_SEM_T];
+  long int __align;
+} sem_t;
diff --git a/sysdeps/csky/nptl/pthread-offsets.h b/sysdeps/csky/nptl/pthread-offsets.h
new file mode 100644
index 0000000..9617354
--- /dev/null
+++ b/sysdeps/csky/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET   16
+#define __PTHREAD_MUTEX_KIND_OFFSET     12
+#define __PTHREAD_MUTEX_SPINS_OFFSET    20
+#define __PTHREAD_MUTEX_ELISION_OFFSET  22
+#define __PTHREAD_MUTEX_LIST_OFFSET     20
diff --git a/sysdeps/csky/nptl/pthreaddef.h b/sysdeps/csky/nptl/pthreaddef.h
new file mode 100644
index 0000000..f69fbc0
--- /dev/null
+++ b/sysdeps/csky/nptl/pthreaddef.h
@@ -0,0 +1,32 @@
+/* pthread machine parameter definitions.  C-SKY version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Default stack size.  */
+#define ARCH_STACK_DEFAULT_SIZE	(2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning.  */
+#define STACK_ALIGN		8
+
+/* Minimal stack size after allocating thread descriptor and guard size.  */
+#define MINIMAL_REST_STACK	2048
+
+/* Alignment requirement for TCB.  */
+#define TCB_ALIGNMENT		8
+
+/* Location of current stack frame.  */
+#define CURRENT_STACK_FRAME	__builtin_frame_address (0)
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 10/13] C-SKY: Build Infastructure
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (9 preceding siblings ...)
  2018-09-12  2:57   ` [PATCH v4 08/13] C-SKY: Linux Startup and Dynamic Loading Code Mao Han
@ 2018-09-12  3:05   ` Mao Han
  2018-09-17 21:52     ` Joseph Myers
  2018-09-12  3:05   ` [PATCH v4 04/13] C-SKY: NPTL support and Atomic Mao Han
  2018-09-12  3:05   ` [PATCH v4 07/13] C-SKY: ABI Lists Mao Han
  12 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-12  3:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

This patch contains all the implile, makefile and configure needed in
C-SKY porting.

	* sysdeps/csky/Implies: New file.
	* sysdeps/csky/Makefile: Likewise.
	* sysdeps/csky/configure: Likewise.
	* sysdeps/csky/configure.ac: Likewise.
	* sysdeps/csky/nofpu/Implies: Likewise.
	* sysdeps/csky/nptl/Makefile: Likewise.
	* sysdeps/csky/preconfigure: Likewise.
	* sysdeps/unix/sysv/linux/csky/Implies: Likewise.
	* sysdeps/unix/sysv/linux/csky/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/csky/configure: Likewise.
	* sysdeps/unix/sysv/linux/csky/configure.ac: Likewise.
---
 sysdeps/csky/Implies                      |  4 ++++
 sysdeps/csky/Makefile                     | 13 ++++++++++++
 sysdeps/csky/configure                    |  4 ++++
 sysdeps/csky/configure.ac                 |  4 ++++
 sysdeps/csky/nptl/Makefile                | 20 +++++++++++++++++++
 sysdeps/csky/preconfigure                 | 33 +++++++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/Implies      |  3 +++
 sysdeps/unix/sysv/linux/csky/Makefile     |  8 ++++++++
 sysdeps/unix/sysv/linux/csky/configure    |  4 ++++
 sysdeps/unix/sysv/linux/csky/configure.ac |  5 +++++
 10 files changed, 98 insertions(+)
 create mode 100644 sysdeps/csky/Implies
 create mode 100644 sysdeps/csky/Makefile
 create mode 100644 sysdeps/csky/configure
 create mode 100644 sysdeps/csky/configure.ac
 create mode 100644 sysdeps/csky/nptl/Makefile
 create mode 100644 sysdeps/csky/preconfigure
 create mode 100644 sysdeps/unix/sysv/linux/csky/Implies
 create mode 100644 sysdeps/unix/sysv/linux/csky/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure.ac

diff --git a/sysdeps/csky/Implies b/sysdeps/csky/Implies
new file mode 100644
index 0000000..f8c3a75
--- /dev/null
+++ b/sysdeps/csky/Implies
@@ -0,0 +1,4 @@
+wordsize-32
+# C-SKY uses IEEE 754 floating point.
+ieee754/flt-32
+ieee754/dbl-64
diff --git a/sysdeps/csky/Makefile b/sysdeps/csky/Makefile
new file mode 100644
index 0000000..4fa84bc
--- /dev/null
+++ b/sysdeps/csky/Makefile
@@ -0,0 +1,13 @@
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
+
+ASFLAGS-.os += $(pic-ccflag)
+
+ifeq ($(subdir),gmon)
+sysdep_routines += csky-mcount
+endif
diff --git a/sysdeps/csky/configure b/sysdeps/csky/configure
new file mode 100644
index 0000000..19acb08
--- /dev/null
+++ b/sysdeps/csky/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/csky.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/csky/configure.ac b/sysdeps/csky/configure.ac
new file mode 100644
index 0000000..5656b66
--- /dev/null
+++ b/sysdeps/csky/configure.ac
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/csky.
+
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/csky/nptl/Makefile b/sysdeps/csky/nptl/Makefile
new file mode 100644
index 0000000..a80a979
--- /dev/null
+++ b/sysdeps/csky/nptl/Makefile
@@ -0,0 +1,20 @@
+# Copyright (C) 2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+#
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure
new file mode 100644
index 0000000..4a5864f
--- /dev/null
+++ b/sysdeps/csky/preconfigure
@@ -0,0 +1,33 @@
+case "$machine" in
+csky*)
+    abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
+      sed -n 's/^#define __CSKYABI__ \(.*\)/\1/p'`
+    float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
+      sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'`
+
+    case "$abi" in
+    2)
+	machine=abiv2
+	;;
+    *)
+	echo "Unknown abi" >&2
+	exit 1
+	;;
+    esac
+
+    case "$float_abi" in
+    1)
+	with_fp_cond=1
+	;;
+    *)
+	with_fp_cond=0
+	;;
+    esac
+
+    base_machine=csky
+    machine=csky/$machine
+
+    $as_echo "#define CSKYABI $abi" >>confdefs.h
+    $as_echo "#define CSKY_HARD_FLOAT $float_abi" >>confdefs.h
+    ;;
+esac
diff --git a/sysdeps/unix/sysv/linux/csky/Implies b/sysdeps/unix/sysv/linux/csky/Implies
new file mode 100644
index 0000000..f37776c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/Implies
@@ -0,0 +1,3 @@
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
+csky/nptl
diff --git a/sysdeps/unix/sysv/linux/csky/Makefile b/sysdeps/unix/sysv/linux/csky/Makefile
new file mode 100644
index 0000000..4462bc0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/Makefile
@@ -0,0 +1,8 @@
+ifeq ($(subdir),misc)
+sysdep_routines += cacheflush
+sysdep_headers += sys/cachectl.h
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/csky/configure b/sysdeps/unix/sysv/linux/csky/configure
new file mode 100644
index 0000000..a8043f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+
+arch_minimum_kernel=4.19.0
+ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/csky/configure.ac b/sysdeps/unix/sysv/linux/csky/configure.ac
new file mode 100644
index 0000000..d61dbb3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/configure.ac
@@ -0,0 +1,5 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/csky
+
+arch_minimum_kernel=4.19.0
+ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v4 07/13] C-SKY: ABI Lists
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
                     ` (11 preceding siblings ...)
  2018-09-12  3:05   ` [PATCH v4 04/13] C-SKY: NPTL support and Atomic Mao Han
@ 2018-09-12  3:05   ` Mao Han
  2018-09-12  6:51     ` Andreas Schwab
  12 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-12  3:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: Mao Han, c-sky_gcc_upstream, gnu-csky

	* sysdeps/unix/sysv/linux/csky/ld.abilist: New file.
	* sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/csky/libutil.abilist: Likewise.
---
 sysdeps/unix/sysv/linux/csky/ld.abilist            |    9 +
 .../unix/sysv/linux/csky/libBrokenLocale.abilist   |    1 +
 sysdeps/unix/sysv/linux/csky/libanl.abilist        |    4 +
 sysdeps/unix/sysv/linux/csky/libc.abilist          | 2086 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/libcrypt.abilist      |    2 +
 sysdeps/unix/sysv/linux/csky/libdl.abilist         |    9 +
 sysdeps/unix/sysv/linux/csky/libm.abilist          |  753 +++++++
 sysdeps/unix/sysv/linux/csky/libnsl.abilist        |  120 ++
 sysdeps/unix/sysv/linux/csky/libpthread.abilist    |  235 +++
 sysdeps/unix/sysv/linux/csky/libresolv.abilist     |   79 +
 sysdeps/unix/sysv/linux/csky/librt.abilist         |   35 +
 sysdeps/unix/sysv/linux/csky/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/csky/libutil.abilist       |    6 +
 13 files changed, 3379 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/csky/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libnsl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/csky/libutil.abilist

diff --git a/sysdeps/unix/sysv/linux/csky/ld.abilist b/sysdeps/unix/sysv/linux/csky/ld.abilist
new file mode 100644
index 0000000..7157616
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/ld.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.29 __libc_stack_end D 0x4
+GLIBC_2.29 __stack_chk_guard D 0x4
+GLIBC_2.29 __tls_get_addr F
+GLIBC_2.29 _dl_mcount F
+GLIBC_2.29 _r_debug D 0x14
+GLIBC_2.29 calloc F
+GLIBC_2.29 free F
+GLIBC_2.29 malloc F
+GLIBC_2.29 realloc F
diff --git a/sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist
new file mode 100644
index 0000000..96b4163
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist
@@ -0,0 +1 @@
+GLIBC_2.29 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist b/sysdeps/unix/sysv/linux/csky/libanl.abilist
new file mode 100644
index 0000000..416a6f8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.29 gai_cancel F
+GLIBC_2.29 gai_error F
+GLIBC_2.29 gai_suspend F
+GLIBC_2.29 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
new file mode 100644
index 0000000..69c1ca3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -0,0 +1,2086 @@
+GLIBC_2.29 _Exit F
+GLIBC_2.29 _IO_2_1_stderr_ D 0x98
+GLIBC_2.29 _IO_2_1_stdin_ D 0x98
+GLIBC_2.29 _IO_2_1_stdout_ D 0x98
+GLIBC_2.29 _IO_adjust_column F
+GLIBC_2.29 _IO_adjust_wcolumn F
+GLIBC_2.29 _IO_default_doallocate F
+GLIBC_2.29 _IO_default_finish F
+GLIBC_2.29 _IO_default_pbackfail F
+GLIBC_2.29 _IO_default_uflow F
+GLIBC_2.29 _IO_default_xsgetn F
+GLIBC_2.29 _IO_default_xsputn F
+GLIBC_2.29 _IO_do_write F
+GLIBC_2.29 _IO_doallocbuf F
+GLIBC_2.29 _IO_fclose F
+GLIBC_2.29 _IO_fdopen F
+GLIBC_2.29 _IO_feof F
+GLIBC_2.29 _IO_ferror F
+GLIBC_2.29 _IO_fflush F
+GLIBC_2.29 _IO_fgetpos F
+GLIBC_2.29 _IO_fgetpos64 F
+GLIBC_2.29 _IO_fgets F
+GLIBC_2.29 _IO_file_attach F
+GLIBC_2.29 _IO_file_close F
+GLIBC_2.29 _IO_file_close_it F
+GLIBC_2.29 _IO_file_doallocate F
+GLIBC_2.29 _IO_file_finish F
+GLIBC_2.29 _IO_file_fopen F
+GLIBC_2.29 _IO_file_init F
+GLIBC_2.29 _IO_file_jumps D 0x54
+GLIBC_2.29 _IO_file_open F
+GLIBC_2.29 _IO_file_overflow F
+GLIBC_2.29 _IO_file_read F
+GLIBC_2.29 _IO_file_seek F
+GLIBC_2.29 _IO_file_seekoff F
+GLIBC_2.29 _IO_file_setbuf F
+GLIBC_2.29 _IO_file_stat F
+GLIBC_2.29 _IO_file_sync F
+GLIBC_2.29 _IO_file_underflow F
+GLIBC_2.29 _IO_file_write F
+GLIBC_2.29 _IO_file_xsputn F
+GLIBC_2.29 _IO_flockfile F
+GLIBC_2.29 _IO_flush_all F
+GLIBC_2.29 _IO_flush_all_linebuffered F
+GLIBC_2.29 _IO_fopen F
+GLIBC_2.29 _IO_fprintf F
+GLIBC_2.29 _IO_fputs F
+GLIBC_2.29 _IO_fread F
+GLIBC_2.29 _IO_free_backup_area F
+GLIBC_2.29 _IO_free_wbackup_area F
+GLIBC_2.29 _IO_fsetpos F
+GLIBC_2.29 _IO_fsetpos64 F
+GLIBC_2.29 _IO_ftell F
+GLIBC_2.29 _IO_ftrylockfile F
+GLIBC_2.29 _IO_funlockfile F
+GLIBC_2.29 _IO_fwrite F
+GLIBC_2.29 _IO_getc F
+GLIBC_2.29 _IO_getline F
+GLIBC_2.29 _IO_getline_info F
+GLIBC_2.29 _IO_gets F
+GLIBC_2.29 _IO_init F
+GLIBC_2.29 _IO_init_marker F
+GLIBC_2.29 _IO_init_wmarker F
+GLIBC_2.29 _IO_iter_begin F
+GLIBC_2.29 _IO_iter_end F
+GLIBC_2.29 _IO_iter_file F
+GLIBC_2.29 _IO_iter_next F
+GLIBC_2.29 _IO_least_wmarker F
+GLIBC_2.29 _IO_link_in F
+GLIBC_2.29 _IO_list_all D 0x4
+GLIBC_2.29 _IO_list_lock F
+GLIBC_2.29 _IO_list_resetlock F
+GLIBC_2.29 _IO_list_unlock F
+GLIBC_2.29 _IO_marker_delta F
+GLIBC_2.29 _IO_marker_difference F
+GLIBC_2.29 _IO_padn F
+GLIBC_2.29 _IO_peekc_locked F
+GLIBC_2.29 _IO_popen F
+GLIBC_2.29 _IO_printf F
+GLIBC_2.29 _IO_proc_close F
+GLIBC_2.29 _IO_proc_open F
+GLIBC_2.29 _IO_putc F
+GLIBC_2.29 _IO_puts F
+GLIBC_2.29 _IO_remove_marker F
+GLIBC_2.29 _IO_seekmark F
+GLIBC_2.29 _IO_seekoff F
+GLIBC_2.29 _IO_seekpos F
+GLIBC_2.29 _IO_seekwmark F
+GLIBC_2.29 _IO_setb F
+GLIBC_2.29 _IO_setbuffer F
+GLIBC_2.29 _IO_setvbuf F
+GLIBC_2.29 _IO_sgetn F
+GLIBC_2.29 _IO_sprintf F
+GLIBC_2.29 _IO_sputbackc F
+GLIBC_2.29 _IO_sputbackwc F
+GLIBC_2.29 _IO_sscanf F
+GLIBC_2.29 _IO_str_init_readonly F
+GLIBC_2.29 _IO_str_init_static F
+GLIBC_2.29 _IO_str_overflow F
+GLIBC_2.29 _IO_str_pbackfail F
+GLIBC_2.29 _IO_str_seekoff F
+GLIBC_2.29 _IO_str_underflow F
+GLIBC_2.29 _IO_sungetc F
+GLIBC_2.29 _IO_sungetwc F
+GLIBC_2.29 _IO_switch_to_get_mode F
+GLIBC_2.29 _IO_switch_to_main_wget_area F
+GLIBC_2.29 _IO_switch_to_wbackup_area F
+GLIBC_2.29 _IO_switch_to_wget_mode F
+GLIBC_2.29 _IO_un_link F
+GLIBC_2.29 _IO_ungetc F
+GLIBC_2.29 _IO_unsave_markers F
+GLIBC_2.29 _IO_unsave_wmarkers F
+GLIBC_2.29 _IO_vfprintf F
+GLIBC_2.29 _IO_vfscanf F
+GLIBC_2.29 _IO_vsprintf F
+GLIBC_2.29 _IO_wdefault_doallocate F
+GLIBC_2.29 _IO_wdefault_finish F
+GLIBC_2.29 _IO_wdefault_pbackfail F
+GLIBC_2.29 _IO_wdefault_uflow F
+GLIBC_2.29 _IO_wdefault_xsgetn F
+GLIBC_2.29 _IO_wdefault_xsputn F
+GLIBC_2.29 _IO_wdo_write F
+GLIBC_2.29 _IO_wdoallocbuf F
+GLIBC_2.29 _IO_wfile_jumps D 0x54
+GLIBC_2.29 _IO_wfile_overflow F
+GLIBC_2.29 _IO_wfile_seekoff F
+GLIBC_2.29 _IO_wfile_sync F
+GLIBC_2.29 _IO_wfile_underflow F
+GLIBC_2.29 _IO_wfile_xsputn F
+GLIBC_2.29 _IO_wmarker_delta F
+GLIBC_2.29 _IO_wsetb F
+GLIBC_2.29 ___brk_addr D 0x4
+GLIBC_2.29 __adjtimex F
+GLIBC_2.29 __after_morecore_hook D 0x4
+GLIBC_2.29 __argz_count F
+GLIBC_2.29 __argz_next F
+GLIBC_2.29 __argz_stringify F
+GLIBC_2.29 __asprintf F
+GLIBC_2.29 __asprintf_chk F
+GLIBC_2.29 __assert F
+GLIBC_2.29 __assert_fail F
+GLIBC_2.29 __assert_perror_fail F
+GLIBC_2.29 __backtrace F
+GLIBC_2.29 __backtrace_symbols F
+GLIBC_2.29 __backtrace_symbols_fd F
+GLIBC_2.29 __bsd_getpgrp F
+GLIBC_2.29 __bzero F
+GLIBC_2.29 __check_rhosts_file D 0x4
+GLIBC_2.29 __chk_fail F
+GLIBC_2.29 __clone F
+GLIBC_2.29 __close F
+GLIBC_2.29 __cmsg_nxthdr F
+GLIBC_2.29 __confstr_chk F
+GLIBC_2.29 __connect F
+GLIBC_2.29 __ctype_b_loc F
+GLIBC_2.29 __ctype_get_mb_cur_max F
+GLIBC_2.29 __ctype_tolower_loc F
+GLIBC_2.29 __ctype_toupper_loc F
+GLIBC_2.29 __curbrk D 0x4
+GLIBC_2.29 __cxa_at_quick_exit F
+GLIBC_2.29 __cxa_atexit F
+GLIBC_2.29 __cxa_finalize F
+GLIBC_2.29 __cxa_thread_atexit_impl F
+GLIBC_2.29 __cyg_profile_func_enter F
+GLIBC_2.29 __cyg_profile_func_exit F
+GLIBC_2.29 __daylight D 0x4
+GLIBC_2.29 __dcgettext F
+GLIBC_2.29 __default_morecore F
+GLIBC_2.29 __dgettext F
+GLIBC_2.29 __dprintf_chk F
+GLIBC_2.29 __dup2 F
+GLIBC_2.29 __duplocale F
+GLIBC_2.29 __endmntent F
+GLIBC_2.29 __environ D 0x4
+GLIBC_2.29 __errno_location F
+GLIBC_2.29 __explicit_bzero_chk F
+GLIBC_2.29 __fbufsize F
+GLIBC_2.29 __fcntl F
+GLIBC_2.29 __fdelt_chk F
+GLIBC_2.29 __fdelt_warn F
+GLIBC_2.29 __ffs F
+GLIBC_2.29 __fgets_chk F
+GLIBC_2.29 __fgets_unlocked_chk F
+GLIBC_2.29 __fgetws_chk F
+GLIBC_2.29 __fgetws_unlocked_chk F
+GLIBC_2.29 __finite F
+GLIBC_2.29 __finitef F
+GLIBC_2.29 __flbf F
+GLIBC_2.29 __fork F
+GLIBC_2.29 __fpending F
+GLIBC_2.29 __fprintf_chk F
+GLIBC_2.29 __fpu_control D 0x4
+GLIBC_2.29 __fpurge F
+GLIBC_2.29 __fread_chk F
+GLIBC_2.29 __fread_unlocked_chk F
+GLIBC_2.29 __freadable F
+GLIBC_2.29 __freading F
+GLIBC_2.29 __free_hook D 0x4
+GLIBC_2.29 __freelocale F
+GLIBC_2.29 __fsetlocking F
+GLIBC_2.29 __fwprintf_chk F
+GLIBC_2.29 __fwritable F
+GLIBC_2.29 __fwriting F
+GLIBC_2.29 __fxstat F
+GLIBC_2.29 __fxstat64 F
+GLIBC_2.29 __fxstatat F
+GLIBC_2.29 __fxstatat64 F
+GLIBC_2.29 __getauxval F
+GLIBC_2.29 __getcwd_chk F
+GLIBC_2.29 __getdelim F
+GLIBC_2.29 __getdomainname_chk F
+GLIBC_2.29 __getgroups_chk F
+GLIBC_2.29 __gethostname_chk F
+GLIBC_2.29 __getlogin_r_chk F
+GLIBC_2.29 __getmntent_r F
+GLIBC_2.29 __getpagesize F
+GLIBC_2.29 __getpgid F
+GLIBC_2.29 __getpid F
+GLIBC_2.29 __gets_chk F
+GLIBC_2.29 __gettimeofday F
+GLIBC_2.29 __getwd_chk F
+GLIBC_2.29 __gmtime_r F
+GLIBC_2.29 __h_errno_location F
+GLIBC_2.29 __isalnum_l F
+GLIBC_2.29 __isalpha_l F
+GLIBC_2.29 __isascii_l F
+GLIBC_2.29 __isblank_l F
+GLIBC_2.29 __iscntrl_l F
+GLIBC_2.29 __isctype F
+GLIBC_2.29 __isdigit_l F
+GLIBC_2.29 __isgraph_l F
+GLIBC_2.29 __isinf F
+GLIBC_2.29 __isinff F
+GLIBC_2.29 __islower_l F
+GLIBC_2.29 __isnan F
+GLIBC_2.29 __isnanf F
+GLIBC_2.29 __isoc99_fscanf F
+GLIBC_2.29 __isoc99_fwscanf F
+GLIBC_2.29 __isoc99_scanf F
+GLIBC_2.29 __isoc99_sscanf F
+GLIBC_2.29 __isoc99_swscanf F
+GLIBC_2.29 __isoc99_vfscanf F
+GLIBC_2.29 __isoc99_vfwscanf F
+GLIBC_2.29 __isoc99_vscanf F
+GLIBC_2.29 __isoc99_vsscanf F
+GLIBC_2.29 __isoc99_vswscanf F
+GLIBC_2.29 __isoc99_vwscanf F
+GLIBC_2.29 __isoc99_wscanf F
+GLIBC_2.29 __isprint_l F
+GLIBC_2.29 __ispunct_l F
+GLIBC_2.29 __isspace_l F
+GLIBC_2.29 __isupper_l F
+GLIBC_2.29 __iswalnum_l F
+GLIBC_2.29 __iswalpha_l F
+GLIBC_2.29 __iswblank_l F
+GLIBC_2.29 __iswcntrl_l F
+GLIBC_2.29 __iswctype F
+GLIBC_2.29 __iswctype_l F
+GLIBC_2.29 __iswdigit_l F
+GLIBC_2.29 __iswgraph_l F
+GLIBC_2.29 __iswlower_l F
+GLIBC_2.29 __iswprint_l F
+GLIBC_2.29 __iswpunct_l F
+GLIBC_2.29 __iswspace_l F
+GLIBC_2.29 __iswupper_l F
+GLIBC_2.29 __iswxdigit_l F
+GLIBC_2.29 __isxdigit_l F
+GLIBC_2.29 __ivaliduser F
+GLIBC_2.29 __key_decryptsession_pk_LOCAL D 0x4
+GLIBC_2.29 __key_encryptsession_pk_LOCAL D 0x4
+GLIBC_2.29 __key_gendes_LOCAL D 0x4
+GLIBC_2.29 __libc_allocate_rtsig F
+GLIBC_2.29 __libc_calloc F
+GLIBC_2.29 __libc_current_sigrtmax F
+GLIBC_2.29 __libc_current_sigrtmin F
+GLIBC_2.29 __libc_free F
+GLIBC_2.29 __libc_freeres F
+GLIBC_2.29 __libc_init_first F
+GLIBC_2.29 __libc_mallinfo F
+GLIBC_2.29 __libc_malloc F
+GLIBC_2.29 __libc_mallopt F
+GLIBC_2.29 __libc_memalign F
+GLIBC_2.29 __libc_pvalloc F
+GLIBC_2.29 __libc_realloc F
+GLIBC_2.29 __libc_sa_len F
+GLIBC_2.29 __libc_start_main F
+GLIBC_2.29 __libc_valloc F
+GLIBC_2.29 __longjmp_chk F
+GLIBC_2.29 __lseek F
+GLIBC_2.29 __lxstat F
+GLIBC_2.29 __lxstat64 F
+GLIBC_2.29 __malloc_hook D 0x4
+GLIBC_2.29 __mbrlen F
+GLIBC_2.29 __mbrtowc F
+GLIBC_2.29 __mbsnrtowcs_chk F
+GLIBC_2.29 __mbsrtowcs_chk F
+GLIBC_2.29 __mbstowcs_chk F
+GLIBC_2.29 __memalign_hook D 0x4
+GLIBC_2.29 __memcpy_chk F
+GLIBC_2.29 __memmove_chk F
+GLIBC_2.29 __mempcpy F
+GLIBC_2.29 __mempcpy_chk F
+GLIBC_2.29 __memset_chk F
+GLIBC_2.29 __monstartup F
+GLIBC_2.29 __morecore D 0x4
+GLIBC_2.29 __nanosleep F
+GLIBC_2.29 __newlocale F
+GLIBC_2.29 __nl_langinfo_l F
+GLIBC_2.29 __nss_configure_lookup F
+GLIBC_2.29 __nss_database_lookup F
+GLIBC_2.29 __nss_hostname_digits_dots F
+GLIBC_2.29 __nss_next F
+GLIBC_2.29 __obstack_printf_chk F
+GLIBC_2.29 __obstack_vprintf_chk F
+GLIBC_2.29 __open F
+GLIBC_2.29 __open64 F
+GLIBC_2.29 __open64_2 F
+GLIBC_2.29 __open_2 F
+GLIBC_2.29 __openat64_2 F
+GLIBC_2.29 __openat_2 F
+GLIBC_2.29 __overflow F
+GLIBC_2.29 __pipe F
+GLIBC_2.29 __poll F
+GLIBC_2.29 __poll_chk F
+GLIBC_2.29 __posix_getopt F
+GLIBC_2.29 __ppoll_chk F
+GLIBC_2.29 __pread64 F
+GLIBC_2.29 __pread64_chk F
+GLIBC_2.29 __pread_chk F
+GLIBC_2.29 __printf_chk F
+GLIBC_2.29 __printf_fp F
+GLIBC_2.29 __profile_frequency F
+GLIBC_2.29 __progname D 0x4
+GLIBC_2.29 __progname_full D 0x4
+GLIBC_2.29 __ptsname_r_chk F
+GLIBC_2.29 __pwrite64 F
+GLIBC_2.29 __rawmemchr F
+GLIBC_2.29 __rcmd_errstr D 0x4
+GLIBC_2.29 __read F
+GLIBC_2.29 __read_chk F
+GLIBC_2.29 __readlink_chk F
+GLIBC_2.29 __readlinkat_chk F
+GLIBC_2.29 __realloc_hook D 0x4
+GLIBC_2.29 __realpath_chk F
+GLIBC_2.29 __recv_chk F
+GLIBC_2.29 __recvfrom_chk F
+GLIBC_2.29 __register_atfork F
+GLIBC_2.29 __res_init F
+GLIBC_2.29 __res_nclose F
+GLIBC_2.29 __res_ninit F
+GLIBC_2.29 __res_randomid F
+GLIBC_2.29 __res_state F
+GLIBC_2.29 __rpc_thread_createerr F
+GLIBC_2.29 __rpc_thread_svc_fdset F
+GLIBC_2.29 __rpc_thread_svc_max_pollfd F
+GLIBC_2.29 __rpc_thread_svc_pollfd F
+GLIBC_2.29 __sbrk F
+GLIBC_2.29 __sched_cpualloc F
+GLIBC_2.29 __sched_cpucount F
+GLIBC_2.29 __sched_cpufree F
+GLIBC_2.29 __sched_get_priority_max F
+GLIBC_2.29 __sched_get_priority_min F
+GLIBC_2.29 __sched_getparam F
+GLIBC_2.29 __sched_getscheduler F
+GLIBC_2.29 __sched_setscheduler F
+GLIBC_2.29 __sched_yield F
+GLIBC_2.29 __select F
+GLIBC_2.29 __send F
+GLIBC_2.29 __setmntent F
+GLIBC_2.29 __setpgid F
+GLIBC_2.29 __sigaction F
+GLIBC_2.29 __signbit F
+GLIBC_2.29 __signbitf F
+GLIBC_2.29 __sigpause F
+GLIBC_2.29 __sigsetjmp F
+GLIBC_2.29 __sigsuspend F
+GLIBC_2.29 __snprintf_chk F
+GLIBC_2.29 __sprintf_chk F
+GLIBC_2.29 __stack_chk_fail F
+GLIBC_2.29 __statfs F
+GLIBC_2.29 __stpcpy F
+GLIBC_2.29 __stpcpy_chk F
+GLIBC_2.29 __stpncpy F
+GLIBC_2.29 __stpncpy_chk F
+GLIBC_2.29 __strcasecmp F
+GLIBC_2.29 __strcasecmp_l F
+GLIBC_2.29 __strcasestr F
+GLIBC_2.29 __strcat_chk F
+GLIBC_2.29 __strcoll_l F
+GLIBC_2.29 __strcpy_chk F
+GLIBC_2.29 __strdup F
+GLIBC_2.29 __strerror_r F
+GLIBC_2.29 __strfmon_l F
+GLIBC_2.29 __strftime_l F
+GLIBC_2.29 __strncasecmp_l F
+GLIBC_2.29 __strncat_chk F
+GLIBC_2.29 __strncpy_chk F
+GLIBC_2.29 __strndup F
+GLIBC_2.29 __strsep_g F
+GLIBC_2.29 __strtod_internal F
+GLIBC_2.29 __strtod_l F
+GLIBC_2.29 __strtof_internal F
+GLIBC_2.29 __strtof_l F
+GLIBC_2.29 __strtok_r F
+GLIBC_2.29 __strtol_internal F
+GLIBC_2.29 __strtol_l F
+GLIBC_2.29 __strtold_internal F
+GLIBC_2.29 __strtold_l F
+GLIBC_2.29 __strtoll_internal F
+GLIBC_2.29 __strtoll_l F
+GLIBC_2.29 __strtoul_internal F
+GLIBC_2.29 __strtoul_l F
+GLIBC_2.29 __strtoull_internal F
+GLIBC_2.29 __strtoull_l F
+GLIBC_2.29 __strverscmp F
+GLIBC_2.29 __strxfrm_l F
+GLIBC_2.29 __swprintf_chk F
+GLIBC_2.29 __sysconf F
+GLIBC_2.29 __syslog_chk F
+GLIBC_2.29 __sysv_signal F
+GLIBC_2.29 __timezone D 0x4
+GLIBC_2.29 __toascii_l F
+GLIBC_2.29 __tolower_l F
+GLIBC_2.29 __toupper_l F
+GLIBC_2.29 __towctrans F
+GLIBC_2.29 __towctrans_l F
+GLIBC_2.29 __towlower_l F
+GLIBC_2.29 __towupper_l F
+GLIBC_2.29 __ttyname_r_chk F
+GLIBC_2.29 __tzname D 0x8
+GLIBC_2.29 __uflow F
+GLIBC_2.29 __underflow F
+GLIBC_2.29 __uselocale F
+GLIBC_2.29 __vasprintf_chk F
+GLIBC_2.29 __vdprintf_chk F
+GLIBC_2.29 __vfork F
+GLIBC_2.29 __vfprintf_chk F
+GLIBC_2.29 __vfscanf F
+GLIBC_2.29 __vfwprintf_chk F
+GLIBC_2.29 __vprintf_chk F
+GLIBC_2.29 __vsnprintf F
+GLIBC_2.29 __vsnprintf_chk F
+GLIBC_2.29 __vsprintf_chk F
+GLIBC_2.29 __vsscanf F
+GLIBC_2.29 __vswprintf_chk F
+GLIBC_2.29 __vsyslog_chk F
+GLIBC_2.29 __vwprintf_chk F
+GLIBC_2.29 __wait F
+GLIBC_2.29 __waitpid F
+GLIBC_2.29 __wcpcpy_chk F
+GLIBC_2.29 __wcpncpy_chk F
+GLIBC_2.29 __wcrtomb_chk F
+GLIBC_2.29 __wcscasecmp_l F
+GLIBC_2.29 __wcscat_chk F
+GLIBC_2.29 __wcscoll_l F
+GLIBC_2.29 __wcscpy_chk F
+GLIBC_2.29 __wcsftime_l F
+GLIBC_2.29 __wcsncasecmp_l F
+GLIBC_2.29 __wcsncat_chk F
+GLIBC_2.29 __wcsncpy_chk F
+GLIBC_2.29 __wcsnrtombs_chk F
+GLIBC_2.29 __wcsrtombs_chk F
+GLIBC_2.29 __wcstod_internal F
+GLIBC_2.29 __wcstod_l F
+GLIBC_2.29 __wcstof_internal F
+GLIBC_2.29 __wcstof_l F
+GLIBC_2.29 __wcstol_internal F
+GLIBC_2.29 __wcstol_l F
+GLIBC_2.29 __wcstold_internal F
+GLIBC_2.29 __wcstold_l F
+GLIBC_2.29 __wcstoll_internal F
+GLIBC_2.29 __wcstoll_l F
+GLIBC_2.29 __wcstombs_chk F
+GLIBC_2.29 __wcstoul_internal F
+GLIBC_2.29 __wcstoul_l F
+GLIBC_2.29 __wcstoull_internal F
+GLIBC_2.29 __wcstoull_l F
+GLIBC_2.29 __wcsxfrm_l F
+GLIBC_2.29 __wctomb_chk F
+GLIBC_2.29 __wctrans_l F
+GLIBC_2.29 __wctype_l F
+GLIBC_2.29 __wmemcpy_chk F
+GLIBC_2.29 __wmemmove_chk F
+GLIBC_2.29 __wmempcpy_chk F
+GLIBC_2.29 __wmemset_chk F
+GLIBC_2.29 __woverflow F
+GLIBC_2.29 __wprintf_chk F
+GLIBC_2.29 __write F
+GLIBC_2.29 __wuflow F
+GLIBC_2.29 __wunderflow F
+GLIBC_2.29 __xmknod F
+GLIBC_2.29 __xmknodat F
+GLIBC_2.29 __xpg_basename F
+GLIBC_2.29 __xpg_sigpause F
+GLIBC_2.29 __xpg_strerror_r F
+GLIBC_2.29 __xstat F
+GLIBC_2.29 __xstat64 F
+GLIBC_2.29 _authenticate F
+GLIBC_2.29 _dl_mcount_wrapper F
+GLIBC_2.29 _dl_mcount_wrapper_check F
+GLIBC_2.29 _environ D 0x4
+GLIBC_2.29 _exit F
+GLIBC_2.29 _flushlbf F
+GLIBC_2.29 _libc_intl_domainname D 0x5
+GLIBC_2.29 _longjmp F
+GLIBC_2.29 _mcleanup F
+GLIBC_2.29 _mcount F
+GLIBC_2.29 _nl_default_dirname D 0x12
+GLIBC_2.29 _nl_domain_bindings D 0x4
+GLIBC_2.29 _nl_msg_cat_cntr D 0x4
+GLIBC_2.29 _null_auth D 0xc
+GLIBC_2.29 _obstack_allocated_p F
+GLIBC_2.29 _obstack_begin F
+GLIBC_2.29 _obstack_begin_1 F
+GLIBC_2.29 _obstack_free F
+GLIBC_2.29 _obstack_memory_used F
+GLIBC_2.29 _obstack_newchunk F
+GLIBC_2.29 _res D 0x200
+GLIBC_2.29 _res_hconf D 0x30
+GLIBC_2.29 _rpc_dtablesize F
+GLIBC_2.29 _seterr_reply F
+GLIBC_2.29 _setjmp F
+GLIBC_2.29 _sys_errlist D 0x21c
+GLIBC_2.29 _sys_nerr D 0x4
+GLIBC_2.29 _sys_siglist D 0x104
+GLIBC_2.29 _tolower F
+GLIBC_2.29 _toupper F
+GLIBC_2.29 a64l F
+GLIBC_2.29 abort F
+GLIBC_2.29 abs F
+GLIBC_2.29 accept F
+GLIBC_2.29 accept4 F
+GLIBC_2.29 access F
+GLIBC_2.29 acct F
+GLIBC_2.29 addmntent F
+GLIBC_2.29 addseverity F
+GLIBC_2.29 adjtime F
+GLIBC_2.29 adjtimex F
+GLIBC_2.29 alarm F
+GLIBC_2.29 aligned_alloc F
+GLIBC_2.29 alphasort F
+GLIBC_2.29 alphasort64 F
+GLIBC_2.29 argp_err_exit_status D 0x4
+GLIBC_2.29 argp_error F
+GLIBC_2.29 argp_failure F
+GLIBC_2.29 argp_help F
+GLIBC_2.29 argp_parse F
+GLIBC_2.29 argp_program_bug_address D 0x4
+GLIBC_2.29 argp_program_version D 0x4
+GLIBC_2.29 argp_program_version_hook D 0x4
+GLIBC_2.29 argp_state_help F
+GLIBC_2.29 argp_usage F
+GLIBC_2.29 argz_add F
+GLIBC_2.29 argz_add_sep F
+GLIBC_2.29 argz_append F
+GLIBC_2.29 argz_count F
+GLIBC_2.29 argz_create F
+GLIBC_2.29 argz_create_sep F
+GLIBC_2.29 argz_delete F
+GLIBC_2.29 argz_extract F
+GLIBC_2.29 argz_insert F
+GLIBC_2.29 argz_next F
+GLIBC_2.29 argz_replace F
+GLIBC_2.29 argz_stringify F
+GLIBC_2.29 asctime F
+GLIBC_2.29 asctime_r F
+GLIBC_2.29 asprintf F
+GLIBC_2.29 atof F
+GLIBC_2.29 atoi F
+GLIBC_2.29 atol F
+GLIBC_2.29 atoll F
+GLIBC_2.29 authdes_create F
+GLIBC_2.29 authdes_getucred F
+GLIBC_2.29 authdes_pk_create F
+GLIBC_2.29 authnone_create F
+GLIBC_2.29 authunix_create F
+GLIBC_2.29 authunix_create_default F
+GLIBC_2.29 backtrace F
+GLIBC_2.29 backtrace_symbols F
+GLIBC_2.29 backtrace_symbols_fd F
+GLIBC_2.29 basename F
+GLIBC_2.29 bcmp F
+GLIBC_2.29 bcopy F
+GLIBC_2.29 bind F
+GLIBC_2.29 bind_textdomain_codeset F
+GLIBC_2.29 bindresvport F
+GLIBC_2.29 bindtextdomain F
+GLIBC_2.29 brk F
+GLIBC_2.29 bsd_signal F
+GLIBC_2.29 bsearch F
+GLIBC_2.29 btowc F
+GLIBC_2.29 bzero F
+GLIBC_2.29 c16rtomb F
+GLIBC_2.29 c32rtomb F
+GLIBC_2.29 cacheflush F
+GLIBC_2.29 calloc F
+GLIBC_2.29 callrpc F
+GLIBC_2.29 canonicalize_file_name F
+GLIBC_2.29 capget F
+GLIBC_2.29 capset F
+GLIBC_2.29 catclose F
+GLIBC_2.29 catgets F
+GLIBC_2.29 catopen F
+GLIBC_2.29 cbc_crypt F
+GLIBC_2.29 cfgetispeed F
+GLIBC_2.29 cfgetospeed F
+GLIBC_2.29 cfmakeraw F
+GLIBC_2.29 cfsetispeed F
+GLIBC_2.29 cfsetospeed F
+GLIBC_2.29 cfsetspeed F
+GLIBC_2.29 chdir F
+GLIBC_2.29 chflags F
+GLIBC_2.29 chmod F
+GLIBC_2.29 chown F
+GLIBC_2.29 chroot F
+GLIBC_2.29 clearenv F
+GLIBC_2.29 clearerr F
+GLIBC_2.29 clearerr_unlocked F
+GLIBC_2.29 clnt_broadcast F
+GLIBC_2.29 clnt_create F
+GLIBC_2.29 clnt_pcreateerror F
+GLIBC_2.29 clnt_perrno F
+GLIBC_2.29 clnt_perror F
+GLIBC_2.29 clnt_spcreateerror F
+GLIBC_2.29 clnt_sperrno F
+GLIBC_2.29 clnt_sperror F
+GLIBC_2.29 clntraw_create F
+GLIBC_2.29 clnttcp_create F
+GLIBC_2.29 clntudp_bufcreate F
+GLIBC_2.29 clntudp_create F
+GLIBC_2.29 clntunix_create F
+GLIBC_2.29 clock F
+GLIBC_2.29 clock_adjtime F
+GLIBC_2.29 clock_getcpuclockid F
+GLIBC_2.29 clock_getres F
+GLIBC_2.29 clock_gettime F
+GLIBC_2.29 clock_nanosleep F
+GLIBC_2.29 clock_settime F
+GLIBC_2.29 clone F
+GLIBC_2.29 close F
+GLIBC_2.29 closedir F
+GLIBC_2.29 closelog F
+GLIBC_2.29 confstr F
+GLIBC_2.29 connect F
+GLIBC_2.29 copy_file_range F
+GLIBC_2.29 copysign F
+GLIBC_2.29 copysignf F
+GLIBC_2.29 copysignl F
+GLIBC_2.29 creat F
+GLIBC_2.29 creat64 F
+GLIBC_2.29 ctermid F
+GLIBC_2.29 ctime F
+GLIBC_2.29 ctime_r F
+GLIBC_2.29 cuserid F
+GLIBC_2.29 daemon F
+GLIBC_2.29 daylight D 0x4
+GLIBC_2.29 dcgettext F
+GLIBC_2.29 dcngettext F
+GLIBC_2.29 delete_module F
+GLIBC_2.29 des_setparity F
+GLIBC_2.29 dgettext F
+GLIBC_2.29 difftime F
+GLIBC_2.29 dirfd F
+GLIBC_2.29 dirname F
+GLIBC_2.29 div F
+GLIBC_2.29 dl_iterate_phdr F
+GLIBC_2.29 dngettext F
+GLIBC_2.29 dprintf F
+GLIBC_2.29 drand48 F
+GLIBC_2.29 drand48_r F
+GLIBC_2.29 dup F
+GLIBC_2.29 dup2 F
+GLIBC_2.29 dup3 F
+GLIBC_2.29 duplocale F
+GLIBC_2.29 dysize F
+GLIBC_2.29 eaccess F
+GLIBC_2.29 ecb_crypt F
+GLIBC_2.29 ecvt F
+GLIBC_2.29 ecvt_r F
+GLIBC_2.29 endaliasent F
+GLIBC_2.29 endfsent F
+GLIBC_2.29 endgrent F
+GLIBC_2.29 endhostent F
+GLIBC_2.29 endmntent F
+GLIBC_2.29 endnetent F
+GLIBC_2.29 endnetgrent F
+GLIBC_2.29 endprotoent F
+GLIBC_2.29 endpwent F
+GLIBC_2.29 endrpcent F
+GLIBC_2.29 endservent F
+GLIBC_2.29 endsgent F
+GLIBC_2.29 endspent F
+GLIBC_2.29 endttyent F
+GLIBC_2.29 endusershell F
+GLIBC_2.29 endutent F
+GLIBC_2.29 endutxent F
+GLIBC_2.29 environ D 0x4
+GLIBC_2.29 envz_add F
+GLIBC_2.29 envz_entry F
+GLIBC_2.29 envz_get F
+GLIBC_2.29 envz_merge F
+GLIBC_2.29 envz_remove F
+GLIBC_2.29 envz_strip F
+GLIBC_2.29 epoll_create F
+GLIBC_2.29 epoll_create1 F
+GLIBC_2.29 epoll_ctl F
+GLIBC_2.29 epoll_pwait F
+GLIBC_2.29 epoll_wait F
+GLIBC_2.29 erand48 F
+GLIBC_2.29 erand48_r F
+GLIBC_2.29 err F
+GLIBC_2.29 error F
+GLIBC_2.29 error_at_line F
+GLIBC_2.29 error_message_count D 0x4
+GLIBC_2.29 error_one_per_line D 0x4
+GLIBC_2.29 error_print_progname D 0x4
+GLIBC_2.29 errx F
+GLIBC_2.29 ether_aton F
+GLIBC_2.29 ether_aton_r F
+GLIBC_2.29 ether_hostton F
+GLIBC_2.29 ether_line F
+GLIBC_2.29 ether_ntoa F
+GLIBC_2.29 ether_ntoa_r F
+GLIBC_2.29 ether_ntohost F
+GLIBC_2.29 euidaccess F
+GLIBC_2.29 eventfd F
+GLIBC_2.29 eventfd_read F
+GLIBC_2.29 eventfd_write F
+GLIBC_2.29 execl F
+GLIBC_2.29 execle F
+GLIBC_2.29 execlp F
+GLIBC_2.29 execv F
+GLIBC_2.29 execve F
+GLIBC_2.29 execvp F
+GLIBC_2.29 execvpe F
+GLIBC_2.29 exit F
+GLIBC_2.29 explicit_bzero F
+GLIBC_2.29 faccessat F
+GLIBC_2.29 fallocate F
+GLIBC_2.29 fallocate64 F
+GLIBC_2.29 fanotify_init F
+GLIBC_2.29 fanotify_mark F
+GLIBC_2.29 fattach F
+GLIBC_2.29 fchdir F
+GLIBC_2.29 fchflags F
+GLIBC_2.29 fchmod F
+GLIBC_2.29 fchmodat F
+GLIBC_2.29 fchown F
+GLIBC_2.29 fchownat F
+GLIBC_2.29 fclose F
+GLIBC_2.29 fcloseall F
+GLIBC_2.29 fcntl F
+GLIBC_2.29 fcntl64 F
+GLIBC_2.29 fcvt F
+GLIBC_2.29 fcvt_r F
+GLIBC_2.29 fdatasync F
+GLIBC_2.29 fdetach F
+GLIBC_2.29 fdopen F
+GLIBC_2.29 fdopendir F
+GLIBC_2.29 feof F
+GLIBC_2.29 feof_unlocked F
+GLIBC_2.29 ferror F
+GLIBC_2.29 ferror_unlocked F
+GLIBC_2.29 fexecve F
+GLIBC_2.29 fflush F
+GLIBC_2.29 fflush_unlocked F
+GLIBC_2.29 ffs F
+GLIBC_2.29 ffsl F
+GLIBC_2.29 ffsll F
+GLIBC_2.29 fgetc F
+GLIBC_2.29 fgetc_unlocked F
+GLIBC_2.29 fgetgrent F
+GLIBC_2.29 fgetgrent_r F
+GLIBC_2.29 fgetpos F
+GLIBC_2.29 fgetpos64 F
+GLIBC_2.29 fgetpwent F
+GLIBC_2.29 fgetpwent_r F
+GLIBC_2.29 fgets F
+GLIBC_2.29 fgets_unlocked F
+GLIBC_2.29 fgetsgent F
+GLIBC_2.29 fgetsgent_r F
+GLIBC_2.29 fgetspent F
+GLIBC_2.29 fgetspent_r F
+GLIBC_2.29 fgetwc F
+GLIBC_2.29 fgetwc_unlocked F
+GLIBC_2.29 fgetws F
+GLIBC_2.29 fgetws_unlocked F
+GLIBC_2.29 fgetxattr F
+GLIBC_2.29 fileno F
+GLIBC_2.29 fileno_unlocked F
+GLIBC_2.29 finite F
+GLIBC_2.29 finitef F
+GLIBC_2.29 finitel F
+GLIBC_2.29 flistxattr F
+GLIBC_2.29 flock F
+GLIBC_2.29 flockfile F
+GLIBC_2.29 fmemopen F
+GLIBC_2.29 fmtmsg F
+GLIBC_2.29 fnmatch F
+GLIBC_2.29 fopen F
+GLIBC_2.29 fopen64 F
+GLIBC_2.29 fopencookie F
+GLIBC_2.29 fork F
+GLIBC_2.29 fpathconf F
+GLIBC_2.29 fprintf F
+GLIBC_2.29 fputc F
+GLIBC_2.29 fputc_unlocked F
+GLIBC_2.29 fputs F
+GLIBC_2.29 fputs_unlocked F
+GLIBC_2.29 fputwc F
+GLIBC_2.29 fputwc_unlocked F
+GLIBC_2.29 fputws F
+GLIBC_2.29 fputws_unlocked F
+GLIBC_2.29 fread F
+GLIBC_2.29 fread_unlocked F
+GLIBC_2.29 free F
+GLIBC_2.29 freeaddrinfo F
+GLIBC_2.29 freeifaddrs F
+GLIBC_2.29 freelocale F
+GLIBC_2.29 fremovexattr F
+GLIBC_2.29 freopen F
+GLIBC_2.29 freopen64 F
+GLIBC_2.29 frexp F
+GLIBC_2.29 frexpf F
+GLIBC_2.29 frexpl F
+GLIBC_2.29 fscanf F
+GLIBC_2.29 fseek F
+GLIBC_2.29 fseeko F
+GLIBC_2.29 fseeko64 F
+GLIBC_2.29 fsetpos F
+GLIBC_2.29 fsetpos64 F
+GLIBC_2.29 fsetxattr F
+GLIBC_2.29 fstatfs F
+GLIBC_2.29 fstatfs64 F
+GLIBC_2.29 fstatvfs F
+GLIBC_2.29 fstatvfs64 F
+GLIBC_2.29 fsync F
+GLIBC_2.29 ftell F
+GLIBC_2.29 ftello F
+GLIBC_2.29 ftello64 F
+GLIBC_2.29 ftime F
+GLIBC_2.29 ftok F
+GLIBC_2.29 ftruncate F
+GLIBC_2.29 ftruncate64 F
+GLIBC_2.29 ftrylockfile F
+GLIBC_2.29 fts64_children F
+GLIBC_2.29 fts64_close F
+GLIBC_2.29 fts64_open F
+GLIBC_2.29 fts64_read F
+GLIBC_2.29 fts64_set F
+GLIBC_2.29 fts_children F
+GLIBC_2.29 fts_close F
+GLIBC_2.29 fts_open F
+GLIBC_2.29 fts_read F
+GLIBC_2.29 fts_set F
+GLIBC_2.29 ftw F
+GLIBC_2.29 ftw64 F
+GLIBC_2.29 funlockfile F
+GLIBC_2.29 futimens F
+GLIBC_2.29 futimes F
+GLIBC_2.29 futimesat F
+GLIBC_2.29 fwide F
+GLIBC_2.29 fwprintf F
+GLIBC_2.29 fwrite F
+GLIBC_2.29 fwrite_unlocked F
+GLIBC_2.29 fwscanf F
+GLIBC_2.29 gai_strerror F
+GLIBC_2.29 gcvt F
+GLIBC_2.29 get_avphys_pages F
+GLIBC_2.29 get_current_dir_name F
+GLIBC_2.29 get_myaddress F
+GLIBC_2.29 get_nprocs F
+GLIBC_2.29 get_nprocs_conf F
+GLIBC_2.29 get_phys_pages F
+GLIBC_2.29 getaddrinfo F
+GLIBC_2.29 getaliasbyname F
+GLIBC_2.29 getaliasbyname_r F
+GLIBC_2.29 getaliasent F
+GLIBC_2.29 getaliasent_r F
+GLIBC_2.29 getauxval F
+GLIBC_2.29 getc F
+GLIBC_2.29 getc_unlocked F
+GLIBC_2.29 getchar F
+GLIBC_2.29 getchar_unlocked F
+GLIBC_2.29 getcontext F
+GLIBC_2.29 getcwd F
+GLIBC_2.29 getdate F
+GLIBC_2.29 getdate_err D 0x4
+GLIBC_2.29 getdate_r F
+GLIBC_2.29 getdelim F
+GLIBC_2.29 getdirentries F
+GLIBC_2.29 getdirentries64 F
+GLIBC_2.29 getdomainname F
+GLIBC_2.29 getdtablesize F
+GLIBC_2.29 getegid F
+GLIBC_2.29 getentropy F
+GLIBC_2.29 getenv F
+GLIBC_2.29 geteuid F
+GLIBC_2.29 getfsent F
+GLIBC_2.29 getfsfile F
+GLIBC_2.29 getfsspec F
+GLIBC_2.29 getgid F
+GLIBC_2.29 getgrent F
+GLIBC_2.29 getgrent_r F
+GLIBC_2.29 getgrgid F
+GLIBC_2.29 getgrgid_r F
+GLIBC_2.29 getgrnam F
+GLIBC_2.29 getgrnam_r F
+GLIBC_2.29 getgrouplist F
+GLIBC_2.29 getgroups F
+GLIBC_2.29 gethostbyaddr F
+GLIBC_2.29 gethostbyaddr_r F
+GLIBC_2.29 gethostbyname F
+GLIBC_2.29 gethostbyname2 F
+GLIBC_2.29 gethostbyname2_r F
+GLIBC_2.29 gethostbyname_r F
+GLIBC_2.29 gethostent F
+GLIBC_2.29 gethostent_r F
+GLIBC_2.29 gethostid F
+GLIBC_2.29 gethostname F
+GLIBC_2.29 getifaddrs F
+GLIBC_2.29 getipv4sourcefilter F
+GLIBC_2.29 getitimer F
+GLIBC_2.29 getline F
+GLIBC_2.29 getloadavg F
+GLIBC_2.29 getlogin F
+GLIBC_2.29 getlogin_r F
+GLIBC_2.29 getmntent F
+GLIBC_2.29 getmntent_r F
+GLIBC_2.29 getmsg F
+GLIBC_2.29 getnameinfo F
+GLIBC_2.29 getnetbyaddr F
+GLIBC_2.29 getnetbyaddr_r F
+GLIBC_2.29 getnetbyname F
+GLIBC_2.29 getnetbyname_r F
+GLIBC_2.29 getnetent F
+GLIBC_2.29 getnetent_r F
+GLIBC_2.29 getnetgrent F
+GLIBC_2.29 getnetgrent_r F
+GLIBC_2.29 getnetname F
+GLIBC_2.29 getopt F
+GLIBC_2.29 getopt_long F
+GLIBC_2.29 getopt_long_only F
+GLIBC_2.29 getpagesize F
+GLIBC_2.29 getpass F
+GLIBC_2.29 getpeername F
+GLIBC_2.29 getpgid F
+GLIBC_2.29 getpgrp F
+GLIBC_2.29 getpid F
+GLIBC_2.29 getpmsg F
+GLIBC_2.29 getppid F
+GLIBC_2.29 getpriority F
+GLIBC_2.29 getprotobyname F
+GLIBC_2.29 getprotobyname_r F
+GLIBC_2.29 getprotobynumber F
+GLIBC_2.29 getprotobynumber_r F
+GLIBC_2.29 getprotoent F
+GLIBC_2.29 getprotoent_r F
+GLIBC_2.29 getpt F
+GLIBC_2.29 getpublickey F
+GLIBC_2.29 getpw F
+GLIBC_2.29 getpwent F
+GLIBC_2.29 getpwent_r F
+GLIBC_2.29 getpwnam F
+GLIBC_2.29 getpwnam_r F
+GLIBC_2.29 getpwuid F
+GLIBC_2.29 getpwuid_r F
+GLIBC_2.29 getrandom F
+GLIBC_2.29 getresgid F
+GLIBC_2.29 getresuid F
+GLIBC_2.29 getrlimit F
+GLIBC_2.29 getrlimit64 F
+GLIBC_2.29 getrpcbyname F
+GLIBC_2.29 getrpcbyname_r F
+GLIBC_2.29 getrpcbynumber F
+GLIBC_2.29 getrpcbynumber_r F
+GLIBC_2.29 getrpcent F
+GLIBC_2.29 getrpcent_r F
+GLIBC_2.29 getrpcport F
+GLIBC_2.29 getrusage F
+GLIBC_2.29 gets F
+GLIBC_2.29 getsecretkey F
+GLIBC_2.29 getservbyname F
+GLIBC_2.29 getservbyname_r F
+GLIBC_2.29 getservbyport F
+GLIBC_2.29 getservbyport_r F
+GLIBC_2.29 getservent F
+GLIBC_2.29 getservent_r F
+GLIBC_2.29 getsgent F
+GLIBC_2.29 getsgent_r F
+GLIBC_2.29 getsgnam F
+GLIBC_2.29 getsgnam_r F
+GLIBC_2.29 getsid F
+GLIBC_2.29 getsockname F
+GLIBC_2.29 getsockopt F
+GLIBC_2.29 getsourcefilter F
+GLIBC_2.29 getspent F
+GLIBC_2.29 getspent_r F
+GLIBC_2.29 getspnam F
+GLIBC_2.29 getspnam_r F
+GLIBC_2.29 getsubopt F
+GLIBC_2.29 gettext F
+GLIBC_2.29 gettimeofday F
+GLIBC_2.29 getttyent F
+GLIBC_2.29 getttynam F
+GLIBC_2.29 getuid F
+GLIBC_2.29 getusershell F
+GLIBC_2.29 getutent F
+GLIBC_2.29 getutent_r F
+GLIBC_2.29 getutid F
+GLIBC_2.29 getutid_r F
+GLIBC_2.29 getutline F
+GLIBC_2.29 getutline_r F
+GLIBC_2.29 getutmp F
+GLIBC_2.29 getutmpx F
+GLIBC_2.29 getutxent F
+GLIBC_2.29 getutxid F
+GLIBC_2.29 getutxline F
+GLIBC_2.29 getw F
+GLIBC_2.29 getwc F
+GLIBC_2.29 getwc_unlocked F
+GLIBC_2.29 getwchar F
+GLIBC_2.29 getwchar_unlocked F
+GLIBC_2.29 getwd F
+GLIBC_2.29 getxattr F
+GLIBC_2.29 glob F
+GLIBC_2.29 glob64 F
+GLIBC_2.29 glob_pattern_p F
+GLIBC_2.29 globfree F
+GLIBC_2.29 globfree64 F
+GLIBC_2.29 gmtime F
+GLIBC_2.29 gmtime_r F
+GLIBC_2.29 gnu_dev_major F
+GLIBC_2.29 gnu_dev_makedev F
+GLIBC_2.29 gnu_dev_minor F
+GLIBC_2.29 gnu_get_libc_release F
+GLIBC_2.29 gnu_get_libc_version F
+GLIBC_2.29 grantpt F
+GLIBC_2.29 group_member F
+GLIBC_2.29 gsignal F
+GLIBC_2.29 gtty F
+GLIBC_2.29 h_errlist D 0x14
+GLIBC_2.29 h_nerr D 0x4
+GLIBC_2.29 hasmntopt F
+GLIBC_2.29 hcreate F
+GLIBC_2.29 hcreate_r F
+GLIBC_2.29 hdestroy F
+GLIBC_2.29 hdestroy_r F
+GLIBC_2.29 herror F
+GLIBC_2.29 host2netname F
+GLIBC_2.29 hsearch F
+GLIBC_2.29 hsearch_r F
+GLIBC_2.29 hstrerror F
+GLIBC_2.29 htonl F
+GLIBC_2.29 htons F
+GLIBC_2.29 iconv F
+GLIBC_2.29 iconv_close F
+GLIBC_2.29 iconv_open F
+GLIBC_2.29 if_freenameindex F
+GLIBC_2.29 if_indextoname F
+GLIBC_2.29 if_nameindex F
+GLIBC_2.29 if_nametoindex F
+GLIBC_2.29 imaxabs F
+GLIBC_2.29 imaxdiv F
+GLIBC_2.29 in6addr_any D 0x10
+GLIBC_2.29 in6addr_loopback D 0x10
+GLIBC_2.29 index F
+GLIBC_2.29 inet6_opt_append F
+GLIBC_2.29 inet6_opt_find F
+GLIBC_2.29 inet6_opt_finish F
+GLIBC_2.29 inet6_opt_get_val F
+GLIBC_2.29 inet6_opt_init F
+GLIBC_2.29 inet6_opt_next F
+GLIBC_2.29 inet6_opt_set_val F
+GLIBC_2.29 inet6_option_alloc F
+GLIBC_2.29 inet6_option_append F
+GLIBC_2.29 inet6_option_find F
+GLIBC_2.29 inet6_option_init F
+GLIBC_2.29 inet6_option_next F
+GLIBC_2.29 inet6_option_space F
+GLIBC_2.29 inet6_rth_add F
+GLIBC_2.29 inet6_rth_getaddr F
+GLIBC_2.29 inet6_rth_init F
+GLIBC_2.29 inet6_rth_reverse F
+GLIBC_2.29 inet6_rth_segments F
+GLIBC_2.29 inet6_rth_space F
+GLIBC_2.29 inet_addr F
+GLIBC_2.29 inet_aton F
+GLIBC_2.29 inet_lnaof F
+GLIBC_2.29 inet_makeaddr F
+GLIBC_2.29 inet_netof F
+GLIBC_2.29 inet_network F
+GLIBC_2.29 inet_nsap_addr F
+GLIBC_2.29 inet_nsap_ntoa F
+GLIBC_2.29 inet_ntoa F
+GLIBC_2.29 inet_ntop F
+GLIBC_2.29 inet_pton F
+GLIBC_2.29 init_module F
+GLIBC_2.29 initgroups F
+GLIBC_2.29 initstate F
+GLIBC_2.29 initstate_r F
+GLIBC_2.29 innetgr F
+GLIBC_2.29 inotify_add_watch F
+GLIBC_2.29 inotify_init F
+GLIBC_2.29 inotify_init1 F
+GLIBC_2.29 inotify_rm_watch F
+GLIBC_2.29 insque F
+GLIBC_2.29 ioctl F
+GLIBC_2.29 iruserok F
+GLIBC_2.29 iruserok_af F
+GLIBC_2.29 isalnum F
+GLIBC_2.29 isalnum_l F
+GLIBC_2.29 isalpha F
+GLIBC_2.29 isalpha_l F
+GLIBC_2.29 isascii F
+GLIBC_2.29 isastream F
+GLIBC_2.29 isatty F
+GLIBC_2.29 isblank F
+GLIBC_2.29 isblank_l F
+GLIBC_2.29 iscntrl F
+GLIBC_2.29 iscntrl_l F
+GLIBC_2.29 isctype F
+GLIBC_2.29 isdigit F
+GLIBC_2.29 isdigit_l F
+GLIBC_2.29 isfdtype F
+GLIBC_2.29 isgraph F
+GLIBC_2.29 isgraph_l F
+GLIBC_2.29 isinf F
+GLIBC_2.29 isinff F
+GLIBC_2.29 isinfl F
+GLIBC_2.29 islower F
+GLIBC_2.29 islower_l F
+GLIBC_2.29 isnan F
+GLIBC_2.29 isnanf F
+GLIBC_2.29 isnanl F
+GLIBC_2.29 isprint F
+GLIBC_2.29 isprint_l F
+GLIBC_2.29 ispunct F
+GLIBC_2.29 ispunct_l F
+GLIBC_2.29 isspace F
+GLIBC_2.29 isspace_l F
+GLIBC_2.29 isupper F
+GLIBC_2.29 isupper_l F
+GLIBC_2.29 iswalnum F
+GLIBC_2.29 iswalnum_l F
+GLIBC_2.29 iswalpha F
+GLIBC_2.29 iswalpha_l F
+GLIBC_2.29 iswblank F
+GLIBC_2.29 iswblank_l F
+GLIBC_2.29 iswcntrl F
+GLIBC_2.29 iswcntrl_l F
+GLIBC_2.29 iswctype F
+GLIBC_2.29 iswctype_l F
+GLIBC_2.29 iswdigit F
+GLIBC_2.29 iswdigit_l F
+GLIBC_2.29 iswgraph F
+GLIBC_2.29 iswgraph_l F
+GLIBC_2.29 iswlower F
+GLIBC_2.29 iswlower_l F
+GLIBC_2.29 iswprint F
+GLIBC_2.29 iswprint_l F
+GLIBC_2.29 iswpunct F
+GLIBC_2.29 iswpunct_l F
+GLIBC_2.29 iswspace F
+GLIBC_2.29 iswspace_l F
+GLIBC_2.29 iswupper F
+GLIBC_2.29 iswupper_l F
+GLIBC_2.29 iswxdigit F
+GLIBC_2.29 iswxdigit_l F
+GLIBC_2.29 isxdigit F
+GLIBC_2.29 isxdigit_l F
+GLIBC_2.29 jrand48 F
+GLIBC_2.29 jrand48_r F
+GLIBC_2.29 key_decryptsession F
+GLIBC_2.29 key_decryptsession_pk F
+GLIBC_2.29 key_encryptsession F
+GLIBC_2.29 key_encryptsession_pk F
+GLIBC_2.29 key_gendes F
+GLIBC_2.29 key_get_conv F
+GLIBC_2.29 key_secretkey_is_set F
+GLIBC_2.29 key_setnet F
+GLIBC_2.29 key_setsecret F
+GLIBC_2.29 kill F
+GLIBC_2.29 killpg F
+GLIBC_2.29 klogctl F
+GLIBC_2.29 l64a F
+GLIBC_2.29 labs F
+GLIBC_2.29 lchmod F
+GLIBC_2.29 lchown F
+GLIBC_2.29 lckpwdf F
+GLIBC_2.29 lcong48 F
+GLIBC_2.29 lcong48_r F
+GLIBC_2.29 ldexp F
+GLIBC_2.29 ldexpf F
+GLIBC_2.29 ldexpl F
+GLIBC_2.29 ldiv F
+GLIBC_2.29 lfind F
+GLIBC_2.29 lgetxattr F
+GLIBC_2.29 link F
+GLIBC_2.29 linkat F
+GLIBC_2.29 listen F
+GLIBC_2.29 listxattr F
+GLIBC_2.29 llabs F
+GLIBC_2.29 lldiv F
+GLIBC_2.29 llistxattr F
+GLIBC_2.29 localeconv F
+GLIBC_2.29 localtime F
+GLIBC_2.29 localtime_r F
+GLIBC_2.29 lockf F
+GLIBC_2.29 lockf64 F
+GLIBC_2.29 longjmp F
+GLIBC_2.29 lrand48 F
+GLIBC_2.29 lrand48_r F
+GLIBC_2.29 lremovexattr F
+GLIBC_2.29 lsearch F
+GLIBC_2.29 lseek F
+GLIBC_2.29 lseek64 F
+GLIBC_2.29 lsetxattr F
+GLIBC_2.29 lutimes F
+GLIBC_2.29 madvise F
+GLIBC_2.29 makecontext F
+GLIBC_2.29 mallinfo F
+GLIBC_2.29 malloc F
+GLIBC_2.29 malloc_info F
+GLIBC_2.29 malloc_stats F
+GLIBC_2.29 malloc_trim F
+GLIBC_2.29 malloc_usable_size F
+GLIBC_2.29 mallopt F
+GLIBC_2.29 mallwatch D 0x4
+GLIBC_2.29 mblen F
+GLIBC_2.29 mbrlen F
+GLIBC_2.29 mbrtoc16 F
+GLIBC_2.29 mbrtoc32 F
+GLIBC_2.29 mbrtowc F
+GLIBC_2.29 mbsinit F
+GLIBC_2.29 mbsnrtowcs F
+GLIBC_2.29 mbsrtowcs F
+GLIBC_2.29 mbstowcs F
+GLIBC_2.29 mbtowc F
+GLIBC_2.29 mcheck F
+GLIBC_2.29 mcheck_check_all F
+GLIBC_2.29 mcheck_pedantic F
+GLIBC_2.29 mcount F
+GLIBC_2.29 memalign F
+GLIBC_2.29 memccpy F
+GLIBC_2.29 memchr F
+GLIBC_2.29 memcmp F
+GLIBC_2.29 memcpy F
+GLIBC_2.29 memfd_create F
+GLIBC_2.29 memfrob F
+GLIBC_2.29 memmem F
+GLIBC_2.29 memmove F
+GLIBC_2.29 mempcpy F
+GLIBC_2.29 memrchr F
+GLIBC_2.29 memset F
+GLIBC_2.29 mincore F
+GLIBC_2.29 mkdir F
+GLIBC_2.29 mkdirat F
+GLIBC_2.29 mkdtemp F
+GLIBC_2.29 mkfifo F
+GLIBC_2.29 mkfifoat F
+GLIBC_2.29 mkostemp F
+GLIBC_2.29 mkostemp64 F
+GLIBC_2.29 mkostemps F
+GLIBC_2.29 mkostemps64 F
+GLIBC_2.29 mkstemp F
+GLIBC_2.29 mkstemp64 F
+GLIBC_2.29 mkstemps F
+GLIBC_2.29 mkstemps64 F
+GLIBC_2.29 mktemp F
+GLIBC_2.29 mktime F
+GLIBC_2.29 mlock F
+GLIBC_2.29 mlock2 F
+GLIBC_2.29 mlockall F
+GLIBC_2.29 mmap F
+GLIBC_2.29 mmap64 F
+GLIBC_2.29 modf F
+GLIBC_2.29 modff F
+GLIBC_2.29 modfl F
+GLIBC_2.29 moncontrol F
+GLIBC_2.29 monstartup F
+GLIBC_2.29 mount F
+GLIBC_2.29 mprobe F
+GLIBC_2.29 mprotect F
+GLIBC_2.29 mrand48 F
+GLIBC_2.29 mrand48_r F
+GLIBC_2.29 mremap F
+GLIBC_2.29 msgctl F
+GLIBC_2.29 msgget F
+GLIBC_2.29 msgrcv F
+GLIBC_2.29 msgsnd F
+GLIBC_2.29 msync F
+GLIBC_2.29 mtrace F
+GLIBC_2.29 munlock F
+GLIBC_2.29 munlockall F
+GLIBC_2.29 munmap F
+GLIBC_2.29 muntrace F
+GLIBC_2.29 name_to_handle_at F
+GLIBC_2.29 nanosleep F
+GLIBC_2.29 netname2host F
+GLIBC_2.29 netname2user F
+GLIBC_2.29 newlocale F
+GLIBC_2.29 nftw F
+GLIBC_2.29 nftw64 F
+GLIBC_2.29 ngettext F
+GLIBC_2.29 nice F
+GLIBC_2.29 nl_langinfo F
+GLIBC_2.29 nl_langinfo_l F
+GLIBC_2.29 nrand48 F
+GLIBC_2.29 nrand48_r F
+GLIBC_2.29 ntohl F
+GLIBC_2.29 ntohs F
+GLIBC_2.29 ntp_adjtime F
+GLIBC_2.29 ntp_gettime F
+GLIBC_2.29 ntp_gettimex F
+GLIBC_2.29 obstack_alloc_failed_handler D 0x4
+GLIBC_2.29 obstack_exit_failure D 0x4
+GLIBC_2.29 obstack_free F
+GLIBC_2.29 obstack_printf F
+GLIBC_2.29 obstack_vprintf F
+GLIBC_2.29 on_exit F
+GLIBC_2.29 open F
+GLIBC_2.29 open64 F
+GLIBC_2.29 open_by_handle_at F
+GLIBC_2.29 open_memstream F
+GLIBC_2.29 open_wmemstream F
+GLIBC_2.29 openat F
+GLIBC_2.29 openat64 F
+GLIBC_2.29 opendir F
+GLIBC_2.29 openlog F
+GLIBC_2.29 optarg D 0x4
+GLIBC_2.29 opterr D 0x4
+GLIBC_2.29 optind D 0x4
+GLIBC_2.29 optopt D 0x4
+GLIBC_2.29 parse_printf_format F
+GLIBC_2.29 passwd2des F
+GLIBC_2.29 pathconf F
+GLIBC_2.29 pause F
+GLIBC_2.29 pclose F
+GLIBC_2.29 perror F
+GLIBC_2.29 personality F
+GLIBC_2.29 pipe F
+GLIBC_2.29 pipe2 F
+GLIBC_2.29 pivot_root F
+GLIBC_2.29 pkey_alloc F
+GLIBC_2.29 pkey_free F
+GLIBC_2.29 pkey_get F
+GLIBC_2.29 pkey_mprotect F
+GLIBC_2.29 pkey_set F
+GLIBC_2.29 pmap_getmaps F
+GLIBC_2.29 pmap_getport F
+GLIBC_2.29 pmap_rmtcall F
+GLIBC_2.29 pmap_set F
+GLIBC_2.29 pmap_unset F
+GLIBC_2.29 poll F
+GLIBC_2.29 popen F
+GLIBC_2.29 posix_fadvise F
+GLIBC_2.29 posix_fadvise64 F
+GLIBC_2.29 posix_fallocate F
+GLIBC_2.29 posix_fallocate64 F
+GLIBC_2.29 posix_madvise F
+GLIBC_2.29 posix_memalign F
+GLIBC_2.29 posix_openpt F
+GLIBC_2.29 posix_spawn F
+GLIBC_2.29 posix_spawn_file_actions_addclose F
+GLIBC_2.29 posix_spawn_file_actions_adddup2 F
+GLIBC_2.29 posix_spawn_file_actions_addopen F
+GLIBC_2.29 posix_spawn_file_actions_destroy F
+GLIBC_2.29 posix_spawn_file_actions_init F
+GLIBC_2.29 posix_spawnattr_destroy F
+GLIBC_2.29 posix_spawnattr_getflags F
+GLIBC_2.29 posix_spawnattr_getpgroup F
+GLIBC_2.29 posix_spawnattr_getschedparam F
+GLIBC_2.29 posix_spawnattr_getschedpolicy F
+GLIBC_2.29 posix_spawnattr_getsigdefault F
+GLIBC_2.29 posix_spawnattr_getsigmask F
+GLIBC_2.29 posix_spawnattr_init F
+GLIBC_2.29 posix_spawnattr_setflags F
+GLIBC_2.29 posix_spawnattr_setpgroup F
+GLIBC_2.29 posix_spawnattr_setschedparam F
+GLIBC_2.29 posix_spawnattr_setschedpolicy F
+GLIBC_2.29 posix_spawnattr_setsigdefault F
+GLIBC_2.29 posix_spawnattr_setsigmask F
+GLIBC_2.29 posix_spawnp F
+GLIBC_2.29 ppoll F
+GLIBC_2.29 prctl F
+GLIBC_2.29 pread F
+GLIBC_2.29 pread64 F
+GLIBC_2.29 preadv F
+GLIBC_2.29 preadv2 F
+GLIBC_2.29 preadv64 F
+GLIBC_2.29 preadv64v2 F
+GLIBC_2.29 printf F
+GLIBC_2.29 printf_size F
+GLIBC_2.29 printf_size_info F
+GLIBC_2.29 prlimit F
+GLIBC_2.29 prlimit64 F
+GLIBC_2.29 process_vm_readv F
+GLIBC_2.29 process_vm_writev F
+GLIBC_2.29 profil F
+GLIBC_2.29 program_invocation_name D 0x4
+GLIBC_2.29 program_invocation_short_name D 0x4
+GLIBC_2.29 pselect F
+GLIBC_2.29 psiginfo F
+GLIBC_2.29 psignal F
+GLIBC_2.29 pthread_attr_destroy F
+GLIBC_2.29 pthread_attr_getdetachstate F
+GLIBC_2.29 pthread_attr_getinheritsched F
+GLIBC_2.29 pthread_attr_getschedparam F
+GLIBC_2.29 pthread_attr_getschedpolicy F
+GLIBC_2.29 pthread_attr_getscope F
+GLIBC_2.29 pthread_attr_init F
+GLIBC_2.29 pthread_attr_setdetachstate F
+GLIBC_2.29 pthread_attr_setinheritsched F
+GLIBC_2.29 pthread_attr_setschedparam F
+GLIBC_2.29 pthread_attr_setschedpolicy F
+GLIBC_2.29 pthread_attr_setscope F
+GLIBC_2.29 pthread_cond_broadcast F
+GLIBC_2.29 pthread_cond_destroy F
+GLIBC_2.29 pthread_cond_init F
+GLIBC_2.29 pthread_cond_signal F
+GLIBC_2.29 pthread_cond_timedwait F
+GLIBC_2.29 pthread_cond_wait F
+GLIBC_2.29 pthread_condattr_destroy F
+GLIBC_2.29 pthread_condattr_init F
+GLIBC_2.29 pthread_equal F
+GLIBC_2.29 pthread_exit F
+GLIBC_2.29 pthread_getschedparam F
+GLIBC_2.29 pthread_mutex_destroy F
+GLIBC_2.29 pthread_mutex_init F
+GLIBC_2.29 pthread_mutex_lock F
+GLIBC_2.29 pthread_mutex_unlock F
+GLIBC_2.29 pthread_self F
+GLIBC_2.29 pthread_setcancelstate F
+GLIBC_2.29 pthread_setcanceltype F
+GLIBC_2.29 pthread_setschedparam F
+GLIBC_2.29 ptrace F
+GLIBC_2.29 ptsname F
+GLIBC_2.29 ptsname_r F
+GLIBC_2.29 putc F
+GLIBC_2.29 putc_unlocked F
+GLIBC_2.29 putchar F
+GLIBC_2.29 putchar_unlocked F
+GLIBC_2.29 putenv F
+GLIBC_2.29 putgrent F
+GLIBC_2.29 putmsg F
+GLIBC_2.29 putpmsg F
+GLIBC_2.29 putpwent F
+GLIBC_2.29 puts F
+GLIBC_2.29 putsgent F
+GLIBC_2.29 putspent F
+GLIBC_2.29 pututline F
+GLIBC_2.29 pututxline F
+GLIBC_2.29 putw F
+GLIBC_2.29 putwc F
+GLIBC_2.29 putwc_unlocked F
+GLIBC_2.29 putwchar F
+GLIBC_2.29 putwchar_unlocked F
+GLIBC_2.29 pvalloc F
+GLIBC_2.29 pwrite F
+GLIBC_2.29 pwrite64 F
+GLIBC_2.29 pwritev F
+GLIBC_2.29 pwritev2 F
+GLIBC_2.29 pwritev64 F
+GLIBC_2.29 pwritev64v2 F
+GLIBC_2.29 qecvt F
+GLIBC_2.29 qecvt_r F
+GLIBC_2.29 qfcvt F
+GLIBC_2.29 qfcvt_r F
+GLIBC_2.29 qgcvt F
+GLIBC_2.29 qsort F
+GLIBC_2.29 qsort_r F
+GLIBC_2.29 quick_exit F
+GLIBC_2.29 quotactl F
+GLIBC_2.29 raise F
+GLIBC_2.29 rand F
+GLIBC_2.29 rand_r F
+GLIBC_2.29 random F
+GLIBC_2.29 random_r F
+GLIBC_2.29 rawmemchr F
+GLIBC_2.29 rcmd F
+GLIBC_2.29 rcmd_af F
+GLIBC_2.29 re_comp F
+GLIBC_2.29 re_compile_fastmap F
+GLIBC_2.29 re_compile_pattern F
+GLIBC_2.29 re_exec F
+GLIBC_2.29 re_match F
+GLIBC_2.29 re_match_2 F
+GLIBC_2.29 re_search F
+GLIBC_2.29 re_search_2 F
+GLIBC_2.29 re_set_registers F
+GLIBC_2.29 re_set_syntax F
+GLIBC_2.29 re_syntax_options D 0x4
+GLIBC_2.29 read F
+GLIBC_2.29 readahead F
+GLIBC_2.29 readdir F
+GLIBC_2.29 readdir64 F
+GLIBC_2.29 readdir64_r F
+GLIBC_2.29 readdir_r F
+GLIBC_2.29 readlink F
+GLIBC_2.29 readlinkat F
+GLIBC_2.29 readv F
+GLIBC_2.29 realloc F
+GLIBC_2.29 reallocarray F
+GLIBC_2.29 realpath F
+GLIBC_2.29 reboot F
+GLIBC_2.29 recv F
+GLIBC_2.29 recvfrom F
+GLIBC_2.29 recvmmsg F
+GLIBC_2.29 recvmsg F
+GLIBC_2.29 regcomp F
+GLIBC_2.29 regerror F
+GLIBC_2.29 regexec F
+GLIBC_2.29 regfree F
+GLIBC_2.29 register_printf_function F
+GLIBC_2.29 register_printf_modifier F
+GLIBC_2.29 register_printf_specifier F
+GLIBC_2.29 register_printf_type F
+GLIBC_2.29 registerrpc F
+GLIBC_2.29 remap_file_pages F
+GLIBC_2.29 remove F
+GLIBC_2.29 removexattr F
+GLIBC_2.29 remque F
+GLIBC_2.29 rename F
+GLIBC_2.29 renameat F
+GLIBC_2.29 renameat2 F
+GLIBC_2.29 revoke F
+GLIBC_2.29 rewind F
+GLIBC_2.29 rewinddir F
+GLIBC_2.29 rexec F
+GLIBC_2.29 rexec_af F
+GLIBC_2.29 rexecoptions D 0x4
+GLIBC_2.29 rindex F
+GLIBC_2.29 rmdir F
+GLIBC_2.29 rpc_createerr D 0x10
+GLIBC_2.29 rpmatch F
+GLIBC_2.29 rresvport F
+GLIBC_2.29 rresvport_af F
+GLIBC_2.29 rtime F
+GLIBC_2.29 ruserok F
+GLIBC_2.29 ruserok_af F
+GLIBC_2.29 ruserpass F
+GLIBC_2.29 sbrk F
+GLIBC_2.29 scalbn F
+GLIBC_2.29 scalbnf F
+GLIBC_2.29 scalbnl F
+GLIBC_2.29 scandir F
+GLIBC_2.29 scandir64 F
+GLIBC_2.29 scandirat F
+GLIBC_2.29 scandirat64 F
+GLIBC_2.29 scanf F
+GLIBC_2.29 sched_get_priority_max F
+GLIBC_2.29 sched_get_priority_min F
+GLIBC_2.29 sched_getaffinity F
+GLIBC_2.29 sched_getcpu F
+GLIBC_2.29 sched_getparam F
+GLIBC_2.29 sched_getscheduler F
+GLIBC_2.29 sched_rr_get_interval F
+GLIBC_2.29 sched_setaffinity F
+GLIBC_2.29 sched_setparam F
+GLIBC_2.29 sched_setscheduler F
+GLIBC_2.29 sched_yield F
+GLIBC_2.29 secure_getenv F
+GLIBC_2.29 seed48 F
+GLIBC_2.29 seed48_r F
+GLIBC_2.29 seekdir F
+GLIBC_2.29 select F
+GLIBC_2.29 semctl F
+GLIBC_2.29 semget F
+GLIBC_2.29 semop F
+GLIBC_2.29 semtimedop F
+GLIBC_2.29 send F
+GLIBC_2.29 sendfile F
+GLIBC_2.29 sendfile64 F
+GLIBC_2.29 sendmmsg F
+GLIBC_2.29 sendmsg F
+GLIBC_2.29 sendto F
+GLIBC_2.29 setaliasent F
+GLIBC_2.29 setbuf F
+GLIBC_2.29 setbuffer F
+GLIBC_2.29 setcontext F
+GLIBC_2.29 setdomainname F
+GLIBC_2.29 setegid F
+GLIBC_2.29 setenv F
+GLIBC_2.29 seteuid F
+GLIBC_2.29 setfsent F
+GLIBC_2.29 setfsgid F
+GLIBC_2.29 setfsuid F
+GLIBC_2.29 setgid F
+GLIBC_2.29 setgrent F
+GLIBC_2.29 setgroups F
+GLIBC_2.29 sethostent F
+GLIBC_2.29 sethostid F
+GLIBC_2.29 sethostname F
+GLIBC_2.29 setipv4sourcefilter F
+GLIBC_2.29 setitimer F
+GLIBC_2.29 setjmp F
+GLIBC_2.29 setlinebuf F
+GLIBC_2.29 setlocale F
+GLIBC_2.29 setlogin F
+GLIBC_2.29 setlogmask F
+GLIBC_2.29 setmntent F
+GLIBC_2.29 setnetent F
+GLIBC_2.29 setnetgrent F
+GLIBC_2.29 setns F
+GLIBC_2.29 setpgid F
+GLIBC_2.29 setpgrp F
+GLIBC_2.29 setpriority F
+GLIBC_2.29 setprotoent F
+GLIBC_2.29 setpwent F
+GLIBC_2.29 setregid F
+GLIBC_2.29 setresgid F
+GLIBC_2.29 setresuid F
+GLIBC_2.29 setreuid F
+GLIBC_2.29 setrlimit F
+GLIBC_2.29 setrlimit64 F
+GLIBC_2.29 setrpcent F
+GLIBC_2.29 setservent F
+GLIBC_2.29 setsgent F
+GLIBC_2.29 setsid F
+GLIBC_2.29 setsockopt F
+GLIBC_2.29 setsourcefilter F
+GLIBC_2.29 setspent F
+GLIBC_2.29 setstate F
+GLIBC_2.29 setstate_r F
+GLIBC_2.29 settimeofday F
+GLIBC_2.29 setttyent F
+GLIBC_2.29 setuid F
+GLIBC_2.29 setusershell F
+GLIBC_2.29 setutent F
+GLIBC_2.29 setutxent F
+GLIBC_2.29 setvbuf F
+GLIBC_2.29 setxattr F
+GLIBC_2.29 sgetsgent F
+GLIBC_2.29 sgetsgent_r F
+GLIBC_2.29 sgetspent F
+GLIBC_2.29 sgetspent_r F
+GLIBC_2.29 shmat F
+GLIBC_2.29 shmctl F
+GLIBC_2.29 shmdt F
+GLIBC_2.29 shmget F
+GLIBC_2.29 shutdown F
+GLIBC_2.29 sigaction F
+GLIBC_2.29 sigaddset F
+GLIBC_2.29 sigaltstack F
+GLIBC_2.29 sigandset F
+GLIBC_2.29 sigblock F
+GLIBC_2.29 sigdelset F
+GLIBC_2.29 sigemptyset F
+GLIBC_2.29 sigfillset F
+GLIBC_2.29 siggetmask F
+GLIBC_2.29 sighold F
+GLIBC_2.29 sigignore F
+GLIBC_2.29 siginterrupt F
+GLIBC_2.29 sigisemptyset F
+GLIBC_2.29 sigismember F
+GLIBC_2.29 siglongjmp F
+GLIBC_2.29 signal F
+GLIBC_2.29 signalfd F
+GLIBC_2.29 sigorset F
+GLIBC_2.29 sigpause F
+GLIBC_2.29 sigpending F
+GLIBC_2.29 sigprocmask F
+GLIBC_2.29 sigqueue F
+GLIBC_2.29 sigrelse F
+GLIBC_2.29 sigreturn F
+GLIBC_2.29 sigset F
+GLIBC_2.29 sigsetmask F
+GLIBC_2.29 sigstack F
+GLIBC_2.29 sigsuspend F
+GLIBC_2.29 sigtimedwait F
+GLIBC_2.29 sigwait F
+GLIBC_2.29 sigwaitinfo F
+GLIBC_2.29 sleep F
+GLIBC_2.29 snprintf F
+GLIBC_2.29 sockatmark F
+GLIBC_2.29 socket F
+GLIBC_2.29 socketpair F
+GLIBC_2.29 splice F
+GLIBC_2.29 sprintf F
+GLIBC_2.29 sprofil F
+GLIBC_2.29 srand F
+GLIBC_2.29 srand48 F
+GLIBC_2.29 srand48_r F
+GLIBC_2.29 srandom F
+GLIBC_2.29 srandom_r F
+GLIBC_2.29 sscanf F
+GLIBC_2.29 ssignal F
+GLIBC_2.29 sstk F
+GLIBC_2.29 statfs F
+GLIBC_2.29 statfs64 F
+GLIBC_2.29 statvfs F
+GLIBC_2.29 statvfs64 F
+GLIBC_2.29 statx F
+GLIBC_2.29 stderr D 0x4
+GLIBC_2.29 stdin D 0x4
+GLIBC_2.29 stdout D 0x4
+GLIBC_2.29 stime F
+GLIBC_2.29 stpcpy F
+GLIBC_2.29 stpncpy F
+GLIBC_2.29 strcasecmp F
+GLIBC_2.29 strcasecmp_l F
+GLIBC_2.29 strcasestr F
+GLIBC_2.29 strcat F
+GLIBC_2.29 strchr F
+GLIBC_2.29 strchrnul F
+GLIBC_2.29 strcmp F
+GLIBC_2.29 strcoll F
+GLIBC_2.29 strcoll_l F
+GLIBC_2.29 strcpy F
+GLIBC_2.29 strcspn F
+GLIBC_2.29 strdup F
+GLIBC_2.29 strerror F
+GLIBC_2.29 strerror_l F
+GLIBC_2.29 strerror_r F
+GLIBC_2.29 strfmon F
+GLIBC_2.29 strfmon_l F
+GLIBC_2.29 strfromd F
+GLIBC_2.29 strfromf F
+GLIBC_2.29 strfromf32 F
+GLIBC_2.29 strfromf32x F
+GLIBC_2.29 strfromf64 F
+GLIBC_2.29 strfroml F
+GLIBC_2.29 strfry F
+GLIBC_2.29 strftime F
+GLIBC_2.29 strftime_l F
+GLIBC_2.29 strlen F
+GLIBC_2.29 strncasecmp F
+GLIBC_2.29 strncasecmp_l F
+GLIBC_2.29 strncat F
+GLIBC_2.29 strncmp F
+GLIBC_2.29 strncpy F
+GLIBC_2.29 strndup F
+GLIBC_2.29 strnlen F
+GLIBC_2.29 strpbrk F
+GLIBC_2.29 strptime F
+GLIBC_2.29 strptime_l F
+GLIBC_2.29 strrchr F
+GLIBC_2.29 strsep F
+GLIBC_2.29 strsignal F
+GLIBC_2.29 strspn F
+GLIBC_2.29 strstr F
+GLIBC_2.29 strtod F
+GLIBC_2.29 strtod_l F
+GLIBC_2.29 strtof F
+GLIBC_2.29 strtof32 F
+GLIBC_2.29 strtof32_l F
+GLIBC_2.29 strtof32x F
+GLIBC_2.29 strtof32x_l F
+GLIBC_2.29 strtof64 F
+GLIBC_2.29 strtof64_l F
+GLIBC_2.29 strtof_l F
+GLIBC_2.29 strtoimax F
+GLIBC_2.29 strtok F
+GLIBC_2.29 strtok_r F
+GLIBC_2.29 strtol F
+GLIBC_2.29 strtol_l F
+GLIBC_2.29 strtold F
+GLIBC_2.29 strtold_l F
+GLIBC_2.29 strtoll F
+GLIBC_2.29 strtoll_l F
+GLIBC_2.29 strtoq F
+GLIBC_2.29 strtoul F
+GLIBC_2.29 strtoul_l F
+GLIBC_2.29 strtoull F
+GLIBC_2.29 strtoull_l F
+GLIBC_2.29 strtoumax F
+GLIBC_2.29 strtouq F
+GLIBC_2.29 strverscmp F
+GLIBC_2.29 strxfrm F
+GLIBC_2.29 strxfrm_l F
+GLIBC_2.29 stty F
+GLIBC_2.29 svc_exit F
+GLIBC_2.29 svc_fdset D 0x80
+GLIBC_2.29 svc_getreq F
+GLIBC_2.29 svc_getreq_common F
+GLIBC_2.29 svc_getreq_poll F
+GLIBC_2.29 svc_getreqset F
+GLIBC_2.29 svc_max_pollfd D 0x4
+GLIBC_2.29 svc_pollfd D 0x4
+GLIBC_2.29 svc_register F
+GLIBC_2.29 svc_run F
+GLIBC_2.29 svc_sendreply F
+GLIBC_2.29 svc_unregister F
+GLIBC_2.29 svcauthdes_stats D 0xc
+GLIBC_2.29 svcerr_auth F
+GLIBC_2.29 svcerr_decode F
+GLIBC_2.29 svcerr_noproc F
+GLIBC_2.29 svcerr_noprog F
+GLIBC_2.29 svcerr_progvers F
+GLIBC_2.29 svcerr_systemerr F
+GLIBC_2.29 svcerr_weakauth F
+GLIBC_2.29 svcfd_create F
+GLIBC_2.29 svcraw_create F
+GLIBC_2.29 svctcp_create F
+GLIBC_2.29 svcudp_bufcreate F
+GLIBC_2.29 svcudp_create F
+GLIBC_2.29 svcudp_enablecache F
+GLIBC_2.29 svcunix_create F
+GLIBC_2.29 svcunixfd_create F
+GLIBC_2.29 swab F
+GLIBC_2.29 swapcontext F
+GLIBC_2.29 swapoff F
+GLIBC_2.29 swapon F
+GLIBC_2.29 swprintf F
+GLIBC_2.29 swscanf F
+GLIBC_2.29 symlink F
+GLIBC_2.29 symlinkat F
+GLIBC_2.29 sync F
+GLIBC_2.29 sync_file_range F
+GLIBC_2.29 syncfs F
+GLIBC_2.29 sys_errlist D 0x21c
+GLIBC_2.29 sys_nerr D 0x4
+GLIBC_2.29 sys_sigabbrev D 0x104
+GLIBC_2.29 sys_siglist D 0x104
+GLIBC_2.29 syscall F
+GLIBC_2.29 sysconf F
+GLIBC_2.29 sysctl F
+GLIBC_2.29 sysinfo F
+GLIBC_2.29 syslog F
+GLIBC_2.29 system F
+GLIBC_2.29 sysv_signal F
+GLIBC_2.29 tcdrain F
+GLIBC_2.29 tcflow F
+GLIBC_2.29 tcflush F
+GLIBC_2.29 tcgetattr F
+GLIBC_2.29 tcgetpgrp F
+GLIBC_2.29 tcgetsid F
+GLIBC_2.29 tcsendbreak F
+GLIBC_2.29 tcsetattr F
+GLIBC_2.29 tcsetpgrp F
+GLIBC_2.29 tdelete F
+GLIBC_2.29 tdestroy F
+GLIBC_2.29 tee F
+GLIBC_2.29 telldir F
+GLIBC_2.29 tempnam F
+GLIBC_2.29 textdomain F
+GLIBC_2.29 tfind F
+GLIBC_2.29 thrd_current F
+GLIBC_2.29 thrd_equal F
+GLIBC_2.29 thrd_sleep F
+GLIBC_2.29 thrd_yield F
+GLIBC_2.29 time F
+GLIBC_2.29 timegm F
+GLIBC_2.29 timelocal F
+GLIBC_2.29 timerfd_create F
+GLIBC_2.29 timerfd_gettime F
+GLIBC_2.29 timerfd_settime F
+GLIBC_2.29 times F
+GLIBC_2.29 timespec_get F
+GLIBC_2.29 timezone D 0x4
+GLIBC_2.29 tmpfile F
+GLIBC_2.29 tmpfile64 F
+GLIBC_2.29 tmpnam F
+GLIBC_2.29 tmpnam_r F
+GLIBC_2.29 toascii F
+GLIBC_2.29 tolower F
+GLIBC_2.29 tolower_l F
+GLIBC_2.29 toupper F
+GLIBC_2.29 toupper_l F
+GLIBC_2.29 towctrans F
+GLIBC_2.29 towctrans_l F
+GLIBC_2.29 towlower F
+GLIBC_2.29 towlower_l F
+GLIBC_2.29 towupper F
+GLIBC_2.29 towupper_l F
+GLIBC_2.29 tr_break F
+GLIBC_2.29 truncate F
+GLIBC_2.29 truncate64 F
+GLIBC_2.29 tsearch F
+GLIBC_2.29 ttyname F
+GLIBC_2.29 ttyname_r F
+GLIBC_2.29 ttyslot F
+GLIBC_2.29 twalk F
+GLIBC_2.29 tzname D 0x8
+GLIBC_2.29 tzset F
+GLIBC_2.29 ualarm F
+GLIBC_2.29 ulckpwdf F
+GLIBC_2.29 ulimit F
+GLIBC_2.29 umask F
+GLIBC_2.29 umount F
+GLIBC_2.29 umount2 F
+GLIBC_2.29 uname F
+GLIBC_2.29 ungetc F
+GLIBC_2.29 ungetwc F
+GLIBC_2.29 unlink F
+GLIBC_2.29 unlinkat F
+GLIBC_2.29 unlockpt F
+GLIBC_2.29 unsetenv F
+GLIBC_2.29 unshare F
+GLIBC_2.29 updwtmp F
+GLIBC_2.29 updwtmpx F
+GLIBC_2.29 uselocale F
+GLIBC_2.29 user2netname F
+GLIBC_2.29 usleep F
+GLIBC_2.29 utime F
+GLIBC_2.29 utimensat F
+GLIBC_2.29 utimes F
+GLIBC_2.29 utmpname F
+GLIBC_2.29 utmpxname F
+GLIBC_2.29 valloc F
+GLIBC_2.29 vasprintf F
+GLIBC_2.29 vdprintf F
+GLIBC_2.29 verr F
+GLIBC_2.29 verrx F
+GLIBC_2.29 versionsort F
+GLIBC_2.29 versionsort64 F
+GLIBC_2.29 vfork F
+GLIBC_2.29 vfprintf F
+GLIBC_2.29 vfscanf F
+GLIBC_2.29 vfwprintf F
+GLIBC_2.29 vfwscanf F
+GLIBC_2.29 vhangup F
+GLIBC_2.29 vlimit F
+GLIBC_2.29 vmsplice F
+GLIBC_2.29 vprintf F
+GLIBC_2.29 vscanf F
+GLIBC_2.29 vsnprintf F
+GLIBC_2.29 vsprintf F
+GLIBC_2.29 vsscanf F
+GLIBC_2.29 vswprintf F
+GLIBC_2.29 vswscanf F
+GLIBC_2.29 vsyslog F
+GLIBC_2.29 vtimes F
+GLIBC_2.29 vwarn F
+GLIBC_2.29 vwarnx F
+GLIBC_2.29 vwprintf F
+GLIBC_2.29 vwscanf F
+GLIBC_2.29 wait F
+GLIBC_2.29 wait3 F
+GLIBC_2.29 wait4 F
+GLIBC_2.29 waitid F
+GLIBC_2.29 waitpid F
+GLIBC_2.29 warn F
+GLIBC_2.29 warnx F
+GLIBC_2.29 wcpcpy F
+GLIBC_2.29 wcpncpy F
+GLIBC_2.29 wcrtomb F
+GLIBC_2.29 wcscasecmp F
+GLIBC_2.29 wcscasecmp_l F
+GLIBC_2.29 wcscat F
+GLIBC_2.29 wcschr F
+GLIBC_2.29 wcschrnul F
+GLIBC_2.29 wcscmp F
+GLIBC_2.29 wcscoll F
+GLIBC_2.29 wcscoll_l F
+GLIBC_2.29 wcscpy F
+GLIBC_2.29 wcscspn F
+GLIBC_2.29 wcsdup F
+GLIBC_2.29 wcsftime F
+GLIBC_2.29 wcsftime_l F
+GLIBC_2.29 wcslen F
+GLIBC_2.29 wcsncasecmp F
+GLIBC_2.29 wcsncasecmp_l F
+GLIBC_2.29 wcsncat F
+GLIBC_2.29 wcsncmp F
+GLIBC_2.29 wcsncpy F
+GLIBC_2.29 wcsnlen F
+GLIBC_2.29 wcsnrtombs F
+GLIBC_2.29 wcspbrk F
+GLIBC_2.29 wcsrchr F
+GLIBC_2.29 wcsrtombs F
+GLIBC_2.29 wcsspn F
+GLIBC_2.29 wcsstr F
+GLIBC_2.29 wcstod F
+GLIBC_2.29 wcstod_l F
+GLIBC_2.29 wcstof F
+GLIBC_2.29 wcstof32 F
+GLIBC_2.29 wcstof32_l F
+GLIBC_2.29 wcstof32x F
+GLIBC_2.29 wcstof32x_l F
+GLIBC_2.29 wcstof64 F
+GLIBC_2.29 wcstof64_l F
+GLIBC_2.29 wcstof_l F
+GLIBC_2.29 wcstoimax F
+GLIBC_2.29 wcstok F
+GLIBC_2.29 wcstol F
+GLIBC_2.29 wcstol_l F
+GLIBC_2.29 wcstold F
+GLIBC_2.29 wcstold_l F
+GLIBC_2.29 wcstoll F
+GLIBC_2.29 wcstoll_l F
+GLIBC_2.29 wcstombs F
+GLIBC_2.29 wcstoq F
+GLIBC_2.29 wcstoul F
+GLIBC_2.29 wcstoul_l F
+GLIBC_2.29 wcstoull F
+GLIBC_2.29 wcstoull_l F
+GLIBC_2.29 wcstoumax F
+GLIBC_2.29 wcstouq F
+GLIBC_2.29 wcswcs F
+GLIBC_2.29 wcswidth F
+GLIBC_2.29 wcsxfrm F
+GLIBC_2.29 wcsxfrm_l F
+GLIBC_2.29 wctob F
+GLIBC_2.29 wctomb F
+GLIBC_2.29 wctrans F
+GLIBC_2.29 wctrans_l F
+GLIBC_2.29 wctype F
+GLIBC_2.29 wctype_l F
+GLIBC_2.29 wcwidth F
+GLIBC_2.29 wmemchr F
+GLIBC_2.29 wmemcmp F
+GLIBC_2.29 wmemcpy F
+GLIBC_2.29 wmemmove F
+GLIBC_2.29 wmempcpy F
+GLIBC_2.29 wmemset F
+GLIBC_2.29 wordexp F
+GLIBC_2.29 wordfree F
+GLIBC_2.29 wprintf F
+GLIBC_2.29 write F
+GLIBC_2.29 writev F
+GLIBC_2.29 wscanf F
+GLIBC_2.29 xdecrypt F
+GLIBC_2.29 xdr_accepted_reply F
+GLIBC_2.29 xdr_array F
+GLIBC_2.29 xdr_authdes_cred F
+GLIBC_2.29 xdr_authdes_verf F
+GLIBC_2.29 xdr_authunix_parms F
+GLIBC_2.29 xdr_bool F
+GLIBC_2.29 xdr_bytes F
+GLIBC_2.29 xdr_callhdr F
+GLIBC_2.29 xdr_callmsg F
+GLIBC_2.29 xdr_char F
+GLIBC_2.29 xdr_cryptkeyarg F
+GLIBC_2.29 xdr_cryptkeyarg2 F
+GLIBC_2.29 xdr_cryptkeyres F
+GLIBC_2.29 xdr_des_block F
+GLIBC_2.29 xdr_double F
+GLIBC_2.29 xdr_enum F
+GLIBC_2.29 xdr_float F
+GLIBC_2.29 xdr_free F
+GLIBC_2.29 xdr_getcredres F
+GLIBC_2.29 xdr_hyper F
+GLIBC_2.29 xdr_int F
+GLIBC_2.29 xdr_int16_t F
+GLIBC_2.29 xdr_int32_t F
+GLIBC_2.29 xdr_int64_t F
+GLIBC_2.29 xdr_int8_t F
+GLIBC_2.29 xdr_key_netstarg F
+GLIBC_2.29 xdr_key_netstres F
+GLIBC_2.29 xdr_keybuf F
+GLIBC_2.29 xdr_keystatus F
+GLIBC_2.29 xdr_long F
+GLIBC_2.29 xdr_longlong_t F
+GLIBC_2.29 xdr_netnamestr F
+GLIBC_2.29 xdr_netobj F
+GLIBC_2.29 xdr_opaque F
+GLIBC_2.29 xdr_opaque_auth F
+GLIBC_2.29 xdr_pmap F
+GLIBC_2.29 xdr_pmaplist F
+GLIBC_2.29 xdr_pointer F
+GLIBC_2.29 xdr_quad_t F
+GLIBC_2.29 xdr_reference F
+GLIBC_2.29 xdr_rejected_reply F
+GLIBC_2.29 xdr_replymsg F
+GLIBC_2.29 xdr_rmtcall_args F
+GLIBC_2.29 xdr_rmtcallres F
+GLIBC_2.29 xdr_short F
+GLIBC_2.29 xdr_sizeof F
+GLIBC_2.29 xdr_string F
+GLIBC_2.29 xdr_u_char F
+GLIBC_2.29 xdr_u_hyper F
+GLIBC_2.29 xdr_u_int F
+GLIBC_2.29 xdr_u_long F
+GLIBC_2.29 xdr_u_longlong_t F
+GLIBC_2.29 xdr_u_quad_t F
+GLIBC_2.29 xdr_u_short F
+GLIBC_2.29 xdr_uint16_t F
+GLIBC_2.29 xdr_uint32_t F
+GLIBC_2.29 xdr_uint64_t F
+GLIBC_2.29 xdr_uint8_t F
+GLIBC_2.29 xdr_union F
+GLIBC_2.29 xdr_unixcred F
+GLIBC_2.29 xdr_vector F
+GLIBC_2.29 xdr_void F
+GLIBC_2.29 xdr_wrapstring F
+GLIBC_2.29 xdrmem_create F
+GLIBC_2.29 xdrrec_create F
+GLIBC_2.29 xdrrec_endofrecord F
+GLIBC_2.29 xdrrec_eof F
+GLIBC_2.29 xdrrec_skiprecord F
+GLIBC_2.29 xdrstdio_create F
+GLIBC_2.29 xencrypt F
+GLIBC_2.29 xprt_register F
+GLIBC_2.29 xprt_unregister F
diff --git a/sysdeps/unix/sysv/linux/csky/libcrypt.abilist b/sysdeps/unix/sysv/linux/csky/libcrypt.abilist
new file mode 100644
index 0000000..da3abbf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libcrypt.abilist
@@ -0,0 +1,2 @@
+GLIBC_2.29 crypt F
+GLIBC_2.29 crypt_r F
diff --git a/sysdeps/unix/sysv/linux/csky/libdl.abilist b/sysdeps/unix/sysv/linux/csky/libdl.abilist
new file mode 100644
index 0000000..8fcb609
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libdl.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.29 dladdr F
+GLIBC_2.29 dladdr1 F
+GLIBC_2.29 dlclose F
+GLIBC_2.29 dlerror F
+GLIBC_2.29 dlinfo F
+GLIBC_2.29 dlmopen F
+GLIBC_2.29 dlopen F
+GLIBC_2.29 dlsym F
+GLIBC_2.29 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/csky/libm.abilist b/sysdeps/unix/sysv/linux/csky/libm.abilist
new file mode 100644
index 0000000..497f622
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libm.abilist
@@ -0,0 +1,753 @@
+GLIBC_2.29 __acos_finite F
+GLIBC_2.29 __acosf_finite F
+GLIBC_2.29 __acosh_finite F
+GLIBC_2.29 __acoshf_finite F
+GLIBC_2.29 __asin_finite F
+GLIBC_2.29 __asinf_finite F
+GLIBC_2.29 __atan2_finite F
+GLIBC_2.29 __atan2f_finite F
+GLIBC_2.29 __atanh_finite F
+GLIBC_2.29 __atanhf_finite F
+GLIBC_2.29 __clog10 F
+GLIBC_2.29 __clog10f F
+GLIBC_2.29 __clog10l F
+GLIBC_2.29 __cosh_finite F
+GLIBC_2.29 __coshf_finite F
+GLIBC_2.29 __exp10_finite F
+GLIBC_2.29 __exp10f_finite F
+GLIBC_2.29 __exp2_finite F
+GLIBC_2.29 __exp2f_finite F
+GLIBC_2.29 __exp_finite F
+GLIBC_2.29 __expf_finite F
+GLIBC_2.29 __finite F
+GLIBC_2.29 __finitef F
+GLIBC_2.29 __fmod_finite F
+GLIBC_2.29 __fmodf_finite F
+GLIBC_2.29 __fpclassify F
+GLIBC_2.29 __fpclassifyf F
+GLIBC_2.29 __gamma_r_finite F
+GLIBC_2.29 __gammaf_r_finite F
+GLIBC_2.29 __hypot_finite F
+GLIBC_2.29 __hypotf_finite F
+GLIBC_2.29 __iseqsig F
+GLIBC_2.29 __iseqsigf F
+GLIBC_2.29 __issignaling F
+GLIBC_2.29 __issignalingf F
+GLIBC_2.29 __j0_finite F
+GLIBC_2.29 __j0f_finite F
+GLIBC_2.29 __j1_finite F
+GLIBC_2.29 __j1f_finite F
+GLIBC_2.29 __jn_finite F
+GLIBC_2.29 __jnf_finite F
+GLIBC_2.29 __lgamma_r_finite F
+GLIBC_2.29 __lgammaf_r_finite F
+GLIBC_2.29 __log10_finite F
+GLIBC_2.29 __log10f_finite F
+GLIBC_2.29 __log2_finite F
+GLIBC_2.29 __log2f_finite F
+GLIBC_2.29 __log_finite F
+GLIBC_2.29 __logf_finite F
+GLIBC_2.29 __pow_finite F
+GLIBC_2.29 __powf_finite F
+GLIBC_2.29 __remainder_finite F
+GLIBC_2.29 __remainderf_finite F
+GLIBC_2.29 __scalb_finite F
+GLIBC_2.29 __scalbf_finite F
+GLIBC_2.29 __signbit F
+GLIBC_2.29 __signbitf F
+GLIBC_2.29 __signgam D 0x4
+GLIBC_2.29 __sinh_finite F
+GLIBC_2.29 __sinhf_finite F
+GLIBC_2.29 __sqrt_finite F
+GLIBC_2.29 __sqrtf_finite F
+GLIBC_2.29 __y0_finite F
+GLIBC_2.29 __y0f_finite F
+GLIBC_2.29 __y1_finite F
+GLIBC_2.29 __y1f_finite F
+GLIBC_2.29 __yn_finite F
+GLIBC_2.29 __ynf_finite F
+GLIBC_2.29 acos F
+GLIBC_2.29 acosf F
+GLIBC_2.29 acosf32 F
+GLIBC_2.29 acosf32x F
+GLIBC_2.29 acosf64 F
+GLIBC_2.29 acosh F
+GLIBC_2.29 acoshf F
+GLIBC_2.29 acoshf32 F
+GLIBC_2.29 acoshf32x F
+GLIBC_2.29 acoshf64 F
+GLIBC_2.29 acoshl F
+GLIBC_2.29 acosl F
+GLIBC_2.29 asin F
+GLIBC_2.29 asinf F
+GLIBC_2.29 asinf32 F
+GLIBC_2.29 asinf32x F
+GLIBC_2.29 asinf64 F
+GLIBC_2.29 asinh F
+GLIBC_2.29 asinhf F
+GLIBC_2.29 asinhf32 F
+GLIBC_2.29 asinhf32x F
+GLIBC_2.29 asinhf64 F
+GLIBC_2.29 asinhl F
+GLIBC_2.29 asinl F
+GLIBC_2.29 atan F
+GLIBC_2.29 atan2 F
+GLIBC_2.29 atan2f F
+GLIBC_2.29 atan2f32 F
+GLIBC_2.29 atan2f32x F
+GLIBC_2.29 atan2f64 F
+GLIBC_2.29 atan2l F
+GLIBC_2.29 atanf F
+GLIBC_2.29 atanf32 F
+GLIBC_2.29 atanf32x F
+GLIBC_2.29 atanf64 F
+GLIBC_2.29 atanh F
+GLIBC_2.29 atanhf F
+GLIBC_2.29 atanhf32 F
+GLIBC_2.29 atanhf32x F
+GLIBC_2.29 atanhf64 F
+GLIBC_2.29 atanhl F
+GLIBC_2.29 atanl F
+GLIBC_2.29 cabs F
+GLIBC_2.29 cabsf F
+GLIBC_2.29 cabsf32 F
+GLIBC_2.29 cabsf32x F
+GLIBC_2.29 cabsf64 F
+GLIBC_2.29 cabsl F
+GLIBC_2.29 cacos F
+GLIBC_2.29 cacosf F
+GLIBC_2.29 cacosf32 F
+GLIBC_2.29 cacosf32x F
+GLIBC_2.29 cacosf64 F
+GLIBC_2.29 cacosh F
+GLIBC_2.29 cacoshf F
+GLIBC_2.29 cacoshf32 F
+GLIBC_2.29 cacoshf32x F
+GLIBC_2.29 cacoshf64 F
+GLIBC_2.29 cacoshl F
+GLIBC_2.29 cacosl F
+GLIBC_2.29 canonicalize F
+GLIBC_2.29 canonicalizef F
+GLIBC_2.29 canonicalizef32 F
+GLIBC_2.29 canonicalizef32x F
+GLIBC_2.29 canonicalizef64 F
+GLIBC_2.29 canonicalizel F
+GLIBC_2.29 carg F
+GLIBC_2.29 cargf F
+GLIBC_2.29 cargf32 F
+GLIBC_2.29 cargf32x F
+GLIBC_2.29 cargf64 F
+GLIBC_2.29 cargl F
+GLIBC_2.29 casin F
+GLIBC_2.29 casinf F
+GLIBC_2.29 casinf32 F
+GLIBC_2.29 casinf32x F
+GLIBC_2.29 casinf64 F
+GLIBC_2.29 casinh F
+GLIBC_2.29 casinhf F
+GLIBC_2.29 casinhf32 F
+GLIBC_2.29 casinhf32x F
+GLIBC_2.29 casinhf64 F
+GLIBC_2.29 casinhl F
+GLIBC_2.29 casinl F
+GLIBC_2.29 catan F
+GLIBC_2.29 catanf F
+GLIBC_2.29 catanf32 F
+GLIBC_2.29 catanf32x F
+GLIBC_2.29 catanf64 F
+GLIBC_2.29 catanh F
+GLIBC_2.29 catanhf F
+GLIBC_2.29 catanhf32 F
+GLIBC_2.29 catanhf32x F
+GLIBC_2.29 catanhf64 F
+GLIBC_2.29 catanhl F
+GLIBC_2.29 catanl F
+GLIBC_2.29 cbrt F
+GLIBC_2.29 cbrtf F
+GLIBC_2.29 cbrtf32 F
+GLIBC_2.29 cbrtf32x F
+GLIBC_2.29 cbrtf64 F
+GLIBC_2.29 cbrtl F
+GLIBC_2.29 ccos F
+GLIBC_2.29 ccosf F
+GLIBC_2.29 ccosf32 F
+GLIBC_2.29 ccosf32x F
+GLIBC_2.29 ccosf64 F
+GLIBC_2.29 ccosh F
+GLIBC_2.29 ccoshf F
+GLIBC_2.29 ccoshf32 F
+GLIBC_2.29 ccoshf32x F
+GLIBC_2.29 ccoshf64 F
+GLIBC_2.29 ccoshl F
+GLIBC_2.29 ccosl F
+GLIBC_2.29 ceil F
+GLIBC_2.29 ceilf F
+GLIBC_2.29 ceilf32 F
+GLIBC_2.29 ceilf32x F
+GLIBC_2.29 ceilf64 F
+GLIBC_2.29 ceill F
+GLIBC_2.29 cexp F
+GLIBC_2.29 cexpf F
+GLIBC_2.29 cexpf32 F
+GLIBC_2.29 cexpf32x F
+GLIBC_2.29 cexpf64 F
+GLIBC_2.29 cexpl F
+GLIBC_2.29 cimag F
+GLIBC_2.29 cimagf F
+GLIBC_2.29 cimagf32 F
+GLIBC_2.29 cimagf32x F
+GLIBC_2.29 cimagf64 F
+GLIBC_2.29 cimagl F
+GLIBC_2.29 clog F
+GLIBC_2.29 clog10 F
+GLIBC_2.29 clog10f F
+GLIBC_2.29 clog10f32 F
+GLIBC_2.29 clog10f32x F
+GLIBC_2.29 clog10f64 F
+GLIBC_2.29 clog10l F
+GLIBC_2.29 clogf F
+GLIBC_2.29 clogf32 F
+GLIBC_2.29 clogf32x F
+GLIBC_2.29 clogf64 F
+GLIBC_2.29 clogl F
+GLIBC_2.29 conj F
+GLIBC_2.29 conjf F
+GLIBC_2.29 conjf32 F
+GLIBC_2.29 conjf32x F
+GLIBC_2.29 conjf64 F
+GLIBC_2.29 conjl F
+GLIBC_2.29 copysign F
+GLIBC_2.29 copysignf F
+GLIBC_2.29 copysignf32 F
+GLIBC_2.29 copysignf32x F
+GLIBC_2.29 copysignf64 F
+GLIBC_2.29 copysignl F
+GLIBC_2.29 cos F
+GLIBC_2.29 cosf F
+GLIBC_2.29 cosf32 F
+GLIBC_2.29 cosf32x F
+GLIBC_2.29 cosf64 F
+GLIBC_2.29 cosh F
+GLIBC_2.29 coshf F
+GLIBC_2.29 coshf32 F
+GLIBC_2.29 coshf32x F
+GLIBC_2.29 coshf64 F
+GLIBC_2.29 coshl F
+GLIBC_2.29 cosl F
+GLIBC_2.29 cpow F
+GLIBC_2.29 cpowf F
+GLIBC_2.29 cpowf32 F
+GLIBC_2.29 cpowf32x F
+GLIBC_2.29 cpowf64 F
+GLIBC_2.29 cpowl F
+GLIBC_2.29 cproj F
+GLIBC_2.29 cprojf F
+GLIBC_2.29 cprojf32 F
+GLIBC_2.29 cprojf32x F
+GLIBC_2.29 cprojf64 F
+GLIBC_2.29 cprojl F
+GLIBC_2.29 creal F
+GLIBC_2.29 crealf F
+GLIBC_2.29 crealf32 F
+GLIBC_2.29 crealf32x F
+GLIBC_2.29 crealf64 F
+GLIBC_2.29 creall F
+GLIBC_2.29 csin F
+GLIBC_2.29 csinf F
+GLIBC_2.29 csinf32 F
+GLIBC_2.29 csinf32x F
+GLIBC_2.29 csinf64 F
+GLIBC_2.29 csinh F
+GLIBC_2.29 csinhf F
+GLIBC_2.29 csinhf32 F
+GLIBC_2.29 csinhf32x F
+GLIBC_2.29 csinhf64 F
+GLIBC_2.29 csinhl F
+GLIBC_2.29 csinl F
+GLIBC_2.29 csqrt F
+GLIBC_2.29 csqrtf F
+GLIBC_2.29 csqrtf32 F
+GLIBC_2.29 csqrtf32x F
+GLIBC_2.29 csqrtf64 F
+GLIBC_2.29 csqrtl F
+GLIBC_2.29 ctan F
+GLIBC_2.29 ctanf F
+GLIBC_2.29 ctanf32 F
+GLIBC_2.29 ctanf32x F
+GLIBC_2.29 ctanf64 F
+GLIBC_2.29 ctanh F
+GLIBC_2.29 ctanhf F
+GLIBC_2.29 ctanhf32 F
+GLIBC_2.29 ctanhf32x F
+GLIBC_2.29 ctanhf64 F
+GLIBC_2.29 ctanhl F
+GLIBC_2.29 ctanl F
+GLIBC_2.29 daddl F
+GLIBC_2.29 ddivl F
+GLIBC_2.29 dmull F
+GLIBC_2.29 drem F
+GLIBC_2.29 dremf F
+GLIBC_2.29 dreml F
+GLIBC_2.29 dsubl F
+GLIBC_2.29 erf F
+GLIBC_2.29 erfc F
+GLIBC_2.29 erfcf F
+GLIBC_2.29 erfcf32 F
+GLIBC_2.29 erfcf32x F
+GLIBC_2.29 erfcf64 F
+GLIBC_2.29 erfcl F
+GLIBC_2.29 erff F
+GLIBC_2.29 erff32 F
+GLIBC_2.29 erff32x F
+GLIBC_2.29 erff64 F
+GLIBC_2.29 erfl F
+GLIBC_2.29 exp F
+GLIBC_2.29 exp10 F
+GLIBC_2.29 exp10f F
+GLIBC_2.29 exp10f32 F
+GLIBC_2.29 exp10f32x F
+GLIBC_2.29 exp10f64 F
+GLIBC_2.29 exp10l F
+GLIBC_2.29 exp2 F
+GLIBC_2.29 exp2f F
+GLIBC_2.29 exp2f32 F
+GLIBC_2.29 exp2f32x F
+GLIBC_2.29 exp2f64 F
+GLIBC_2.29 exp2l F
+GLIBC_2.29 expf F
+GLIBC_2.29 expf32 F
+GLIBC_2.29 expf32x F
+GLIBC_2.29 expf64 F
+GLIBC_2.29 expl F
+GLIBC_2.29 expm1 F
+GLIBC_2.29 expm1f F
+GLIBC_2.29 expm1f32 F
+GLIBC_2.29 expm1f32x F
+GLIBC_2.29 expm1f64 F
+GLIBC_2.29 expm1l F
+GLIBC_2.29 f32addf32x F
+GLIBC_2.29 f32addf64 F
+GLIBC_2.29 f32divf32x F
+GLIBC_2.29 f32divf64 F
+GLIBC_2.29 f32mulf32x F
+GLIBC_2.29 f32mulf64 F
+GLIBC_2.29 f32subf32x F
+GLIBC_2.29 f32subf64 F
+GLIBC_2.29 f32xaddf64 F
+GLIBC_2.29 f32xdivf64 F
+GLIBC_2.29 f32xmulf64 F
+GLIBC_2.29 f32xsubf64 F
+GLIBC_2.29 fabs F
+GLIBC_2.29 fabsf F
+GLIBC_2.29 fabsf32 F
+GLIBC_2.29 fabsf32x F
+GLIBC_2.29 fabsf64 F
+GLIBC_2.29 fabsl F
+GLIBC_2.29 fadd F
+GLIBC_2.29 faddl F
+GLIBC_2.29 fdim F
+GLIBC_2.29 fdimf F
+GLIBC_2.29 fdimf32 F
+GLIBC_2.29 fdimf32x F
+GLIBC_2.29 fdimf64 F
+GLIBC_2.29 fdiml F
+GLIBC_2.29 fdiv F
+GLIBC_2.29 fdivl F
+GLIBC_2.29 feclearexcept F
+GLIBC_2.29 fedisableexcept F
+GLIBC_2.29 feenableexcept F
+GLIBC_2.29 fegetenv F
+GLIBC_2.29 fegetexcept F
+GLIBC_2.29 fegetexceptflag F
+GLIBC_2.29 fegetmode F
+GLIBC_2.29 fegetround F
+GLIBC_2.29 feholdexcept F
+GLIBC_2.29 feraiseexcept F
+GLIBC_2.29 fesetenv F
+GLIBC_2.29 fesetexcept F
+GLIBC_2.29 fesetexceptflag F
+GLIBC_2.29 fesetmode F
+GLIBC_2.29 fesetround F
+GLIBC_2.29 fetestexcept F
+GLIBC_2.29 fetestexceptflag F
+GLIBC_2.29 feupdateenv F
+GLIBC_2.29 finite F
+GLIBC_2.29 finitef F
+GLIBC_2.29 finitel F
+GLIBC_2.29 floor F
+GLIBC_2.29 floorf F
+GLIBC_2.29 floorf32 F
+GLIBC_2.29 floorf32x F
+GLIBC_2.29 floorf64 F
+GLIBC_2.29 floorl F
+GLIBC_2.29 fma F
+GLIBC_2.29 fmaf F
+GLIBC_2.29 fmaf32 F
+GLIBC_2.29 fmaf32x F
+GLIBC_2.29 fmaf64 F
+GLIBC_2.29 fmal F
+GLIBC_2.29 fmax F
+GLIBC_2.29 fmaxf F
+GLIBC_2.29 fmaxf32 F
+GLIBC_2.29 fmaxf32x F
+GLIBC_2.29 fmaxf64 F
+GLIBC_2.29 fmaxl F
+GLIBC_2.29 fmaxmag F
+GLIBC_2.29 fmaxmagf F
+GLIBC_2.29 fmaxmagf32 F
+GLIBC_2.29 fmaxmagf32x F
+GLIBC_2.29 fmaxmagf64 F
+GLIBC_2.29 fmaxmagl F
+GLIBC_2.29 fmin F
+GLIBC_2.29 fminf F
+GLIBC_2.29 fminf32 F
+GLIBC_2.29 fminf32x F
+GLIBC_2.29 fminf64 F
+GLIBC_2.29 fminl F
+GLIBC_2.29 fminmag F
+GLIBC_2.29 fminmagf F
+GLIBC_2.29 fminmagf32 F
+GLIBC_2.29 fminmagf32x F
+GLIBC_2.29 fminmagf64 F
+GLIBC_2.29 fminmagl F
+GLIBC_2.29 fmod F
+GLIBC_2.29 fmodf F
+GLIBC_2.29 fmodf32 F
+GLIBC_2.29 fmodf32x F
+GLIBC_2.29 fmodf64 F
+GLIBC_2.29 fmodl F
+GLIBC_2.29 fmul F
+GLIBC_2.29 fmull F
+GLIBC_2.29 frexp F
+GLIBC_2.29 frexpf F
+GLIBC_2.29 frexpf32 F
+GLIBC_2.29 frexpf32x F
+GLIBC_2.29 frexpf64 F
+GLIBC_2.29 frexpl F
+GLIBC_2.29 fromfp F
+GLIBC_2.29 fromfpf F
+GLIBC_2.29 fromfpf32 F
+GLIBC_2.29 fromfpf32x F
+GLIBC_2.29 fromfpf64 F
+GLIBC_2.29 fromfpl F
+GLIBC_2.29 fromfpx F
+GLIBC_2.29 fromfpxf F
+GLIBC_2.29 fromfpxf32 F
+GLIBC_2.29 fromfpxf32x F
+GLIBC_2.29 fromfpxf64 F
+GLIBC_2.29 fromfpxl F
+GLIBC_2.29 fsub F
+GLIBC_2.29 fsubl F
+GLIBC_2.29 gamma F
+GLIBC_2.29 gammaf F
+GLIBC_2.29 gammal F
+GLIBC_2.29 getpayload F
+GLIBC_2.29 getpayloadf F
+GLIBC_2.29 getpayloadf32 F
+GLIBC_2.29 getpayloadf32x F
+GLIBC_2.29 getpayloadf64 F
+GLIBC_2.29 getpayloadl F
+GLIBC_2.29 hypot F
+GLIBC_2.29 hypotf F
+GLIBC_2.29 hypotf32 F
+GLIBC_2.29 hypotf32x F
+GLIBC_2.29 hypotf64 F
+GLIBC_2.29 hypotl F
+GLIBC_2.29 ilogb F
+GLIBC_2.29 ilogbf F
+GLIBC_2.29 ilogbf32 F
+GLIBC_2.29 ilogbf32x F
+GLIBC_2.29 ilogbf64 F
+GLIBC_2.29 ilogbl F
+GLIBC_2.29 j0 F
+GLIBC_2.29 j0f F
+GLIBC_2.29 j0f32 F
+GLIBC_2.29 j0f32x F
+GLIBC_2.29 j0f64 F
+GLIBC_2.29 j0l F
+GLIBC_2.29 j1 F
+GLIBC_2.29 j1f F
+GLIBC_2.29 j1f32 F
+GLIBC_2.29 j1f32x F
+GLIBC_2.29 j1f64 F
+GLIBC_2.29 j1l F
+GLIBC_2.29 jn F
+GLIBC_2.29 jnf F
+GLIBC_2.29 jnf32 F
+GLIBC_2.29 jnf32x F
+GLIBC_2.29 jnf64 F
+GLIBC_2.29 jnl F
+GLIBC_2.29 ldexp F
+GLIBC_2.29 ldexpf F
+GLIBC_2.29 ldexpf32 F
+GLIBC_2.29 ldexpf32x F
+GLIBC_2.29 ldexpf64 F
+GLIBC_2.29 ldexpl F
+GLIBC_2.29 lgamma F
+GLIBC_2.29 lgamma_r F
+GLIBC_2.29 lgammaf F
+GLIBC_2.29 lgammaf32 F
+GLIBC_2.29 lgammaf32_r F
+GLIBC_2.29 lgammaf32x F
+GLIBC_2.29 lgammaf32x_r F
+GLIBC_2.29 lgammaf64 F
+GLIBC_2.29 lgammaf64_r F
+GLIBC_2.29 lgammaf_r F
+GLIBC_2.29 lgammal F
+GLIBC_2.29 lgammal_r F
+GLIBC_2.29 llogb F
+GLIBC_2.29 llogbf F
+GLIBC_2.29 llogbf32 F
+GLIBC_2.29 llogbf32x F
+GLIBC_2.29 llogbf64 F
+GLIBC_2.29 llogbl F
+GLIBC_2.29 llrint F
+GLIBC_2.29 llrintf F
+GLIBC_2.29 llrintf32 F
+GLIBC_2.29 llrintf32x F
+GLIBC_2.29 llrintf64 F
+GLIBC_2.29 llrintl F
+GLIBC_2.29 llround F
+GLIBC_2.29 llroundf F
+GLIBC_2.29 llroundf32 F
+GLIBC_2.29 llroundf32x F
+GLIBC_2.29 llroundf64 F
+GLIBC_2.29 llroundl F
+GLIBC_2.29 log F
+GLIBC_2.29 log10 F
+GLIBC_2.29 log10f F
+GLIBC_2.29 log10f32 F
+GLIBC_2.29 log10f32x F
+GLIBC_2.29 log10f64 F
+GLIBC_2.29 log10l F
+GLIBC_2.29 log1p F
+GLIBC_2.29 log1pf F
+GLIBC_2.29 log1pf32 F
+GLIBC_2.29 log1pf32x F
+GLIBC_2.29 log1pf64 F
+GLIBC_2.29 log1pl F
+GLIBC_2.29 log2 F
+GLIBC_2.29 log2f F
+GLIBC_2.29 log2f32 F
+GLIBC_2.29 log2f32x F
+GLIBC_2.29 log2f64 F
+GLIBC_2.29 log2l F
+GLIBC_2.29 logb F
+GLIBC_2.29 logbf F
+GLIBC_2.29 logbf32 F
+GLIBC_2.29 logbf32x F
+GLIBC_2.29 logbf64 F
+GLIBC_2.29 logbl F
+GLIBC_2.29 logf F
+GLIBC_2.29 logf32 F
+GLIBC_2.29 logf32x F
+GLIBC_2.29 logf64 F
+GLIBC_2.29 logl F
+GLIBC_2.29 lrint F
+GLIBC_2.29 lrintf F
+GLIBC_2.29 lrintf32 F
+GLIBC_2.29 lrintf32x F
+GLIBC_2.29 lrintf64 F
+GLIBC_2.29 lrintl F
+GLIBC_2.29 lround F
+GLIBC_2.29 lroundf F
+GLIBC_2.29 lroundf32 F
+GLIBC_2.29 lroundf32x F
+GLIBC_2.29 lroundf64 F
+GLIBC_2.29 lroundl F
+GLIBC_2.29 modf F
+GLIBC_2.29 modff F
+GLIBC_2.29 modff32 F
+GLIBC_2.29 modff32x F
+GLIBC_2.29 modff64 F
+GLIBC_2.29 modfl F
+GLIBC_2.29 nan F
+GLIBC_2.29 nanf F
+GLIBC_2.29 nanf32 F
+GLIBC_2.29 nanf32x F
+GLIBC_2.29 nanf64 F
+GLIBC_2.29 nanl F
+GLIBC_2.29 nearbyint F
+GLIBC_2.29 nearbyintf F
+GLIBC_2.29 nearbyintf32 F
+GLIBC_2.29 nearbyintf32x F
+GLIBC_2.29 nearbyintf64 F
+GLIBC_2.29 nearbyintl F
+GLIBC_2.29 nextafter F
+GLIBC_2.29 nextafterf F
+GLIBC_2.29 nextafterf32 F
+GLIBC_2.29 nextafterf32x F
+GLIBC_2.29 nextafterf64 F
+GLIBC_2.29 nextafterl F
+GLIBC_2.29 nextdown F
+GLIBC_2.29 nextdownf F
+GLIBC_2.29 nextdownf32 F
+GLIBC_2.29 nextdownf32x F
+GLIBC_2.29 nextdownf64 F
+GLIBC_2.29 nextdownl F
+GLIBC_2.29 nexttoward F
+GLIBC_2.29 nexttowardf F
+GLIBC_2.29 nexttowardl F
+GLIBC_2.29 nextup F
+GLIBC_2.29 nextupf F
+GLIBC_2.29 nextupf32 F
+GLIBC_2.29 nextupf32x F
+GLIBC_2.29 nextupf64 F
+GLIBC_2.29 nextupl F
+GLIBC_2.29 pow F
+GLIBC_2.29 powf F
+GLIBC_2.29 powf32 F
+GLIBC_2.29 powf32x F
+GLIBC_2.29 powf64 F
+GLIBC_2.29 powl F
+GLIBC_2.29 remainder F
+GLIBC_2.29 remainderf F
+GLIBC_2.29 remainderf32 F
+GLIBC_2.29 remainderf32x F
+GLIBC_2.29 remainderf64 F
+GLIBC_2.29 remainderl F
+GLIBC_2.29 remquo F
+GLIBC_2.29 remquof F
+GLIBC_2.29 remquof32 F
+GLIBC_2.29 remquof32x F
+GLIBC_2.29 remquof64 F
+GLIBC_2.29 remquol F
+GLIBC_2.29 rint F
+GLIBC_2.29 rintf F
+GLIBC_2.29 rintf32 F
+GLIBC_2.29 rintf32x F
+GLIBC_2.29 rintf64 F
+GLIBC_2.29 rintl F
+GLIBC_2.29 round F
+GLIBC_2.29 roundeven F
+GLIBC_2.29 roundevenf F
+GLIBC_2.29 roundevenf32 F
+GLIBC_2.29 roundevenf32x F
+GLIBC_2.29 roundevenf64 F
+GLIBC_2.29 roundevenl F
+GLIBC_2.29 roundf F
+GLIBC_2.29 roundf32 F
+GLIBC_2.29 roundf32x F
+GLIBC_2.29 roundf64 F
+GLIBC_2.29 roundl F
+GLIBC_2.29 scalb F
+GLIBC_2.29 scalbf F
+GLIBC_2.29 scalbl F
+GLIBC_2.29 scalbln F
+GLIBC_2.29 scalblnf F
+GLIBC_2.29 scalblnf32 F
+GLIBC_2.29 scalblnf32x F
+GLIBC_2.29 scalblnf64 F
+GLIBC_2.29 scalblnl F
+GLIBC_2.29 scalbn F
+GLIBC_2.29 scalbnf F
+GLIBC_2.29 scalbnf32 F
+GLIBC_2.29 scalbnf32x F
+GLIBC_2.29 scalbnf64 F
+GLIBC_2.29 scalbnl F
+GLIBC_2.29 setpayload F
+GLIBC_2.29 setpayloadf F
+GLIBC_2.29 setpayloadf32 F
+GLIBC_2.29 setpayloadf32x F
+GLIBC_2.29 setpayloadf64 F
+GLIBC_2.29 setpayloadl F
+GLIBC_2.29 setpayloadsig F
+GLIBC_2.29 setpayloadsigf F
+GLIBC_2.29 setpayloadsigf32 F
+GLIBC_2.29 setpayloadsigf32x F
+GLIBC_2.29 setpayloadsigf64 F
+GLIBC_2.29 setpayloadsigl F
+GLIBC_2.29 signgam D 0x4
+GLIBC_2.29 significand F
+GLIBC_2.29 significandf F
+GLIBC_2.29 significandl F
+GLIBC_2.29 sin F
+GLIBC_2.29 sincos F
+GLIBC_2.29 sincosf F
+GLIBC_2.29 sincosf32 F
+GLIBC_2.29 sincosf32x F
+GLIBC_2.29 sincosf64 F
+GLIBC_2.29 sincosl F
+GLIBC_2.29 sinf F
+GLIBC_2.29 sinf32 F
+GLIBC_2.29 sinf32x F
+GLIBC_2.29 sinf64 F
+GLIBC_2.29 sinh F
+GLIBC_2.29 sinhf F
+GLIBC_2.29 sinhf32 F
+GLIBC_2.29 sinhf32x F
+GLIBC_2.29 sinhf64 F
+GLIBC_2.29 sinhl F
+GLIBC_2.29 sinl F
+GLIBC_2.29 sqrt F
+GLIBC_2.29 sqrtf F
+GLIBC_2.29 sqrtf32 F
+GLIBC_2.29 sqrtf32x F
+GLIBC_2.29 sqrtf64 F
+GLIBC_2.29 sqrtl F
+GLIBC_2.29 tan F
+GLIBC_2.29 tanf F
+GLIBC_2.29 tanf32 F
+GLIBC_2.29 tanf32x F
+GLIBC_2.29 tanf64 F
+GLIBC_2.29 tanh F
+GLIBC_2.29 tanhf F
+GLIBC_2.29 tanhf32 F
+GLIBC_2.29 tanhf32x F
+GLIBC_2.29 tanhf64 F
+GLIBC_2.29 tanhl F
+GLIBC_2.29 tanl F
+GLIBC_2.29 tgamma F
+GLIBC_2.29 tgammaf F
+GLIBC_2.29 tgammaf32 F
+GLIBC_2.29 tgammaf32x F
+GLIBC_2.29 tgammaf64 F
+GLIBC_2.29 tgammal F
+GLIBC_2.29 totalorder F
+GLIBC_2.29 totalorderf F
+GLIBC_2.29 totalorderf32 F
+GLIBC_2.29 totalorderf32x F
+GLIBC_2.29 totalorderf64 F
+GLIBC_2.29 totalorderl F
+GLIBC_2.29 totalordermag F
+GLIBC_2.29 totalordermagf F
+GLIBC_2.29 totalordermagf32 F
+GLIBC_2.29 totalordermagf32x F
+GLIBC_2.29 totalordermagf64 F
+GLIBC_2.29 totalordermagl F
+GLIBC_2.29 trunc F
+GLIBC_2.29 truncf F
+GLIBC_2.29 truncf32 F
+GLIBC_2.29 truncf32x F
+GLIBC_2.29 truncf64 F
+GLIBC_2.29 truncl F
+GLIBC_2.29 ufromfp F
+GLIBC_2.29 ufromfpf F
+GLIBC_2.29 ufromfpf32 F
+GLIBC_2.29 ufromfpf32x F
+GLIBC_2.29 ufromfpf64 F
+GLIBC_2.29 ufromfpl F
+GLIBC_2.29 ufromfpx F
+GLIBC_2.29 ufromfpxf F
+GLIBC_2.29 ufromfpxf32 F
+GLIBC_2.29 ufromfpxf32x F
+GLIBC_2.29 ufromfpxf64 F
+GLIBC_2.29 ufromfpxl F
+GLIBC_2.29 y0 F
+GLIBC_2.29 y0f F
+GLIBC_2.29 y0f32 F
+GLIBC_2.29 y0f32x F
+GLIBC_2.29 y0f64 F
+GLIBC_2.29 y0l F
+GLIBC_2.29 y1 F
+GLIBC_2.29 y1f F
+GLIBC_2.29 y1f32 F
+GLIBC_2.29 y1f32x F
+GLIBC_2.29 y1f64 F
+GLIBC_2.29 y1l F
+GLIBC_2.29 yn F
+GLIBC_2.29 ynf F
+GLIBC_2.29 ynf32 F
+GLIBC_2.29 ynf32x F
+GLIBC_2.29 ynf64 F
+GLIBC_2.29 ynl F
diff --git a/sysdeps/unix/sysv/linux/csky/libnsl.abilist b/sysdeps/unix/sysv/linux/csky/libnsl.abilist
new file mode 100644
index 0000000..c8ef9e3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libnsl.abilist
@@ -0,0 +1,120 @@
+GLIBC_2.29 __free_fdresult F
+GLIBC_2.29 __nis_default_access F
+GLIBC_2.29 __nis_default_group F
+GLIBC_2.29 __nis_default_owner F
+GLIBC_2.29 __nis_default_ttl F
+GLIBC_2.29 __nis_finddirectory F
+GLIBC_2.29 __nisbind_connect F
+GLIBC_2.29 __nisbind_create F
+GLIBC_2.29 __nisbind_destroy F
+GLIBC_2.29 __nisbind_next F
+GLIBC_2.29 __yp_check F
+GLIBC_2.29 nis_add F
+GLIBC_2.29 nis_add_entry F
+GLIBC_2.29 nis_addmember F
+GLIBC_2.29 nis_checkpoint F
+GLIBC_2.29 nis_clone_directory F
+GLIBC_2.29 nis_clone_object F
+GLIBC_2.29 nis_clone_result F
+GLIBC_2.29 nis_creategroup F
+GLIBC_2.29 nis_destroy_object F
+GLIBC_2.29 nis_destroygroup F
+GLIBC_2.29 nis_dir_cmp F
+GLIBC_2.29 nis_domain_of F
+GLIBC_2.29 nis_domain_of_r F
+GLIBC_2.29 nis_first_entry F
+GLIBC_2.29 nis_free_directory F
+GLIBC_2.29 nis_free_object F
+GLIBC_2.29 nis_free_request F
+GLIBC_2.29 nis_freenames F
+GLIBC_2.29 nis_freeresult F
+GLIBC_2.29 nis_freeservlist F
+GLIBC_2.29 nis_freetags F
+GLIBC_2.29 nis_getnames F
+GLIBC_2.29 nis_getservlist F
+GLIBC_2.29 nis_ismember F
+GLIBC_2.29 nis_leaf_of F
+GLIBC_2.29 nis_leaf_of_r F
+GLIBC_2.29 nis_lerror F
+GLIBC_2.29 nis_list F
+GLIBC_2.29 nis_local_directory F
+GLIBC_2.29 nis_local_group F
+GLIBC_2.29 nis_local_host F
+GLIBC_2.29 nis_local_principal F
+GLIBC_2.29 nis_lookup F
+GLIBC_2.29 nis_mkdir F
+GLIBC_2.29 nis_modify F
+GLIBC_2.29 nis_modify_entry F
+GLIBC_2.29 nis_name_of F
+GLIBC_2.29 nis_name_of_r F
+GLIBC_2.29 nis_next_entry F
+GLIBC_2.29 nis_perror F
+GLIBC_2.29 nis_ping F
+GLIBC_2.29 nis_print_directory F
+GLIBC_2.29 nis_print_entry F
+GLIBC_2.29 nis_print_group F
+GLIBC_2.29 nis_print_group_entry F
+GLIBC_2.29 nis_print_link F
+GLIBC_2.29 nis_print_object F
+GLIBC_2.29 nis_print_result F
+GLIBC_2.29 nis_print_rights F
+GLIBC_2.29 nis_print_table F
+GLIBC_2.29 nis_read_obj F
+GLIBC_2.29 nis_remove F
+GLIBC_2.29 nis_remove_entry F
+GLIBC_2.29 nis_removemember F
+GLIBC_2.29 nis_rmdir F
+GLIBC_2.29 nis_servstate F
+GLIBC_2.29 nis_sperrno F
+GLIBC_2.29 nis_sperror F
+GLIBC_2.29 nis_sperror_r F
+GLIBC_2.29 nis_stats F
+GLIBC_2.29 nis_verifygroup F
+GLIBC_2.29 nis_write_obj F
+GLIBC_2.29 readColdStartFile F
+GLIBC_2.29 writeColdStartFile F
+GLIBC_2.29 xdr_cback_data F
+GLIBC_2.29 xdr_domainname F
+GLIBC_2.29 xdr_keydat F
+GLIBC_2.29 xdr_mapname F
+GLIBC_2.29 xdr_obj_p F
+GLIBC_2.29 xdr_peername F
+GLIBC_2.29 xdr_valdat F
+GLIBC_2.29 xdr_yp_buf F
+GLIBC_2.29 xdr_ypall F
+GLIBC_2.29 xdr_ypbind_binding F
+GLIBC_2.29 xdr_ypbind_resp F
+GLIBC_2.29 xdr_ypbind_resptype F
+GLIBC_2.29 xdr_ypbind_setdom F
+GLIBC_2.29 xdr_ypdelete_args F
+GLIBC_2.29 xdr_ypmap_parms F
+GLIBC_2.29 xdr_ypmaplist F
+GLIBC_2.29 xdr_yppush_status F
+GLIBC_2.29 xdr_yppushresp_xfr F
+GLIBC_2.29 xdr_ypreq_key F
+GLIBC_2.29 xdr_ypreq_nokey F
+GLIBC_2.29 xdr_ypreq_xfr F
+GLIBC_2.29 xdr_ypresp_all F
+GLIBC_2.29 xdr_ypresp_key_val F
+GLIBC_2.29 xdr_ypresp_maplist F
+GLIBC_2.29 xdr_ypresp_master F
+GLIBC_2.29 xdr_ypresp_order F
+GLIBC_2.29 xdr_ypresp_val F
+GLIBC_2.29 xdr_ypresp_xfr F
+GLIBC_2.29 xdr_ypstat F
+GLIBC_2.29 xdr_ypupdate_args F
+GLIBC_2.29 xdr_ypxfrstat F
+GLIBC_2.29 yp_all F
+GLIBC_2.29 yp_bind F
+GLIBC_2.29 yp_first F
+GLIBC_2.29 yp_get_default_domain F
+GLIBC_2.29 yp_maplist F
+GLIBC_2.29 yp_master F
+GLIBC_2.29 yp_match F
+GLIBC_2.29 yp_next F
+GLIBC_2.29 yp_order F
+GLIBC_2.29 yp_unbind F
+GLIBC_2.29 yp_update F
+GLIBC_2.29 ypbinderr_string F
+GLIBC_2.29 yperr_string F
+GLIBC_2.29 ypprot_err F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
new file mode 100644
index 0000000..ea4b79a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -0,0 +1,235 @@
+GLIBC_2.29 _IO_flockfile F
+GLIBC_2.29 _IO_ftrylockfile F
+GLIBC_2.29 _IO_funlockfile F
+GLIBC_2.29 __close F
+GLIBC_2.29 __connect F
+GLIBC_2.29 __errno_location F
+GLIBC_2.29 __h_errno_location F
+GLIBC_2.29 __libc_allocate_rtsig F
+GLIBC_2.29 __libc_current_sigrtmax F
+GLIBC_2.29 __libc_current_sigrtmin F
+GLIBC_2.29 __lseek F
+GLIBC_2.29 __nanosleep F
+GLIBC_2.29 __open F
+GLIBC_2.29 __open64 F
+GLIBC_2.29 __pread64 F
+GLIBC_2.29 __pthread_cleanup_routine F
+GLIBC_2.29 __pthread_getspecific F
+GLIBC_2.29 __pthread_key_create F
+GLIBC_2.29 __pthread_mutex_destroy F
+GLIBC_2.29 __pthread_mutex_init F
+GLIBC_2.29 __pthread_mutex_lock F
+GLIBC_2.29 __pthread_mutex_trylock F
+GLIBC_2.29 __pthread_mutex_unlock F
+GLIBC_2.29 __pthread_mutexattr_destroy F
+GLIBC_2.29 __pthread_mutexattr_init F
+GLIBC_2.29 __pthread_mutexattr_settype F
+GLIBC_2.29 __pthread_once F
+GLIBC_2.29 __pthread_register_cancel F
+GLIBC_2.29 __pthread_register_cancel_defer F
+GLIBC_2.29 __pthread_rwlock_destroy F
+GLIBC_2.29 __pthread_rwlock_init F
+GLIBC_2.29 __pthread_rwlock_rdlock F
+GLIBC_2.29 __pthread_rwlock_tryrdlock F
+GLIBC_2.29 __pthread_rwlock_trywrlock F
+GLIBC_2.29 __pthread_rwlock_unlock F
+GLIBC_2.29 __pthread_rwlock_wrlock F
+GLIBC_2.29 __pthread_setspecific F
+GLIBC_2.29 __pthread_unregister_cancel F
+GLIBC_2.29 __pthread_unregister_cancel_restore F
+GLIBC_2.29 __pthread_unwind_next F
+GLIBC_2.29 __pwrite64 F
+GLIBC_2.29 __read F
+GLIBC_2.29 __res_state F
+GLIBC_2.29 __send F
+GLIBC_2.29 __sigaction F
+GLIBC_2.29 __wait F
+GLIBC_2.29 __write F
+GLIBC_2.29 _pthread_cleanup_pop F
+GLIBC_2.29 _pthread_cleanup_pop_restore F
+GLIBC_2.29 _pthread_cleanup_push F
+GLIBC_2.29 _pthread_cleanup_push_defer F
+GLIBC_2.29 accept F
+GLIBC_2.29 call_once F
+GLIBC_2.29 close F
+GLIBC_2.29 cnd_broadcast F
+GLIBC_2.29 cnd_destroy F
+GLIBC_2.29 cnd_init F
+GLIBC_2.29 cnd_signal F
+GLIBC_2.29 cnd_timedwait F
+GLIBC_2.29 cnd_wait F
+GLIBC_2.29 connect F
+GLIBC_2.29 flockfile F
+GLIBC_2.29 fsync F
+GLIBC_2.29 ftrylockfile F
+GLIBC_2.29 funlockfile F
+GLIBC_2.29 lseek F
+GLIBC_2.29 lseek64 F
+GLIBC_2.29 msync F
+GLIBC_2.29 mtx_destroy F
+GLIBC_2.29 mtx_init F
+GLIBC_2.29 mtx_lock F
+GLIBC_2.29 mtx_timedlock F
+GLIBC_2.29 mtx_trylock F
+GLIBC_2.29 mtx_unlock F
+GLIBC_2.29 nanosleep F
+GLIBC_2.29 open F
+GLIBC_2.29 open64 F
+GLIBC_2.29 pause F
+GLIBC_2.29 pread F
+GLIBC_2.29 pread64 F
+GLIBC_2.29 pthread_attr_destroy F
+GLIBC_2.29 pthread_attr_getaffinity_np F
+GLIBC_2.29 pthread_attr_getdetachstate F
+GLIBC_2.29 pthread_attr_getguardsize F
+GLIBC_2.29 pthread_attr_getinheritsched F
+GLIBC_2.29 pthread_attr_getschedparam F
+GLIBC_2.29 pthread_attr_getschedpolicy F
+GLIBC_2.29 pthread_attr_getscope F
+GLIBC_2.29 pthread_attr_getstack F
+GLIBC_2.29 pthread_attr_getstackaddr F
+GLIBC_2.29 pthread_attr_getstacksize F
+GLIBC_2.29 pthread_attr_init F
+GLIBC_2.29 pthread_attr_setaffinity_np F
+GLIBC_2.29 pthread_attr_setdetachstate F
+GLIBC_2.29 pthread_attr_setguardsize F
+GLIBC_2.29 pthread_attr_setinheritsched F
+GLIBC_2.29 pthread_attr_setschedparam F
+GLIBC_2.29 pthread_attr_setschedpolicy F
+GLIBC_2.29 pthread_attr_setscope F
+GLIBC_2.29 pthread_attr_setstack F
+GLIBC_2.29 pthread_attr_setstackaddr F
+GLIBC_2.29 pthread_attr_setstacksize F
+GLIBC_2.29 pthread_barrier_destroy F
+GLIBC_2.29 pthread_barrier_init F
+GLIBC_2.29 pthread_barrier_wait F
+GLIBC_2.29 pthread_barrierattr_destroy F
+GLIBC_2.29 pthread_barrierattr_getpshared F
+GLIBC_2.29 pthread_barrierattr_init F
+GLIBC_2.29 pthread_barrierattr_setpshared F
+GLIBC_2.29 pthread_cancel F
+GLIBC_2.29 pthread_cond_broadcast F
+GLIBC_2.29 pthread_cond_destroy F
+GLIBC_2.29 pthread_cond_init F
+GLIBC_2.29 pthread_cond_signal F
+GLIBC_2.29 pthread_cond_timedwait F
+GLIBC_2.29 pthread_cond_wait F
+GLIBC_2.29 pthread_condattr_destroy F
+GLIBC_2.29 pthread_condattr_getclock F
+GLIBC_2.29 pthread_condattr_getpshared F
+GLIBC_2.29 pthread_condattr_init F
+GLIBC_2.29 pthread_condattr_setclock F
+GLIBC_2.29 pthread_condattr_setpshared F
+GLIBC_2.29 pthread_create F
+GLIBC_2.29 pthread_detach F
+GLIBC_2.29 pthread_equal F
+GLIBC_2.29 pthread_exit F
+GLIBC_2.29 pthread_getaffinity_np F
+GLIBC_2.29 pthread_getattr_default_np F
+GLIBC_2.29 pthread_getattr_np F
+GLIBC_2.29 pthread_getconcurrency F
+GLIBC_2.29 pthread_getcpuclockid F
+GLIBC_2.29 pthread_getname_np F
+GLIBC_2.29 pthread_getschedparam F
+GLIBC_2.29 pthread_getspecific F
+GLIBC_2.29 pthread_join F
+GLIBC_2.29 pthread_key_create F
+GLIBC_2.29 pthread_key_delete F
+GLIBC_2.29 pthread_kill F
+GLIBC_2.29 pthread_kill_other_threads_np F
+GLIBC_2.29 pthread_mutex_consistent F
+GLIBC_2.29 pthread_mutex_consistent_np F
+GLIBC_2.29 pthread_mutex_destroy F
+GLIBC_2.29 pthread_mutex_getprioceiling F
+GLIBC_2.29 pthread_mutex_init F
+GLIBC_2.29 pthread_mutex_lock F
+GLIBC_2.29 pthread_mutex_setprioceiling F
+GLIBC_2.29 pthread_mutex_timedlock F
+GLIBC_2.29 pthread_mutex_trylock F
+GLIBC_2.29 pthread_mutex_unlock F
+GLIBC_2.29 pthread_mutexattr_destroy F
+GLIBC_2.29 pthread_mutexattr_getkind_np F
+GLIBC_2.29 pthread_mutexattr_getprioceiling F
+GLIBC_2.29 pthread_mutexattr_getprotocol F
+GLIBC_2.29 pthread_mutexattr_getpshared F
+GLIBC_2.29 pthread_mutexattr_getrobust F
+GLIBC_2.29 pthread_mutexattr_getrobust_np F
+GLIBC_2.29 pthread_mutexattr_gettype F
+GLIBC_2.29 pthread_mutexattr_init F
+GLIBC_2.29 pthread_mutexattr_setkind_np F
+GLIBC_2.29 pthread_mutexattr_setprioceiling F
+GLIBC_2.29 pthread_mutexattr_setprotocol F
+GLIBC_2.29 pthread_mutexattr_setpshared F
+GLIBC_2.29 pthread_mutexattr_setrobust F
+GLIBC_2.29 pthread_mutexattr_setrobust_np F
+GLIBC_2.29 pthread_mutexattr_settype F
+GLIBC_2.29 pthread_once F
+GLIBC_2.29 pthread_rwlock_destroy F
+GLIBC_2.29 pthread_rwlock_init F
+GLIBC_2.29 pthread_rwlock_rdlock F
+GLIBC_2.29 pthread_rwlock_timedrdlock F
+GLIBC_2.29 pthread_rwlock_timedwrlock F
+GLIBC_2.29 pthread_rwlock_tryrdlock F
+GLIBC_2.29 pthread_rwlock_trywrlock F
+GLIBC_2.29 pthread_rwlock_unlock F
+GLIBC_2.29 pthread_rwlock_wrlock F
+GLIBC_2.29 pthread_rwlockattr_destroy F
+GLIBC_2.29 pthread_rwlockattr_getkind_np F
+GLIBC_2.29 pthread_rwlockattr_getpshared F
+GLIBC_2.29 pthread_rwlockattr_init F
+GLIBC_2.29 pthread_rwlockattr_setkind_np F
+GLIBC_2.29 pthread_rwlockattr_setpshared F
+GLIBC_2.29 pthread_setaffinity_np F
+GLIBC_2.29 pthread_setattr_default_np F
+GLIBC_2.29 pthread_setcancelstate F
+GLIBC_2.29 pthread_setcanceltype F
+GLIBC_2.29 pthread_setconcurrency F
+GLIBC_2.29 pthread_setname_np F
+GLIBC_2.29 pthread_setschedparam F
+GLIBC_2.29 pthread_setschedprio F
+GLIBC_2.29 pthread_setspecific F
+GLIBC_2.29 pthread_sigmask F
+GLIBC_2.29 pthread_sigqueue F
+GLIBC_2.29 pthread_spin_destroy F
+GLIBC_2.29 pthread_spin_init F
+GLIBC_2.29 pthread_spin_lock F
+GLIBC_2.29 pthread_spin_trylock F
+GLIBC_2.29 pthread_spin_unlock F
+GLIBC_2.29 pthread_testcancel F
+GLIBC_2.29 pthread_timedjoin_np F
+GLIBC_2.29 pthread_tryjoin_np F
+GLIBC_2.29 pthread_yield F
+GLIBC_2.29 pwrite F
+GLIBC_2.29 pwrite64 F
+GLIBC_2.29 raise F
+GLIBC_2.29 read F
+GLIBC_2.29 recv F
+GLIBC_2.29 recvfrom F
+GLIBC_2.29 recvmsg F
+GLIBC_2.29 sem_close F
+GLIBC_2.29 sem_destroy F
+GLIBC_2.29 sem_getvalue F
+GLIBC_2.29 sem_init F
+GLIBC_2.29 sem_open F
+GLIBC_2.29 sem_post F
+GLIBC_2.29 sem_timedwait F
+GLIBC_2.29 sem_trywait F
+GLIBC_2.29 sem_unlink F
+GLIBC_2.29 sem_wait F
+GLIBC_2.29 send F
+GLIBC_2.29 sendmsg F
+GLIBC_2.29 sendto F
+GLIBC_2.29 sigaction F
+GLIBC_2.29 sigwait F
+GLIBC_2.29 tcdrain F
+GLIBC_2.29 thrd_create F
+GLIBC_2.29 thrd_detach F
+GLIBC_2.29 thrd_exit F
+GLIBC_2.29 thrd_join F
+GLIBC_2.29 tss_create F
+GLIBC_2.29 tss_delete F
+GLIBC_2.29 tss_get F
+GLIBC_2.29 tss_set F
+GLIBC_2.29 wait F
+GLIBC_2.29 waitpid F
+GLIBC_2.29 write F
diff --git a/sysdeps/unix/sysv/linux/csky/libresolv.abilist b/sysdeps/unix/sysv/linux/csky/libresolv.abilist
new file mode 100644
index 0000000..2830a7e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libresolv.abilist
@@ -0,0 +1,79 @@
+GLIBC_2.29 __b64_ntop F
+GLIBC_2.29 __b64_pton F
+GLIBC_2.29 __dn_comp F
+GLIBC_2.29 __dn_count_labels F
+GLIBC_2.29 __dn_expand F
+GLIBC_2.29 __dn_skipname F
+GLIBC_2.29 __fp_nquery F
+GLIBC_2.29 __fp_query F
+GLIBC_2.29 __fp_resstat F
+GLIBC_2.29 __hostalias F
+GLIBC_2.29 __loc_aton F
+GLIBC_2.29 __loc_ntoa F
+GLIBC_2.29 __p_cdname F
+GLIBC_2.29 __p_cdnname F
+GLIBC_2.29 __p_class F
+GLIBC_2.29 __p_class_syms D 0x54
+GLIBC_2.29 __p_fqname F
+GLIBC_2.29 __p_fqnname F
+GLIBC_2.29 __p_option F
+GLIBC_2.29 __p_query F
+GLIBC_2.29 __p_rcode F
+GLIBC_2.29 __p_time F
+GLIBC_2.29 __p_type F
+GLIBC_2.29 __p_type_syms D 0x228
+GLIBC_2.29 __putlong F
+GLIBC_2.29 __putshort F
+GLIBC_2.29 __res_close F
+GLIBC_2.29 __res_dnok F
+GLIBC_2.29 __res_hnok F
+GLIBC_2.29 __res_hostalias F
+GLIBC_2.29 __res_isourserver F
+GLIBC_2.29 __res_mailok F
+GLIBC_2.29 __res_mkquery F
+GLIBC_2.29 __res_nameinquery F
+GLIBC_2.29 __res_nmkquery F
+GLIBC_2.29 __res_nquery F
+GLIBC_2.29 __res_nquerydomain F
+GLIBC_2.29 __res_nsearch F
+GLIBC_2.29 __res_nsend F
+GLIBC_2.29 __res_ownok F
+GLIBC_2.29 __res_queriesmatch F
+GLIBC_2.29 __res_query F
+GLIBC_2.29 __res_querydomain F
+GLIBC_2.29 __res_search F
+GLIBC_2.29 __res_send F
+GLIBC_2.29 __sym_ntop F
+GLIBC_2.29 __sym_ntos F
+GLIBC_2.29 __sym_ston F
+GLIBC_2.29 _getlong F
+GLIBC_2.29 _getshort F
+GLIBC_2.29 inet_net_ntop F
+GLIBC_2.29 inet_net_pton F
+GLIBC_2.29 inet_neta F
+GLIBC_2.29 ns_datetosecs F
+GLIBC_2.29 ns_format_ttl F
+GLIBC_2.29 ns_get16 F
+GLIBC_2.29 ns_get32 F
+GLIBC_2.29 ns_initparse F
+GLIBC_2.29 ns_makecanon F
+GLIBC_2.29 ns_msg_getflag F
+GLIBC_2.29 ns_name_compress F
+GLIBC_2.29 ns_name_ntol F
+GLIBC_2.29 ns_name_ntop F
+GLIBC_2.29 ns_name_pack F
+GLIBC_2.29 ns_name_pton F
+GLIBC_2.29 ns_name_rollback F
+GLIBC_2.29 ns_name_skip F
+GLIBC_2.29 ns_name_uncompress F
+GLIBC_2.29 ns_name_unpack F
+GLIBC_2.29 ns_parse_ttl F
+GLIBC_2.29 ns_parserr F
+GLIBC_2.29 ns_put16 F
+GLIBC_2.29 ns_put32 F
+GLIBC_2.29 ns_samedomain F
+GLIBC_2.29 ns_samename F
+GLIBC_2.29 ns_skiprr F
+GLIBC_2.29 ns_sprintrr F
+GLIBC_2.29 ns_sprintrrf F
+GLIBC_2.29 ns_subdomain F
diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist b/sysdeps/unix/sysv/linux/csky/librt.abilist
new file mode 100644
index 0000000..c6690ef
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/librt.abilist
@@ -0,0 +1,35 @@
+GLIBC_2.29 __mq_open_2 F
+GLIBC_2.29 aio_cancel F
+GLIBC_2.29 aio_cancel64 F
+GLIBC_2.29 aio_error F
+GLIBC_2.29 aio_error64 F
+GLIBC_2.29 aio_fsync F
+GLIBC_2.29 aio_fsync64 F
+GLIBC_2.29 aio_init F
+GLIBC_2.29 aio_read F
+GLIBC_2.29 aio_read64 F
+GLIBC_2.29 aio_return F
+GLIBC_2.29 aio_return64 F
+GLIBC_2.29 aio_suspend F
+GLIBC_2.29 aio_suspend64 F
+GLIBC_2.29 aio_write F
+GLIBC_2.29 aio_write64 F
+GLIBC_2.29 lio_listio F
+GLIBC_2.29 lio_listio64 F
+GLIBC_2.29 mq_close F
+GLIBC_2.29 mq_getattr F
+GLIBC_2.29 mq_notify F
+GLIBC_2.29 mq_open F
+GLIBC_2.29 mq_receive F
+GLIBC_2.29 mq_send F
+GLIBC_2.29 mq_setattr F
+GLIBC_2.29 mq_timedreceive F
+GLIBC_2.29 mq_timedsend F
+GLIBC_2.29 mq_unlink F
+GLIBC_2.29 shm_open F
+GLIBC_2.29 shm_unlink F
+GLIBC_2.29 timer_create F
+GLIBC_2.29 timer_delete F
+GLIBC_2.29 timer_getoverrun F
+GLIBC_2.29 timer_gettime F
+GLIBC_2.29 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/csky/libthread_db.abilist b/sysdeps/unix/sysv/linux/csky/libthread_db.abilist
new file mode 100644
index 0000000..37e9bac
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libthread_db.abilist
@@ -0,0 +1,40 @@
+GLIBC_2.29 td_init F
+GLIBC_2.29 td_log F
+GLIBC_2.29 td_symbol_list F
+GLIBC_2.29 td_ta_clear_event F
+GLIBC_2.29 td_ta_delete F
+GLIBC_2.29 td_ta_enable_stats F
+GLIBC_2.29 td_ta_event_addr F
+GLIBC_2.29 td_ta_event_getmsg F
+GLIBC_2.29 td_ta_get_nthreads F
+GLIBC_2.29 td_ta_get_ph F
+GLIBC_2.29 td_ta_get_stats F
+GLIBC_2.29 td_ta_map_id2thr F
+GLIBC_2.29 td_ta_map_lwp2thr F
+GLIBC_2.29 td_ta_new F
+GLIBC_2.29 td_ta_reset_stats F
+GLIBC_2.29 td_ta_set_event F
+GLIBC_2.29 td_ta_setconcurrency F
+GLIBC_2.29 td_ta_thr_iter F
+GLIBC_2.29 td_ta_tsd_iter F
+GLIBC_2.29 td_thr_clear_event F
+GLIBC_2.29 td_thr_dbresume F
+GLIBC_2.29 td_thr_dbsuspend F
+GLIBC_2.29 td_thr_event_enable F
+GLIBC_2.29 td_thr_event_getmsg F
+GLIBC_2.29 td_thr_get_info F
+GLIBC_2.29 td_thr_getfpregs F
+GLIBC_2.29 td_thr_getgregs F
+GLIBC_2.29 td_thr_getxregs F
+GLIBC_2.29 td_thr_getxregsize F
+GLIBC_2.29 td_thr_set_event F
+GLIBC_2.29 td_thr_setfpregs F
+GLIBC_2.29 td_thr_setgregs F
+GLIBC_2.29 td_thr_setprio F
+GLIBC_2.29 td_thr_setsigpending F
+GLIBC_2.29 td_thr_setxregs F
+GLIBC_2.29 td_thr_sigsetmask F
+GLIBC_2.29 td_thr_tls_get_addr F
+GLIBC_2.29 td_thr_tlsbase F
+GLIBC_2.29 td_thr_tsd F
+GLIBC_2.29 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/csky/libutil.abilist b/sysdeps/unix/sysv/linux/csky/libutil.abilist
new file mode 100644
index 0000000..cbd1199
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/libutil.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.29 forkpty F
+GLIBC_2.29 login F
+GLIBC_2.29 login_tty F
+GLIBC_2.29 logout F
+GLIBC_2.29 logwtmp F
+GLIBC_2.29 openpty F
-- 
2.7.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
@ 2018-09-12  4:16     ` H.J. Lu
  2018-09-12  7:07       ` Mao Han
  2018-09-17 21:46     ` Joseph Myers
  1 sibling, 1 reply; 57+ messages in thread
From: H.J. Lu @ 2018-09-12  4:16 UTC (permalink / raw)
  To: Mao Han; +Cc: GNU C Library, c-sky_gcc_upstream, gnu-csky

On Tue, Sep 11, 2018 at 7:56 PM, Mao Han <han_mao@c-sky.com> wrote:
> Codes in this patch contains lots of C-SKY ABI related code.  They are
> written accroding to the registers assgnments, relocations, assemblly
> described in C-SKY CPU ABI Standards and C-SKY architercure user guide.
> Available from: https://github.com/c-sky/csky-doc
> This does not contain any linux related code.
>
>         * sysdeps/csky/abiv2/__longjmp.S: New file.
>         * sysdeps/csky/abiv2/crti.S: Likewise.
>         * sysdeps/csky/abiv2/crtn.S: Likewise.
>         * sysdeps/csky/abiv2/csky-mcount.S: Likewise.
>         * sysdeps/csky/abiv2/dl-trampoline.S: Likewise.
>         * sysdeps/csky/abiv2/memcmp.S: Likewise.
>         * sysdeps/csky/abiv2/memcpy.S: Likewise.
>         * sysdeps/csky/abiv2/memmove.S: Likewise.
>         * sysdeps/csky/abiv2/memset.S: Likewise.
>         * sysdeps/csky/abiv2/setjmp.S: Likewise.
>         * sysdeps/csky/abiv2/start.S: Likewise.
>         * sysdeps/csky/abiv2/strcmp.S: Likewise.
>         * sysdeps/csky/abiv2/strcpy.S: Likewise.
>         * sysdeps/csky/abiv2/strlen.S: Likewise.
>         * sysdeps/csky/abort-instr.h: Likewise.
>         * sysdeps/csky/bits/endian.h: Likewise.
>         * sysdeps/csky/bits/link.h: Likewise.
>         * sysdeps/csky/bits/setjmp.h: Likewise.
>         * sysdeps/csky/bsd-_setjmp.S: Likewise.
>         * sysdeps/csky/bsd-setjmp.S: Likewise.
>         * sysdeps/csky/gccframe.h: Likewise.
>         * sysdeps/csky/jmpbuf-unwind.h: Likewise.
>         * sysdeps/csky/machine-gmon.h: Likewise.
>         * sysdeps/csky/memusage.h: Likewise.
>         * sysdeps/csky/stackinfo.h: Likewise.
>         * sysdeps/csky/sysdep.h: Likewise.
> ---
>  sysdeps/csky/abiv2/__longjmp.S     |  61 ++++++++++
>  sysdeps/csky/abiv2/crti.S          |  99 ++++++++++++++++
>  sysdeps/csky/abiv2/crtn.S          |  50 +++++++++
>  sysdeps/csky/abiv2/csky-mcount.S   |  72 ++++++++++++
>  sysdeps/csky/abiv2/dl-trampoline.S |  50 +++++++++
>  sysdeps/csky/abiv2/memcmp.S        | 142 +++++++++++++++++++++++
>  sysdeps/csky/abiv2/memcpy.S        | 224 +++++++++++++++++++++++++++++++++++++
>  sysdeps/csky/abiv2/memmove.S       |   1 +
>  sysdeps/csky/abiv2/memset.S        |  98 ++++++++++++++++
>  sysdeps/csky/abiv2/setjmp.S        |  77 +++++++++++++
>  sysdeps/csky/abiv2/start.S         | 109 ++++++++++++++++++
>  sysdeps/csky/abiv2/strcmp.S        | 156 ++++++++++++++++++++++++++
>  sysdeps/csky/abiv2/strcpy.S        | 127 +++++++++++++++++++++
>  sysdeps/csky/abiv2/strlen.S        | 102 +++++++++++++++++
>  sysdeps/csky/abort-instr.h         |   2 +
>  sysdeps/csky/bits/endian.h         |   6 +
>  sysdeps/csky/bits/link.h           |  55 +++++++++
>  sysdeps/csky/bits/setjmp.h         |  34 ++++++
>  sysdeps/csky/bsd-_setjmp.S         |   1 +
>  sysdeps/csky/bsd-setjmp.S          |   1 +
>  sysdeps/csky/gccframe.h            |  21 ++++
>  sysdeps/csky/jmpbuf-unwind.h       |  48 ++++++++
>  sysdeps/csky/machine-gmon.h        |  32 ++++++
>  sysdeps/csky/memusage.h            |  21 ++++
>  sysdeps/csky/stackinfo.h           |  29 +++++
>  sysdeps/csky/sysdep.h              |  88 +++++++++++++++
>  26 files changed, 1706 insertions(+)
>  create mode 100644 sysdeps/csky/abiv2/__longjmp.S
>  create mode 100644 sysdeps/csky/abiv2/crti.S
>  create mode 100644 sysdeps/csky/abiv2/crtn.S
>  create mode 100644 sysdeps/csky/abiv2/csky-mcount.S
>  create mode 100644 sysdeps/csky/abiv2/dl-trampoline.S
>  create mode 100644 sysdeps/csky/abiv2/memcmp.S
>  create mode 100644 sysdeps/csky/abiv2/memcpy.S
>  create mode 100644 sysdeps/csky/abiv2/memmove.S
>  create mode 100644 sysdeps/csky/abiv2/memset.S
>  create mode 100644 sysdeps/csky/abiv2/setjmp.S
>  create mode 100644 sysdeps/csky/abiv2/start.S
>  create mode 100644 sysdeps/csky/abiv2/strcmp.S
>  create mode 100644 sysdeps/csky/abiv2/strcpy.S
>  create mode 100644 sysdeps/csky/abiv2/strlen.S
>  create mode 100644 sysdeps/csky/abort-instr.h
>  create mode 100644 sysdeps/csky/bits/endian.h
>  create mode 100644 sysdeps/csky/bits/link.h
>  create mode 100644 sysdeps/csky/bits/setjmp.h
>  create mode 100644 sysdeps/csky/bsd-_setjmp.S
>  create mode 100644 sysdeps/csky/bsd-setjmp.S
>  create mode 100644 sysdeps/csky/gccframe.h
>  create mode 100644 sysdeps/csky/jmpbuf-unwind.h
>  create mode 100644 sysdeps/csky/machine-gmon.h
>  create mode 100644 sysdeps/csky/memusage.h
>  create mode 100644 sysdeps/csky/stackinfo.h
>  create mode 100644 sysdeps/csky/sysdep.h
>

> diff --git a/sysdeps/csky/abiv2/crti.S b/sysdeps/csky/abiv2/crti.S
> new file mode 100644
> index 0000000..4526a9e
> --- /dev/null
> +++ b/sysdeps/csky/abiv2/crti.S
> @@ -0,0 +1,99 @@
> +/* Special .init and .fini section support for C-SKY ABIV2.
> +   Copyright (C) 2018 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   In addition to the permissions in the GNU Lesser General Public
> +   License, the Free Software Foundation gives you unlimited
> +   permission to link the compiled version of this file with other
> +   programs, and to distribute those programs without any restriction
> +   coming from the use of this file. (The GNU Lesser General Public
> +   License restrictions do apply in other respects; for example, they
> +   cover modification of the file, and distribution when not linked
> +   into another program.)
> +
> +   Note that people who make modified versions of this file are not
> +   obligated to grant this special exception for their modified
> +   versions; it is their choice whether to do so. The GNU Lesser
> +   General Public License gives permission to release a modified
> +   version without this exception; this exception also makes it
> +   possible to release a modified version which carries forward this
> +   exception.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library.  If not, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +/* crti.S puts a function prologue at the beginning of the .init and
> +   .fini sections and defines global symbols for those addresses, so
> +   they can be called as functions.  The symbols _init and _fini are
> +   magic and cause the linker to emit DT_INIT and DT_FINI.  */
> +
> +#include <libc-symbols.h>
> +#include <sysdep.h>
> +
> +#ifndef PREINIT_FUNCTION
> +# define PREINIT_FUNCTION __gmon_start__
> +#endif
> +
> +#ifndef PREINIT_FUNCTION_WEAK
> +# define PREINIT_FUNCTION_WEAK 1
> +#endif
> +
> +#if PREINIT_FUNCTION_WEAK
> +       weak_extern (PREINIT_FUNCTION)
> +#else
> +       .hidden PREINIT_FUNCTION
> +#endif
> +
> +       .section .init,"ax",@progbits
> +       .align 4
> +       .globl _init
> +       .hidden _init

Does C-SKY really need _init and _fini?


-- 
H.J.

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12  3:05   ` [PATCH v4 07/13] C-SKY: ABI Lists Mao Han
@ 2018-09-12  6:51     ` Andreas Schwab
  2018-09-12  7:12       ` Mao Han
  2018-09-12 12:35       ` Joseph Myers
  0 siblings, 2 replies; 57+ messages in thread
From: Andreas Schwab @ 2018-09-12  6:51 UTC (permalink / raw)
  To: Mao Han; +Cc: libc-alpha, c-sky_gcc_upstream, gnu-csky

On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:

> 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.

This is useless since you cannot link against libnsl anyway (in the
default configuration).

With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
be built any more.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  4:16     ` H.J. Lu
@ 2018-09-12  7:07       ` Mao Han
  2018-09-12  8:23         ` Florian Weimer
  0 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-12  7:07 UTC (permalink / raw)
  To: H.J. Lu; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Tue, Sep 11, 2018 at 09:15:19PM -0700, H.J. Lu wrote:
> On Tue, Sep 11, 2018 at 7:56 PM, Mao Han <han_mao@c-sky.com> wrote:
> > Codes in this patch contains lots of C-SKY ABI related code.  They are
> > written accroding to the registers assgnments, relocations, assemblly
> > described in C-SKY CPU ABI Standards and C-SKY architercure user guide.
> >
> > diff --git a/sysdeps/csky/abiv2/crti.S b/sysdeps/csky/abiv2/crti.S
> > new file mode 100644
> > index 0000000..4526a9e
> > --- /dev/null
> > +++ b/sysdeps/csky/abiv2/crti.S
> > @@ -0,0 +1,99 @@
> > +/* Special .init and .fini section support for C-SKY ABIV2.
> > +   Copyright (C) 2018 Free Software Foundation, Inc.
> > +   This file is part of the GNU C Library.
> > +
> > +   The GNU C Library is free software; you can redistribute it and/or
> > +   modify it under the terms of the GNU Lesser General Public
> > +   License as published by the Free Software Foundation; either
> > +   version 2.1 of the License, or (at your option) any later version.
> > +
> > +   In addition to the permissions in the GNU Lesser General Public
> > +   License, the Free Software Foundation gives you unlimited
> > +   permission to link the compiled version of this file with other
> > +   programs, and to distribute those programs without any restriction
> > +   coming from the use of this file. (The GNU Lesser General Public
> > +   License restrictions do apply in other respects; for example, they
> > +   cover modification of the file, and distribution when not linked
> > +   into another program.)
> > +
> > +   Note that people who make modified versions of this file are not
> > +   obligated to grant this special exception for their modified
> > +   versions; it is their choice whether to do so. The GNU Lesser
> > +   General Public License gives permission to release a modified
> > +   version without this exception; this exception also makes it
> > +   possible to release a modified version which carries forward this
> > +   exception.
> > +
> > +   The GNU C Library is distributed in the hope that it will be useful,
> > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > +   Lesser General Public License for more details.
> > +
> > +   You should have received a copy of the GNU Lesser General Public
> > +   License along with the GNU C Library.  If not, see
> > +   <http://www.gnu.org/licenses/>.  */
> > +
> > +/* crti.S puts a function prologue at the beginning of the .init and
> > +   .fini sections and defines global symbols for those addresses, so
> > +   they can be called as functions.  The symbols _init and _fini are
> > +   magic and cause the linker to emit DT_INIT and DT_FINI.  */
> > +
> > +#include <libc-symbols.h>
> > +#include <sysdep.h>
> > +
> > +#ifndef PREINIT_FUNCTION
> > +# define PREINIT_FUNCTION __gmon_start__
> > +#endif
> > +
> > +#ifndef PREINIT_FUNCTION_WEAK
> > +# define PREINIT_FUNCTION_WEAK 1
> > +#endif
> > +
> > +#if PREINIT_FUNCTION_WEAK
> > +       weak_extern (PREINIT_FUNCTION)
> > +#else
> > +       .hidden PREINIT_FUNCTION
> > +#endif
> > +
> > +       .section .init,"ax",@progbits
> > +       .align 4
> > +       .globl _init
> > +       .hidden _init
> 
> Does C-SKY really need _init and _fini?
> 
> 
> -- 
> H.J.

It seems used to call some pre-init function for libc, register transactional
memory clone tables and invoke global constructors on C-SKY. Althrough I 
haven't found any constructors call by _init, I just tend to have _init and
_fini as most other arch have these.

Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12  6:51     ` Andreas Schwab
@ 2018-09-12  7:12       ` Mao Han
  2018-09-12 12:35       ` Joseph Myers
  1 sibling, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  7:12 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, Sep 12, 2018 at 08:51:07AM +0200, Andreas Schwab wrote:
> On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:
> 
> > 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
> 
> This is useless since you cannot link against libnsl anyway (in the
> default configuration).
> 
> With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
> be built any more.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

OK. I will remove this file.

Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  7:07       ` Mao Han
@ 2018-09-12  8:23         ` Florian Weimer
  2018-09-12  9:06           ` Mao Han
  2018-09-29  1:46           ` Palmer Dabbelt
  0 siblings, 2 replies; 57+ messages in thread
From: Florian Weimer @ 2018-09-12  8:23 UTC (permalink / raw)
  To: Mao Han, H.J. Lu; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On 09/12/2018 09:07 AM, Mao Han wrote:
> It seems used to call some pre-init function for libc, register transactional
> memory clone tables and invoke global constructors on C-SKY. Althrough I
> haven't found any constructors call by _init, I just tend to have _init and
> _fini as most other arch have these.

The expectation is that for new glibc ports, GCC is tweaked to generate 
the array variant of these constructs exclusively, like RISC-V did. 
Then you won't need the function variant.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  8:23         ` Florian Weimer
@ 2018-09-12  9:06           ` Mao Han
  2018-09-29  1:46           ` Palmer Dabbelt
  1 sibling, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-12  9:06 UTC (permalink / raw)
  To: Florian Weimer; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, Sep 12, 2018 at 10:23:29AM +0200, Florian Weimer wrote:
> On 09/12/2018 09:07 AM, Mao Han wrote:
> >It seems used to call some pre-init function for libc, register transactional
> >memory clone tables and invoke global constructors on C-SKY. Althrough I
> >haven't found any constructors call by _init, I just tend to have _init and
> >_fini as most other arch have these.
> 
> The expectation is that for new glibc ports, GCC is tweaked to generate the
> array variant of these constructs exclusively, like RISC-V did. Then you
> won't need the function variant.
> 
> Thanks,
> Florian

init_array seems work fine on C-SKY. I'll run the tests again to see whether
there is any new problems.

Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-12  2:56 [PATCH v4 00/13] port C-SKY to glibc Mao Han
       [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
  2018-09-12  3:05 ` [PATCH 1/1] Update config.guess and config.sub to current versions Mao Han
@ 2018-09-12 12:31 ` Joseph Myers
  2018-09-13  8:14   ` Mao Han
  2 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-12 12:31 UTC (permalink / raw)
  To: Mao Han; +Cc: libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Mao Han wrote:

> 38245425a9add7bd22f8732219e0085432f223b6 (6 sep). Two abi combinations
> are supported with this patch: C-SKY ABIV2 with (soft float & little endian,
> hard float & little endian). CK807(ef), CK810(ef), CK860 are the

Could you please clarify whether those are the same ABI (compatible for 
function calling, structure layout for types from glibc headers, etc.) or 
different ABIs?

If they are different ABIs, they should have different dynamic linker 
names (of course you need to make the GCC port reflect the dynamic linker 
name used for each ABI), and your bits/fenv.h should disable most of its 
contents for soft float, like e.g. MIPS does (define only __FE_UNDEFINED 
and FE_TONEAREST as rounding modes in that case, define FE_ALL_EXCEPT to 0 
and no other exception macros, do not define FE_NOMASK_ENV).  Then you 
shouldn't need math-tests-exceptions.h and math-tests-rounding.h in the 
nofpu directory because things will be handled automatically when 
bits/fenv.h avoids defining unsupported things.

If they are the same ABI, I don't see any use for the CSKY_HARD_FLOAT 
macro defined in preconfigure; nothing seems to test it, so it's only 
relevant if shlib-versions is testing it (i.e. if they are different ABIs 
with different dynamic linker names).

Does C-SKY hard float support exception traps or not?  math-tests-trap.h 
has a comment saying not.  But you have an implementation of 
feenableexcept that implies it does support exception traps.

* If exception traps are never supported, everything related to them 
(including the definition of FE_NOMASK_ENV) should be removed; the default 
feenableexcept and fedisableexcept and fegetexcept implementations should 
suffice.

* If exception traps are always supported, your math-tests-trap.h is wrong 
and should be removed.

* If they are conditionally supported, like on Arm and AArch64, your 
math-tests-trap.h is appropriate with a different comment explaining the 
conditional support - but various fenv.h functions like feenableexcept 
need to check for the support and give errors if asked to enable 
exception traps they are unable to enable (this includes fesetenv and 
feupdateenv passed FE_NOMASK_ENV - see Arm and AArch64 for examples).

> Several patches will be post to GCC and Binutils to fix some testcase fail
> later this month, while the follow results have these patches applied.

Note that glibc ports can't go in while they depend on such non-upstream 
patches for good results (see the ARC port discussion).  You can send a 
list of all the patches required to get the given test results, but 
they'll need to be upstream (as will the Linux kernel port) before the 
port can go into glibc.

> 5. The following cases fail due to gcc optimize change the sequence of
>    -a * b to -(a * b) and got 1ulps error.
>    math/test-double-tgamma
>    math/test-float-tgamma
>    math/test-float32-tgamma
>    math/test-float32x-tgamma
>    math/test-float64-tgamma
>    math/test-ldouble-tgamma

So that needs a GCC bug fix (just like when the Arm and AArch64 ports of 
GCC used to have such a bug).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12  6:51     ` Andreas Schwab
  2018-09-12  7:12       ` Mao Han
@ 2018-09-12 12:35       ` Joseph Myers
  2018-09-12 13:46         ` Andreas Schwab
  2018-09-13  8:23         ` Mao Han
  1 sibling, 2 replies; 57+ messages in thread
From: Joseph Myers @ 2018-09-12 12:35 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Mao Han, libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Andreas Schwab wrote:

> On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:
> 
> > 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
> 
> This is useless since you cannot link against libnsl anyway (in the
> default configuration).
> 
> With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
> be built any more.

As far as I can see that patch isn't in glibc and hasn't been pinged.  A 
new port needs to have clean ABI test results with the glibc version it 
goes into; the point at which libnsl.abilist should be removed from the 
port is the point at which such a change to prevent building libnsl goes 
in (if it does go in without there having been a release with the new port 
first).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-12  2:57   ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
@ 2018-09-12 13:40     ` Arnd Bergmann
  2018-09-12 14:21       ` Joseph Myers
  2018-09-13  8:17       ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
  0 siblings, 2 replies; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-12 13:40 UTC (permalink / raw)
  To: Mao Han; +Cc: GNU C Library, c-sky_gcc_upstream, gnu-csky

On Wed, Sep 12, 2018 at 4:58 AM Mao Han <han_mao@c-sky.com> wrote:
>
> Linux-specific code that is required for maintaining ABI compatibility.
> This doesn't contain the actual system call interface.
>
>         * sysdeps/unix/sysv/linux/csky/Versions: Likewise.
>         * sysdeps/unix/sysv/linux/csky/bits/mman.h: New file.
>         * sysdeps/unix/sysv/linux/csky/bits/shm.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/c++-types.data: Likewise.
>         * sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym: Likewise.
>         * sysdeps/unix/sysv/linux/csky/ipc_priv.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/kernel-features.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/localplt.data: Likewise.
>         * sysdeps/unix/sysv/linux/csky/makecontext.c: Likewise.
>         * sysdeps/unix/sysv/linux/csky/profil-counter.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/register-dump.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/shlib-versions: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sigcontextinfo.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sys/cachectl.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sys/procfs.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sys/user.h: Likewise.
>         * sysdeps/unix/sysv/linux/csky/sysdep.h: Likewise.
> ---
>  sysdeps/unix/sysv/linux/csky/Versions             |   5 +
>  sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym |  32 ++
>  sysdeps/unix/sysv/linux/csky/bits/mman.h          |  44 ++
>  sysdeps/unix/sysv/linux/csky/bits/shm.h           | 104 +++++
>  sysdeps/unix/sysv/linux/csky/c++-types.data       |  67 +++
>  sysdeps/unix/sysv/linux/csky/ipc_priv.h           |  21 +
>  sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h     |   6 +
>  sysdeps/unix/sysv/linux/csky/kernel-features.h    |  23 +
>  sysdeps/unix/sysv/linux/csky/localplt.data        |  19 +
>  sysdeps/unix/sysv/linux/csky/makecontext.c        |  74 +++
>  sysdeps/unix/sysv/linux/csky/profil-counter.h     |  31 ++
>  sysdeps/unix/sysv/linux/csky/register-dump.h      | 193 ++++++++
>  sysdeps/unix/sysv/linux/csky/shlib-versions       |   7 +
>  sysdeps/unix/sysv/linux/csky/sigcontextinfo.h     |  32 ++
>  sysdeps/unix/sysv/linux/csky/sys/cachectl.h       |  38 ++
>  sysdeps/unix/sysv/linux/csky/sys/procfs.h         | 123 +++++
>  sysdeps/unix/sysv/linux/csky/sys/ucontext.h       |  89 ++++
>  sysdeps/unix/sysv/linux/csky/sys/user.h           |  60 +++
>  sysdeps/unix/sysv/linux/csky/sysdep.h             | 534 ++++++++++++++++++++++

I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
Since the kernel port just uses the generic interfaces that all other
architectures used in the past decade, shouldn't the glibc defaults
match be enough here?

       Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12 12:35       ` Joseph Myers
@ 2018-09-12 13:46         ` Andreas Schwab
  2018-09-12 15:19           ` Joseph Myers
  2018-09-13  8:23         ` Mao Han
  1 sibling, 1 reply; 57+ messages in thread
From: Andreas Schwab @ 2018-09-12 13:46 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, libc-alpha, c-sky_gcc_upstream, gnu-csky

On Sep 12 2018, Joseph Myers <joseph@codesourcery.com> wrote:

> On Wed, 12 Sep 2018, Andreas Schwab wrote:
>
>> On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:
>> 
>> > 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
>> 
>> This is useless since you cannot link against libnsl anyway (in the
>> default configuration).
>> 
>> With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
>> be built any more.
>
> As far as I can see that patch isn't in glibc

You can help changing that.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-12 13:40     ` Arnd Bergmann
@ 2018-09-12 14:21       ` Joseph Myers
  2018-09-12 15:34         ` Arnd Bergmann
  2018-09-13  8:17       ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
  1 sibling, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-12 14:21 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, GNU C Library, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Arnd Bergmann wrote:

> I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
> Since the kernel port just uses the generic interfaces that all other
> architectures used in the past decade, shouldn't the glibc defaults
> match be enough here?

There's no generic bits/mman.h for systems using the Linux kernel; a lot 
is shared through bits/mman-linux.h and bits/mman-shared.h, but all 
architectures need their own bits/mman.h as well.

In practice there's no generic sys/procfs.h either 
(sysdeps/unix/sysv/linux/sys/procfs.h exists but all architectures 
override it - so if there's something in common between many architectures 
such that they don't need their own files, it's quite likely that file 
does not reflect whatever is common).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12 13:46         ` Andreas Schwab
@ 2018-09-12 15:19           ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-09-12 15:19 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Mao Han, libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Andreas Schwab wrote:

> On Sep 12 2018, Joseph Myers <joseph@codesourcery.com> wrote:
> 
> > On Wed, 12 Sep 2018, Andreas Schwab wrote:
> >
> >> On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:
> >> 
> >> > 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
> >> 
> >> This is useless since you cannot link against libnsl anyway (in the
> >> default configuration).
> >> 
> >> With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
> >> be built any more.
> >
> > As far as I can see that patch isn't in glibc
> 
> You can help changing that.

Well, an obvious question for that patch is how it interacts with 
--enable-obsolete-nsl.  --enable-obsolete-nsl has four documented effects: 
enabling being able to link against libnsl symbols and enabling the three 
NSS modules libnss_compat, libnss_nis and libnss_nisplus.  Does this patch 
prevent all those effects on platforms with new ABIs?  If so, the option 
should preferably give an error on such platforms.  But in any case, the 
documentation of --enable-obsolete-nsl (install.texi and INSTALL 
regeneration) needs to be clear if some or all of the semantics of that 
option are unavailable on some platforms.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-12 14:21       ` Joseph Myers
@ 2018-09-12 15:34         ` Arnd Bergmann
  2018-09-12 21:28           ` struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI) Florian Weimer
  0 siblings, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-12 15:34 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, GNU C Library, c-sky_gcc_upstream, gnu-csky

On Wed, Sep 12, 2018 at 5:18 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Wed, 12 Sep 2018, Arnd Bergmann wrote:
>
> > I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
> > Since the kernel port just uses the generic interfaces that all other
> > architectures used in the past decade, shouldn't the glibc defaults
> > match be enough here?
>
> There's no generic bits/mman.h for systems using the Linux kernel; a lot
> is shared through bits/mman-linux.h and bits/mman-shared.h, but all
> architectures need their own bits/mman.h as well.

Ok. I checked a couple that should be using the generic kernel
implementation and found that at least nios2, aarch64 and riscv
differ only in comments, so this is probably something that can
be improved by creating a common version.

> In practice there's no generic sys/procfs.h either
> (sysdeps/unix/sysv/linux/sys/procfs.h exists but all architectures
> override it - so if there's something in common between many architectures
> such that they don't need their own files, it's quite likely that file
> does not reflect whatever is common).

This one seems worse: looking at the same architectures above,
I find that at least nios2 is wrong: pr_uid/pr_gid are declared as
'unsigned short' here, compat to a signed 'long int' for riscv and
'unsigned int' for aarch64.

In the kernel, these are all 'unsigned int' except on some older 32-bit
architectures (arm, m68k, s390-32, sh, sparc32, sparc64, and
x86-32).

Aside from that, they are basically identical, except for the
regset array types that match the number of registers.

Speaking of this file, I think we still need a solution for elf_prstatus
containing a 'timeval' after time_t becomes 64-bit wide. I actually
have a patch to change the kernel header file declaring the
same structure, but I had not realized that glibc contains another
copy.

https://sourceware.org/glibc/wiki/Y2038ProofnessDesign mentions
that type, but not what to do about it. What I did in the kernel
was to change the type of pr_utime/pr_stime/pr_cutime/pr_cstime
to something that keeps using 'long' fields. Given that we can't
change the file format in an incompatible way, and that 32-bit
is sufficient here, that seemed like the most appropriate solution.

        Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI)
  2018-09-12 15:34         ` Arnd Bergmann
@ 2018-09-12 21:28           ` Florian Weimer
  2018-09-13 10:48             ` Arnd Bergmann
  0 siblings, 1 reply; 57+ messages in thread
From: Florian Weimer @ 2018-09-12 21:28 UTC (permalink / raw)
  To: Arnd Bergmann, Joseph Myers
  Cc: Mao Han, GNU C Library, c-sky_gcc_upstream, gnu-csky

On 09/12/2018 05:34 PM, Arnd Bergmann wrote:
> Speaking of this file, I think we still need a solution for elf_prstatus
> containing a 'timeval' after time_t becomes 64-bit wide. I actually
> have a patch to change the kernel header file declaring the
> same structure, but I had not realized that glibc contains another
> copy.
> 
> https://sourceware.org/glibc/wiki/Y2038ProofnessDesign  mentions
> that type, but not what to do about it. What I did in the kernel
> was to change the type of pr_utime/pr_stime/pr_cutime/pr_cstime
> to something that keeps using 'long' fields. Given that we can't
> change the file format in an incompatible way, and that 32-bit
> is sufficient here, that seemed like the most appropriate solution.

Keeping 32 bits there looks reasonable.  I thought we had a port where 
time_t isn't long, but that doesn't seem to be the case.

Ah, I think it's actually s390, where suseconds_t is int, not long.

Presumably that will need a special case so that existing format 
specifiers etc. are not disturbed unnecessarily.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-12 12:31 ` [PATCH v4 00/13] port C-SKY to glibc Joseph Myers
@ 2018-09-13  8:14   ` Mao Han
  2018-09-13 12:36     ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-13  8:14 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, Sep 12, 2018 at 12:31:24PM +0000, Joseph Myers wrote:
> On Wed, 12 Sep 2018, Mao Han wrote:
> 
> > 38245425a9add7bd22f8732219e0085432f223b6 (6 sep). Two abi combinations
> > are supported with this patch: C-SKY ABIV2 with (soft float & little endian,
> > hard float & little endian). CK807(ef), CK810(ef), CK860 are the
> 
> Could you please clarify whether those are the same ABI (compatible for 
> function calling, structure layout for types from glibc headers, etc.) or 
> different ABIs?
>
> If they are different ABIs, they should have different dynamic linker 
> names (of course you need to make the GCC port reflect the dynamic linker 
> name used for each ABI), and your bits/fenv.h should disable most of its 
> contents for soft float, like e.g. MIPS does (define only __FE_UNDEFINED 
> and FE_TONEAREST as rounding modes in that case, define FE_ALL_EXCEPT to 0 
> and no other exception macros, do not define FE_NOMASK_ENV).  Then you 
> shouldn't need math-tests-exceptions.h and math-tests-rounding.h in the 
> nofpu directory because things will be handled automatically when 
> bits/fenv.h avoids defining unsupported things.
> 
> If they are the same ABI, I don't see any use for the CSKY_HARD_FLOAT 
> macro defined in preconfigure; nothing seems to test it, so it's only 
> relevant if shlib-versions is testing it (i.e. if they are different ABIs 
> with different dynamic linker names).

Hard float will use to vr to pass arguments, the ABI is imcompatible if the
function has any float-point arguments. I use the same dynamic linker names
because there is no float in ldso, the same ldso can be used on system with
soft float/hard float. Seems I still need to use different dynamic linker
names even if they are compatible, and distinct soft float/hard float in
bits/fenv.h to make glibc have correct definitions?
> 
> Does C-SKY hard float support exception traps or not?  math-tests-trap.h 
> has a comment saying not.  But you have an implementation of 
> feenableexcept that implies it does support exception traps.
> 
> * If exception traps are never supported, everything related to them 
> (including the definition of FE_NOMASK_ENV) should be removed; the default 
> feenableexcept and fedisableexcept and fegetexcept implementations should 
> suffice.
> 
> * If exception traps are always supported, your math-tests-trap.h is wrong 
> and should be removed.
> 
> * If they are conditionally supported, like on Arm and AArch64, your 
> math-tests-trap.h is appropriate with a different comment explaining the 
> conditional support - but various fenv.h functions like feenableexcept 
> need to check for the support and give errors if asked to enable 
> exception traps they are unable to enable (this includes fesetenv and 
> feupdateenv passed FE_NOMASK_ENV - see Arm and AArch64 for examples).
>

Exception traps is design to be conditionally supported, seems define to no
for compatibility. All the cpu with fpu have exception traps support at
present and I have no method to check whether hardware support that, so I
prefer to remove math-tests-trap.h.

> > Several patches will be post to GCC and Binutils to fix some testcase fail
> > later this month, while the follow results have these patches applied.
> 
> Note that glibc ports can't go in while they depend on such non-upstream 
> patches for good results (see the ARC port discussion).  You can send a 
> list of all the patches required to get the given test results, but 
> they'll need to be upstream (as will the Linux kernel port) before the 
> port can go into glibc.
>

I can understand the glibc patch and test-result should base on upstreamed
gcc/binutils/linux. The purpose for this submission is to make sure there
is no big issue in this patchset itself. Once other components are ready
I can test the patch again and resubmit it easily.
I'v got another issue while using build-many-glibcs.py. 
csky-linux-gnuabiv2-gcc can not recognise -profile during the make check
stage and stoped. but it can recognise --profile. Is this a problem will
block the c-sky glibc port goes in.
 
> > 5. The following cases fail due to gcc optimize change the sequence of
> >    -a * b to -(a * b) and got 1ulps error.
> >    math/test-double-tgamma
> >    math/test-float-tgamma
> >    math/test-float32-tgamma
> >    math/test-float32x-tgamma
> >    math/test-float64-tgamma
> >    math/test-ldouble-tgamma
> 
> So that needs a GCC bug fix (just like when the Arm and AArch64 ports of 
> GCC used to have such a bug).
>

We have this bug tracked internally. Also need to report a bug on gcc bugzilla? 

Thanks,
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-12 13:40     ` Arnd Bergmann
  2018-09-12 14:21       ` Joseph Myers
@ 2018-09-13  8:17       ` Mao Han
  2018-09-13  8:46         ` Arnd Bergmann
  1 sibling, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-13  8:17 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, Sep 12, 2018 at 03:40:35PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 12, 2018 at 4:58 AM Mao Han <han_mao@c-sky.com> wrote:
> >
> > Linux-specific code that is required for maintaining ABI compatibility.
> > This doesn't contain the actual system call interface.
> >  sysdeps/unix/sysv/linux/csky/sys/user.h           |  60 +++
> >  sysdeps/unix/sysv/linux/csky/sysdep.h             | 534 ++++++++++++++++++++++
> 
> I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
> Since the kernel port just uses the generic interfaces that all other
> architectures used in the past decade, shouldn't the glibc defaults
> match be enough here?
> 
>        Arnd

We have SHMLBA defined to __getpagesize () << 2 in the linux port not
__getpagesize () in the generic version in glibc. So an arch specific
bits/shm.h seems needed.
The generic sys/procfs.h in glibc define pr_uid/pr_gid as 'unsigned short',
we have __kernel_uid_t define as "unsigned int"  in linux/include/uapi/
asm-generic/posix_types.h. So I need an arch specific sys/procfs.h
with pr_uid/pr_gid define as "unsigned int".

Thanks
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 07/13] C-SKY: ABI Lists
  2018-09-12 12:35       ` Joseph Myers
  2018-09-12 13:46         ` Andreas Schwab
@ 2018-09-13  8:23         ` Mao Han
  1 sibling, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-13  8:23 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, Sep 12, 2018 at 12:35:34PM +0000, Joseph Myers wrote:
> On Wed, 12 Sep 2018, Andreas Schwab wrote:
> 
> > On Sep 12 2018, Mao Han <han_mao@c-sky.com> wrote:
> > 
> > > 	* sysdeps/unix/sysv/linux/csky/libnsl.abilist: Likewise.
> > 
> > This is useless since you cannot link against libnsl anyway (in the
> > default configuration).
> > 
> > With http://sourceware.org/ml/libc-alpha/2018-08/msg00261.html it won't
> > be built any more.
> 
> As far as I can see that patch isn't in glibc and hasn't been pinged.  A 
> new port needs to have clean ABI test results with the glibc version it 
> goes into; the point at which libnsl.abilist should be removed from the 
> port is the point at which such a change to prevent building libnsl goes 
> in (if it does go in without there having been a release with the new port 
> first).
>

Seems I shall keep libnsl.abilist unless this patch get in. 

Thanks,
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13  8:17       ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
@ 2018-09-13  8:46         ` Arnd Bergmann
  2018-09-13 15:32           ` [gnu-csky] " Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13  8:46 UTC (permalink / raw)
  To: Mao Han; +Cc: c-sky_gcc_upstream, gnu-csky, GNU C Library

On Thu, Sep 13, 2018 at 10:17 AM Mao Han <han_mao@c-sky.com> wrote:
>
> On Wed, Sep 12, 2018 at 03:40:35PM +0200, Arnd Bergmann wrote:
> > On Wed, Sep 12, 2018 at 4:58 AM Mao Han <han_mao@c-sky.com> wrote:
> > >
> > > Linux-specific code that is required for maintaining ABI compatibility.
> > > This doesn't contain the actual system call interface.
> > >  sysdeps/unix/sysv/linux/csky/sys/user.h           |  60 +++
> > >  sysdeps/unix/sysv/linux/csky/sysdep.h             | 534 ++++++++++++++++++++++
> >
> > I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
> > Since the kernel port just uses the generic interfaces that all other
> > architectures used in the past decade, shouldn't the glibc defaults
> > match be enough here?

>
> We have SHMLBA defined to __getpagesize () << 2 in the linux port not
> __getpagesize () in the generic version in glibc. So an arch specific
> bits/shm.h seems needed.

Right, that makes sense.You need that for aliasing virtually indexed
caches, correct?

In the kernel, I'd probably try to change the generic file to allow an
architecture specific override, but I don't know what
the policy for this is in glibc.

> The generic sys/procfs.h in glibc define pr_uid/pr_gid as 'unsigned short',
> we have __kernel_uid_t define as "unsigned int"  in linux/include/uapi/
> asm-generic/posix_types.h. So I need an arch specific sys/procfs.h
> with pr_uid/pr_gid define as "unsigned int".

This sounds like something that should be improved in glibc, by
changing the default to the common case, and letting the less
common ones override it.

Here is what I see in glibc:

sysdeps/unix/sysv/linux/aarch64/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/alpha/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/arm/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/hppa/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/ia64/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/m68k/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/microblaze/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/mips/sys/procfs.h:    long pr_uid;
sysdeps/unix/sysv/linux/nios2/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:    __uid_t pr_uid;  # __U32_TYPE
sysdeps/unix/sysv/linux/riscv/sys/procfs.h:    long int pr_uid;
sysdeps/unix/sysv/linux/s390/sys/procfs.h:    unsigned int pr_uid;  # s390-64
sysdeps/unix/sysv/linux/s390/sys/procfs.h:    unsigned short int
pr_uid; # s390-32
sysdeps/unix/sysv/linux/sh/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/sparc/sys/procfs.h:    unsigned int pr_uid;  # sparc64
sysdeps/unix/sysv/linux/sparc/sys/procfs.h:    unsigned short int
pr_uid; # sparc32
sysdeps/unix/sysv/linux/x86/sys/procfs.h:    unsigned short int pr_uid; # i386
sysdeps/unix/sysv/linux/x86/sys/procfs.h:    unsigned int pr_uid; # x86-64
sysdeps/unix/sysv/linux/sys/procfs.h:    unsigned short int pr_uid; #
everything else

and what we have in the kernel:

arch/arm/include/uapi/asm/posix_types.h:typedef unsigned short
 __kernel_uid_t;
arch/m68k/include/uapi/asm/posix_types.h:typedef unsigned short __kernel_uid_t;
arch/s390/include/uapi/asm/posix_types.h:typedef unsigned short
__kernel_uid_t; # s390-32
arch/s390/include/uapi/asm/posix_types.h:typedef unsigned int
__kernel_uid_t; # s390-64
arch/sh/include/uapi/asm/posix_types_32.h:typedef unsigned short
 __kernel_uid_t;
arch/sparc/include/uapi/asm/posix_types.h:typedef unsigned short
  __kernel_uid_t; # sparc32
arch/x86/include/uapi/asm/posix_types_32.h:typedef unsigned short
 __kernel_uid_t; # i386
include/uapi/asm-generic/posix_types.h:typedef unsigned int
__kernel_uid_t; # everything else

From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
the generic default would be wrong as well if picked up by anything else (but
nothing seems to use it).

        Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI)
  2018-09-12 21:28           ` struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI) Florian Weimer
@ 2018-09-13 10:48             ` Arnd Bergmann
  2018-09-13 10:56               ` struct elf_prstatus and Y2038 Florian Weimer
  0 siblings, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13 10:48 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Joseph Myers, Mao Han, GNU C Library, c-sky_gcc_upstream, gnu-csky

On Wed, Sep 12, 2018 at 11:28 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> On 09/12/2018 05:34 PM, Arnd Bergmann wrote:
> > Speaking of this file, I think we still need a solution for elf_prstatus
> > containing a 'timeval' after time_t becomes 64-bit wide. I actually
> > have a patch to change the kernel header file declaring the
> > same structure, but I had not realized that glibc contains another
> > copy.
> >
> > https://sourceware.org/glibc/wiki/Y2038ProofnessDesign  mentions
> > that type, but not what to do about it. What I did in the kernel
> > was to change the type of pr_utime/pr_stime/pr_cutime/pr_cstime
> > to something that keeps using 'long' fields. Given that we can't
> > change the file format in an incompatible way, and that 32-bit
> > is sufficient here, that seemed like the most appropriate solution.
>
> Keeping 32 bits there looks reasonable.  I thought we had a port where
> time_t isn't long, but that doesn't seem to be the case.

Ok. I'll change it to 'struct __kernel_old_timeval' in the kernel
headers then, keeping the existing definition we have for timeval.
I did that patch a while ago, but think I've never posted it
for inclusion so far.

The same thing also gets used in the implementation for
the wait4()/waitid() and getrusage() syscalls, which carry the same
data as the core file, as well as the various VDSO implementations
that we can't change over.

I'm still undecided on whether we want a version of waitid and
getrusage that takes a 64-bit timespec or 64-bit timeval
for consistency, or just let the libc deal with the conversion from
the 32-bit timeval here.

> Ah, I think it's actually s390, where suseconds_t is int, not long.

Odd: in the kernel, suseconds_t is long on s390, but int on
sparc and parisc. Were you thinking of sparc64 instead of s390
maybe? I would guess that parisc64 is actually wrong here, but
since there are not a lot of users on parisc and they tend to run
32-bit user space, it's plausible that this never got caught.

I totally missed the sparc/parisc oddity about suseconds_t
in the past, I'll have to modify my patch for that.

       Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: struct elf_prstatus and Y2038
  2018-09-13 10:48             ` Arnd Bergmann
@ 2018-09-13 10:56               ` Florian Weimer
  0 siblings, 0 replies; 57+ messages in thread
From: Florian Weimer @ 2018-09-13 10:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Joseph Myers, Mao Han, GNU C Library, c-sky_gcc_upstream, gnu-csky

On 09/13/2018 12:48 PM, Arnd Bergmann wrote:
>> Ah, I think it's actually s390, where suseconds_t is int, not long.

> Odd: in the kernel, suseconds_t is long on s390, but int on
> sparc and parisc. Were you thinking of sparc64 instead of s390
> maybe?

Correct; sparc it is.  I was off by a line.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-13  8:14   ` Mao Han
@ 2018-09-13 12:36     ` Joseph Myers
  2018-09-18  6:22       ` Mao Han
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 12:36 UTC (permalink / raw)
  To: Mao Han; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Thu, 13 Sep 2018, Mao Han wrote:

> Hard float will use to vr to pass arguments, the ABI is imcompatible if the
> function has any float-point arguments. I use the same dynamic linker names
> because there is no float in ldso, the same ldso can be used on system with
> soft float/hard float. Seems I still need to use different dynamic linker
> names even if they are compatible, and distinct soft float/hard float in
> bits/fenv.h to make glibc have correct definitions?

A different dynamic linker name should be used because the ABI to libc and 
other glibc libraries is incompatible; if you have a different dynamic 
linker name for every ABI, that allows distributions using Debian-style 
multiarch directory arrangements to have libraries for both ABIs installed 
simultaneously.  Then, because you can't sensibly use soft-float binaries 
with hard-float libm, you should have the conditionals in bits/fenv.h (a 
single installed header should be set up to work for both ABIs) so that it 
doesn't define macros for unsupported features for soft float.

Once you have the conditionals in bits/fenv.h, the glibc testsuite will 
automatically disable tests for unsupported features for soft float, and 
internal calls to fenv.h functions within libm will automatically be 
optimized out for soft float.

It's not required, but it's a good idea to make binutils check for ABI 
incompatibilities at static link time, using GNU object attributes, which 
GCC should generate based on the ABI selected when compiling.  See how 
powerpc and mips handle this, for example.  That helps protect against 
user mistakes (linking .o files for different ABIs together) by making the 
linker complain about such mixing.

The Argument Passing section of the ABI document you provided doesn't seem 
to say anything about the different argument passing for hard float, so I 
think you need to update the document to cover that issue (likewise for 
return values if they are handled differently for hard float).  (And the 
table in 2.2.1.2 would presumably also need to say what's used for 
argument passing.)

> Exception traps is design to be conditionally supported, seems define to no
> for compatibility. All the cpu with fpu have exception traps support at
> present and I have no method to check whether hardware support that, so I
> prefer to remove math-tests-trap.h.

Yes, removing math-tests-trap.h until you are able to test on a platform 
without exception traps support seems reasonable.

On Arm / AArch64, the processor specification is that the trap-enable bits 
in the control register always read as 0 if the processor does not support 
exception traps.  Thus, the glibc implementations of relevant fenv.h 
functions read back the control register after writing it to see if the 
bits were set successfully.  If C-SKY follows a similar specification, 
that would provide a way for the fenv.h functions to test whether traps 
were enabled as requested and return an error if not.

> I'v got another issue while using build-many-glibcs.py. 
> csky-linux-gnuabiv2-gcc can not recognise -profile during the make check
> stage and stoped. but it can recognise --profile. Is this a problem will
> block the c-sky glibc port goes in.

We want the build-many-glibcs.py build to succeed.  You'll need to 
investigate why you see this problem.  The -profile option is defined in 
gcc/config/gnu-user.opt which all *-linux* targets should be using, so 
you'll need to look at why you get an error there.

> > > 5. The following cases fail due to gcc optimize change the sequence of
> > >    -a * b to -(a * b) and got 1ulps error.
> > >    math/test-double-tgamma
> > >    math/test-float-tgamma
> > >    math/test-float32-tgamma
> > >    math/test-float32x-tgamma
> > >    math/test-float64-tgamma
> > >    math/test-ldouble-tgamma
> > 
> > So that needs a GCC bug fix (just like when the Arm and AArch64 ports of 
> > GCC used to have such a bug).
> 
> We have this bug tracked internally. Also need to report a bug on gcc 
> bugzilla?

No, you just need to get a fix for the problem checked in upstream; no 
need to file a bug in GCC Bugzilla.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13  8:46         ` Arnd Bergmann
@ 2018-09-13 15:32           ` Joseph Myers
  2018-09-13 16:35             ` Joseph Myers
  2018-09-13 20:31             ` Arnd Bergmann
  0 siblings, 2 replies; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 15:32 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, 13 Sep 2018, Arnd Bergmann wrote:

> From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
> the generic default would be wrong as well if picked up by anything else (but
> nothing seems to use it).

A question for cleaning this up and possibly unifying versions of this 
header: for multi-ABI architectures, in userspace, what are these 
structures meant to refer to?  The structures that would be produced by a 
core dump for the current process, as opposed to those that might be 
produced by a core dump for another ABI?

I can confirm that the struct elf_prpsinfo defined in sys/procfs.h for 
MIPS n64 has size 0x90 whereas an n64 core dump has data size 0x88 for 
NT_PRPSINFO, indicating the pr_uid / pr_gid types are indeed wrong.  But 
I'm concerned here about n32 and about other fields in the structure.  
The code (dating back to the original addition of support for 64-bit MIPS 
ABIs to glibc in 2003) uses type unsigned long long int for pr_flag for 
n32.  But if I core dump an n32 process, I get 0x80 for the size of 
NT_PRPSINFO (while the userspace structure has size 0x88).  And similarly 
there are n32 conditionals in struct elf_prstatus - the core dump has size 
0x1b8 for NT_PRSTATUS but the userspace structure has size 0x1c0.  If the 
structure is meant to correspond to the current ABI, that suggests those 
n32 conditionals are wrong (the conditional on the definition of 
elf_greg_t, however, is correct, as n32 does use 64-bit registers).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 15:32           ` [gnu-csky] " Joseph Myers
@ 2018-09-13 16:35             ` Joseph Myers
  2018-09-13 20:47               ` Arnd Bergmann
  2018-09-13 20:31             ` Arnd Bergmann
  1 sibling, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 16:35 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, 13 Sep 2018, Joseph Myers wrote:

> On Thu, 13 Sep 2018, Arnd Bergmann wrote:
> 
> > From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
> > the generic default would be wrong as well if picked up by anything else (but
> > nothing seems to use it).
> 
> A question for cleaning this up and possibly unifying versions of this 
> header: for multi-ABI architectures, in userspace, what are these 
> structures meant to refer to?  The structures that would be produced by a 
> core dump for the current process, as opposed to those that might be 
> produced by a core dump for another ABI?

Also, I tried writing a test for the glibc testsuite to verify 
compatibility of the layout of these structures in the glibc and Linux 
headers, but found that a simple

#include <linux/elfcore.h>

using the installed uapi headers doesn't compile, because of unknown type 
names size_t, elf_greg_t, elf_gregset_t, elf_fpregset_t, elf_fpxregset_t, 
pid_t.  And indeed, e.g. elf_greg_t is not defined in any of the uapi 
headers, for many architectures.  What are the Linux kernel expectations 
regarding installed uapi headers actually being usable from userspace 
without needing additional type definitions provided by the user?

If that include worked, and produced the expected layout for the ABI used 
in the current compilation, it would be very helpful for writing such 
tests and ensuring bugs in this area can be found and fixed and avoided in 
future (and more general tests of consistency between glibc and Linux 
headers are probably possible as long as includes of the Linux headers 
from make headers_install do reliably compile without external 
dependencies).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 15:32           ` [gnu-csky] " Joseph Myers
  2018-09-13 16:35             ` Joseph Myers
@ 2018-09-13 20:31             ` Arnd Bergmann
  2018-09-13 20:49               ` Joseph Myers
  1 sibling, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13 20:31 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, Sep 13, 2018 at 5:32 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 13 Sep 2018, Arnd Bergmann wrote:
>
> > From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
> > the generic default would be wrong as well if picked up by anything else (but
> > nothing seems to use it).
>
> A question for cleaning this up and possibly unifying versions of this
> header: for multi-ABI architectures, in userspace, what are these
> structures meant to refer to?  The structures that would be produced by a
> core dump for the current process, as opposed to those that might be
> produced by a core dump for another ABI?

The structures match the process that they describe. We use them for
three distinct things in the kernel:

/proc/kcore describes the kernel itself, in core dump format that can
be used with gdb etc to look at the currently running kernel

/proc/vmcore can be used for crash dump analysis when a kernel
crashes and we restart into a new kernel (kdump), making the
crashed one available in the same format

Core files generated by the kernel for running processes (the most
common case). A 32-bit task running on a 64-bit kernel should produce
the same core file as one running on a 32-bit kernel. At least that's
what the code is trying to do, looking up the sources I came across
a patch for a bug in that area[1]

> I can confirm that the struct elf_prpsinfo defined in sys/procfs.h for
> MIPS n64 has size 0x90 whereas an n64 core dump has data size 0x88 for
> NT_PRPSINFO, indicating the pr_uid / pr_gid types are indeed wrong.  But
> I'm concerned here about n32 and about other fields in the structure.
> The code (dating back to the original addition of support for 64-bit MIPS
> ABIs to glibc in 2003) uses type unsigned long long int for pr_flag for
> n32.  But if I core dump an n32 process, I get 0x80 for the size of
> NT_PRPSINFO (while the userspace structure has size 0x88).  And similarly
> there are n32 conditionals in struct elf_prstatus - the core dump has size
> 0x1b8 for NT_PRSTATUS but the userspace structure has size 0x1c0.  If the
> structure is meant to correspond to the current ABI, that suggests those
> n32 conditionals are wrong (the conditional on the definition of
> elf_greg_t, however, is correct, as n32 does use 64-bit registers).

We have four definitions in the kernel for these structures: The native
structure for the ELF implementation [2], the generic compat implementation[3]
for everything other than MIPS, and the two MIPS variants [4][5].
Looking at the sources, the last three seem to use identical layouts,
aside from the elf_gregset_t, which uses 64-bit registers on n64 but
32-bit registers everywhere else, and the architecture specific
ELF_NGREG constant.

         Arnd

[1] https://www.linux-mips.org/archives/linux-mips/2009-05/msg00135.html
[2] https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/elfcore.h
[3] https://elixir.bootlin.com/linux/latest/source/include/linux/elfcore-compat.h
[4] https://elixir.bootlin.com/linux/latest/source/arch/mips/kernel/binfmt_elfo32.c
[5] https://elixir.bootlin.com/linux/latest/source/arch/mips/kernel/binfmt_elfn32.c

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 16:35             ` Joseph Myers
@ 2018-09-13 20:47               ` Arnd Bergmann
  2018-09-13 20:59                 ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13 20:47 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, Sep 13, 2018 at 6:35 PM Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 13 Sep 2018, Joseph Myers wrote:
> > On Thu, 13 Sep 2018, Arnd Bergmann wrote:
> > > From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
> > > the generic default would be wrong as well if picked up by anything else (but
> > > nothing seems to use it).
> >
> > A question for cleaning this up and possibly unifying versions of this
> > header: for multi-ABI architectures, in userspace, what are these
> > structures meant to refer to?  The structures that would be produced by a
> > core dump for the current process, as opposed to those that might be
> > produced by a core dump for another ABI?
>
> Also, I tried writing a test for the glibc testsuite to verify
> compatibility of the layout of these structures in the glibc and Linux
> headers, but found that a simple
>
> #include <linux/elfcore.h>
>
> using the installed uapi headers doesn't compile, because of unknown type
> names size_t, elf_greg_t, elf_gregset_t, elf_fpregset_t, elf_fpxregset_t,
> pid_t.  And indeed, e.g. elf_greg_t is not defined in any of the uapi
> headers, for many architectures.  What are the Linux kernel expectations
> regarding installed uapi headers actually being usable from userspace
> without needing additional type definitions provided by the user?

I think the expectations are generally mismatched with reality for our
headers. It's something that's been bugging me for a while and that
is not trivial to fix. We've had developers in the past that tried to
ensure that each exported uapi header can be included by itself,
but they (I forget who last worked on that) got too frustrated over
time to finish the job.  What you found is clearly a bug on our side
and we should try to fix it.

> If that include worked, and produced the expected layout for the ABI used
> in the current compilation, it would be very helpful for writing such
> tests and ensuring bugs in this area can be found and fixed and avoided in
> future (and more general tests of consistency between glibc and Linux
> headers are probably possible as long as includes of the Linux headers
> from make headers_install do reliably compile without external
> dependencies).

Agreed. I think the main problem is that the kernel still provides certain
types that are also provided by the C library, and other kernel headers
have interdependencies with these.

One example that is particularly nasty are kernel structures that
are defined in terms of 'timeval' and 'timespec'. Those are provided
by either <time.h> or <linux/time.h>, with an inconsistent set of
#ifdef guards between them, and (in the future) incompatible definitions.

Some instances in the kernel need to get changed to a type that
is independent of the libc type (e.g. the elf_prstatus here), while
others need to use the libc type (e.g. ioctl structures with
CLOCK_REALTIME timestamp members), and then need to include
<time.h> in user space.

        Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 20:31             ` Arnd Bergmann
@ 2018-09-13 20:49               ` Joseph Myers
  2018-09-13 21:38                 ` Arnd Bergmann
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 20:49 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, 13 Sep 2018, Arnd Bergmann wrote:

> We have four definitions in the kernel for these structures: The native
> structure for the ELF implementation [2], the generic compat implementation[3]
> for everything other than MIPS, and the two MIPS variants [4][5].
> Looking at the sources, the last three seem to use identical layouts,
> aside from the elf_gregset_t, which uses 64-bit registers on n64 but
> 32-bit registers everywhere else, and the architecture specific
> ELF_NGREG constant.

A 64-bit MIPS kernel is n64, not n32, so "unsigned long" in 
binfmt_elfn32.c is actually a 64-bit type for registers (as expected).

I think this confirms that the other two n32 conditionals in 
sysdeps/unix/sysv/linux/mips/sys/procfs.h are incorrect, as they would 
result in a field having the size it does for n64, not that for n32.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 20:47               ` Arnd Bergmann
@ 2018-09-13 20:59                 ` Joseph Myers
  2018-09-13 21:32                   ` Arnd Bergmann
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 20:59 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, 13 Sep 2018, Arnd Bergmann wrote:

> I think the expectations are generally mismatched with reality for our
> headers. It's something that's been bugging me for a while and that
> is not trivial to fix. We've had developers in the past that tried to
> ensure that each exported uapi header can be included by itself,
> but they (I forget who last worked on that) got too frustrated over
> time to finish the job.  What you found is clearly a bug on our side
> and we should try to fix it.

I note the recent proposed changes to make uapi headers build as C++ just 
fudges this issue, by providing dummy definitions of all the required 
types.  Which can't work for my purpose, because we need the actual 
definition of elf_gregset_t that the kernel uses when generating core 
dumps, not a dummy unsigned long[1] array, for tests of sizes and offsets 
to work.

> Agreed. I think the main problem is that the kernel still provides certain
> types that are also provided by the C library, and other kernel headers
> have interdependencies with these.

The types in question (in both linux/elfcore.h and sys/procfs.h) are of 
course types provided in both places - but in this case I'm not concerned 
about being able to include both headers at once, my test includes each in 
a separate file and compares the resulting sets of sizes and offsets (and 
if the kernel header tried to delegate to the libc header to get the type 
definitions when included from userspace code, that would defeat the point 
of my test).  If various types in the kernel header were to gain 
__kernel_* prefixes, that would be fine for my purposes.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 20:59                 ` Joseph Myers
@ 2018-09-13 21:32                   ` Arnd Bergmann
  2018-09-13 22:57                     ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13 21:32 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, Sep 13, 2018 at 10:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 13 Sep 2018, Arnd Bergmann wrote:
>
> > I think the expectations are generally mismatched with reality for our
> > headers. It's something that's been bugging me for a while and that
> > is not trivial to fix. We've had developers in the past that tried to
> > ensure that each exported uapi header can be included by itself,
> > but they (I forget who last worked on that) got too frustrated over
> > time to finish the job.  What you found is clearly a bug on our side
> > and we should try to fix it.
>
> I note the recent proposed changes to make uapi headers build as C++ just
> fudges this issue, by providing dummy definitions of all the required
> types.  Which can't work for my purpose, because we need the actual
> definition of elf_gregset_t that the kernel uses when generating core
> dumps, not a dummy unsigned long[1] array, for tests of sizes and offsets
> to work.

Ah, I had missed that email thread. Since David Howells is now working
on the issue overall, I'm sure we will figure something out.

I haven't seen the part about the unsigned long[1] array, but I would
assume this is something that can and should be cahnged to make
it work for you.

> > Agreed. I think the main problem is that the kernel still provides certain
> > types that are also provided by the C library, and other kernel headers
> > have interdependencies with these.
>
> The types in question (in both linux/elfcore.h and sys/procfs.h) are of
> course types provided in both places - but in this case I'm not concerned
> about being able to include both headers at once, my test includes each in
> a separate file and compares the resulting sets of sizes and offsets (and
> if the kernel header tried to delegate to the libc header to get the type
> definitions when included from userspace code, that would defeat the point
> of my test).  If various types in the kernel header were to gain
> __kernel_* prefixes, that would be fine for my purposes.

 I need to think about this a bit more, and talk to a few other people.
A first step is probably to identify all structures that are provided
by both glibc and linux and classify them. In some cases, simply
renaming will be appropriate, in others it is not. One issue is that
we try to remain compatible with whatever behavior we had before,
and renaming e.g. 'struct stat' would work for glibc but not necessarily
all other libc implementations, unless we put some extra logic in
there to get the old name /unless/ we get included from glibc.

Another issue is structures that are intentionally ambiguous,
e.g. In the uapi headers there is an ioctl command definition
include/uapi/linux/ppdev.h:#define PPGETTIME    _IOR(PP_IOCTL, 0x95,
struct timeval)
This gets included by an application passing a pointer to
a 'struct timeval' into the kernel, which now implements two
commands, based on codes
drivers/char/ppdev.c:#define PPGETTIME32   _IOR(PP_IOCTL, 0x95, s32[2])
drivers/char/ppdev.c:#define PPGETTIME64   _IOR(PP_IOCTL, 0x95, s64[2])
so it can work with any user space.

         Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 20:49               ` Joseph Myers
@ 2018-09-13 21:38                 ` Arnd Bergmann
  0 siblings, 0 replies; 57+ messages in thread
From: Arnd Bergmann @ 2018-09-13 21:38 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, Sep 13, 2018 at 10:48 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 13 Sep 2018, Arnd Bergmann wrote:
>
> > We have four definitions in the kernel for these structures: The native
> > structure for the ELF implementation [2], the generic compat implementation[3]
> > for everything other than MIPS, and the two MIPS variants [4][5].
> > Looking at the sources, the last three seem to use identical layouts,
> > aside from the elf_gregset_t, which uses 64-bit registers on n64 but
> > 32-bit registers everywhere else, and the architecture specific
> > ELF_NGREG constant.
>
> A 64-bit MIPS kernel is n64, not n32, so "unsigned long" in
> binfmt_elfn32.c is actually a 64-bit type for registers (as expected).
>
> I think this confirms that the other two n32 conditionals in
> sysdeps/unix/sysv/linux/mips/sys/procfs.h are incorrect, as they would
> result in a field having the size it does for n64, not that for n32.

Yes, that sounds right. From what I can tell, the n32 ABI has come
out of fashion a bit: the embedded stuff tends to be 32-bit only
so it uses o32, and the Debian and Fedora ports port do either
n64 or o32 but not n32. There was a partial Fedora 12 n32 port, but
that was 7 years ago.

        Arnd

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI
  2018-09-13 21:32                   ` Arnd Bergmann
@ 2018-09-13 22:57                     ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-09-13 22:57 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Mao Han, gnu-csky, GNU C Library, c-sky_gcc_upstream

On Thu, 13 Sep 2018, Arnd Bergmann wrote:

> I haven't seen the part about the unsigned long[1] array, but I would
> assume this is something that can and should be cahnged to make
> it work for you.

It's the hack in the test 
<https://lwn.net/ml/linux-api/153616295066.23468.6133013878008690375.stgit@warthog.procyon.org.uk/> 
where it has a load of type and macro definitions before trying to include 
the uapi headers, including

+typedef unsigned long		elf_greg_t;
+typedef elf_greg_t		elf_gregset_t[1];

(but presumably most of the other type and macro definitions shouldn't be 
needed either, if the uapi headers are to work properly when included on 
their own).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
  2018-09-12  4:16     ` H.J. Lu
@ 2018-09-17 21:46     ` Joseph Myers
  2018-09-18  6:09       ` Mao Han
  1 sibling, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-17 21:46 UTC (permalink / raw)
  To: Mao Han; +Cc: libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Mao Han wrote:

> +/* The canonical name for the function is `_mcount' in both C and asm,
> +   but some old asm code might assume it's `mcount'.  */
> +#undef mcount
> +weak_alias (_mcount, mcount)

That may be a reason to have this for old architectures, but you shouldn't 
have old asm for a new architecture, so no need for an mcount alias.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 03/13] C-SKY: Math support
  2018-09-12  2:56   ` [PATCH v4 03/13] C-SKY: Math support Mao Han
@ 2018-09-17 21:49     ` Joseph Myers
  2018-09-18  6:05       ` Mao Han
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-17 21:49 UTC (permalink / raw)
  To: Mao Han; +Cc: libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Mao Han wrote:

> 	* sysdeps/csky/fpu/fpu_control.h: Likewise.

fpu_control.h is an installed header, and we generally want installed 
headers to be the same between different multilibs for the same compiler, 
so that a single include directory can be shared between multilibs.

Thus, it should not be in the fpu/ directory; instead, it should contain 
preprocessor conditionals to make most of the contents trivial in the 
soft-float case (as done for arm / m68k / mips / riscv / sh).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 10/13] C-SKY: Build Infastructure
  2018-09-12  3:05   ` [PATCH v4 10/13] C-SKY: Build Infastructure Mao Han
@ 2018-09-17 21:52     ` Joseph Myers
  2018-09-18  6:02       ` Mao Han
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-09-17 21:52 UTC (permalink / raw)
  To: Mao Han; +Cc: libc-alpha, c-sky_gcc_upstream, gnu-csky

On Wed, 12 Sep 2018, Mao Han wrote:

> +ifeq ($(subdir),debug)
> +CFLAGS-backtrace.c += -funwind-tables
> +endif

This is in the generic debug/Makefile, so you shouldn't need it here.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 10/13] C-SKY: Build Infastructure
  2018-09-17 21:52     ` Joseph Myers
@ 2018-09-18  6:02       ` Mao Han
  0 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-18  6:02 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Mon, Sep 17, 2018 at 09:52:48PM +0000, Joseph Myers wrote:
> On Wed, 12 Sep 2018, Mao Han wrote:
> 
> > +ifeq ($(subdir),debug)
> > +CFLAGS-backtrace.c += -funwind-tables
> > +endif
> 
> This is in the generic debug/Makefile, so you shouldn't need it here.

OK. I'll remove it.

Thanks
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 03/13] C-SKY: Math support
  2018-09-17 21:49     ` Joseph Myers
@ 2018-09-18  6:05       ` Mao Han
  0 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-18  6:05 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Mon, Sep 17, 2018 at 09:49:18PM +0000, Joseph Myers wrote:
> On Wed, 12 Sep 2018, Mao Han wrote:
> 
> > 	* sysdeps/csky/fpu/fpu_control.h: Likewise.
> 
> fpu_control.h is an installed header, and we generally want installed 
> headers to be the same between different multilibs for the same compiler, 
> so that a single include directory can be shared between multilibs.
> 
> Thus, it should not be in the fpu/ directory; instead, it should contain 
> preprocessor conditionals to make most of the contents trivial in the 
> soft-float case (as done for arm / m68k / mips / riscv / sh).
>

OK. I'll put it outside and make it conditional.

Thanks,
Han Mao 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-17 21:46     ` Joseph Myers
@ 2018-09-18  6:09       ` Mao Han
  0 siblings, 0 replies; 57+ messages in thread
From: Mao Han @ 2018-09-18  6:09 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Mon, Sep 17, 2018 at 09:45:55PM +0000, Joseph Myers wrote:
> On Wed, 12 Sep 2018, Mao Han wrote:
> 
> > +/* The canonical name for the function is `_mcount' in both C and asm,
> > +   but some old asm code might assume it's `mcount'.  */
> > +#undef mcount
> > +weak_alias (_mcount, mcount)
> 
> That may be a reason to have this for old architectures, but you shouldn't 
> have old asm for a new architecture, so no need for an mcount alias.
>

Yes. No need to keep this, will remove.

Thanks,
Han Mao 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-13 12:36     ` Joseph Myers
@ 2018-09-18  6:22       ` Mao Han
  2018-09-18  7:18         ` Mao Han
  0 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-18  6:22 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Thu, Sep 13, 2018 at 12:36:15PM +0000, Joseph Myers wrote:
> A different dynamic linker name should be used because the ABI to libc and 
> other glibc libraries is incompatible; if you have a different dynamic 
> linker name for every ABI, that allows distributions using Debian-style 
> multiarch directory arrangements to have libraries for both ABIs installed 
> simultaneously.  Then, because you can't sensibly use soft-float binaries 
> with hard-float libm, you should have the conditionals in bits/fenv.h (a 
> single installed header should be set up to work for both ABIs) so that it 
> doesn't define macros for unsupported features for soft float.
> 
> Once you have the conditionals in bits/fenv.h, the glibc testsuite will 
> automatically disable tests for unsupported features for soft float, and 
> internal calls to fenv.h functions within libm will automatically be 
> optimized out for soft float.
>

OK. I've add different dynamic linker name name for hard-float and put
some conditionals in bits/fenv.h, seems work fine.
 
> It's not required, but it's a good idea to make binutils check for ABI 
> incompatibilities at static link time, using GNU object attributes, which 
> GCC should generate based on the ABI selected when compiling.  See how 
> powerpc and mips handle this, for example.  That helps protect against 
> user mistakes (linking .o files for different ABIs together) by making the 
> linker complain about such mixing.

OK. I'll try to add some check here.

> The Argument Passing section of the ABI document you provided doesn't seem 
> to say anything about the different argument passing for hard float, so I 
> think you need to update the document to cover that issue (likewise for 
> return values if they are handled differently for hard float).  (And the 
> table in 2.2.1.2 would presumably also need to say what's used for 
> argument passing.)

OK. We will update it.

> We want the build-many-glibcs.py build to succeed.  You'll need to 
> investigate why you see this problem.  The -profile option is defined in 
> gcc/config/gnu-user.opt which all *-linux* targets should be using, so 
> you'll need to look at why you get an error there.
>
> > > > 5. The following cases fail due to gcc optimize change the sequence of
> > > >    -a * b to -(a * b) and got 1ulps error.
> > > >    math/test-double-tgamma
> > > >    math/test-float-tgamma
> > > >    math/test-float32-tgamma
> > > >    math/test-float32x-tgamma
> > > >    math/test-float64-tgamma
> > > >    math/test-ldouble-tgamma
> 
> No, you just need to get a fix for the problem checked in upstream; no 
> need to file a bug in GCC Bugzilla.

OK. My colleague Xianmiao Qu is working on these problems, will be fixed soon.

Thanks,
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-18  6:22       ` Mao Han
@ 2018-09-18  7:18         ` Mao Han
  2018-09-18 11:43           ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Mao Han @ 2018-09-18  7:18 UTC (permalink / raw)
  To: Joseph Myers; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Tue, Sep 18, 2018 at 02:22:11PM +0800, Mao Han wrote:
> > It's not required, but it's a good idea to make binutils check for ABI 
> > incompatibilities at static link time, using GNU object attributes, which 
> > GCC should generate based on the ABI selected when compiling.  See how 
> > powerpc and mips handle this, for example.  That helps protect against 
> > user mistakes (linking .o files for different ABIs together) by making the 
> > linker complain about such mixing.
> 
> OK. I'll try to add some check here.
>

Seems I just missunderstand to add some check in glibc configure.
We have ABI check using eflag in elf header, which can recognize different
ISA but not float ABI.
We may support ABI check using GNU object attributes in the later version.

Thanks,
Han Mao

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 00/13] port C-SKY to glibc
  2018-09-18  7:18         ` Mao Han
@ 2018-09-18 11:43           ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-09-18 11:43 UTC (permalink / raw)
  To: Mao Han; +Cc: c-sky_gcc_upstream, gnu-csky, libc-alpha

On Tue, 18 Sep 2018, Mao Han wrote:

> On Tue, Sep 18, 2018 at 02:22:11PM +0800, Mao Han wrote:
> > > It's not required, but it's a good idea to make binutils check for ABI 
> > > incompatibilities at static link time, using GNU object attributes, which 
> > > GCC should generate based on the ABI selected when compiling.  See how 
> > > powerpc and mips handle this, for example.  That helps protect against 
> > > user mistakes (linking .o files for different ABIs together) by making the 
> > > linker complain about such mixing.
> > 
> > OK. I'll try to add some check here.
> >
> 
> Seems I just missunderstand to add some check in glibc configure.
> We have ABI check using eflag in elf header, which can recognize different
> ISA but not float ABI.
> We may support ABI check using GNU object attributes in the later version.

Object attributes are generally appropriate for the static linker (ld); 
checks of the ELF header are generally appropriate for the dynamic linker 
(ld.so).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-12  8:23         ` Florian Weimer
  2018-09-12  9:06           ` Mao Han
@ 2018-09-29  1:46           ` Palmer Dabbelt
  2018-09-30  9:04             ` Manuel A. Fernandez Montecelo
  2018-10-01  8:18             ` Richard W.M. Jones
  1 sibling, 2 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2018-09-29  1:46 UTC (permalink / raw)
  To: fweimer, merker, mafm, dj, rjones, david.abdurachmanov
  Cc: han_mao, H.J. Lu, c-sky_gcc_upstream, gnu-csky, libc-alpha

On Wed, 12 Sep 2018 01:23:29 PDT (-0700), fweimer@redhat.com wrote:
> On 09/12/2018 09:07 AM, Mao Han wrote:
>> It seems used to call some pre-init function for libc, register transactional
>> memory clone tables and invoke global constructors on C-SKY. Althrough I
>> haven't found any constructors call by _init, I just tend to have _init and
>> _fini as most other arch have these.
>
> The expectation is that for new glibc ports, GCC is tweaked to generate
> the array variant of these constructs exclusively, like RISC-V did.
> Then you won't need the function variant.

I think we're the only ones who do it this way, but it appears to work and 
saves us a few symbols so I see no reason not to do so.  In RISC-V land we're 
pretty aggressive about pruning old interfaces, but this one doesn't appear to 
have bitten us anywhere (or at least, has bitten us less than others :)).

The distro guys are probably in a better place to comment on this decision, 
though, as this is one of those things that will only crop up in real code.  
I've added a few people who are more plugged in to these sorts of issues than I 
am.

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-29  1:46           ` Palmer Dabbelt
@ 2018-09-30  9:04             ` Manuel A. Fernandez Montecelo
  2018-10-01  8:18             ` Richard W.M. Jones
  1 sibling, 0 replies; 57+ messages in thread
From: Manuel A. Fernandez Montecelo @ 2018-09-30  9:04 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: fweimer, Karsten Merker, Manuel A. Fernandez Montecelo,
	DJ Delorie, Richard W.M. Jones, David Abdurachmanov, han_mao,
	hjl.tools, c-sky_gcc_upstream, gnu-csky, GNU C Library

Hi,

Em sáb, 29 de set de 2018 às 03:46, Palmer Dabbelt <palmer@sifive.com> escreveu:
>
> On Wed, 12 Sep 2018 01:23:29 PDT (-0700), fweimer@redhat.com wrote:
> > On 09/12/2018 09:07 AM, Mao Han wrote:
> >> It seems used to call some pre-init function for libc, register transactional
> >> memory clone tables and invoke global constructors on C-SKY. Althrough I
> >> haven't found any constructors call by _init, I just tend to have _init and
> >> _fini as most other arch have these.
> >
> > The expectation is that for new glibc ports, GCC is tweaked to generate
> > the array variant of these constructs exclusively, like RISC-V did.
> > Then you won't need the function variant.
>
> I think we're the only ones who do it this way, but it appears to work and
> saves us a few symbols so I see no reason not to do so.  In RISC-V land we're
> pretty aggressive about pruning old interfaces, but this one doesn't appear to
> have bitten us anywhere (or at least, has bitten us less than others :)).
>
> The distro guys are probably in a better place to comment on this decision,
> though, as this is one of those things that will only crop up in real code.
> I've added a few people who are more plugged in to these sorts of issues than I
> am.

What kind of error messages or behaviours would we see, if this is
used by any software packaged in the distros?

In the Debian port for riscv64, with ~85% of the whole archive
compiled, I don't remember seeing messages in packages that seemed
related to this, but maybe they manifest in non-obvious (for me) ways.

Cheers.
-- 
Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v4 01/13] C-SKY: ABI related code
  2018-09-29  1:46           ` Palmer Dabbelt
  2018-09-30  9:04             ` Manuel A. Fernandez Montecelo
@ 2018-10-01  8:18             ` Richard W.M. Jones
  1 sibling, 0 replies; 57+ messages in thread
From: Richard W.M. Jones @ 2018-10-01  8:18 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: fweimer, merker, mafm, dj, david.abdurachmanov, han_mao, H.J. Lu,
	c-sky_gcc_upstream, gnu-csky, libc-alpha

On Fri, Sep 28, 2018 at 06:46:08PM -0700, Palmer Dabbelt wrote:
> On Wed, 12 Sep 2018 01:23:29 PDT (-0700), fweimer@redhat.com wrote:
> >On 09/12/2018 09:07 AM, Mao Han wrote:
> >>It seems used to call some pre-init function for libc, register transactional
> >>memory clone tables and invoke global constructors on C-SKY. Althrough I
> >>haven't found any constructors call by _init, I just tend to have _init and
> >>_fini as most other arch have these.
> >
> >The expectation is that for new glibc ports, GCC is tweaked to generate
> >the array variant of these constructs exclusively, like RISC-V did.
> >Then you won't need the function variant.
> 
> I think we're the only ones who do it this way, but it appears to
> work and saves us a few symbols so I see no reason not to do so.  In
> RISC-V land we're pretty aggressive about pruning old interfaces,
> but this one doesn't appear to have bitten us anywhere (or at least,
> has bitten us less than others :)).
> 
> The distro guys are probably in a better place to comment on this
> decision, though, as this is one of those things that will only crop
> up in real code.  I've added a few people who are more plugged in to
> these sorts of issues than I am.

I read the thread, which for reference starts here:

  https://sourceware.org/ml/libc-alpha/2018-09/threads.html#00126

As mafm said too, we'd need to know what to look for to answer this
question.  If you can suggest either a message that might have
appeared in the log files during compilation, or a test we can run
across all final binaries/libraries, then I'd be able to do that for
Fedora.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2018-10-01  8:18 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12  2:56 [PATCH v4 00/13] port C-SKY to glibc Mao Han
     [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
2018-09-12  2:56   ` [PATCH v4 02/13] C-SKY: TLS support Mao Han
2018-09-12  2:56   ` [PATCH v4 03/13] C-SKY: Math support Mao Han
2018-09-17 21:49     ` Joseph Myers
2018-09-18  6:05       ` Mao Han
2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
2018-09-12  4:16     ` H.J. Lu
2018-09-12  7:07       ` Mao Han
2018-09-12  8:23         ` Florian Weimer
2018-09-12  9:06           ` Mao Han
2018-09-29  1:46           ` Palmer Dabbelt
2018-09-30  9:04             ` Manuel A. Fernandez Montecelo
2018-10-01  8:18             ` Richard W.M. Jones
2018-09-17 21:46     ` Joseph Myers
2018-09-18  6:09       ` Mao Han
2018-09-12  2:56   ` [PATCH v4 05/13] C-SKY: Linux Syscall Interface Mao Han
2018-09-12  2:57   ` [PATCH v4 09/13] C-SKY: Add dynamic relocations to elf.h Mao Han
2018-09-12  2:57   ` [PATCH v4 11/13] C-SKY: Add ABI definitions in config.h.in Mao Han
2018-09-12  2:57   ` [PATCH v4 12/13] C-SKY: Add build-many-glibcs.py support Mao Han
2018-09-12  2:57   ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
2018-09-12 13:40     ` Arnd Bergmann
2018-09-12 14:21       ` Joseph Myers
2018-09-12 15:34         ` Arnd Bergmann
2018-09-12 21:28           ` struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI) Florian Weimer
2018-09-13 10:48             ` Arnd Bergmann
2018-09-13 10:56               ` struct elf_prstatus and Y2038 Florian Weimer
2018-09-13  8:17       ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
2018-09-13  8:46         ` Arnd Bergmann
2018-09-13 15:32           ` [gnu-csky] " Joseph Myers
2018-09-13 16:35             ` Joseph Myers
2018-09-13 20:47               ` Arnd Bergmann
2018-09-13 20:59                 ` Joseph Myers
2018-09-13 21:32                   ` Arnd Bergmann
2018-09-13 22:57                     ` Joseph Myers
2018-09-13 20:31             ` Arnd Bergmann
2018-09-13 20:49               ` Joseph Myers
2018-09-13 21:38                 ` Arnd Bergmann
2018-09-12  2:57   ` [PATCH v4 13/13] C-SKY: Skeleton documentation Mao Han
2018-09-12  2:57   ` [PATCH v4 08/13] C-SKY: Linux Startup and Dynamic Loading Code Mao Han
2018-09-12  3:05   ` [PATCH v4 10/13] C-SKY: Build Infastructure Mao Han
2018-09-17 21:52     ` Joseph Myers
2018-09-18  6:02       ` Mao Han
2018-09-12  3:05   ` [PATCH v4 04/13] C-SKY: NPTL support and Atomic Mao Han
2018-09-12  3:05   ` [PATCH v4 07/13] C-SKY: ABI Lists Mao Han
2018-09-12  6:51     ` Andreas Schwab
2018-09-12  7:12       ` Mao Han
2018-09-12 12:35       ` Joseph Myers
2018-09-12 13:46         ` Andreas Schwab
2018-09-12 15:19           ` Joseph Myers
2018-09-13  8:23         ` Mao Han
2018-09-12  3:05 ` [PATCH 1/1] Update config.guess and config.sub to current versions Mao Han
2018-09-12 12:31 ` [PATCH v4 00/13] port C-SKY to glibc Joseph Myers
2018-09-13  8:14   ` Mao Han
2018-09-13 12:36     ` Joseph Myers
2018-09-18  6:22       ` Mao Han
2018-09-18  7:18         ` Mao Han
2018-09-18 11:43           ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).