[v6,00/11] nds32 glibc port, v6
mbox series

Message ID 1561822890-23219-1-git-send-email-vincentc@andestech.com
Headers show
Series
  • nds32 glibc port, v6
Related show

Message

Vincent Chen June 29, 2019, 3:41 p.m. UTC
This is the 6th version of nds32 ports. The major modification in this
patchset is to change the data length of off_t, rlim_t, fsblkcnt_t,
fsfilcnt_t and ino_t from 32 bits to 64 bits, because in all nds32
supported kernel, these data types used by syscall handler are 64 bits
version. Hence, It seems a bit pointless to uses 32 bits version of
these types in user space. Thanks to Arnd Bergmann for this suggestion.

All CPU-relative information can be found from
<http://www.andestech.com/en/products-solutions/product-documentation/>.
The ISA and ABI used in nds32 ports are documented in the "AndeStar ISA Manual"
and "Andes Programming Guide for ISA V3", respectively.

The patchset has been tested by glibc testsuite on FPGA board based on
kernel 5.0 and glibc commit "fefa21790". In addition to the known
architecture-independent issues on the per-release wiki pages, there are three
unexpected FAIL cases, libio/tst-wfile-sync, io/tst-lockf and timezone/tst-tzse.
The reasons for their failure are as follows.

1. libio/tst-wfile-sync
In the testcase, an unexpected Error code -ESPIPE retunred by the function
xlseek() causes this testcase to fail. This is an architecture independent
issue and I have reported it to Bugzilla (Bug 24668).

2. io/tst-lockf
When the macro __OFF_T_MATCHES_OFF64_T is defined, the __lockf64 function
shall be used instead of lockf. However, in lockf.c, the typesizes.h which
defines the macro __OFF_T_MATCHES_OFF64_T is included after the
condition "ifndef __OFF_T_MATCHES_OFF64_T". It causes that lockf is always
linked. I have sent a patch to fix this bug. 
(https://sourceware.org/ml/libc-alpha/2019-06/msg00856.html)

3. timezone/tst-tzset
When the data length of off_t is extend from 32 bits to 64 bits, the file
offset does not overflow after calling function
lseek(fd,0xffffffff-6,SEEK_CUR). However, the maximum offset of file system
does not changed in kernel. Hence, if the file system does not support file
offsets greater than 0xffffffff, the function write(fd,,1) will return the
EFBIG error code and the testcase will fail.

UNSUPPORTED misc/tst-ofdlocks-compat
UNSUPPORTED misc/tst-pkey
UNSUPPORTED string/tst-strcoll-overflow
UNSUPPORTED time/tst-y2039
UNSUPPORTED resolv/tst-p_secstodate
UNSUPPORTED resolv/tst-resolv-ai_idn
UNSUPPORTED resolv/tst-resolv-ai_idn-latin1
UNSUPPORTED posix/tst-glob_lstat_compat
UNSUPPORTED posix/tst-spawn4-compat
UNSUPPORTED posix/tst-sysconf-empty-chroot
UNSUPPORTED crypt/cert
UNSUPPORTED stdlib/test-bz22786
UNSUPPORTED stdlib/tst-strtod-overflow
UNSUPPORTED malloc/tst-mallocstate
UNSUPPORTED iconv/tst-gconv-init-failure
UNSUPPORTED math/test-matherr
UNSUPPORTED math/test-matherr-2
FAIL sunrpc/bug20790
FAIL libio/tst-wfile-sync
FAIL nptl/test-cond-printers
FAIL nptl/test-condattr-printers
FAIL nptl/test-mutex-printers
FAIL nptl/test-mutexattr-printers
FAIL nptl/test-rwlock-printers
FAIL nptl/test-rwlockattr-printers
FAIL io/tst-lockf
FAIL timezone/tst-tzset
FAIL stdio-common/bug22
XPASS elf/tst-protected1a
XPASS elf/tst-protected1b

  11 FAIL cases 
  5276 PASS case
  17 UNSUPPORT case
  17 XFAIL case
  2 XPASS case

The detailed testing results can be found in the following link.
(https://github.com/andestech/glibc/blob/nds32-glibc-2.29-v6/nds32_glibc_test_result.tar.gz)

This patchset cannot be compiled due to the lack of the Linux 4 hash code.
I have sent a patch to add it (https://sourceware.org/ml/libc-alpha/2019-06/msg00962.html)
The following logs for build and make check by build-many-glibcs.py has
included the above patch.
(https://github.com/andestech/glibc/blob/nds32-glibc-2.29-v6/nds32_build-many-glibcs.tar.gz)

The short log of the changes since our v6 includes:
* Extend off_t, ino_t, rlim_t, fsblkcnt_t and fsfilcnt_t from 32 bits to 64 bits.
* Replace PREPARE_VERSION with PREPARE_VERSION_KNOWN

[v5] The highlight of the changes since our v4 includes:
* Remove hard-fp support
* Modify the base version of cacheflush to GLIBC_2.30
* Remove __ctx macro 
* Modify code to meet the coding style requirements


[v4] The highlight of the changes since our v3 includes:
* Add FP extension support
* Use init_array to call PREINIT_FUNCTION
* Modify ports to meet current program flow. 
* Update Copyright


[v3] The highlight of the changes since our v2 includes:
* Add MAP_FIXED_NOREPLACE definition to mman.h
* Mark _init and _fini as hidden in nds32 crti.S
* Replace u_long with unsigned long int
* Add a space between __attribute__ and '((' in sysdeps/nds32/bits/setjmp.h.
* Remove fno-isolate-erroneous-paths-dereference option from nds32 Makefile
  after adding __builtin_trap support to gcc
* Set arch_minimum_kernel as 4.17.0
* Replace 'long' and 'unsigned long' with 'long int' and 'unsigned long int'
* Remove the comma which is after the last element of an enum in
  sysdeps/nds32/bits/fenv.h
* Correct copyright
* Remove empty ABI test baselines
* Code cleanup for syscall.c
* Code cleanup for sysdeps/nds32/tls-macros.h

[v2] The highlight of the changes since our v1 includes:
* Update ABI list.
* Upadate libm-test-ulps file.
* Add fno-isolate-erroneous-paths-dereference compile option to
  CFLAGS-divrem.c to avoid compiler calling abort() function for
  divde-by-zero case.
* Update the list of register preservation and move the list from
  sysdeps/nds32/__longjmp.S to sysdeps/nds32/setjmp.h.
* Remove sysdeps/nds32/backtrace.c.
* Remove big endian support.
* Add description for compile option -minline-asm-r15 to configure file.
* Refine sysdeps/nds32/dl-machine.h.
* Remove sysdeps/nds32/math_private.h
* Refine memcpy and memset function of nds32 version
* Define THREAD_GSCOPE_IN_TCB in sysdeps/nds32/nptl/tls.h to fix compiler
  error
* Rename dynamic linker based on supported ABI.
* Remove big endian support
* To use generic fork function, define __ASSUME_CLONE_BACKWARDS and remove
  nds32 arch-fork.h
* Remove nds32 kernel_sigaction.h
* Remove nds32 readahead.c
* Remove unused macro from sigcontextinfo.h
* Refine nds32 syscall.c
* Add MAP_SYNC from Linux 4.15
* Add change log to the end of each commit.


CheWei Chunang (1):
  Add nds32 port to build-many-glibcs.py

Vincent Chen (10):
  nds32: Build Infastructure
  nds32: ABI Implementation
  nds32: Thread-Local Storage Support
  nds32: Startup and Dynamic Loader
  nds32: Generic <math.h>, soft-fp Routines
  nds32: Atomic and Locking Routines
  nds32: Linux Syscall Interface
  nds32: Linux ABI
  nds32: Add ABI list
  Add nds32 port skeleton

 ChangeLog                                          |  108 +
 NEWS                                               |    4 +
 README                                             |    1 +
 scripts/build-many-glibcs.py                       |    7 +
 sysdeps/nds32/Implies                              |    4 +
 sysdeps/nds32/Makefile                             |   11 +
 sysdeps/nds32/__longjmp.S                          |   32 +
 sysdeps/nds32/atomic-machine.h                     |  162 ++
 sysdeps/nds32/bits/endian.h                        |   29 +
 sysdeps/nds32/bits/fenv.h                          |   51 +
 sysdeps/nds32/bits/link.h                          |   54 +
 sysdeps/nds32/bits/setjmp.h                        |   45 +
 sysdeps/nds32/bsd-_setjmp.S                        |    1 +
 sysdeps/nds32/bsd-setjmp.S                         |    1 +
 sysdeps/nds32/configure                            |   10 +
 sysdeps/nds32/configure.ac                         |   10 +
 sysdeps/nds32/dl-machine.h                         |  404 ++++
 sysdeps/nds32/dl-sysdep.h                          |   22 +
 sysdeps/nds32/dl-tls.h                             |   28 +
 sysdeps/nds32/dl-tlsdesc.S                         |  109 +
 sysdeps/nds32/dl-tlsdesc.h                         |   61 +
 sysdeps/nds32/dl-trampoline.S                      |  164 ++
 sysdeps/nds32/gccframe.h                           |   21 +
 sysdeps/nds32/jmpbuf-offsets.h                     |   34 +
 sysdeps/nds32/jmpbuf-unwind.h                      |   47 +
 sysdeps/nds32/ldsodefs.h                           |   44 +
 sysdeps/nds32/linkmap.h                            |   25 +
 sysdeps/nds32/machine-gmon.h                       |   34 +
 sysdeps/nds32/memcpy.S                             |  101 +
 sysdeps/nds32/memset.S                             |  120 ++
 sysdeps/nds32/memusage.h                           |   21 +
 sysdeps/nds32/nofpu/Implies                        |    1 +
 sysdeps/nds32/nofpu/libm-test-ulps                 |  390 ++++
 sysdeps/nds32/nofpu/libm-test-ulps-name            |    1 +
 sysdeps/nds32/nptl/Makefile                        |    4 +
 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h        |   71 +
 sysdeps/nds32/nptl/bits/semaphore.h                |   32 +
 sysdeps/nds32/nptl/pthread-offsets.h               |   23 +
 sysdeps/nds32/nptl/pthreaddef.h                    |   33 +
 sysdeps/nds32/nptl/tcb-offsets.sym                 |    7 +
 sysdeps/nds32/nptl/tls.h                           |  155 ++
 sysdeps/nds32/preconfigure                         |   28 +
 sysdeps/nds32/setjmp.S                             |   64 +
 sysdeps/nds32/sfp-machine.h                        |   70 +
 sysdeps/nds32/sotruss-lib.c                        |   50 +
 sysdeps/nds32/stackinfo.h                          |   32 +
 sysdeps/nds32/start.S                              |  124 ++
 sysdeps/nds32/strcmp.S                             |  111 ++
 sysdeps/nds32/strcpy.S                             |   85 +
 sysdeps/nds32/sysdep.h                             |   58 +
 sysdeps/nds32/tininess.h                           |    1 +
 sysdeps/nds32/tls-macros.h                         |   75 +
 sysdeps/nds32/tlsdesc.c                            |   38 +
 sysdeps/nds32/tlsdesc.sym                          |   16 +
 sysdeps/nds32/tst-audit.h                          |   23 +
 sysdeps/unix/sysv/linux/nds32/Implies              |    3 +
 sysdeps/unix/sysv/linux/nds32/Makefile             |   16 +
 sysdeps/unix/sysv/linux/nds32/Versions             |   11 +
 sysdeps/unix/sysv/linux/nds32/bits/environments.h  |   55 +
 sysdeps/unix/sysv/linux/nds32/bits/procfs.h        |   35 +
 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h        |   24 +
 sysdeps/unix/sysv/linux/nds32/bits/stat.h          |  150 ++
 sysdeps/unix/sysv/linux/nds32/bits/statfs.h        |   64 +
 sysdeps/unix/sysv/linux/nds32/bits/typesizes.h     |   80 +
 sysdeps/unix/sysv/linux/nds32/c++-types.data       |   67 +
 sysdeps/unix/sysv/linux/nds32/clone.S              |   66 +
 sysdeps/unix/sysv/linux/nds32/configure            |    4 +
 sysdeps/unix/sysv/linux/nds32/configure.ac         |    4 +
 sysdeps/unix/sysv/linux/nds32/dl-static.c          |   84 +
 sysdeps/unix/sysv/linux/nds32/getcontext.S         |   51 +
 sysdeps/unix/sysv/linux/nds32/init-first.c         |   52 +
 sysdeps/unix/sysv/linux/nds32/ipc_priv.h           |   22 +
 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h     |   24 +
 sysdeps/unix/sysv/linux/nds32/kernel-features.h    |   31 +
 sysdeps/unix/sysv/linux/nds32/kernel_stat.h        |   23 +
 sysdeps/unix/sysv/linux/nds32/ld.abilist           |    9 +
 sysdeps/unix/sysv/linux/nds32/ldconfig.h           |   27 +
 sysdeps/unix/sysv/linux/nds32/ldsodefs.h           |   33 +
 .../unix/sysv/linux/nds32/libBrokenLocale.abilist  |    1 +
 sysdeps/unix/sysv/linux/nds32/libanl.abilist       |    4 +
 sysdeps/unix/sysv/linux/nds32/libc-vdso.h          |   32 +
 sysdeps/unix/sysv/linux/nds32/libc.abilist         | 2081 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist     |    2 +
 sysdeps/unix/sysv/linux/nds32/libdl.abilist        |    9 +
 sysdeps/unix/sysv/linux/nds32/libm.abilist         |  753 +++++++
 sysdeps/unix/sysv/linux/nds32/libpthread.abilist   |  235 +++
 sysdeps/unix/sysv/linux/nds32/libresolv.abilist    |   79 +
 sysdeps/unix/sysv/linux/nds32/librt.abilist        |   35 +
 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist |   40 +
 sysdeps/unix/sysv/linux/nds32/libutil.abilist      |    6 +
 sysdeps/unix/sysv/linux/nds32/localplt.data        |   19 +
 sysdeps/unix/sysv/linux/nds32/makecontext.c        |   57 +
 sysdeps/unix/sysv/linux/nds32/profil-counter.h     |   31 +
 sysdeps/unix/sysv/linux/nds32/pt-vfork.S           |    1 +
 sysdeps/unix/sysv/linux/nds32/setcontext.S         |   65 +
 sysdeps/unix/sysv/linux/nds32/shlib-versions       |    2 +
 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h     |   35 +
 sysdeps/unix/sysv/linux/nds32/swapcontext.S        |   57 +
 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h       |   33 +
 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h       |   81 +
 sysdeps/unix/sysv/linux/nds32/sys/user.h           |   22 +
 sysdeps/unix/sysv/linux/nds32/syscall.c            |   39 +
 sysdeps/unix/sysv/linux/nds32/syscalls.list        |    2 +
 sysdeps/unix/sysv/linux/nds32/sysctl.mk            |    1 +
 sysdeps/unix/sysv/linux/nds32/sysdep.c             |   29 +
 sysdeps/unix/sysv/linux/nds32/sysdep.h             |  340 ++++
 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym       |   25 +
 sysdeps/unix/sysv/linux/nds32/vfork.S              |   46 +
 108 files changed, 8354 insertions(+)
 create mode 100644 sysdeps/nds32/Implies
 create mode 100644 sysdeps/nds32/Makefile
 create mode 100644 sysdeps/nds32/__longjmp.S
 create mode 100644 sysdeps/nds32/atomic-machine.h
 create mode 100644 sysdeps/nds32/bits/endian.h
 create mode 100644 sysdeps/nds32/bits/fenv.h
 create mode 100644 sysdeps/nds32/bits/link.h
 create mode 100644 sysdeps/nds32/bits/setjmp.h
 create mode 100644 sysdeps/nds32/bsd-_setjmp.S
 create mode 100644 sysdeps/nds32/bsd-setjmp.S
 create mode 100755 sysdeps/nds32/configure
 create mode 100644 sysdeps/nds32/configure.ac
 create mode 100644 sysdeps/nds32/dl-machine.h
 create mode 100644 sysdeps/nds32/dl-sysdep.h
 create mode 100644 sysdeps/nds32/dl-tls.h
 create mode 100644 sysdeps/nds32/dl-tlsdesc.S
 create mode 100644 sysdeps/nds32/dl-tlsdesc.h
 create mode 100644 sysdeps/nds32/dl-trampoline.S
 create mode 100644 sysdeps/nds32/gccframe.h
 create mode 100644 sysdeps/nds32/jmpbuf-offsets.h
 create mode 100644 sysdeps/nds32/jmpbuf-unwind.h
 create mode 100644 sysdeps/nds32/ldsodefs.h
 create mode 100644 sysdeps/nds32/linkmap.h
 create mode 100644 sysdeps/nds32/machine-gmon.h
 create mode 100644 sysdeps/nds32/memcpy.S
 create mode 100644 sysdeps/nds32/memset.S
 create mode 100644 sysdeps/nds32/memusage.h
 create mode 100644 sysdeps/nds32/nofpu/Implies
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/nds32/nptl/Makefile
 create mode 100644 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/nds32/nptl/bits/semaphore.h
 create mode 100644 sysdeps/nds32/nptl/pthread-offsets.h
 create mode 100644 sysdeps/nds32/nptl/pthreaddef.h
 create mode 100644 sysdeps/nds32/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/nds32/nptl/tls.h
 create mode 100644 sysdeps/nds32/preconfigure
 create mode 100644 sysdeps/nds32/setjmp.S
 create mode 100644 sysdeps/nds32/sfp-machine.h
 create mode 100644 sysdeps/nds32/sotruss-lib.c
 create mode 100644 sysdeps/nds32/stackinfo.h
 create mode 100644 sysdeps/nds32/start.S
 create mode 100644 sysdeps/nds32/strcmp.S
 create mode 100644 sysdeps/nds32/strcpy.S
 create mode 100644 sysdeps/nds32/sysdep.h
 create mode 100644 sysdeps/nds32/tininess.h
 create mode 100644 sysdeps/nds32/tls-macros.h
 create mode 100644 sysdeps/nds32/tlsdesc.c
 create mode 100644 sysdeps/nds32/tlsdesc.sym
 create mode 100644 sysdeps/nds32/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Versions
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/environments.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/stat.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/statfs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/typesizes.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/nds32/clone.S
 create mode 100755 sysdeps/unix/sysv/linux/nds32/configure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/nds32/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/init-first.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/kernel_stat.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldsodefs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc-vdso.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/nds32/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscall.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysctl.mk
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/nds32/vfork.S