Skip to contentSkip to conversation

glibc port to ARC architecture

RFC New Vineet Gupta 5 participants 39 messages Jun 27, 2017 – Dec 8, 2017 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

cover glibc port to ARC architecture

Hi,

This is a Request for comments for glibc port to ARC architecture.
http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx

The Linux kernel, uClibc, buildroot have been upstream for quite some time.

The code has been rebased off of upstream/master as of yesterday and contains adjustments for recent changes such as mmap wrapper consolidation etc.

All comments welcome !

Thx,
-Vineet

Cupertino Miranda (2):
ARC: Fixed inline asm contraints to gcc 6.x
ARC: Fix several testsuite failures related to unwinding

Vineet Gupta (4):
upstream: comment update
ARC: add definitions to elf/elf.h
ARC: Initial port to glibc
ARC: Enable __start as entry point vs. canonical _start

 .gitignore                                         |    1 +
 elf/elf.h                                          |   69 +
 stdlib/longlong.h                                  |    8 +-
 sysdeps/arc/Implies                                |    3 +
 sysdeps/arc/Makefile                               |   26 +
 sysdeps/arc/Subdirs                                |    1 +
 sysdeps/arc/Versions                               |   13 +
 sysdeps/arc/__longjmp.S                            |   50 +
 sysdeps/arc/abort-instr.h                          |    2 +
 sysdeps/arc/atomic-machine.h                       |   85 +
 sysdeps/arc/backtrace.c                            |    1 +
 sysdeps/arc/bits/endian.h                          |   12 +
 sysdeps/arc/bits/fenv.h                            |   52 +
 sysdeps/arc/bits/link.h                            |   52 +
 sysdeps/arc/bits/setjmp.h                          |   33 +
 sysdeps/arc/bsd-_setjmp.S                          |    1 +
 sysdeps/arc/bsd-setjmp.S                           |    1 +
 sysdeps/arc/configure                              |   17 +
 sysdeps/arc/configure.ac                           |   13 +
 sysdeps/arc/crti.S                                 |   77 +
 sysdeps/arc/crtn.S                                 |   56 +
 sysdeps/arc/dl-machine.h                           |  338 ++++
 sysdeps/arc/dl-runtime.c                           |   21 +
 sysdeps/arc/dl-sysdep.h                            |   25 +
 sysdeps/arc/dl-tls.h                               |   30 +
 sysdeps/arc/dl-trampoline.S                        |   81 +
 sysdeps/arc/entry.h                                |    5 +
 sysdeps/arc/gccframe.h                             |   21 +
 sysdeps/arc/gmp-mparam.h                           |   23 +
 sysdeps/arc/jmpbuf-offsets.h                       |   46 +
 sysdeps/arc/jmpbuf-unwind.h                        |   47 +
 sysdeps/arc/ldsodefs.h                             |   43 +
 sysdeps/arc/libc-tls.c                             |   27 +
 sysdeps/arc/libm-test-ulps                         |  394 ++++
 sysdeps/arc/libm-test-ulps-name                    |    1 +
 sysdeps/arc/machine-gmon.h                         |   30 +
 sysdeps/arc/math-tests.h                           |   28 +
 sysdeps/arc/math_private.h                         |   33 +
 sysdeps/arc/memusage.h                             |   23 +
 sysdeps/arc/nptl/Makefile                          |   22 +
 sysdeps/arc/nptl/bits/pthreadtypes-arch.h          |   70 +
 sysdeps/arc/nptl/bits/semaphore.h                  |   32 +
 sysdeps/arc/nptl/pthread_spin_lock.c               |   24 +
 sysdeps/arc/nptl/pthreaddef.h                      |   32 +
 sysdeps/arc/nptl/tcb-offsets.sym                   |   11 +
 sysdeps/arc/nptl/tls.h                             |  151 ++
 sysdeps/arc/preconfigure                           |    6 +
 sysdeps/arc/s_fma.c                                |    1 +
 sysdeps/arc/s_fmaf.c                               |    1 +
 sysdeps/arc/setjmp.S                               |   64 +
 sysdeps/arc/sfp-machine.h                          |   51 +
 sysdeps/arc/sotruss-lib.c                          |   51 +
 sysdeps/arc/stackinfo.h                            |   33 +
 sysdeps/arc/start.S                                |   89 +
 sysdeps/arc/sysdep.h                               |   51 +
 sysdeps/arc/tls-macros.h                           |   29 +
 sysdeps/arc/tst-audit.h                            |   23 +
 sysdeps/unix/make-syscalls.sh                      |    2 +-
 sysdeps/unix/sysv/linux/arc/Implies                |    3 +
 sysdeps/unix/sysv/linux/arc/Makefile               |    9 +
 sysdeps/unix/sysv/linux/arc/Versions               |    6 +
 sysdeps/unix/sysv/linux/arc/arch-fork.h            |   35 +
 sysdeps/unix/sysv/linux/arc/bits/mman.h            |   42 +
 sysdeps/unix/sysv/linux/arc/bits/sigaction.h       |   78 +
 sysdeps/unix/sysv/linux/arc/c++-types.data         |   67 +
 sysdeps/unix/sysv/linux/arc/cacheflush.c           |   29 +
 sysdeps/unix/sysv/linux/arc/clone.S                |   97 +
 sysdeps/unix/sysv/linux/arc/configure              |    4 +
 sysdeps/unix/sysv/linux/arc/configure.ac           |    4 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h      |   31 +
 sysdeps/unix/sysv/linux/arc/ld.abilist             |   12 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h             |   24 +
 .../unix/sysv/linux/arc/libBrokenLocale.abilist    |    3 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist         |    6 +
 sysdeps/unix/sysv/linux/arc/libc.abilist           | 2123 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist       |    9 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist          |   11 +
 sysdeps/unix/sysv/linux/arc/libm.abilist           |  370 ++++
 sysdeps/unix/sysv/linux/arc/libnsl.abilist         |  123 ++
 sysdeps/unix/sysv/linux/arc/libpthread.abilist     |  224 +++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist      |   93 +
 sysdeps/unix/sysv/linux/arc/librt.abilist          |   37 +
 sysdeps/unix/sysv/linux/arc/libthread_db.abilist   |   42 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist        |    8 +
 sysdeps/unix/sysv/linux/arc/localplt.data          |   35 +
 sysdeps/unix/sysv/linux/arc/mmap_internal.h        |   26 +
 sysdeps/unix/sysv/linux/arc/profil-counter.h       |    2 +
 sysdeps/unix/sysv/linux/arc/pt-vfork.S             |    1 +
 sysdeps/unix/sysv/linux/arc/shlib-versions         |    2 +
 sysdeps/unix/sysv/linux/arc/sigaction.c            |   69 +
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h       |   28 +
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h         |   36 +
 sysdeps/unix/sysv/linux/arc/sys/procfs.h           |  123 ++
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h         |   40 +
 sysdeps/unix/sysv/linux/arc/sys/user.h             |   32 +
 sysdeps/unix/sysv/linux/arc/syscall.S              |   33 +
 sysdeps/unix/sysv/linux/arc/sysdep-cancel.h        |  144 ++
 sysdeps/unix/sysv/linux/arc/sysdep.c               |   22 +
 sysdeps/unix/sysv/linux/arc/sysdep.h               |  257 +++
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym         |   17 +
 sysdeps/unix/sysv/linux/arc/vfork.S                |   42 +
 101 files changed, 6926 insertions(+), 5 deletions(-)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 create mode 100644 sysdeps/arc/Subdirs
 create mode 100644 sysdeps/arc/Versions
 create mode 100644 sysdeps/arc/__longjmp.S
 create mode 100644 sysdeps/arc/abort-instr.h
 create mode 100644 sysdeps/arc/atomic-machine.h
 create mode 100644 sysdeps/arc/backtrace.c
 create mode 100644 sysdeps/arc/bits/endian.h
 create mode 100644 sysdeps/arc/bits/fenv.h
 create mode 100644 sysdeps/arc/bits/link.h
 create mode 100644 sysdeps/arc/bits/setjmp.h
 create mode 100644 sysdeps/arc/bsd-_setjmp.S
 create mode 100644 sysdeps/arc/bsd-setjmp.S
 create mode 100644 sysdeps/arc/configure
 create mode 100644 sysdeps/arc/configure.ac
 create mode 100644 sysdeps/arc/crti.S
 create mode 100644 sysdeps/arc/crtn.S
 create mode 100644 sysdeps/arc/dl-machine.h
 create mode 100644 sysdeps/arc/dl-runtime.c
 create mode 100644 sysdeps/arc/dl-sysdep.h
 create mode 100644 sysdeps/arc/dl-tls.h
 create mode 100644 sysdeps/arc/dl-trampoline.S
 create mode 100644 sysdeps/arc/entry.h
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/gmp-mparam.h
 create mode 100644 sysdeps/arc/jmpbuf-offsets.h
 create mode 100644 sysdeps/arc/jmpbuf-unwind.h
 create mode 100644 sysdeps/arc/ldsodefs.h
 create mode 100644 sysdeps/arc/libc-tls.c
 create mode 100644 sysdeps/arc/libm-test-ulps
 create mode 100644 sysdeps/arc/libm-test-ulps-name
 create mode 100644 sysdeps/arc/machine-gmon.h
 create mode 100644 sysdeps/arc/math-tests.h
 create mode 100644 sysdeps/arc/math_private.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/nptl/Makefile
 create mode 100644 sysdeps/arc/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/arc/nptl/bits/semaphore.h
 create mode 100644 sysdeps/arc/nptl/pthread_spin_lock.c
 create mode 100644 sysdeps/arc/nptl/pthreaddef.h
 create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/arc/nptl/tls.h
 create mode 100644 sysdeps/arc/preconfigure
 create mode 100644 sysdeps/arc/s_fma.c
 create mode 100644 sysdeps/arc/s_fmaf.c
 create mode 100644 sysdeps/arc/setjmp.S
 create mode 100644 sysdeps/arc/sfp-machine.h
 create mode 100644 sysdeps/arc/sotruss-lib.c
 create mode 100644 sysdeps/arc/stackinfo.h
 create mode 100644 sysdeps/arc/start.S
 create mode 100644 sysdeps/arc/sysdep.h
 create mode 100644 sysdeps/arc/tls-macros.h
 create mode 100644 sysdeps/arc/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/Implies
 create mode 100644 sysdeps/unix/sysv/linux/arc/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/arc/Versions
 create mode 100644 sysdeps/unix/sysv/linux/arc/arch-fork.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/mman.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/sigaction.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/cacheflush.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libnsl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep-cancel.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S
Signature · 1 line
2.7.4
#1 lore raw

RFC 1/6 upstream: comment update

Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 sysdeps/unix/make-syscalls.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sysdeps/unix/make-syscalls.sh +1 -1
index 123553c1d900..d9e607681740 100644
@@ -7,7 +7,7 @@
 #
 # This script is used to process the syscall data encoded in the various
 # syscalls.list files to produce thin assembly syscall wrappers around the
-# appropriate OS syscall. See syscall-template.s for more details on the
+# appropriate OS syscall. See syscall-template.S for more details on the
 # actual wrapper.
 #
 # Syscall Signature Prefixes:
Signature · 1 line
2.7.4
#2 lore raw

RFC 2/6 ARC: Fixed inline asm contraints to gcc 6.x

In reply to Vineet Gupta

From: Cupertino Miranda <[email protected]>

It seems glibc had some ancient ARC bits, added as part of some header sync up back in 1999 (I was still in college)

That code obviously doesn't build with modern compilers.

Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 stdlib/longlong.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
stdlib/longlong.h +4 -4
index 0ec11c5056bf..fb6557272fa0 100644
@@ -197,17 +197,17 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
 	   : "=r" ((USItype) (sh)),					\
 	     "=&r" ((USItype) (sl))					\
 	   : "%r" ((USItype) (ah)),					\
-	     "rIJ" ((USItype) (bh)),					\
+	     "rICal" ((USItype) (bh)),					\
 	     "%r" ((USItype) (al)),					\
-	     "rIJ" ((USItype) (bl)))
+	     "rICal" ((USItype) (bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("sub.f	%1, %4, %5\n\tsbc	%0, %2, %3"		\
 	   : "=r" ((USItype) (sh)),					\
 	     "=&r" ((USItype) (sl))					\
 	   : "r" ((USItype) (ah)),					\
-	     "rIJ" ((USItype) (bh)),					\
+	     "rICal" ((USItype) (bh)),					\
 	     "r" ((USItype) (al)),					\
-	     "rIJ" ((USItype) (bl)))
+	     "rICal" ((USItype) (bl)))
 
 #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
 #ifdef __ARC_NORM__
Signature · 1 line
2.7.4
#3 lore raw

RFC 2/6 ARC: Fixed inline asm contraints to gcc 6.x

longlong.h should be kept in sync with GCC. If the GCC version has been fixed we can copy the updated version verbatim from GCC.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#4 lore raw

RFC 2/6 ARC: Fixed inline asm contraints to gcc 6.x

Quoted 2 lines · Joseph Myers

longlong.h should be kept in sync with GCC. If the GCC version has been fixed we can copy the updated version verbatim from GCC.

Indeed it is fixed in upstream gcc.

	commit 608e1e3746f5242f0b0987ce64ca99969c33fb48
	Author: claziss <claziss at 138bc75d-0d04-0410-961f-82ee72b054a4>
	Date:   Fri Apr 29 10:11:25 2016 +0000

	    [ARC] Fix obsolete constrain

So I drop this patch from my series and rely on glibc upstream to have this fixed ?

#5 lore raw

RFC 2/6 ARC: Fixed inline asm contraints to gcc 6.x

Quoted 8 lines · Vineet Gupta
Quoted 3 lines · Joseph Myers

longlong.h should be kept in sync with GCC. If the GCC version has been fixed we can copy the updated version verbatim from GCC.

Indeed it is fixed in upstream gcc.

Quoted 8 lines
        commit 608e1e3746f5242f0b0987ce64ca99969c33fb48
        Author: claziss <claziss at 138bc75d-0d04-0410-961f-82ee72b054a4>
        Date:   Fri Apr 29 10:11:25 2016 +0000

            [ARC] Fix obsolete constrain

So I drop this patch from my series and rely on glibc upstream to have this fixed ?

Don't drop the patch; replace it with a patch that copies the file verbatim from the GCC source tree.

zw

#6 lore raw

RFC 3/6 ARC: add definitions to elf/elf.h

In reply to Vineet Gupta
Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 elf/elf.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
elf/elf.h +68 -0
index 3900b4c9f0ca..8b58818228ba 100644
@@ -3757,6 +3757,74 @@ enum
 #define R_METAG_TLS_LE_HI16	60
 #define R_METAG_TLS_LE_LO16	61
 
+/* ARCompact/ARCv2 specific relocs */
+#define R_ARC_NONE		0x0
+#define R_ARC_8			0x1
+#define R_ARC_16		0x2
+#define R_ARC_24		0x3
+#define R_ARC_32		0x4
+#define R_ARC_B26		0x5
+#define R_ARC_B22_PCREL		0x6
+#define R_ARC_H30		0x7
+#define R_ARC_N8		0x8
+#define R_ARC_N16		0x9
+#define R_ARC_N24		0xA
+#define R_ARC_N32		0xB
+#define R_ARC_SDA		0xC
+#define R_ARC_SECTOFF		0xD
+#define R_ARC_S21H_PCREL	0xE
+#define R_ARC_S21W_PCREL	0xF
+#define R_ARC_S25H_PCREL	0x10
+#define R_ARC_S25W_PCREL	0x11
+#define R_ARC_SDA32		0x12
+#define R_ARC_SDA_LDST		0x13
+#define R_ARC_SDA_LDST1		0x14
+#define R_ARC_SDA_LDST2		0x15
+#define R_ARC_SDA16_LD		0x16
+#define R_ARC_SDA16_LD1		0x17
+#define R_ARC_SDA16_LD2		0x18
+#define R_ARC_S13_PCREL		0x19
+#define R_ARC_W			0x1A
+#define R_ARC_32_ME		0x1B
+#define R_ARC_N32_ME		0x1C
+#define R_ARC_SECTOFF_ME	0x1D
+#define R_ARC_SDA32_ME		0x1E
+#define R_ARC_W_ME		0x1F
+#define R_ARC_H30_ME		0x20
+#define R_ARC_SECTOFF_U8	0x21
+#define R_ARC_SECTOFF_S9	0x22
+#define R_AC_SECTOFF_U8		0x23
+#define R_AC_SECTOFF_U8_1	0x24
+#define R_AC_SECTOFF_U8_2	0x25
+#define R_AC_SECTOFF_S9		0x26
+#define R_AC_SECTOFF_S9_1	0x27
+#define R_AC_SECTOFF_S9_2	0x28
+#define R_ARC_SECTOFF_ME_1	0x29
+#define R_ARC_SECTOFF_ME_2	0x2A
+#define R_ARC_SECTOFF_1		0x2B
+#define R_ARC_SECTOFF_2		0x2C
+#define R_ARC_PC32		0x32
+#define R_ARC_GOTPC32		0x33
+#define R_ARC_PLT32		0x34
+#define R_ARC_COPY		0x35
+#define R_ARC_GLOB_DAT		0x36
+#define R_ARC_JUMP_SLOT		0x37
+#define R_ARC_RELATIVE		0x38
+#define R_ARC_GOTOFF		0x39
+#define R_ARC_GOTPC		0x3A
+#define R_ARC_GOT32		0x3B
+
+#define R_ARC_TLS_DTPMOD	0x42
+#define R_ARC_TLS_DTPOFF	0x43
+#define R_ARC_TLS_TPOFF		0x44
+#define R_ARC_TLS_GD_GOT	0x45
+#define R_ARC_TLS_GD_LD	        0x46
+#define R_ARC_TLS_GD_CALL	0x47
+#define R_ARC_TLS_IE_GOT	0x48
+#define R_ARC_TLS_DTPOFF_S9	0x4a
+#define R_ARC_TLS_LE_S9		0x4a
+#define R_ARC_TLS_LE_32		0x4b
+
 __END_DECLS
 
 #endif	/* elf.h */
Signature · 1 line
2.7.4
#7 lore raw

RFC 4/6 ARC: Initial port to glibc

In reply to Vineet Gupta

The starting point for the code was Nios2 port, thanks to them.

Big shout out to Cupertino who spent many weeks / nights debugging the initial bringup of init, sh, running into pesky issues in ARC port of dynamic loader, syscall wrappers, binutils, gcc...

Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 .gitignore                                         |    1 +
 elf/elf.h                                          |    1 +
 sysdeps/arc/Implies                                |    3 +
 sysdeps/arc/Makefile                               |   26 +
 sysdeps/arc/Subdirs                                |    1 +
 sysdeps/arc/Versions                               |   13 +
 sysdeps/arc/__longjmp.S                            |   50 +
 sysdeps/arc/abort-instr.h                          |    2 +
 sysdeps/arc/atomic-machine.h                       |   85 +
 sysdeps/arc/backtrace.c                            |    1 +
 sysdeps/arc/bits/endian.h                          |   12 +
 sysdeps/arc/bits/fenv.h                            |   52 +
 sysdeps/arc/bits/link.h                            |   52 +
 sysdeps/arc/bits/setjmp.h                          |   33 +
 sysdeps/arc/bsd-_setjmp.S                          |    1 +
 sysdeps/arc/bsd-setjmp.S                           |    1 +
 sysdeps/arc/configure                              |   17 +
 sysdeps/arc/configure.ac                           |   13 +
 sysdeps/arc/crti.S                                 |   77 +
 sysdeps/arc/crtn.S                                 |   56 +
 sysdeps/arc/dl-machine.h                           |  332 +++
 sysdeps/arc/dl-runtime.c                           |   21 +
 sysdeps/arc/dl-sysdep.h                            |   25 +
 sysdeps/arc/dl-tls.h                               |   30 +
 sysdeps/arc/dl-trampoline.S                        |   72 +
 sysdeps/arc/gccframe.h                             |   21 +
 sysdeps/arc/gmp-mparam.h                           |   23 +
 sysdeps/arc/jmpbuf-offsets.h                       |   46 +
 sysdeps/arc/jmpbuf-unwind.h                        |   47 +
 sysdeps/arc/ldsodefs.h                             |   43 +
 sysdeps/arc/libc-tls.c                             |   27 +
 sysdeps/arc/libm-test-ulps                         |  394 ++++
 sysdeps/arc/libm-test-ulps-name                    |    1 +
 sysdeps/arc/machine-gmon.h                         |   30 +
 sysdeps/arc/math-tests.h                           |   28 +
 sysdeps/arc/math_private.h                         |   33 +
 sysdeps/arc/memusage.h                             |   23 +
 sysdeps/arc/nptl/Makefile                          |   22 +
 sysdeps/arc/nptl/bits/pthreadtypes-arch.h          |   70 +
 sysdeps/arc/nptl/bits/semaphore.h                  |   32 +
 sysdeps/arc/nptl/pthread_spin_lock.c               |   24 +
 sysdeps/arc/nptl/pthreaddef.h                      |   32 +
 sysdeps/arc/nptl/tcb-offsets.sym                   |   11 +
 sysdeps/arc/nptl/tls.h                             |  151 ++
 sysdeps/arc/preconfigure                           |    6 +
 sysdeps/arc/s_fma.c                                |    1 +
 sysdeps/arc/s_fmaf.c                               |    1 +
 sysdeps/arc/setjmp.S                               |   64 +
 sysdeps/arc/sfp-machine.h                          |   51 +
 sysdeps/arc/sotruss-lib.c                          |   51 +
 sysdeps/arc/stackinfo.h                            |   33 +
 sysdeps/arc/start.S                                |   81 +
 sysdeps/arc/sysdep.h                               |   49 +
 sysdeps/arc/tls-macros.h                           |   29 +
 sysdeps/arc/tst-audit.h                            |   23 +
 sysdeps/unix/sysv/linux/arc/Implies                |    3 +
 sysdeps/unix/sysv/linux/arc/Makefile               |    9 +
 sysdeps/unix/sysv/linux/arc/Versions               |    6 +
 sysdeps/unix/sysv/linux/arc/arch-fork.h            |   35 +
 sysdeps/unix/sysv/linux/arc/bits/mman.h            |   42 +
 sysdeps/unix/sysv/linux/arc/bits/sigaction.h       |   78 +
 sysdeps/unix/sysv/linux/arc/c++-types.data         |   67 +
 sysdeps/unix/sysv/linux/arc/cacheflush.c           |   29 +
 sysdeps/unix/sysv/linux/arc/clone.S                |   97 +
 sysdeps/unix/sysv/linux/arc/configure              |    4 +
 sysdeps/unix/sysv/linux/arc/configure.ac           |    4 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h      |   31 +
 sysdeps/unix/sysv/linux/arc/ld.abilist             |   12 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h             |   24 +
 .../unix/sysv/linux/arc/libBrokenLocale.abilist    |    3 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist         |    6 +
 sysdeps/unix/sysv/linux/arc/libc.abilist           | 2123 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist       |    9 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist          |   11 +
 sysdeps/unix/sysv/linux/arc/libm.abilist           |  370 ++++
 sysdeps/unix/sysv/linux/arc/libnsl.abilist         |  123 ++
 sysdeps/unix/sysv/linux/arc/libpthread.abilist     |  224 +++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist      |   93 +
 sysdeps/unix/sysv/linux/arc/librt.abilist          |   37 +
 sysdeps/unix/sysv/linux/arc/libthread_db.abilist   |   42 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist        |    8 +
 sysdeps/unix/sysv/linux/arc/localplt.data          |   35 +
 sysdeps/unix/sysv/linux/arc/mmap_internal.h        |   26 +
 sysdeps/unix/sysv/linux/arc/profil-counter.h       |    2 +
 sysdeps/unix/sysv/linux/arc/pt-vfork.S             |    1 +
 sysdeps/unix/sysv/linux/arc/shlib-versions         |    2 +
 sysdeps/unix/sysv/linux/arc/sigaction.c            |   64 +
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h       |   28 +
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h         |   36 +
 sysdeps/unix/sysv/linux/arc/sys/procfs.h           |  123 ++
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h         |   40 +
 sysdeps/unix/sysv/linux/arc/sys/user.h             |   32 +
 sysdeps/unix/sysv/linux/arc/syscall.S              |   33 +
 sysdeps/unix/sysv/linux/arc/sysdep-cancel.h        |  140 ++
 sysdeps/unix/sysv/linux/arc/sysdep.c               |   22 +
 sysdeps/unix/sysv/linux/arc/sysdep.h               |  253 +++
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym         |   17 +
 sysdeps/unix/sysv/linux/arc/vfork.S                |   42 +
 98 files changed, 6810 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 create mode 100644 sysdeps/arc/Subdirs
 create mode 100644 sysdeps/arc/Versions
 create mode 100644 sysdeps/arc/__longjmp.S
 create mode 100644 sysdeps/arc/abort-instr.h
 create mode 100644 sysdeps/arc/atomic-machine.h
 create mode 100644 sysdeps/arc/backtrace.c
 create mode 100644 sysdeps/arc/bits/endian.h
 create mode 100644 sysdeps/arc/bits/fenv.h
 create mode 100644 sysdeps/arc/bits/link.h
 create mode 100644 sysdeps/arc/bits/setjmp.h
 create mode 100644 sysdeps/arc/bsd-_setjmp.S
 create mode 100644 sysdeps/arc/bsd-setjmp.S
 create mode 100644 sysdeps/arc/configure
 create mode 100644 sysdeps/arc/configure.ac
 create mode 100644 sysdeps/arc/crti.S
 create mode 100644 sysdeps/arc/crtn.S
 create mode 100644 sysdeps/arc/dl-machine.h
 create mode 100644 sysdeps/arc/dl-runtime.c
 create mode 100644 sysdeps/arc/dl-sysdep.h
 create mode 100644 sysdeps/arc/dl-tls.h
 create mode 100644 sysdeps/arc/dl-trampoline.S
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/gmp-mparam.h
 create mode 100644 sysdeps/arc/jmpbuf-offsets.h
 create mode 100644 sysdeps/arc/jmpbuf-unwind.h
 create mode 100644 sysdeps/arc/ldsodefs.h
 create mode 100644 sysdeps/arc/libc-tls.c
 create mode 100644 sysdeps/arc/libm-test-ulps
 create mode 100644 sysdeps/arc/libm-test-ulps-name
 create mode 100644 sysdeps/arc/machine-gmon.h
 create mode 100644 sysdeps/arc/math-tests.h
 create mode 100644 sysdeps/arc/math_private.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/nptl/Makefile
 create mode 100644 sysdeps/arc/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/arc/nptl/bits/semaphore.h
 create mode 100644 sysdeps/arc/nptl/pthread_spin_lock.c
 create mode 100644 sysdeps/arc/nptl/pthreaddef.h
 create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/arc/nptl/tls.h
 create mode 100644 sysdeps/arc/preconfigure
 create mode 100644 sysdeps/arc/s_fma.c
 create mode 100644 sysdeps/arc/s_fmaf.c
 create mode 100644 sysdeps/arc/setjmp.S
 create mode 100644 sysdeps/arc/sfp-machine.h
 create mode 100644 sysdeps/arc/sotruss-lib.c
 create mode 100644 sysdeps/arc/stackinfo.h
 create mode 100644 sysdeps/arc/start.S
 create mode 100644 sysdeps/arc/sysdep.h
 create mode 100644 sysdeps/arc/tls-macros.h
 create mode 100644 sysdeps/arc/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/Implies
 create mode 100644 sysdeps/unix/sysv/linux/arc/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/arc/Versions
 create mode 100644 sysdeps/unix/sysv/linux/arc/arch-fork.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/mman.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/sigaction.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/cacheflush.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libnsl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep-cancel.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S
.gitignore +1 -0
index 07d4a129e5dc..969dabc873d6 100644
@@ -6,6 +6,7 @@
 *.bz2
 *.rej
 *.orig
+*.sw*
 =*
 TAGS
 TODO
elf/elf.h +1 -0
index 8b58818228ba..dff23c2d2a19 100644
@@ -366,6 +366,7 @@ typedef struct
 /* Old spellings/synonyms.  */
 
 #define EM_ARC_A5	EM_ARC_COMPACT
+#define EM_ARCV2	EM_ARC_COMPACT2
 
 /* If it is necessary to assign new unofficial EM_* values, please
    pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
sysdeps/arc/Implies new file +3 -0
new file mode 100644
index 000000000000..387a0ca05204
@@ -0,0 +1,3 @@
+wordsize-32
+ieee754/dbl-64
+ieee754/flt-32
sysdeps/arc/Makefile new file +26 -0
new file mode 100644
index 000000000000..b43ae0d0dedf
@@ -0,0 +1,26 @@
+# Copyright (C) 1993-2015 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/>.
+
+pic-ccflag = -fpic
+
+# We don't support long doubles as a distinct type.  We don't need to set
+# this variable; it's here mostly for documentational purposes.
+long-double-fcts = no
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
sysdeps/arc/Subdirs new file +1 -0
new file mode 100644
index 000000000000..87eadf302430
@@ -0,0 +1 @@
+soft-fp
sysdeps/arc/Versions new file +13 -0
new file mode 100644
index 000000000000..54ac5e7d1b5f
@@ -0,0 +1,13 @@
+libc {
+  GLIBC_2.24 {
+    __adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2; __extendsfdf2;
+    __fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
+    __fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
+    __floatdidf; __floatdisf; __floatsidf; __floatsisf;
+    __floatundidf; __floatundisf; __floatunsidf; __floatunsisf;
+    __gedf2; __gesf2; __gtdf2; __gtsf2; __ledf2; __lesf2; __ltdf2; __ltsf2;
+    __muldf3; __mulsf3; __nedf2; __nesf2; __negdf2; __negsf2;
+    __subdf3; __subsf3; __truncdfsf2; __unorddf2; __unordsf2;
+    __syscall_error;
+  }
+}
sysdeps/arc/__longjmp.S new file +50 -0

50 lines not on this page · raw message

sysdeps/arc/abort-instr.h new file +2 -0
new file mode 100644
index 000000000000..474098e9a819
@@ -0,0 +1,2 @@
+/* FLAG 1 is privilege mode only instruction, hence will crash any program */
+#define ABORT_INSTRUCTION asm ("flag 1")
sysdeps/arc/atomic-machine.h new file +85 -0

85 lines not on this page · raw message

sysdeps/arc/backtrace.c new file +1 -0
new file mode 100644
index 000000000000..27ce597b3950
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/backtrace.c>
sysdeps/arc/bits/endian.h new file +12 -0
new file mode 100644
index 000000000000..88fbcf39a58a
@@ -0,0 +1,12 @@
+/* The ARC architecture has selectable endianness.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __BIG_ENDIAN__
+# define __BYTE_ORDER __BIG_ENDIAN
+#endif
+#ifdef __LITTLE_ENDIAN__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
sysdeps/arc/bits/fenv.h new file +52 -0

52 lines not on this page · raw message

sysdeps/arc/bits/link.h new file +52 -0

52 lines not on this page · raw message

sysdeps/arc/bits/setjmp.h new file +33 -0
new file mode 100644
index 000000000000..6fe5cbf1f86d
@@ -0,0 +1,33 @@
+/* Define the machine-dependent type `jmp_buf'.  ARC version.
+   Copyright (C) 1992-2015 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_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined(_SETJMP_H) && !defined(_PTHREAD_H)
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer),
+ * blink (branch-n-link) */
+typedef int __jmp_buf[32];
+#endif
+
+#endif
sysdeps/arc/bsd-_setjmp.S new file +1 -0
new file mode 100644
index 000000000000..4e6a2da560c4
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
sysdeps/arc/bsd-setjmp.S new file +1 -0
new file mode 100644
index 000000000000..1da848d2f1ee
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
sysdeps/arc/configure new file +17 -0
new file mode 100644
index 000000000000..2033957d0d9f
@@ -0,0 +1,17 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/arc.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+
+libc_cv_have_sdata_section=no
+
+# For ARC, historically ; was used for comments and not newline
+# Later # also got added to comment list, but ; couldn't be switched to
+# canonical newline as there's lots of code out there which will break
+libc_cv_asm_line_sep='`'
+cat >>confdefs.h <<_ACEOF
+#define ASM_LINE_SEP $libc_cv_asm_line_sep
+_ACEOF
+
+
+libc_cv_fpie=no
sysdeps/arc/configure.ac new file +13 -0
new file mode 100644
index 000000000000..91e58efb35c8
@@ -0,0 +1,13 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/arc.
+
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
+libc_cv_have_sdata_section=no
+
+# For ARC, historically ; was used for comments and not newline
+# Later # also got added to comment list, but ; couldn't be switched to
+# canonical newline as there's lots of code out there which will break
+libc_cv_asm_line_sep='`'
+AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
+
+libc_cv_fpie=no
sysdeps/arc/crti.S new file +77 -0

77 lines not on this page · raw message

sysdeps/arc/crtn.S new file +56 -0

56 lines not on this page · raw message

sysdeps/arc/dl-machine.h new file +332 -0

332 lines not on this page · raw message

sysdeps/arc/dl-runtime.c new file +21 -0
new file mode 100644
index 000000000000..76d39fab5ab8
@@ -0,0 +1,21 @@
+/* PLT jump into resolver passes PC of PLTn, while _dl_fixup expects the
+   address of corresponding .rela.plt entry */
+
+#ifdef __A7__
+#define ARC_PLT_SIZE	12
+#else
+#define ARC_PLT_SIZE	16
+#endif
+
+#define reloc_index					\
+({							\
+  unsigned long plt0 = D_PTR (l, l_info[DT_PLTGOT]);	\
+  unsigned long pltn = reloc_arg;			\
+  /* exclude PL0 and PLT1 */				\
+  unsigned long idx = (pltn - plt0)/ARC_PLT_SIZE - 2;	\
+  idx;							\
+})
+
+#define reloc_offset reloc_index * sizeof (PLTREL)
+
+#include <elf/dl-runtime.c>
sysdeps/arc/dl-sysdep.h new file +25 -0
new file mode 100644
index 000000000000..80a6f58a8eca
@@ -0,0 +1,25 @@
+/* System-specific settings for dynamic linker code.  ARC version.
+   Copyright (C) 2009-2015 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
+
+#define DL_EXTERN_PROTECTED_DATA
sysdeps/arc/dl-tls.h new file +30 -0
new file mode 100644
index 000000000000..8ad07bfc1318
@@ -0,0 +1,30 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2012-2015 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);
+
+/* Value used for dtv entries for which the allocation is delayed.  */
+#define TLS_DTV_UNALLOCATED	((void *) -1l)
sysdeps/arc/dl-trampoline.S new file +72 -0

72 lines not on this page · raw message

sysdeps/arc/gccframe.h new file +21 -0
new file mode 100644
index 000000000000..df7562571dbe
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  ARC version.
+   Copyright (C) 2015 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 40
+
+#include <sysdeps/generic/gccframe.h>
sysdeps/arc/gmp-mparam.h new file +23 -0
new file mode 100644
index 000000000000..67d25d342c0e
@@ -0,0 +1,23 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/gmp-mparam.h>
+
+#define IEEE_DOUBLE_BIG_ENDIAN 0
sysdeps/arc/jmpbuf-offsets.h new file +46 -0

46 lines not on this page · raw message

sysdeps/arc/jmpbuf-unwind.h new file +47 -0

47 lines not on this page · raw message

sysdeps/arc/ldsodefs.h new file +43 -0

43 lines not on this page · raw message

sysdeps/arc/libc-tls.c new file +27 -0
new file mode 100644
index 000000000000..160dacfe6f3c
@@ -0,0 +1,27 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2005-2015 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>
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+  dtv_t *dtv = THREAD_DTV ();
+  return (char *) dtv[1].pointer.val + ti->ti_offset;
+}
sysdeps/arc/libm-test-ulps new file +394 -0

394 lines not on this page · raw message

sysdeps/arc/libm-test-ulps-name new file +1 -0
new file mode 100644
index 000000000000..8c4fba4f9ae0
@@ -0,0 +1 @@
+ARC
sysdeps/arc/machine-gmon.h new file +30 -0
new file mode 100644
index 000000000000..b9bdd2c6d43a
@@ -0,0 +1,30 @@
+/* Machine-dependent definitions for profiling support.  ARC version.
+   Copyright (C) 1996-2015 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>
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+static void __attribute_used__ __mcount_internal (u_long frompc, u_long selfpc)
+
+#define MCOUNT						\
+  asm (".globl _mcount\n\t"				\
+       ".type _mcount, at function\n\t"			\
+       "_mcount:\n\t"					\
+       "flag 1	\n\t"					\
+       ".size _mcount, . - _mcount\n\t"			\
+       );
sysdeps/arc/math-tests.h new file +28 -0
new file mode 100644
index 000000000000..2029c963b6e3
@@ -0,0 +1,28 @@
+/* Configuration for math tests.  ARC version.
+   Copyright (C) 2015 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/>.  */
+
+/* Current ARC soft-float does not support exceptions or 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)
+#define EXCEPTION_TESTS_float	0
+#define EXCEPTION_TESTS_double	0
+#define EXCEPTION_TESTS_long_double	0
+
+#include_next <math-tests.h>
sysdeps/arc/math_private.h new file +33 -0
new file mode 100644
index 000000000000..77416da20387
@@ -0,0 +1,33 @@
+#ifndef _MATH_PRIVATE_H
+
+/* Suppress use of exceptions here to avoid build errors if the FE_*
+   macros aren't defined. Only allow rounding modes implemented for ARC.
+
+   This does mean that some code will silently fail to report exceptions,
+   set rounding mode as expected, etc., but it allows math code to compile
+   that otherwise wouldn't (such as math/s_fma.c) and so is valuable.
+
+   We intentionally ignore the "exception" arguments of functions that
+   take an exception, since we can't even evaluate the argument
+   without causing a build failure.  The extra level of statement
+   expression wrapping avoids "statement with no effect" warnings.
+   Since the callers don't check for errors anyway, we just claim
+   success in every case.
+
+   The overrides for libc_ functions must happen before we include
+   the generic math_private.h, and the overrides for regular
+   <fenv.h> functions must happen afterwards, to avoid clashing with
+   the declarations of those functions.  */
+
+#define libc_fesetround(rnd)                   ({ 0; })
+#define libc_fetestexcept(exc)                 ({ 0; })
+#define libc_feholdexcept_setround(env, exc)   ({ (void) (env); 0; })
+#define libc_feupdateenv_test(env, exc)        ({ (void) (env); 0; })
+
+#include_next <math_private.h>
+
+#define feraiseexcept(excepts)                 ({ 0; })
+#define __feraiseexcept(excepts)               ({ 0; })
+#define feclearexcept(exc)                     ({ 0; })
+
+#endif
sysdeps/arc/memusage.h new file +23 -0
new file mode 100644
index 000000000000..833545084c2f
@@ -0,0 +1,23 @@
+/* Machine-specific definitions for memory usage profiling, ARC version.
+   Copyright (C) 2000-2015 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; })
+
+#define uatomic32_t unsigned int
+
+#include <sysdeps/generic/memusage.h>
sysdeps/arc/nptl/Makefile new file +22 -0
new file mode 100644
index 000000000000..2b7fa79a0ce1
@@ -0,0 +1,22 @@
+# NPTL makefile fragment for ARC.
+# Copyright (C) 2005-2015 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
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +70 -0

70 lines not on this page · raw message

sysdeps/arc/nptl/bits/semaphore.h new file +32 -0
new file mode 100644
index 000000000000..588b957b4dcd
@@ -0,0 +1,32 @@
+/* Machine-specific POSIX semaphore type layouts.  ARC version.
+   Copyright (C) 2002-2015 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;
sysdeps/arc/nptl/pthread_spin_lock.c new file +24 -0
new file mode 100644
index 000000000000..e9b723c37ff6
@@ -0,0 +1,24 @@
+/* pthread spin-lock implementation for ARC.
+   Copyright (C) 2005-2015 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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
+
+/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
+   it will resolve to this very file.  Using "sysdeps/.." as reference to the
+   top level directory does the job.  */
+#include <sysdeps/../nptl/pthread_spin_lock.c>
sysdeps/arc/nptl/pthreaddef.h new file +32 -0
new file mode 100644
index 000000000000..af0a8daa4f92
@@ -0,0 +1,32 @@
+/* pthread machine parameter definitions, ARC version.
+   Copyright (C) 2002-2015 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		4
+
+/* Minimal stack size after allocating thread descriptor and guard size.  */
+#define MINIMAL_REST_STACK	2048
+
+/* Alignment requirement for TCB.  */
+#define TCB_ALIGNMENT		4
+
+/* Location of current stack frame.  */
+#define CURRENT_STACK_FRAME	__builtin_frame_address (0)
sysdeps/arc/nptl/tcb-offsets.sym new file +11 -0
new file mode 100644
index 000000000000..56950e0676ed
@@ -0,0 +1,11 @@
+#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		offsetof (struct pthread, header.multiple_threads)
+TLS_PRE_TCB_SIZE		sizeof (struct pthread)
+TLS_TCB_SIZE            	sizeof(tcbhead_t)
+
+PTHREAD_TID			offsetof(struct pthread, tid)
sysdeps/arc/nptl/tls.h new file +151 -0

151 lines not on this page · raw message

sysdeps/arc/preconfigure new file +6 -0
new file mode 100644
index 000000000000..8a24fcb18319
@@ -0,0 +1,6 @@
+case "$machine" in
+arc*)
+	base_machine=arc
+	machine=arc
+	;;
+esac
sysdeps/arc/s_fma.c new file +1 -0
new file mode 100644
index 000000000000..d9613fa67cef
@@ -0,0 +1 @@
+#include <soft-fp/fmadf4.c>
sysdeps/arc/s_fmaf.c new file +1 -0
new file mode 100644
index 000000000000..aa5c9b2d9136
@@ -0,0 +1 @@
+#include <soft-fp/fmasf4.c>
sysdeps/arc/setjmp.S new file +64 -0

64 lines not on this page · raw message

sysdeps/arc/sfp-machine.h new file +51 -0

51 lines not on this page · raw message

sysdeps/arc/sotruss-lib.c new file +51 -0

51 lines not on this page · raw message

sysdeps/arc/stackinfo.h new file +33 -0
new file mode 100644
index 000000000000..7d8c38715bbf
@@ -0,0 +1,33 @@
+/* Stack environment definitions for ARC.
+   Copyright (C) 2012-2015 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 file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+#include <elf.h>
+
+/* On ARC the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+/* Default to a non-executable stack.  */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W)
+
+#endif	/* stackinfo.h */
sysdeps/arc/start.S new file +81 -0

81 lines not on this page · raw message

sysdeps/arc/sysdep.h new file +49 -0

49 lines not on this page · raw message

sysdeps/arc/tls-macros.h new file +29 -0
new file mode 100644
index 000000000000..51855edef6e7
@@ -0,0 +1,29 @@
+/* Macros to support TLS testing in times of missing compiler support.  */
+
+/* For now */
+#define TLS_LD(x)	TLS_IE(x)
+
+#define TLS_GD(x)					\
+  ({ int *__result;					\
+     __asm__ ("add r0, pcl, @" #x "@tlsgd      \n"     	\
+	  ".tls_gd_ld " #x "`bl __tls_get_addr at plt \n"	\
+	  "mov %0, r0                    \n"		\
+	  : "=&r" (__result)				\
+	  ::"r0","r1","r2","r3","r4","r5","r6","r7",	\
+	    "r8","r9","r10","r11","r12");		\
+     __result; })
+
+#define TLS_LE(x)					\
+  ({ int *__result;					\
+     void *tp = __builtin_thread_pointer();		\
+     __asm__ ("add %0, %1, @" #x "@tpoff   \n"		\
+	  : "=r" (__result) : "r"(tp));	        	\
+     __result; })
+
+#define TLS_IE(x)					\
+  ({ int *__result;					\
+     void *tp = __builtin_thread_pointer();		\
+     __asm__ ("ld %0, [pcl, @" #x "@tlsie]      \n"     \
+	  "add %0, %1, %0                       \n"	\
+	  : "=&r" (__result) : "r" (tp));		\
+     __result; })
sysdeps/arc/tst-audit.h new file +23 -0
new file mode 100644
index 000000000000..16c7028529b4
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing.  ARC version.
+   Copyright (C) 2009-2015 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_arc_gnu_pltenter
+#define pltexit la_arc_gnu_pltexit
+#define La_regs La_arc_regs
+#define La_retval La_arc_retval
+#define int_retval lrv_reg[0]
sysdeps/unix/sysv/linux/arc/Implies new file +3 -0
new file mode 100644
index 000000000000..7f739a0340b6
@@ -0,0 +1,3 @@
+arc/nptl
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
sysdeps/unix/sysv/linux/arc/Makefile new file +9 -0
new file mode 100644
index 000000000000..c22425f08744
@@ -0,0 +1,9 @@
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir),misc)
+# MIPS/Tile-style cacheflush routine
+sysdep_headers += sys/cachectl.h
+sysdep_routines += cacheflush
+endif
sysdeps/unix/sysv/linux/arc/Versions new file +6 -0
new file mode 100644
index 000000000000..e42c85f57594
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.21 {
+    _flush_cache;
+    cacheflush;
+  }
+}
sysdeps/unix/sysv/linux/arc/arch-fork.h new file +35 -0
new file mode 100644
index 000000000000..3ab83156f5a5
@@ -0,0 +1,35 @@
+/* ARCH_FORK definition for Linux fork implementation.  ARC version.
+   Copyright (C) 2005-2015 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 <sched.h>
+#include <signal.h>
+#include <sysdep.h>
+#include <tls.h>
+
+/* Argument 1 - Clone flags.
+            2 - Child stack pointer.
+	    3 - Parent tid pointer.
+	    4 - New TLS area pointer.
+	    5 - Child tid pointer. */
+
+/* clone syscall in kernel (ABI: CONFIG_CLONE_BACKWARDS) */
+
+#define ARCH_FORK() \
+  INLINE_SYSCALL (clone, 5,						\
+		  CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD,	\
+                  NULL, NULL, NULL, &THREAD_SELF->tid)
sysdeps/unix/sysv/linux/arc/bits/mman.h new file +42 -0

42 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/bits/sigaction.h new file +78 -0

78 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/c++-types.data new file +67 -0

67 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/cacheflush.c new file +29 -0
new file mode 100644
index 000000000000..9ea072a28650
@@ -0,0 +1,29 @@
+/* cacheflush system call for ARC Linux.
+   Copyright (C) 2015 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 <stddef.h>
+#include <unistd.h>
+
+/* Flush cache(s).  */
+int
+_flush_cache (char *addr, const int nbytes, const int op)
+{
+  return INLINE_SYSCALL (cacheflush, 3, addr, nbytes, op);
+}
+weak_alias (_flush_cache, cacheflush)
sysdeps/unix/sysv/linux/arc/clone.S new file +97 -0

97 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/configure new file +4 -0
new file mode 100644
index 000000000000..f74fa7cb0259
@@ -0,0 +1,4 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/arc.
+
+arch_minimum_kernel=3.9.0
sysdeps/unix/sysv/linux/arc/configure.ac new file +4 -0
new file mode 100644
index 000000000000..a9528032d32a
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/arc.
+
+arch_minimum_kernel=3.9.0
sysdeps/unix/sysv/linux/arc/kernel-features.h new file +31 -0
new file mode 100644
index 000000000000..e78ee9dacbd2
@@ -0,0 +1,31 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+
+   Copyright (C) 2009-2015 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 <linux/version.h>
+
+/* The minimum supported kernel version for ARC is 3.9,
+   guaranteeing many kernel features.  */
+
+#define __ASSUME_ACCEPT4_SYSCALL        1
+#define __ASSUME_RECVMMSG_SYSCALL       1
+#define __ASSUME_SENDMMSG_SYSCALL       1
+
+#include_next <kernel-features.h>
sysdeps/unix/sysv/linux/arc/ld.abilist new file +12 -0
new file mode 100644
index 000000000000..6001f2e98402
@@ -0,0 +1,12 @@
+GLIBC_2.24
+ GLIBC_2.24 A
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ __stack_chk_guard D 0x4
+ __tls_get_addr F
+ _dl_mcount F
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F
sysdeps/unix/sysv/linux/arc/ldconfig.h new file +24 -0
new file mode 100644
index 000000000000..d5d3646f5b1d
@@ -0,0 +1,24 @@
+/* Copyright (C) 2001-2016 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 SYSDEP_KNOWN_INTERPRETER_NAMES \
+  { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 },
+#define SYSDEP_KNOWN_LIBRARY_NAMES \
+  { "libc.so.6", FLAG_ELF_LIBC6 },	\
+  { "libm.so.6", FLAG_ELF_LIBC6 },
sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist new file +3 -0
new file mode 100644
index 000000000000..0562003fff3c
@@ -0,0 +1,3 @@
+GLIBC_2.24
+ GLIBC_2.24 A
+ __ctype_get_mb_cur_max F
sysdeps/unix/sysv/linux/arc/libanl.abilist new file +6 -0
new file mode 100644
index 000000000000..070f45aeac08
@@ -0,0 +1,6 @@
+GLIBC_2.24
+ GLIBC_2.24 A
+ gai_cancel F
+ gai_error F
+ gai_suspend F
+ getaddrinfo_a F
sysdeps/unix/sysv/linux/arc/libc.abilist new file +2123 -0

114 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libcrypt.abilist new file +9 -0
new file mode 100644
index 000000000000..835e081728ec

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/libdl.abilist new file +11 -0
new file mode 100644
index 000000000000..ec7296aa7502

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/libm.abilist new file +370 -0

370 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libnsl.abilist new file +123 -0

123 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libpthread.abilist new file +224 -0

224 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libresolv.abilist new file +93 -0

93 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/librt.abilist new file +37 -0
new file mode 100644
index 000000000000..c1192b9eca07

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/libthread_db.abilist new file +42 -0

42 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libutil.abilist new file +8 -0
new file mode 100644
index 000000000000..e12934336d7a

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/localplt.data new file +35 -0
new file mode 100644
index 000000000000..ee2b94889b12

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +26 -0
new file mode 100644
index 000000000000..e9b8a4366de6

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/profil-counter.h new file +2 -0
new file mode 100644
index 000000000000..8a6a0bcf3d59

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/pt-vfork.S new file +1 -0
new file mode 100644
index 000000000000..65cc3823ac87

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sigaction.c new file +64 -0

64 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sigcontextinfo.h new file +28 -0
new file mode 100644
index 000000000000..12ca534c9467

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sys/cachectl.h new file +36 -0
new file mode 100644
index 000000000000..1f7db26af6ff

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sys/procfs.h new file +123 -0

123 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +40 -0
new file mode 100644
index 000000000000..37f7f9224853

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sys/user.h new file +32 -0
new file mode 100644
index 000000000000..642f480f2302

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/syscall.S new file +33 -0
new file mode 100644
index 000000000000..1ad559619f69

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sysdep-cancel.h new file +140 -0

140 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sysdep.c new file +22 -0
new file mode 100644
index 000000000000..43cca0fe6688

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/sysdep.h new file +253 -0

253 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/ucontext_i.sym new file +17 -0
new file mode 100644
index 000000000000..5d0b6a1ae67e

Lines of this file are not shown. View the raw message.

sysdeps/unix/sysv/linux/arc/vfork.S new file +42 -0

42 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#8 lore raw

RFC 4/6 ARC: Initial port to glibc

sysdeps/unix/sysv/linux/arc/shlib-versions line 2

Quoted 8 lines · Vineet Gupta
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d
@@ -0,0 +1,2 @@
+DEFAULT                 GLIBC_2.21
+ld=ld-linux.so.2

Is there a reason why you set the ABI baseline to GLIBC_2.21? Why not GLBIC_2.26?

Thanks,
Florian

#9 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 12 lines · Florian Weimer

sysdeps/unix/sysv/linux/arc/shlib-versions line 2

Quoted 8 lines · Vineet Gupta
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d
@@ -0,0 +1,2 @@
+DEFAULT                 GLIBC_2.21
+ld=ld-linux.so.2

Is there a reason why you set the ABI baseline to GLIBC_2.21? Why not GLBIC_2.26?

No real reason, perhaps this is the version where we started off of. I'll change this - and other places to 2.26 !

Thx,
-Vineet

#10 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 15 lines · Vineet Gupta
Quoted 13 lines · Florian Weimer

sysdeps/unix/sysv/linux/arc/shlib-versions line 2

Quoted 9 lines · Vineet Gupta
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d
@@ -0,0 +1,2 @@
+DEFAULT                 GLIBC_2.21
+ld=ld-linux.so.2

Is there a reason why you set the ABI baseline to GLIBC_2.21? Why not GLBIC_2.26?

Quoted 2 lines

No real reason, perhaps this is the version where we started off of. I'll change this - and other places to 2.26 !

Great. Note that this will cause problems with some tests which exercise compatibility symbols. I still want to contribute the build system changes required to support them, but I probably won't be able to make the July 1st deadline.

(Realistically, I'd need a port which can build with build-many-glibcs.py for that anyway.)

Thanks,
Florian

#11 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 2 lines · Florian Weimer

(Realistically, I'd need a port which can build with build-many-glibcs.py for that anyway.)

It's probably not hard to increase the minimum symbol version for an existing port, especially one of the newer ones, for testing purposes. (It's possible you'd find missing SHLIB_COMPAT conditionals or similar in port-specific code when doing so, especially if doing it for an older port.)

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#12 lore raw

RFC 4/6 ARC: Initial port to glibc

In reply to Vineet Gupta
Quoted 2 lines · Vineet Gupta
Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>

We need ChangeLog entries and copyright assignments, but don't use Signed-off-by.

.gitignore line 12

Quoted 12 lines
.gitignore +1 -0
index 07d4a129e5dc..969dabc873d6 100644
@@ -6,6 +6,7 @@
 *.bz2
 *.rej
 *.orig
+*.sw*
 =*
 TAGS
 TODO

I don't think this belongs here. If it does you'll need to explain further.

sysdeps/arc/Makefile line 1

Quoted 7 lines
sysdeps/arc/Makefile new file +1 -0
new file mode 100644
index 000000000000..b43ae0d0dedf
@@ -0,0 +1,26 @@
+# Copyright (C) 1993-2015 Free Software Foundation, Inc.

All new files should have a descriptive comment before the copyright notice. All copyright notices should use <year>-2017 as dates.

sysdeps/arc/Versions line 2

Quoted 8 lines
sysdeps/arc/Versions new file +2 -0
new file mode 100644
index 000000000000..54ac5e7d1b5f
@@ -0,0 +1,13 @@
+libc {
+  GLIBC_2.24 {

As a new port, of course use GLIBC_2.26 for minimum symbol version (or GLIBC_2.27 if that's when it gets in, etc.), and so for any port-specific symbols.

sysdeps/unix/sysv/linux/arc/Versions line 5

Quoted 11 lines
sysdeps/unix/sysv/linux/arc/Versions new file +5 -0
new file mode 100644
index 000000000000..e42c85f57594
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.21 {
+    _flush_cache;
+    cacheflush;
+  }

Same comment on symbol versions applies.

sysdeps/unix/sysv/linux/arc/Versions

Quoted 3 lines
sysdeps/unix/sysv/linux/arc/Versions new file +3 -0
+#define __ASSUME_ACCEPT4_SYSCALL        1
+#define __ASSUME_RECVMMSG_SYSCALL       1
+#define __ASSUME_SENDMMSG_SYSCALL       1

This is the default, so you shouldn't need your kernel-features.h file.

Quoted 8 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +2 -0
new file mode 100644
index 000000000000..6001f2e98402
@@ -0,0 +1,12 @@
+GLIBC_2.24
+ GLIBC_2.24 A

sysdeps/unix/sysv/linux/arc/ld.abilist line 12

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +10 -0
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ __stack_chk_guard D 0x4
+ __tls_get_addr F
+ _dl_mcount F
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F

These ABI lists are in the old format. You need to regenerate them anyway for the increased minimum symbol version.

sysdeps/unix/sysv/linux/arc/shlib-versions line 2

Quoted 8 lines
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d
@@ -0,0 +1,2 @@
+DEFAULT                 GLIBC_2.21
+ld=ld-linux.so.2

Should be 2.26 (or later). Consider using an architecture-specific dynamic linker name as various other architectures do.

Quoted 22 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +16 -0
new file mode 100644
index 000000000000..37f7f9224853
@@ -0,0 +1,40 @@
+/* struct ucontext definition, ARC version.
+   Copyright (C) 2015 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

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 26

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +10 -0
+   <http://www.gnu.org/licenses/>.  */
+
+/* System V/ARC ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/sigcontext.h>

I'd expect includes of bits/types/sigset_t.h and bits/types/stack_t.h like other versions, but not of signal.h.

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 28

Quoted 1 line
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +1 -0
+typedef struct sigcontext mcontext_t;

You can avoid this problematic definition for a new architecture, even while we're still discussing eliminating it for existing architectures.

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 34

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +5 -0
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long uc_flags;
+    struct ucontext *uc_link;

This is now struct ucontext_t.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#13 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 7 lines · Joseph Myers
Quoted 2 lines · Vineet Gupta
Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>

We need ChangeLog entries and copyright assignments, but don't use Signed-off-by.

OK !

Quoted 7 lines
Quoted 7 lines
.gitignore +0 -0
index 07d4a129e5dc..969dabc873d6 100644
@@ -6,6 +6,7 @@
  *.bz2
  *.rej
Quoted 8 lines

.gitignore line 12

Quoted 5 lines
.gitignore +1 -0
  *.orig
+*.sw*
  =*
  TAGS
  TODO

I don't think this belongs here. If it does you'll need to explain further.

Right - that was a local change which seeped out. Now removed.

Quoted 10 lines

sysdeps/arc/Makefile line 1

Quoted 7 lines
sysdeps/arc/Makefile new file +1 -0
new file mode 100644
index 000000000000..b43ae0d0dedf
@@ -0,0 +1,26 @@
+# Copyright (C) 1993-2015 Free Software Foundation, Inc.

All new files should have a descriptive comment before the copyright notice. All copyright notices should use <year>-2017 as dates.

OK !

Quoted 4 lines
Quoted 4 lines
sysdeps/arc/Versions new file +0 -1
new file mode 100644
index 000000000000..54ac5e7d1b5f
--- /dev/null
Quoted 8 lines

sysdeps/arc/Versions line 2

Quoted 4 lines

+++ b/sysdeps/arc/Versions

sysdeps/arc/Versions new file +2 -0
@@ -0,0 +1,13 @@
+libc {
+  GLIBC_2.24 {

As a new port, of course use GLIBC_2.26 for minimum symbol version (or GLIBC_2.27 if that's when it gets in, etc.), and so for any port-specific symbols.

Done !

Quoted 5 lines
Quoted 5 lines
sysdeps/unix/sysv/linux/arc/Versions new file +0 -0
new file mode 100644
index 000000000000..e42c85f57594
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/Versions line 5

Quoted 6 lines
sysdeps/unix/sysv/linux/arc/Versions new file +5 -0
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.21 {
+    _flush_cache;
+    cacheflush;
+  }

Same comment on symbol versions applies.

Done !

Quoted 6 lines

sysdeps/unix/sysv/linux/arc/Versions

Quoted 4 lines
sysdeps/unix/sysv/linux/arc/Versions new file +3 -0
+#define __ASSUME_ACCEPT4_SYSCALL        1
+#define __ASSUME_RECVMMSG_SYSCALL       1
+#define __ASSUME_SENDMMSG_SYSCALL       1

This is the default, so you shouldn't need your kernel-features.h file.

Now removed.

Quoted 14 lines
Quoted 14 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +7 -0
new file mode 100644
index 000000000000..6001f2e98402
@@ -0,0 +1,12 @@
+GLIBC_2.24
+ GLIBC_2.24 A
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ __stack_chk_guard D 0x4
+ __tls_get_addr F
+ _dl_mcount F
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/ld.abilist line 12

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +5 -0
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F

These ABI lists are in the old format. You need to regenerate them anyway for the increased minimum symbol version.

OK !

Quoted 12 lines

sysdeps/unix/sysv/linux/arc/shlib-versions line 2

Quoted 9 lines
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
new file mode 100644
index 000000000000..c4d5d029812d
@@ -0,0 +1,2 @@
+DEFAULT                 GLIBC_2.21
+ld=ld-linux.so.2

Should be 2.26 (or later). Consider using an architecture-specific dynamic linker name as various other architectures do.

OK ! FWIW, this also ties into gcc defined GLIBC_DYNAMIC_LINKER which needs a pairing change as well.

Quoted 7 lines
Quoted 7 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +0 -0
new file mode 100644
index 000000000000..37f7f9224853
@@ -0,0 +1,40 @@

...

Quoted 10 lines

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 26

Quoted 7 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +7 -0
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/sigcontext.h>

I'd expect includes of bits/types/sigset_t.h and bits/types/stack_t.h like other versions, but not of signal.h.

Yeah I see that you recently did sweeping changes to same effect. Noted and updated.

Quoted 5 lines
Quoted 2 lines

+typedef struct sigcontext mcontext_t;

You can avoid this problematic definition for a new architecture, even while we're still discussing eliminating it for existing architectures.

So just use struct sigcontext as data type for uc_mcontext ?

Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 34

Quoted 6 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +5 -0
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long uc_flags;
+    struct ucontext *uc_link;

This is now struct ucontext_t.

Ah I see this was done yesterday on up/master - ok will do !

Thx for taking a quick first pass at the code and providing the comments.

-Vineet

#14 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 6 lines · Vineet Gupta
Quoted 4 lines
Quoted 1 line

+typedef struct sigcontext mcontext_t;

You can avoid this problematic definition for a new architecture, even while we're still discussing eliminating it for existing architectures.

So just use struct sigcontext as data type for uc_mcontext ?

No. Define mcontext_t to be a struct without a tag, with the same layout as struct sigcontext, as the identifier sigcontext (and non-reserved identifiers for its elements) are not in the POSIX namespace permitted for ucontext.h.

https://sourceware.org/ml/libc-alpha/2017-06/msg00946.html

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#15 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 7 lines · Joseph Myers
Quoted 5 lines · Vineet Gupta
Quoted 4 lines
Quoted 1 line

+typedef struct sigcontext mcontext_t;

You can avoid this problematic definition for a new architecture, even while we're still discussing eliminating it for existing architectures.

Quoted 8 lines
Quoted 1 line

So just use struct sigcontext as data type for uc_mcontext ?

No. Define mcontext_t to be a struct without a tag, with the same layout as struct sigcontext, as the identifier sigcontext (and non-reserved identifiers for its elements) are not in the POSIX namespace permitted for ucontext.h.

https://sourceware.org/ml/libc-alpha/2017-06/msg00946.html

thx for this link - per comments there the contents of struct sigcontext could come from kernel which is

   struct sigcontext {
	struct user_regs_struct regs;

};

Now I'd rather prefer to not duplicate user_regs_struct here, but instead just refer to kernel variant, something like ...

typedef struct user_regs_struct mcontext_t;

Will that work or do I absolutely need to redefine this in userspace hdrs ?

-Vineet

#16 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 5 lines · Vineet Gupta

thx for this link - per comments there the contents of struct sigcontext could come from kernel which is

  struct sigcontext {
	struct user_regs_struct regs;
Quoted 8 lines

};

Now I'd rather prefer to not duplicate user_regs_struct here, but instead just refer to kernel variant, something like ...

typedef struct user_regs_struct mcontext_t;

Will that work or do I absolutely need to redefine this in userspace hdrs ?

You have to redefine. Neither "user_regs_struct" nor "regs" is an identifier permitted here by POSIX.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#17 lore raw

RFC 4/6 ARC: Initial port to glibc

In reply to Joseph Myers
Quoted 4 lines · Joseph Myers
Quoted 2 lines
Signed-off-by Cupertino Miranda<cmiranda at synopsys.com>
Signed-off-by Vineet Gupta<vgupta at synopsys.com>

We need ChangeLog entries and copyright assignments, but don't use Signed-off-by.

About the copyright assignment and $start-$end, I suppose end needs to be 2017, what about start - does it need to be specific year.

-Vineet

#18 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 8 lines · Vineet Gupta
Quoted 4 lines · Joseph Myers
Quoted 2 lines
Signed-off-by Cupertino Miranda<cmiranda at synopsys.com>
Signed-off-by Vineet Gupta<vgupta at synopsys.com>

We need ChangeLog entries and copyright assignments, but don't use Signed-off-by.

About the copyright assignment and $start-$end, I suppose end needs to be 2017, what about start - does it need to be specific year.

The start year should be the earliest year in which a published file from which you took copyrightable content was completed. If copyrightable content was copied from another port in glibc, that means you copy the start year from the file you copied from. If this port or parts thereof has been developed in a public version control system, then files that are completely new to this port should use the year of the first revision of those files in that public version control system.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#19 lore raw

ucontect vs. ucontext_t (was Re: [RFC 4/6] ARC: Initial port to glibc)

In reply to Joseph Myers
Quoted 6 lines · Joseph Myers

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 34

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +5 -0
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long uc_flags;
+    struct ucontext *uc_link;

This is now struct ucontext_t.

Isn't this an ABI change. After making change as you suggested, building gcc/libgcc itself fails now as the ARC libgcc unwinder expects ucontext.

	#define MD_FALLBACK_FRAME_STATE_FOR arc_fallback_frame_state

	static __attribute__((noinline)) _Unwind_Reason_Code
	arc_fallback_frame_state (struct _Unwind_Context *context,
				   _Unwind_FrameState *fs)
	{
	  struct rt_sigframe {
	    siginfo_t info;
	    struct ucontext uc;
	    unsigned int sigret_magic;
	  };

Can we atleast define a preprocessor macro to indicate this ABI change so downstream projects can support both things in short term ?

I see other threads on mailing list about distros being notifed etc of this ...

-Vineet

#20 lore raw

ucontect vs. ucontext_t (was Re: [RFC 4/6] ARC: Initial port to glibc)

[ignoring newsgroups]

Quoted 11 lines · Vineet Gupta
Quoted 6 lines · Joseph Myers

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 34

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +5 -0
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long uc_flags;
+    struct ucontext *uc_link;

This is now struct ucontext_t.

Isn't this an ABI change. After making change as you suggested, building gcc/libgcc itself fails now as the ARC libgcc unwinder expects ucontext.

this is a c++ abi change (name mangling of c++ function taking ucontext_t* arguments changes, but such arg should be rare in extern functions)

Quoted 12 lines
    #define MD_FALLBACK_FRAME_STATE_FOR arc_fallback_frame_state

    static __attribute__((noinline)) _Unwind_Reason_Code
    arc_fallback_frame_state (struct _Unwind_Context *context,
                   _Unwind_FrameState *fs)
    {
      struct rt_sigframe {
        siginfo_t info;
        struct ucontext uc;
        unsigned int sigret_magic;
      };
Quoted 3 lines

Can we atleast define a preprocessor macro to indicate this ABI change so downstream projects can support both things in short term ?

this is not an abi issue but api (source code) issue:
there is no 'struct ucontext' in the public api, only ucontext_t (without struct) so i think libgcc should be fixed anyway.

Quoted 3 lines

I see other threads on mailing list about distros being notifed etc of this ...

-Vineet

#21 lore raw

ucontect vs. ucontext_t (was Re: [RFC 4/6] ARC: Initial port to glibc)

In reply to Vineet Gupta
Quoted 10 lines · Vineet Gupta
Quoted 6 lines · Joseph Myers

sysdeps/unix/sysv/linux/arc/sys/ucontext.h line 34

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +5 -0
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long uc_flags;
+    struct ucontext *uc_link;

This is now struct ucontext_t.

Isn't this an ABI change. After making change as you suggested, building gcc/libgcc itself fails now as the ARC libgcc unwinder expects ucontext.

Florian established a lack of ucontext in C++ mangled names in Fedora.

Quoted 2 lines

Can we atleast define a preprocessor macro to indicate this ABI change so downstream projects can support both things in short term ?

Projects should use the standard typedef name ucontext_t unconditionally, not the tag; the typedef name was already present in glibc before this change and should be present in any library implementing these interfaces. See my libgcc patch
<https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>, now committed to trunk. This is much like the removal of the struct siginfo tag a few years ago (including the same motivation, to follow POSIX namespace rules); projects had to use siginfo_t, which already existed, instead.

I see no references to ucontext at all in ARC libgcc (ARC doesn't have a linux-unwind.h file).

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#22 lore raw

ucontect vs. ucontext_t (was Re: [RFC 4/6] ARC: Initial port to glibc)

Quoted 4 lines · Joseph Myers

On Wed, 28 Jun 2017, Vineet Gupta wrote:

I see no references to ucontext at all in ARC libgcc (ARC doesn't have a linux-unwind.h file).

Those bits are still in flight, Claudiu ?

-Vineet

#23 lore raw

RFC 4/6 ARC: Initial port to glibc

In reply to Joseph Myers
Quoted 12 lines · Joseph Myers
Quoted 12 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +6 -0
new file mode 100644
index 000000000000..6001f2e98402
@@ -0,0 +1,12 @@
+GLIBC_2.24
+ GLIBC_2.24 A
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ __stack_chk_guard D 0x4
+ __tls_get_addr F
Quoted 9 lines

sysdeps/unix/sysv/linux/arc/ld.abilist line 12

Quoted 6 lines
sysdeps/unix/sysv/linux/arc/ld.abilist new file +6 -0
+ _dl_mcount F
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F

These ABI lists are in the old format. You need to regenerate them anyway for the increased minimum symbol version.

I regenerated the ABI files, but it seems generated libc abilist is lacking malloc_{get,set}_stated and had to be added manually - which causes a subsequent testsuite failure. Is this (manual addition of entries to abi file) correct or is this a deficiency of ARC port.

Speaking of testsuite, since this is bootstrapping a glibc system we have to resort to using scripts/cross-test-ssh.sh which is a serious pain in the neck. Is there no easy way to build the whole test suite first and then just run it on target.

-Vineet

#24 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 4 lines · Vineet Gupta

I regenerated the ABI files, but it seems generated libc abilist is lacking malloc_{get,set}_stated and had to be added manually - which causes a subsequent testsuite failure. Is this (manual addition of entries to abi file) correct or is this a deficiency of ARC port.

malloc_get_state and malloc_set_state have been obsoleted, meaning that they are not included in any new ports, are not included in static libc for any port and in shared libc in existing ports they are compat symbols that new binaries can't be linked against. (Yes, the testsuite work to support ports postdating that obsoletion is still needed.)

Quoted 4 lines

Speaking of testsuite, since this is bootstrapping a glibc system we have to resort to using scripts/cross-test-ssh.sh which is a serious pain in the neck. Is there no easy way to build the whole test suite first and then just run it on target.

You can probably build the testsuite with "make check" without setting test-wrapper, presuming you've fixed all issues with compilation of the testsuite, then rerun "make check" with test-wrapper specified to run the execution tests. I don't know whether transferring the build directory to a different system for a native "make check" would work, but at least lots of tools would be required on the target to do so.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#25 lore raw

RFC 4/6 ARC: Initial port to glibc

In reply to Joseph Myers

Hi Joseph,

Quoted 7 lines · Joseph Myers
Quoted 2 lines · Vineet Gupta
Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>

We need ChangeLog entries and copyright assignments, but don't use Signed-off-by.

Revisiting glibc upstreaming for ARC. I was told that the lawyers did their "foo". Do you have the copyright assignment from Synopsys already - or do you want me to send it to you (privately perhaps)

glibc has obviously moved on since our initial submission. What branch / tag shall I rebase off of. This also has a bearing on minimum symbol version, which per the last comment on the list was changed to 2.26 across the port !

Thx,
-Vineet

#26 lore raw

RFC 4/6 ARC: Initial port to glibc

Quoted 3 lines · Vineet Gupta

Revisiting glibc upstreaming for ARC. I was told that the lawyers did their "foo". Do you have the copyright assignment from Synopsys already - or do you want me to send it to you (privately perhaps)

I can confirm the assignment is listed in copyright.list.

Quoted 3 lines

glibc has obviously moved on since our initial submission. What branch / tag shall I rebase off of. This also has a bearing on minimum symbol version, which per the last comment on the list was changed to 2.26 across the port !

New port submissions should be based on master, and use the next release's version as minimum symbol version (so GLIBC_2.27 minimum symbol version at present).

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#27 lore raw

RFC 5/6 ARC: Enable __start as entry point vs. canonical _start

In reply to Vineet Gupta

ARC linker scripts have defined __start as entry point so to not break ABI for uClibc et al we allow __start for glibc as well

Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 sysdeps/arc/dl-machine.h | 14 ++++++++++----
 sysdeps/arc/entry.h      |  5 +++++
 sysdeps/arc/start.S      | 14 +++++++++++---
 3 files changed, 26 insertions(+), 7 deletions(-)
 create mode 100644 sysdeps/arc/entry.h
sysdeps/arc/dl-machine.h +10 -4
index 3f985702649d..7f9220339e4c 100644
@@ -21,6 +21,12 @@
 
 #define ELF_MACHINE_NAME "arc"
 
+#include <entry.h>
+
+#ifndef ENTRY_POINT
+#error ENTRY_POINT needs to be defined for ARC
+#endif
+
 #include <string.h>
 #include <link.h>
 #include <dl-tls.h>
@@ -149,9 +155,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 
 #define RTLD_START asm ("\
 .text								\n\
-.globl _start							\n\
-.type _start, @function						\n\
-_start:								\n\
+.globl __start							\n\
+.type __start, @function					\n\
+__start:							\n\
 	; (1). bootstrap ld.so					\n\
 	bl.d    _dl_start                                       \n\
 	mov_s   r0, sp          ; pass ptr to aux vector tbl    \n\
@@ -181,7 +187,7 @@ _start:								\n\
 	add     r0, pcl, _dl_fini at pcl				\n\
 	j	[r13]						\n\
 								\n\
-	.size  _start,.-_start                                  \n\
+	.size  __start,.-__start                                \n\
 	.previous                                               \n\
 ");
 
sysdeps/arc/entry.h new file +5 -0
new file mode 100644
index 000000000000..adb01d981afd
@@ -0,0 +1,5 @@
+#ifndef __ASSEMBLY__
+extern void __start (void) attribute_hidden;
+#endif
+
+#define ENTRY_POINT __start
sysdeps/arc/start.S +11 -3
index 911f7cd3b056..5bdceee3923d 100644
@@ -34,7 +34,14 @@
    <http://www.gnu.org/licenses/>.  */
 
 
+#define __ASSEMBLY__ 1
+#include <entry.h>
+#ifndef ENTRY_POINT
+#error ENTRY_POINT needs to be defined for ARC
+#endif
+
 /* When we enter this piece of code, the program stack looks like this:
+
         argc            argument counter (integer)
         argv[0]         program name (pointer)
         argv[1...N]     program args (pointers)
@@ -45,9 +52,9 @@
 */
 	.text
 	.align 4
-	.global _start
-	.type _start, at function
-_start:
+	.global __start
+	.type __start, at function
+__start:
 	mov	fp, 0
 	ld_s	r1, [sp]	; argc
 
@@ -71,6 +78,7 @@ _start:
 
 	/* Should never get here....  */
 	flag    1
+	.size  __start,.-__start
 
 /* Define a symbol for the first piece of initialized data.  */
 	.data
Signature · 1 line
2.7.4
#28 lore raw

RFC 6/6 ARC: Fix several testsuite failures related to unwinding

In reply to Vineet Gupta

From: Cupertino Miranda <[email protected]>

1. Add BLINK clobber to syscall wrappers allowing unwinding off of sleeping syscalls
(this is arguably excessive, give it is not needed except for a handful of slow syscalls such as read/write/nanosleep...)

2. Rework sigreturn to undo above since we don't want BLINK spilled on stack for this specific case

3. Add dwarf CFI psuedo-ops to various syscall generators

Signed-off-by Cupertino Miranda <cmiranda at synopsys.com>
Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 sysdeps/arc/dl-trampoline.S                 |  9 +++++++++
 sysdeps/arc/sysdep.h                        |  2 ++
 sysdeps/unix/sysv/linux/arc/sigaction.c     |  7 ++++++-
 sysdeps/unix/sysv/linux/arc/sysdep-cancel.h |  4 ++++
 sysdeps/unix/sysv/linux/arc/sysdep.h        | 12 ++++++++----
 5 files changed, 29 insertions(+), 5 deletions(-)
sysdeps/arc/dl-trampoline.S +9 -0
index 0e781af8380e..06fd7ff9a667 100644
@@ -37,11 +37,16 @@
 	st.a	r7, [sp, -4]
 	st.a	r8, [sp, -4]
 	st.a	r9, [sp, -4]
+	cfi_adjust_cfa_offset (40)
 	push_s	blink
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (blink, 0)
 .endm
 
 .macro RESTORE_CALLER_SAVED_BUT_R0
 	ld.ab	blink,[sp, 4]
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (blink)
 	ld.ab	r9, [sp, 4]
 	ld.ab	r8, [sp, 4]
 	ld.ab	r7, [sp, 4]
@@ -51,6 +56,7 @@
 	pop_s   r3
 	pop_s   r2
 	pop_s   r1
+	cfi_adjust_cfa_offset (-36)
 .endm
 
 ; Upon entry, PLTn, which led us here, sets up the following regs
@@ -69,4 +75,7 @@ ENTRY(_dl_runtime_resolve)
 	RESTORE_CALLER_SAVED_BUT_R0
 	j_s.d   [r0]    ; r0 has resolved function addr
 	pop_s   r0      ; restore first arg to resolved call
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (r0)
+
 END(_dl_runtime_resolve)
sysdeps/arc/sysdep.h +2 -0
index d57f1c0c60a4..c4495bd877c9 100644
@@ -32,10 +32,12 @@
     .globl C_SYMBOL_NAME(name)			ASM_LINE_SEP	\
     .type C_SYMBOL_NAME(name),%function		ASM_LINE_SEP	\
   C_LABEL(name)					ASM_LINE_SEP	\
+    cfi_startproc				ASM_LINE_SEP	\
     CALL_MCOUNT
 
 #undef  END
 #define END(name)						\
+  cfi_endproc					ASM_LINE_SEP	\
   ASM_SIZE_DIRECTIVE(name)
 
 #ifdef SHARED
sysdeps/unix/sysv/linux/arc/sigaction.c +6 -1
index 2bd7b0f08ddc..e2b898039df1 100644
@@ -26,7 +26,12 @@
  */
 static void __default_rt_sa_restorer(void)
 {
-	INTERNAL_SYSCALL_NCS(__NR_rt_sigreturn, , 0);
+	/* Don't use INTERNAL_SYSCALL_NCS as it causes blink to be spilled on stack */
+	asm volatile(
+		"mov r8, %0	\n\t"	\
+		ARC_TRAP_INSN		\
+	:
+	: "r"(__NR_rt_sigreturn));
 }
 
 #define SA_RESTORER	0x04000000
sysdeps/unix/sysv/linux/arc/sysdep-cancel.h +4 -0
index db89ad033a79..b2dbb8670874 100644
@@ -83,10 +83,14 @@
 
 .macro PUSH reg
 	st.a \reg, [sp, -4]
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (\reg, 0)
 .endm
 
 .macro POP reg
 	ld.ab \reg, [sp, 4]
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (\reg)
 .endm
 
 #define DOCARGS_0	PUSH blink
sysdeps/unix/sysv/linux/arc/sysdep.h +8 -4
index 507d06a8a575..492a709b51fd 100644
@@ -103,8 +103,12 @@
 # define SYSCALL_ERROR_HANDLER					\
 0:						ASM_LINE_SEP	\
     st.a   blink, [sp, -4]			ASM_LINE_SEP	\
+    cfi_adjust_cfa_offset (4)			ASM_LINE_SEP	\
+    cfi_rel_offset (blink, 0)			ASM_LINE_SEP	\
     CALL_ERRNO_SETTER_C				ASM_LINE_SEP	\
     ld.ab  blink, [sp, 4]			ASM_LINE_SEP	\
+    cfi_adjust_cfa_offset (-4)			ASM_LINE_SEP	\
+    cfi_restore (blink)				ASM_LINE_SEP	\
     j      [blink]
 
 # define DO_CALL(syscall_name, args)				\
@@ -137,13 +141,13 @@ hidden_proto (__syscall_error)
 	__res = INTERNAL_SYSCALL_NCS(__NR_##name, , nr_args, args);	\
 	if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P ((__res), ), 0))	\
 	{								\
-		asm volatile ("st.a blink, [sp, -4] \n\t"         	\
+		asm volatile ( \
 			       CALL_ERRNO_SETTER                   	\
-			      "ld.ab blink, [sp, 4] \n\t"         	\
 			      :"+r" (__res)                 		\
 			      :                                   	\
 			      :"r1","r2","r3","r4","r5","r6",		\
-			        "r7","r8","r9","r10","r11","r12");	\
+			        "r7","r8","r9","r10","r11","r12",	\
+			        "blink");				\
 	}								\
 	__res;								\
 })
@@ -174,7 +178,7 @@ hidden_proto (__syscall_error)
 		ARC_TRAP_INSN				\
 		: "+r" (__ret)				\
 		: "r"(_sys_num) ASM_ARGS_##nr_args	\
-		: "memory");				\
+		: "memory", "blink");				\
                                                         \
 	__ret;						\
 })
Signature · 1 line
2.7.4
#30 lore raw

cover glibc port to ARC architecture

Quoted 7 lines · Florian Weimer
Quoted 4 lines · Vineet Gupta

This is a Request for comments for glibc port to ARC architecture.
http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx

The Linux kernel, uClibc, buildroot have been upstream for quite some time.

Is it possible to build the new port with scripts/build-many-glibcs.py?

More specifically:

Any new port should have support added to build-many-glibcs.py for all ABIs supported by the port (e.g. both endiannesses, if you support both BE and LE, and any other ABI variants).

You should make sure that produces clean test results for all the compilation tests, for all those variants.

You should also include results for the full testsuite, including execution tests (whether testing natively, or cross testing with test-wrapper set to execute tests for a cross build), in the submission of the port (and those should be as clean as possible).

Any new port should be added to the list in README, and have a NEWS entry added.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#31 lore raw

cover glibc port to ARC architecture

Quoted 8 lines · Joseph Myers
Quoted 6 lines · Florian Weimer
Quoted 4 lines · Vineet Gupta

This is a Request for comments for glibc port to ARC architecture.
http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx

The Linux kernel, uClibc, buildroot have been upstream for quite some time.

Quoted 7 lines
Quoted 1 line

Is it possible to build the new port with scripts/build-many-glibcs.py?

More specifically:

Any new port should have support added to build-many-glibcs.py for all ABIs supported by the port (e.g. both endiannesses, if you support both BE and LE, and any other ABI variants).

I added the trivial bits to build-many-glibcs.py for supporting ARC, but it seems there are some roadblocks.

1. There are still some in-flight patches for gcc/binutils upstreaming. The latest working versions are hoisted on on SNPS github portal, but that won't fly I guess. Anyhow for now, the upstream versions are likely to suffice for say building part.

2. The immediate (and embarrassing) issue is trying to figure out how to make the build-many-glibcs.py script work. A wiki page for new ports would have helped a lot.

- How do I call it the first time, with my existing version of glibc. The checkout process, gets upstream glibc and tries to build that instead.

- So I created a src directory manually, will all other tools and glibc being a symlink to my existing glibc tree and calling it as follows

$ test-glibc/src/glibc>./scripts/build-many-glibcs.py <abs-path>/test-glibc 
compilers  arc-linux-gnu

FAIL: compilers-arc-linux-gnu check-host-libraries
UNRESOLVED: compilers-arc-linux-gnu binutils rm
UNRESOLVED: compilers-arc-linux-gnu binutils mkdir
UNRESOLVED: compilers-arc-linux-gnu binutils configure
UNRESOLVED: compilers-arc-linux-gnu binutils build
...

I'm missing obvious/simple stuff, but this is a new env for me.

-Vineet

#32 lore raw

cover glibc port to ARC architecture

Quoted 2 lines · Vineet Gupta

- How do I call it the first time, with my existing version of glibc. The checkout process, gets upstream glibc and tries to build that instead.

build-many-glibcs.py <dir> checkout
[replace the src/glibc directory there with a different branch if desired] build-many-glibcs.py <dir> host-libraries
build-many-glibcs.py <dir> compilers <targets> build-many-glibcs.py <dir> glibcs <targets>

(It won't actually check that components are checked out from the repositories / branches it thinks they are, so replacing by a checkout from a different location should work fine.)

It's expected that upstream glibc should work with upstream versions of the relevant other toolchain components; we don't want a repeat of the NaCl situation, or the situation with MicroBlaze for a long time, where required changes either never got upstream or took a very long time to get upstream. It's possible for very new ports that it only works with upstream mainline and not the most recent releases, although I'd encourage you to act like the RISC-V maintainers and e.g. actively backport important fixes to the most recent binutils release branch.

"work" should include clean results from the compilation tests, as run by build-many-glibcs.py for the "glibcs" action.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#33 lore raw

cover glibc port to ARC architecture

In reply to Joseph Myers
Quoted 8 lines · Joseph Myers
Quoted 6 lines · Florian Weimer
Quoted 4 lines · Vineet Gupta

This is a Request for comments for glibc port to ARC architecture.
http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx

The Linux kernel, uClibc, buildroot have been upstream for quite some time.

Quoted 7 lines
Quoted 1 line

Is it possible to build the new port with scripts/build-many-glibcs.py?

More specifically:

Any new port should have support added to build-many-glibcs.py for all ABIs supported by the port (e.g. both endiannesses, if you support both BE and LE, and any other ABI variants).

build-many-glibcs.py works for ARC now - after the 2 backports to gcc 7.2

Quoted 7 lines

You should make sure that produces clean test results for all the compilation tests, for all those variants.

You should also include results for the full testsuite, including execution tests (whether testing natively, or cross testing with test-wrapper set to execute tests for a cross build), in the submission of the port (and those should be as clean as possible).

ATM we have around 200 failures for upstream tools (likely due to libgcc unwinder patch not yet merged upstream). And just for data point, with github based gcc including the non-merged patches that number comes down to ~100. Bunch of them are in math/doubler and some in backtrace/nptl. Will this be considered a blocker. I'm almost ready for next round, rebased recently !

-Vineet

#34 lore raw

cover glibc port to ARC architecture

Quoted 5 lines · Vineet Gupta
Quoted 3 lines

Any new port should have support added to build-many-glibcs.py for all ABIs supported by the port (e.g. both endiannesses, if you support both BE and LE, and any other ABI variants).

build-many-glibcs.py works for ARC now - after the 2 backports to gcc 7.2

Works with clean compilation test results for the glibc testsuite?

Quoted 8 lines
Quoted 7 lines

You should make sure that produces clean test results for all the compilation tests, for all those variants.

You should also include results for the full testsuite, including execution tests (whether testing natively, or cross testing with test-wrapper set to execute tests for a cross build), in the submission of the port (and those should be as clean as possible).

Quoted 5 lines

ATM we have around 200 failures for upstream tools (likely due to libgcc unwinder patch not yet merged upstream). And just for data point, with github based gcc including the non-merged patches that number comes down to ~100. Bunch of them are in math/doubler and some in backtrace/nptl. Will this be considered a blocker. I'm almost ready for next round, rebased recently !

You should make sure you regenerate libm-test-ulps for your port (from scratch, truncate the file and run make regen-ulps).

If you look at
<https://sourceware.org/glibc/wiki/Release/2.26#Architecture-independent>
you'll see some known architecture-independent issues that are generic for certain cases (some cases of cross-testing, particular kernel versions, etc.). Beyond anything listed there, I'd say you should have no more than 10-20 FAILs in a well-maintained port, preferably less than that. 100 FAILs indicates there's still some work to do before the port can be considered to be in a good state.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#35 lore raw

cover glibc port to ARC architecture

Quoted 9 lines · Joseph Myers
Quoted 5 lines · Vineet Gupta
Quoted 3 lines

Any new port should have support added to build-many-glibcs.py for all ABIs supported by the port (e.g. both endiannesses, if you support both BE and LE, and any other ABI variants).

build-many-glibcs.py works for ARC now - after the 2 backports to gcc 7.2

Works with clean compilation test results for the glibc testsuite?

I presume you just want to know 010-glibcs-arc-linux-gnu-check-*.txt after running

scripts/build-many-glibcs.py <path> glibcs arc-linux-gnu

FAIL: elf/check-localplt
Summary of test results:

       1 FAIL
    1169 PASS
      15 XFAIL

And even that failure is weird as
(1) this is despite my updates to .../arc/localplt.data
(2) My buildrooot based build reports this test to pass (after my update) but still fails in build-many-glibc based build.

Anyhow seems like this should be easy to figure - not mission critical as the system running testsuite xcheck is bootstrapped with same ld.so / libc etc.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

You should make sure that produces clean test results for all the compilation tests, for all those variants.

You should also include results for the full testsuite, including execution tests (whether testing natively, or cross testing with test-wrapper set to execute tests for a cross build), in the submission of the port (and those should be as clean as possible).

Quoted 8 lines
Quoted 5 lines

ATM we have around 200 failures for upstream tools (likely due to libgcc unwinder patch not yet merged upstream). And just for data point, with github based gcc including the non-merged patches that number comes down to ~100. Bunch of them are in math/doubler and some in backtrace/nptl. Will this be considered a blocker. I'm almost ready for next round, rebased recently !

You should make sure you regenerate libm-test-ulps for your port (from scratch, truncate the file and run make regen-ulps).

Thx, that indeed help with quite a few failures.

Quoted 8 lines

If you look at
<https://sourceware.org/glibc/wiki/Release/2.26#Architecture-independent>
you'll see some known architecture-independent issues that are generic for certain cases (some cases of cross-testing, particular kernel versions, etc.). Beyond anything listed there, I'd say you should have no more than 10-20 FAILs in a well-maintained port, preferably less than that. 100 FAILs indicates there's still some work to do before the port can be considered to be in a good state.

The 100 were due to lack of c++ support, stale math ulps etc, default sa_restorer generated code etc (which libgcc unwinder is choosy about). And then there were some genuine fixes such as:

csu/test-as-const-tcb-offsets
misc/tst-syscall-list
dlfcn/tststatic5
misc/tst-clone3
...

We are now down to 51 (with github based gcc: more obviously with upstream gcc). I think only a very small percentage (~10% guess) would be due to missing glibc bits per-se.

Do you think it would be considered review/merge worthy. I will continue to work on bringing down failures. Otherwise new changes will mean I keep missing the sweeping arch updates / more failures ... I can post the full set of current failures if that helps steer decision.

-Vineet

#36 lore raw

cover glibc port to ARC architecture

Quoted 11 lines · Vineet Gupta

I presume you just want to know 010-glibcs-arc-linux-gnu-check-*.txt after running

scripts/build-many-glibcs.py <path> glibcs arc-linux-gnu

FAIL: elf/check-localplt
Summary of test results:
1 FAIL
1169 PASS
15 XFAIL

Quoted 4 lines

And even that failure is weird as
(1) this is despite my updates to .../arc/localplt.data
(2) My buildrooot based build reports this test to pass (after my update) but still fails in build-many-glibc based build.

The 011 log should show the output of all non-PASS tests, so allowing you to identify the problem local PLT entry use (or if applicable, PLT entry not used that was expected to be used). If it's e.g. compiler-version-specific and hard to fix for some reason, note how entries in localplt.data can use "?" to mark them optional (or can specify an alternative relocation, in cases where a function is meant to be interposable but may not have a PLT entry).

Quoted 2 lines

Anyhow seems like this should be easy to figure - not mission critical as the system running testsuite xcheck is bootstrapped with same ld.so / libc etc.

For build-many-glibcs.py use to detect testsuite regressions for a configuration, the baseline required is *no* failures in the parts of the testsuite it runs. If there are any failures at all, that serves to hide regressions (additional tests starting to fail, or the testsuite starting to fail to build), because it just distinguishes zero / nonzero exit status from "make check".

Quoted 5 lines

We are now down to 51 (with github based gcc: more obviously with upstream gcc). I think only a very small percentage (~10% guess) would be due to missing glibc bits per-se.

Do you think it would be considered review/merge worthy. I will continue to

I think a plausible state to be merge-ready would be no more than 20 architecture-specific failures, *with upstream GCC and binutils*. We've had enough problems in the past with glibc ports that turn out to rely on non-upstream toolchain pieces that I think you need results with upstream tools essentially as good as those with non-upstream before inclusion of the port is appropriate. So you should get whatever GCC fixes are needed upstream sooner rather than later. (That means upstream in GCC mainline so GCC 8 is ready for the port. Release branch backports are at your discretion, although it's generally a good idea to make sure the GCC port is in a good state in the most recent release branch, where there is any GCC release branch supporting the architecture at all.)

That does not mean you should stop work on eliminating failures once down to 20, as many ports are rather better than that, just that 20 is more comparable with other reasonably well maintained glibc ports.

It's still be appropriate to submit the code for review now, before you're down to 20 failures, given that a port is likely to need to go through multiple rounds of review anyway before it's ready for inclusion in glibc.

Note that it should be possible for a new port to go into glibc during the release freeze period (January), provided it's clear the changes cannot affect other ports. So if you have any fixes to architecture-independent parts of glibc that are needed for this port, you should submit them as soon as possible, and separately from the main port submission.

Quoted 4 lines

work
on bringing down failures. Otherwise new changes will mean I keep missing the sweeping arch updates / more failures ... I can post the full set of current failures if that helps steer decision.

The full list of failures, and whatever analysis you have of their causes / symptoms, should certainly be included in every submission of the port.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#37 lore raw

cover glibc port to ARC architecture

In reply to Vineet Gupta

I don't see a corporate copyright assignment (or disclaimer plus individual assignments) from Synopsys in the FSF copyright.list. The assignment will be needed before we can consider this port.

Signature · 2 lines
Joseph S. Myers
joseph at codesourcery.com
#38 lore raw

cover glibc port to ARC architecture

Quoted 4 lines · Joseph Myers

I don't see a corporate copyright assignment (or disclaimer plus individual assignments) from Synopsys in the FSF copyright.list. The assignment will be needed before we can consider this port.

Right we missed this ! FWIW we did the agreements for gcc, gdb and binutils and will get the paperwork going for glibc as well.

Thx,
-Vineet