Skip to contentSkip to conversation

glibc port to ARC processors

PATCH In review Vineet Gupta 6 participants 58 messages Jun 15, 2020 – Jul 10, 2020 3 messages not in the archive Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

v7 cover glibc port to ARC processors

Hi,

This patchset implements glibc port to ARC HS48x processor from Synopsys.

[email protected]:foss-for-synopsys-dwc-arc-processors/glibc.git upstream-v7

v7:
* Addresses review comments from Adhemerval Zanella and Florian Weimer (many thx to you both)
* Dropped ARC specific semaphore.h (following upstream 1270fbaaeebe)
* ARC specific dl-runtime.h (following upstream 8dbb7a08ec52)
* ARC specific math-use-builtins.h and dropped ARC specific sqrt/fma routines (math-use-builtins.h will be disintegrated once done upstream)
* setjmp/longjmp to save GP, no need to save r25 (thread pointer)
* makecontext/startcontext use r14/r15 (vs. r13/r14)
* flatten out register file in mcontext_t (remove scratch/callee)
* Use of 'C' comments in asm code, LDR/STR macros
* Use of L (..) in asm code
* Dropped asm global register r25 specification for thread pointer and rely on __builtin_thread_pointer
* NEWS update rewording
* Sweeping update of Copyright year 2020
v6:
* Dropped 11/14: merged upstream
* _FPU_SETS() inline asm reworked
* Introduce fixup-asm-unistd.h to elide 32-bit time, offset syscalls and regenerate arch-syscall.h
* Fix snafu in updating build-many-glibcs for ARC
* More code sytle fixes flagged by Joseph
v5:
* Big Endian formally supported as multi-ABI
* Removed code for ARC700 processors
* Hard-float code updates: fegetmode, fesetround, feupdateenv
* socket-constant.h update for 64-bit ABI spun off as standalone patch
* __syscall_error made glibc_private
* math ulps regen
* gmp-mparam.h removed
* lint fixes as flagged by Joseph
v4:
* Dropped 1/17: Merged upstream
* Dropped 17/17:
- 64-bit time/offset code chunked up into respective patches
* sysctl removed
* Updated README for arc gnu triplet
* Updated install files for ARC gcc/binutils requirements
* Updated NEWS with brief ISA/ABI info

v3:
* Support for Hardware Floating Point
* 64-bit time and offsets ABI (although all such changes are confined to a single patch)

v5: https://sourceware.org/pipermail/libc-alpha/2020-April/112657.html
v4: https://sourceware.org/pipermail/libc-alpha/2020-March/111855.html
v3: https://sourceware.org/legacy-ml/libc-alpha/2020-03/msg00167.html
v2: https://sourceware.org/legacy-ml/libc-alpha/2019-01/msg00681.html
v1: https://sourceware.org/legacy-ml/libc-alpha/2018-12/msg00678.html

Documentation:
--------------

(a) ABI doc:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki/files/ARCv2_ABI.pdf

(b) Programmer's Reference Manual (PRM) : needs a download request to be filled
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs44-hs46-hs48
https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf

Test Results:
--------------
(a) build-many-glibcs.py

| Summary of test results:
|   1251 PASS
|     15 XFAIL

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Bulk of failures come from cross testing setup and I intend to improve things with native testing going forward.

| Summary of test results:
|     30 FAIL   (-3)
|
| FAIL: csu/test-as-const-tcb-offsets

+ FAIL: elf/tst-audit14
+ FAIL: elf/tst-audit15
+ FAIL: elf/tst-audit16
| FAIL: elf/tst-ldconfig-ld_so_conf-update # not true: dlopen
| FAIL: iconv/test-iconvconfig # Needs gconv installed
- FAIL: iconv/tst-gconv-init-failure
| FAIL: io/ftwtest # Requires execution by non-root
- FAIL: io/tst-futimesat

| FAIL: io/tst-lockf
| FAIL: libio/tst-wfile-sync
| FAIL: locale/tst-C-locale
| FAIL: locale/tst-duplocale
| FAIL: locale/tst-locale-locpath
| FAIL: locale/tst-locname
| FAIL: localedata/sort-test
| FAIL: nptl/test-cond-printers		# needs Python3 and target GDB on target
| FAIL: nptl/test-condattr-printers	#    ditto
| FAIL: nptl/test-mutex-printers	#    ditto
| FAIL: nptl/test-mutexattr-printers	#    ditto
| FAIL: nptl/test-rwlock-printers	#    ditto
| FAIL: nptl/test-rwlockattr-printers	#    ditto
| FAIL: nptl/tst-umask1			# passes if run natively on target (NFS ACLv3 support needed)
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent	# Timed out
| FAIL: nss/tst-nss-files-hosts-multi	# Timed out
| FAIL: posix/bug-ga2			# DNS issue: google DNS vs. SNPS
| FAIL: posix/globtest			# require same user on target and host
| FAIL: posix/tst-getaddrinfo5		# passes outside corporate network

- FAIL: resolv/tst-resolv-basic
- FAIL: resolv/tst-resolv-edns
- FAIL: resolv/tst-resolv-rotate
- FAIL: resolv/tst-resolv-search

| FAIL: stdio-common/bug22		# Needs more RAM: 2 GB memory
| FAIL: sunrpc/bug20790			# missing cpp on target
| FAIL: timezone/tst-tzset		# passes outside corporate network

kindly review.

Thx,
-Vineet

Vineet Gupta (13):
ARC: ABI Implementation
ARC: startup and dynamic linking code
ARC: Thread Local Storage support
ARC: Atomics and Locking primitives
ARC: math soft float support
ARC: hardware floating point support
ARC: Linux Syscall Interface
ARC: Linux ABI
ARC: Linux Startup and Dynamic Loading
ARC: ABI lists
ARC: Build Infrastructure
build-many-glibcs.py: Enable ARC builds
Documentation for ARC port

 NEWS                                          |   11 +
 README                                        |    1 +
 config.h.in                                   |    3 +
 manual/install.texi                           |    4 +
 scripts/build-many-glibcs.py                  |   10 +
 sysdeps/arc/Implies                           |    3 +
 sysdeps/arc/Makefile                          |   21 +
 sysdeps/arc/Versions                          |    8 +
 sysdeps/arc/__longjmp.S                       |   49 +
 sysdeps/arc/abort-instr.h                     |    2 +
 sysdeps/arc/atomic-machine.h                  |   69 +
 sysdeps/arc/bits/endianness.h                 |   15 +
 sysdeps/arc/bits/fenv.h                       |   78 +
 sysdeps/arc/bits/link.h                       |   52 +
 sysdeps/arc/bits/setjmp.h                     |   26 +
 sysdeps/arc/bsd-_setjmp.S                     |    1 +
 sysdeps/arc/bsd-setjmp.S                      |    1 +
 sysdeps/arc/configure                         |  182 ++
 sysdeps/arc/configure.ac                      |   26 +
 sysdeps/arc/dl-machine.h                      |  341 +++
 sysdeps/arc/dl-runtime.h                      |   42 +
 sysdeps/arc/dl-sysdep.h                       |   25 +
 sysdeps/arc/dl-tls.h                          |   30 +
 sysdeps/arc/dl-trampoline.S                   |   72 +
 sysdeps/arc/entry.h                           |    5 +
 sysdeps/arc/fpu/fclrexcpt.c                   |   36 +
 sysdeps/arc/fpu/fegetenv.c                    |   37 +
 sysdeps/arc/fpu/fegetmode.c                   |   31 +
 sysdeps/arc/fpu/fegetround.c                  |   32 +
 sysdeps/arc/fpu/feholdexcpt.c                 |   43 +
 sysdeps/arc/fpu/fesetenv.c                    |   48 +
 sysdeps/arc/fpu/fesetexcept.c                 |   32 +
 sysdeps/arc/fpu/fesetmode.c                   |   40 +
 sysdeps/arc/fpu/fesetround.c                  |   40 +
 sysdeps/arc/fpu/feupdateenv.c                 |   51 +
 sysdeps/arc/fpu/fgetexcptflg.c                |   31 +
 sysdeps/arc/fpu/fraiseexcpt.c                 |   39 +
 sysdeps/arc/fpu/fsetexcptflg.c                |   38 +
 sysdeps/arc/fpu/ftestexcept.c                 |   33 +
 sysdeps/arc/fpu/libm-test-ulps                | 1140 +++++++++
 sysdeps/arc/fpu/libm-test-ulps-name           |    1 +
 sysdeps/arc/fpu/math-use-builtins.h           |   70 +
 sysdeps/arc/fpu_control.h                     |  106 +
 sysdeps/arc/gccframe.h                        |   21 +
 sysdeps/arc/get-rounding-mode.h               |   38 +
 sysdeps/arc/jmpbuf-offsets.h                  |   22 +
 sysdeps/arc/jmpbuf-unwind.h                   |   47 +
 sysdeps/arc/ldsodefs.h                        |   43 +
 sysdeps/arc/libc-tls.c                        |   27 +
 sysdeps/arc/machine-gmon.h                    |   35 +
 sysdeps/arc/math-tests-trap.h                 |   27 +
 sysdeps/arc/memusage.h                        |   23 +
 sysdeps/arc/nofpu/Implies                     |    1 +
 sysdeps/arc/nofpu/libm-test-ulps              |  270 +++
 sysdeps/arc/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/arc/nofpu/math-tests-exceptions.h     |   27 +
 sysdeps/arc/nofpu/math-tests-rounding.h       |   27 +
 sysdeps/arc/nptl/Makefile                     |   22 +
 sysdeps/arc/nptl/pthreaddef.h                 |   32 +
 sysdeps/arc/nptl/tcb-offsets.sym              |   11 +
 sysdeps/arc/nptl/tls.h                        |  148 ++
 sysdeps/arc/preconfigure                      |   14 +
 sysdeps/arc/setjmp.S                          |   66 +
 sysdeps/arc/sfp-machine.h                     |   70 +
 sysdeps/arc/sotruss-lib.c                     |   50 +
 sysdeps/arc/stackinfo.h                       |   33 +
 sysdeps/arc/start.S                           |   74 +
 sysdeps/arc/sysdep.h                          |   53 +
 sysdeps/arc/tininess.h                        |    1 +
 sysdeps/arc/tls-macros.h                      |   47 +
 sysdeps/arc/tst-audit.h                       |   23 +
 sysdeps/unix/sysv/linux/arc/Implies           |    3 +
 sysdeps/unix/sysv/linux/arc/Makefile          |   29 +
 sysdeps/unix/sysv/linux/arc/Versions          |   16 +
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    |  303 +++
 sysdeps/unix/sysv/linux/arc/bits/procfs.h     |   35 +
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |   21 +
 .../sysv/linux/arc/bits/types/__sigset_t.h    |   12 +
 sysdeps/unix/sysv/linux/arc/c++-types.data    |   67 +
 sysdeps/unix/sysv/linux/arc/clone.S           |   93 +
 sysdeps/unix/sysv/linux/arc/configure         |    4 +
 sysdeps/unix/sysv/linux/arc/configure.ac      |    4 +
 sysdeps/unix/sysv/linux/arc/dl-static.c       |   84 +
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |   41 +
 sysdeps/unix/sysv/linux/arc/getcontext.S      |   64 +
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |    6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |   27 +
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |   26 +
 sysdeps/unix/sysv/linux/arc/ld.abilist        |    5 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h        |   27 +
 sysdeps/unix/sysv/linux/arc/ldsodefs.h        |   32 +
 .../sysv/linux/arc/libBrokenLocale.abilist    |    1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist    |    4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      | 2084 +++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist  |    2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist     |    9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist      |  699 ++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  213 ++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist     |   35 +
 .../unix/sysv/linux/arc/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |    6 +
 sysdeps/unix/sysv/linux/arc/localplt.data     |   12 +
 sysdeps/unix/sysv/linux/arc/makecontext.c     |   73 +
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |   27 +
 sysdeps/unix/sysv/linux/arc/setcontext.S      |   93 +
 sysdeps/unix/sysv/linux/arc/shlib-versions    |    7 +
 sysdeps/unix/sysv/linux/arc/sigaction.c       |   31 +
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h  |   28 +
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |   29 +
 sysdeps/unix/sysv/linux/arc/swapcontext.S     |   94 +
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h    |   35 +
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h    |   57 +
 sysdeps/unix/sysv/linux/arc/sys/user.h        |   31 +
 sysdeps/unix/sysv/linux/arc/syscall.S         |   33 +
 sysdeps/unix/sysv/linux/arc/syscalls.list     |    3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |   33 +
 sysdeps/unix/sysv/linux/arc/sysdep.h          |  224 ++
 sysdeps/unix/sysv/linux/arc/ucontext-macros.h |   25 +
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym    |   20 +
 sysdeps/unix/sysv/linux/arc/vfork.S           |   42 +
 121 files changed, 9146 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 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/bits/endianness.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/dl-machine.h
 create mode 100644 sysdeps/arc/dl-runtime.h
 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/fpu/fclrexcpt.c
 create mode 100644 sysdeps/arc/fpu/fegetenv.c
 create mode 100644 sysdeps/arc/fpu/fegetmode.c
 create mode 100644 sysdeps/arc/fpu/fegetround.c
 create mode 100644 sysdeps/arc/fpu/feholdexcpt.c
 create mode 100644 sysdeps/arc/fpu/fesetenv.c
 create mode 100644 sysdeps/arc/fpu/fesetexcept.c
 create mode 100644 sysdeps/arc/fpu/fesetmode.c
 create mode 100644 sysdeps/arc/fpu/fesetround.c
 create mode 100644 sysdeps/arc/fpu/feupdateenv.c
 create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/ftestexcept.c
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/fpu/math-use-builtins.h
 create mode 100644 sysdeps/arc/fpu_control.h
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/get-rounding-mode.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/machine-gmon.h
 create mode 100644 sysdeps/arc/math-tests-trap.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/nofpu/Implies
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/arc/nptl/Makefile
 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/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/tininess.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-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 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/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.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/ldsodefs.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/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/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.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/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.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/syscalls.list
 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-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#1 lore raw

PATCH v7 1/13 ARC: ABI Implementation

This code deals with the ARC ABI.

---
 sysdeps/arc/__longjmp.S       | 49 ++++++++++++++++++++++++
 sysdeps/arc/abort-instr.h     |  2 +
 sysdeps/arc/bits/endianness.h | 15 ++++++++
 sysdeps/arc/bits/setjmp.h     | 26 +++++++++++++
 sysdeps/arc/bsd-_setjmp.S     |  1 +
 sysdeps/arc/bsd-setjmp.S      |  1 +
 sysdeps/arc/dl-runtime.h      | 42 ++++++++++++++++++++
 sysdeps/arc/dl-sysdep.h       | 25 ++++++++++++
 sysdeps/arc/dl-trampoline.S   | 72 +++++++++++++++++++++++++++++++++++
 sysdeps/arc/gccframe.h        | 21 ++++++++++
 sysdeps/arc/jmpbuf-offsets.h  | 22 +++++++++++
 sysdeps/arc/jmpbuf-unwind.h   | 47 +++++++++++++++++++++++
 sysdeps/arc/machine-gmon.h    | 35 +++++++++++++++++
 sysdeps/arc/memusage.h        | 23 +++++++++++
 sysdeps/arc/setjmp.S          | 66 ++++++++++++++++++++++++++++++++
 sysdeps/arc/sysdep.h          | 53 ++++++++++++++++++++++++++
 sysdeps/arc/tls-macros.h      | 47 +++++++++++++++++++++++
 17 files changed, 547 insertions(+)
 create mode 100644 sysdeps/arc/__longjmp.S
 create mode 100644 sysdeps/arc/abort-instr.h
 create mode 100644 sysdeps/arc/bits/endianness.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/dl-runtime.h
 create mode 100644 sysdeps/arc/dl-sysdep.h
 create mode 100644 sysdeps/arc/dl-trampoline.S
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/jmpbuf-offsets.h
 create mode 100644 sysdeps/arc/jmpbuf-unwind.h
 create mode 100644 sysdeps/arc/machine-gmon.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/setjmp.S
 create mode 100644 sysdeps/arc/sysdep.h
 create mode 100644 sysdeps/arc/tls-macros.h
sysdeps/arc/__longjmp.S new file +49 -0
new file mode 100644
index 000000000000..fcbf1bb6c0e2
@@ -0,0 +1,49 @@
+/* longjmp for ARC.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <jmpbuf-offsets.h>
+
+/* @ r0 = jump buffer from which regs will be restored
+   @ r1 = value that setjmp( ) will return due to this longjmp.  */
+
+ENTRY (__longjmp)
+
+	LDR (blink, r0,  0)
+	LDR (sp,    r0,  1)
+	LDR (fp,    r0,  2)
+	LDR (gp,    r0,  3)
+
+	LDR (r13,   r0,  4)
+	LDR (r14,   r0,  5)
+	LDR (r15,   r0,  6)
+	LDR (r16,   r0,  7)
+	LDR (r17,   r0,  8)
+	LDR (r18,   r0,  9)
+	LDR (r19,   r0, 10)
+	LDR (r20,   r0, 11)
+	LDR (r21,   r0, 12)
+	LDR (r22,   r0, 13)
+	LDR (r23,   r0, 14)
+	LDR (r24,   r0, 15)
+
+	mov.f  r0, r1
+	j.d    [blink]
+	mov.z  r0, 1	/* don't return 0 to setjmp callsite from longjmp.  */
+
+END (__longjmp)
sysdeps/arc/abort-instr.h new file +2 -0
new file mode 100644
index 000000000000..49f33613c404
@@ -0,0 +1,2 @@
+/* FLAG 1 is privilege mode only instruction, hence will crash any program.  */
+#define ABORT_INSTRUCTION asm ("flag 1")
sysdeps/arc/bits/endianness.h new file +15 -0
new file mode 100644
index 000000000000..8f17ca84b485
@@ -0,0 +1,15 @@
+#ifndef _BITS_ENDIANNESS_H
+#define _BITS_ENDIANNESS_H 1
+
+#ifndef _BITS_ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/* ARC has selectable endianness.  */
+#ifdef __BIG_ENDIAN__
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+
+#endif /* bits/endianness.h */
sysdeps/arc/bits/setjmp.h new file +26 -0
new file mode 100644
index 000000000000..6bba95fafe0f
@@ -0,0 +1,26 @@
+/* Define the machine-dependent type `jmp_buf'.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ARC_BITS_SETJMP_H
+#define _ARC_BITS_SETJMP_H 1
+
+/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer),
+   blink (branch-n-link).  */
+typedef long int __jmp_buf[32];
+
+#endif
sysdeps/arc/bsd-_setjmp.S new file +1 -0
new file mode 100644
index 000000000000..90b99cd8c3e0
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S.  */
sysdeps/arc/bsd-setjmp.S new file +1 -0
new file mode 100644
index 000000000000..d3b823c118bc
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S.  */
sysdeps/arc/dl-runtime.h new file +42 -0

42 lines not on this page · raw message

sysdeps/arc/dl-sysdep.h new file +25 -0
new file mode 100644
index 000000000000..aefec2ba056a
@@ -0,0 +1,25 @@
+/* System-specific settings for dynamic linker code.  ARC version.
+   Copyright (C) 2020 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
+   <https://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-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..296857ba9ccc
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define FIRST_PSEUDO_REGISTER 40
+
+#include <sysdeps/generic/gccframe.h>
sysdeps/arc/jmpbuf-offsets.h new file +22 -0
new file mode 100644
index 000000000000..e7551cad3b47
@@ -0,0 +1,22 @@
+/* Private macros for accessing __jmp_buf contents.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define JB_SP	1
+
+/* Helper for generic ____longjmp_chk.  */
+#define JB_FRAME_ADDRESS(buf) ((void *) (unsigned long int) (buf[JB_SP]))
sysdeps/arc/jmpbuf-unwind.h new file +47 -0

47 lines not on this page · raw message

sysdeps/arc/machine-gmon.h new file +35 -0
new file mode 100644
index 000000000000..a0d4e95a945d
@@ -0,0 +1,35 @@
+/* Machine-dependent definitions for profiling support.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#define _MCOUNT_DECL(frompc, selfpc)					\
+static void								\
+__mcount_internal (unsigned long int frompc, unsigned long int selfpc)
+
+/* This is very simple as gcc does all the heavy lifting at _mcount call site
+    - sets up caller's blink in r0, so frompc is setup correctly
+    - preserve argument registers for original call.  */
+
+#define MCOUNT								\
+void									\
+_mcount (void *frompc)							\
+{									\
+  __mcount_internal ((unsigned long int) frompc,			\
+		     (unsigned long int) __builtin_return_address (0));	\
+}
sysdeps/arc/memusage.h new file +23 -0
new file mode 100644
index 000000000000..724bc4de1312
@@ -0,0 +1,23 @@
+/* Machine-specific definitions for memory usage profiling, ARC version.
+   Copyright (C) 2020 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
+   <https://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/setjmp.S new file +66 -0

66 lines not on this page · raw message

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

53 lines not on this page · raw message

sysdeps/arc/tls-macros.h new file +47 -0

47 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#2 lore raw

PATCH v7 1/13 ARC: ABI Implementation

This code deals with the ARC ABI.
---
Changes since v7:
- Used void * (iso int *) in tls-macros.h

---
 sysdeps/arc/__longjmp.S       | 49 ++++++++++++++++++++++++
 sysdeps/arc/abort-instr.h     |  2 +
 sysdeps/arc/bits/endianness.h | 15 ++++++++
 sysdeps/arc/bits/setjmp.h     | 26 +++++++++++++
 sysdeps/arc/bsd-_setjmp.S     |  1 +
 sysdeps/arc/bsd-setjmp.S      |  1 +
 sysdeps/arc/dl-runtime.h      | 42 ++++++++++++++++++++
 sysdeps/arc/dl-sysdep.h       | 25 ++++++++++++
 sysdeps/arc/dl-trampoline.S   | 72 +++++++++++++++++++++++++++++++++++
 sysdeps/arc/gccframe.h        | 21 ++++++++++
 sysdeps/arc/jmpbuf-offsets.h  | 22 +++++++++++
 sysdeps/arc/jmpbuf-unwind.h   | 47 +++++++++++++++++++++++
 sysdeps/arc/machine-gmon.h    | 35 +++++++++++++++++
 sysdeps/arc/memusage.h        | 23 +++++++++++
 sysdeps/arc/setjmp.S          | 66 ++++++++++++++++++++++++++++++++
 sysdeps/arc/sysdep.h          | 53 ++++++++++++++++++++++++++
 sysdeps/arc/tls-macros.h      | 47 +++++++++++++++++++++++
 17 files changed, 547 insertions(+)
 create mode 100644 sysdeps/arc/__longjmp.S
 create mode 100644 sysdeps/arc/abort-instr.h
 create mode 100644 sysdeps/arc/bits/endianness.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/dl-runtime.h
 create mode 100644 sysdeps/arc/dl-sysdep.h
 create mode 100644 sysdeps/arc/dl-trampoline.S
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/jmpbuf-offsets.h
 create mode 100644 sysdeps/arc/jmpbuf-unwind.h
 create mode 100644 sysdeps/arc/machine-gmon.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/setjmp.S
 create mode 100644 sysdeps/arc/sysdep.h
 create mode 100644 sysdeps/arc/tls-macros.h
sysdeps/arc/__longjmp.S new file +49 -0
new file mode 100644
index 000000000000..fcbf1bb6c0e2
@@ -0,0 +1,49 @@
+/* longjmp for ARC.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <jmpbuf-offsets.h>
+
+/* @ r0 = jump buffer from which regs will be restored
+   @ r1 = value that setjmp( ) will return due to this longjmp.  */
+
+ENTRY (__longjmp)
+
+	LDR (blink, r0,  0)
+	LDR (sp,    r0,  1)
+	LDR (fp,    r0,  2)
+	LDR (gp,    r0,  3)
+
+	LDR (r13,   r0,  4)
+	LDR (r14,   r0,  5)
+	LDR (r15,   r0,  6)
+	LDR (r16,   r0,  7)
+	LDR (r17,   r0,  8)
+	LDR (r18,   r0,  9)
+	LDR (r19,   r0, 10)
+	LDR (r20,   r0, 11)
+	LDR (r21,   r0, 12)
+	LDR (r22,   r0, 13)
+	LDR (r23,   r0, 14)
+	LDR (r24,   r0, 15)
+
+	mov.f  r0, r1
+	j.d    [blink]
+	mov.z  r0, 1	/* don't return 0 to setjmp callsite from longjmp.  */
+
+END (__longjmp)
sysdeps/arc/abort-instr.h new file +2 -0
new file mode 100644
index 000000000000..49f33613c404
@@ -0,0 +1,2 @@
+/* FLAG 1 is privilege mode only instruction, hence will crash any program.  */
+#define ABORT_INSTRUCTION asm ("flag 1")
sysdeps/arc/bits/endianness.h new file +15 -0
new file mode 100644
index 000000000000..8f17ca84b485
@@ -0,0 +1,15 @@
+#ifndef _BITS_ENDIANNESS_H
+#define _BITS_ENDIANNESS_H 1
+
+#ifndef _BITS_ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/* ARC has selectable endianness.  */
+#ifdef __BIG_ENDIAN__
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+
+#endif /* bits/endianness.h */
sysdeps/arc/bits/setjmp.h new file +26 -0
new file mode 100644
index 000000000000..6bba95fafe0f
@@ -0,0 +1,26 @@
+/* Define the machine-dependent type `jmp_buf'.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ARC_BITS_SETJMP_H
+#define _ARC_BITS_SETJMP_H 1
+
+/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer),
+   blink (branch-n-link).  */
+typedef long int __jmp_buf[32];
+
+#endif
sysdeps/arc/bsd-_setjmp.S new file +1 -0
new file mode 100644
index 000000000000..90b99cd8c3e0
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S.  */
sysdeps/arc/bsd-setjmp.S new file +1 -0
new file mode 100644
index 000000000000..d3b823c118bc
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S.  */
sysdeps/arc/dl-runtime.h new file +42 -0

42 lines not on this page · raw message

sysdeps/arc/dl-sysdep.h new file +25 -0
new file mode 100644
index 000000000000..aefec2ba056a
@@ -0,0 +1,25 @@
+/* System-specific settings for dynamic linker code.  ARC version.
+   Copyright (C) 2020 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
+   <https://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-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..296857ba9ccc
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define FIRST_PSEUDO_REGISTER 40
+
+#include <sysdeps/generic/gccframe.h>
sysdeps/arc/jmpbuf-offsets.h new file +22 -0
new file mode 100644
index 000000000000..e7551cad3b47
@@ -0,0 +1,22 @@
+/* Private macros for accessing __jmp_buf contents.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define JB_SP	1
+
+/* Helper for generic ____longjmp_chk.  */
+#define JB_FRAME_ADDRESS(buf) ((void *) (unsigned long int) (buf[JB_SP]))
sysdeps/arc/jmpbuf-unwind.h new file +47 -0

47 lines not on this page · raw message

sysdeps/arc/machine-gmon.h new file +35 -0
new file mode 100644
index 000000000000..a0d4e95a945d
@@ -0,0 +1,35 @@
+/* Machine-dependent definitions for profiling support.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#define _MCOUNT_DECL(frompc, selfpc)					\
+static void								\
+__mcount_internal (unsigned long int frompc, unsigned long int selfpc)
+
+/* This is very simple as gcc does all the heavy lifting at _mcount call site
+    - sets up caller's blink in r0, so frompc is setup correctly
+    - preserve argument registers for original call.  */
+
+#define MCOUNT								\
+void									\
+_mcount (void *frompc)							\
+{									\
+  __mcount_internal ((unsigned long int) frompc,			\
+		     (unsigned long int) __builtin_return_address (0));	\
+}
sysdeps/arc/memusage.h new file +23 -0
new file mode 100644
index 000000000000..724bc4de1312
@@ -0,0 +1,23 @@
+/* Machine-specific definitions for memory usage profiling, ARC version.
+   Copyright (C) 2020 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
+   <https://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/setjmp.S new file +66 -0

66 lines not on this page · raw message

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

53 lines not on this page · raw message

sysdeps/arc/tls-macros.h new file +47 -0

47 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Re: [PATCH v7.1 01/13] ARC: ABI Implementation

Quoted 11 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

This code deals with the ARC ABI.
---
Changes since v7:
- Used void * (iso int *) in tls-macros.h

LGTM, with just a couple of syntax nits below.

Thx. I suppose the process for new ports is to have a Reviewed-by on all patches, squash them and push in 1 go (although in past I was asked to push the ARC elf header patch).
Also do we need more than 1 Reviewed-by for this to be "push worthy" ?

Quoted 19 lines
Quoted 19 lines
sysdeps/arc/__longjmp.S new file +19 -0
+ENTRY (__longjmp)
+
+	LDR (blink, r0,  0)
+	LDR (sp,    r0,  1)
+	LDR (fp,    r0,  2)
+	LDR (gp,    r0,  3)
+
+	LDR (r13,   r0,  4)
+	LDR (r14,   r0,  5)
+	LDR (r15,   r0,  6)
+	LDR (r16,   r0,  7)
+	LDR (r17,   r0,  8)
+	LDR (r18,   r0,  9)
+	LDR (r19,   r0, 10)
+	LDR (r20,   r0, 11)
+	LDR (r21,   r0, 12)
+	LDR (r22,   r0, 13)
+	LDR (r23,   r0, 14)
+	LDR (r24,   r0, 15)
Quoted 8 lines

sysdeps/arc/__longjmp.S line 49

Quoted 6 lines
sysdeps/arc/__longjmp.S new file +6 -0
+
+	mov.f  r0, r1
+	j.d    [blink]
+	mov.z  r0, 1	/* don't return 0 to setjmp callsite from longjmp.  */
+
+END (__longjmp)

Ok, you have removed r25 save as pre previous discussion.

Right, and GP is being saved now.

Quoted 10 lines

sysdeps/arc/bits/setjmp.h line 1

Quoted 7 lines
sysdeps/arc/bits/setjmp.h new file +1 -0
new file mode 100644
index 000000000000..6bba95fafe0f
@@ -0,0 +1,26 @@
+/* Define the machine-dependent type `jmp_buf'.  ARC version.

I think current trend is to just use apostrophe instead of the grave accent in such cases.

Ok changed.

Quoted 7 lines

sysdeps/arc/bits/setjmp.h line 6

Quoted 5 lines
sysdeps/arc/bits/setjmp.h new file +5 -0
+reloc_index (uintptr_t plt0, uintptr_t pltn, size_t size)
+{
+  unsigned long int idx = pltn - plt0;
+
+  /* PLT trampoline is 16 bytes. */

Double space after period.

Fixed.

Quoted 8 lines

sysdeps/arc/bits/setjmp.h line 11

Quoted 5 lines
sysdeps/arc/bits/setjmp.h new file +5 -0
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf_sp (_jmpbuf) - (_adj)))
+
+/* We use the normal longjmp for unwinding.  */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)

Ok. As a side note teh jmpbuf-unwind.h is candidate for some consolidation (the same macros are replicated in each architecture).

OK.
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#5 lore raw

Re: [PATCH v7.1 01/13] ARC: ABI Implementation

Quoted 9 lines · Vineet Gupta
Quoted 8 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

This code deals with the ARC ABI.
---
Changes since v7:
- Used void * (iso int *) in tls-macros.h

Quoted 7 lines
Quoted 3 lines

LGTM, with just a couple of syntax nits below.

Thx. I suppose the process for new ports is to have a Reviewed-by on all patches, squash them and push in 1 go (although in past I was asked to push the ARC elf header patch).

I think there is no need to squash them up in one commit, but I think it would be better to commit them at the same time.

Quoted 1 line

Also do we need more than 1 Reviewed-by for this to be "push worthy" ?

I don't think so, unless someone raise some questioning on the review itself.

I plan to finish them up by the end of the week.

Quoted 63 lines
Quoted 20 lines
Quoted 20 lines
sysdeps/arc/__longjmp.S new file +19 -0
+ENTRY (__longjmp)
+
+	LDR (blink, r0,  0)
+	LDR (sp,    r0,  1)
+	LDR (fp,    r0,  2)
+	LDR (gp,    r0,  3)
+
+	LDR (r13,   r0,  4)
+	LDR (r14,   r0,  5)
+	LDR (r15,   r0,  6)
+	LDR (r16,   r0,  7)
+	LDR (r17,   r0,  8)
+	LDR (r18,   r0,  9)
+	LDR (r19,   r0, 10)
+	LDR (r20,   r0, 11)
+	LDR (r21,   r0, 12)
+	LDR (r22,   r0, 13)
+	LDR (r23,   r0, 14)
+	LDR (r24,   r0, 15)
Quoted 8 lines

sysdeps/arc/__longjmp.S line 49

Quoted 6 lines
sysdeps/arc/__longjmp.S new file +6 -0
+
+	mov.f  r0, r1
+	j.d    [blink]
+	mov.z  r0, 1	/* don't return 0 to setjmp callsite from longjmp.  */
+
+END (__longjmp)

Ok, you have removed r25 save as pre previous discussion.

Right, and GP is being saved now.

Quoted 10 lines

sysdeps/arc/bits/setjmp.h line 1

Quoted 7 lines
sysdeps/arc/bits/setjmp.h new file +1 -0
new file mode 100644
index 000000000000..6bba95fafe0f
@@ -0,0 +1,26 @@
+/* Define the machine-dependent type `jmp_buf'.  ARC version.

I think current trend is to just use apostrophe instead of the grave accent in such cases.

Ok changed.

Quoted 7 lines

sysdeps/arc/bits/setjmp.h line 6

Quoted 5 lines
sysdeps/arc/bits/setjmp.h new file +5 -0
+reloc_index (uintptr_t plt0, uintptr_t pltn, size_t size)
+{
+  unsigned long int idx = pltn - plt0;
+
+  /* PLT trampoline is 16 bytes. */

Double space after period.

Fixed.

Quoted 8 lines

sysdeps/arc/bits/setjmp.h line 11

Quoted 5 lines
sysdeps/arc/bits/setjmp.h new file +5 -0
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf_sp (_jmpbuf) - (_adj)))
+
+/* We use the normal longjmp for unwinding.  */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)

Ok. As a side note teh jmpbuf-unwind.h is candidate for some consolidation (the same macros are replicated in each architecture).

Quoted 2 lines

OK.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#6 lore raw

PATCH v7 2/13 ARC: startup and dynamic linking code

In reply to Vineet Gupta

Code for C runtime startup and dynamic loading including PLT layout.

---
 sysdeps/arc/bits/link.h   |  52 ++++++
 sysdeps/arc/dl-machine.h  | 341 ++++++++++++++++++++++++++++++++++++++
 sysdeps/arc/entry.h       |   5 +
 sysdeps/arc/ldsodefs.h    |  43 +++++
 sysdeps/arc/sotruss-lib.c |  50 ++++++
 sysdeps/arc/start.S       |  74 +++++++++
 sysdeps/arc/tst-audit.h   |  23 +++
 7 files changed, 588 insertions(+)
 create mode 100644 sysdeps/arc/bits/link.h
 create mode 100644 sysdeps/arc/dl-machine.h
 create mode 100644 sysdeps/arc/entry.h
 create mode 100644 sysdeps/arc/ldsodefs.h
 create mode 100644 sysdeps/arc/sotruss-lib.c
 create mode 100644 sysdeps/arc/start.S
 create mode 100644 sysdeps/arc/tst-audit.h
sysdeps/arc/bits/link.h new file +52 -0
new file mode 100644
index 000000000000..b687250a7a07
@@ -0,0 +1,52 @@
+/* Machine-specific declarations for dynamic linker interface, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef	_LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+/* Registers for entry into PLT on ARC.  */
+typedef struct La_arc_regs
+{
+  uint32_t lr_reg[8]; /* r0 through r7 (upto 8 args).  */
+} La_arc_regs;
+
+/* Return values for calls from PLT on ARC.  */
+typedef struct La_arc_retval
+{
+  /* For ARCv2, a 64-bit integer return value can use 2 regs.  */
+  uint32_t lrv_reg[2];
+} La_arc_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+					 uintptr_t *__refcook,
+					 uintptr_t *__defcook,
+					 La_arc_regs *__regs,
+					 unsigned int *__flags,
+					 const char *__symname,
+					 long int *__framesizep);
+extern unsigned int la_arc_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
+					  uintptr_t *__refcook,
+					  uintptr_t *__defcook,
+					  const La_arc_regs *__inregs,
+					  La_arc_retval *__outregs,
+					  const char *symname);
+
+__END_DECLS
sysdeps/arc/dl-machine.h new file +341 -0

341 lines not on this page · raw message

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/ldsodefs.h new file +43 -0

43 lines not on this page · raw message

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

50 lines not on this page · raw message

sysdeps/arc/start.S new file +74 -0

74 lines not on this page · raw message

sysdeps/arc/tst-audit.h new file +23 -0
new file mode 100644
index 000000000000..0b8f0b9c2f3f
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing.  ARC version.
+   Copyright (C) 2020 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
+   <https://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]
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#7 lore raw

PATCH v7 3/13 ARC: Thread Local Storage support

In reply to Vineet Gupta

This includes all 4 TLS addressing models

---
 sysdeps/arc/dl-tls.h             |  30 +++++++
 sysdeps/arc/libc-tls.c           |  27 ++++++
 sysdeps/arc/nptl/tcb-offsets.sym |  11 +++
 sysdeps/arc/nptl/tls.h           | 148 +++++++++++++++++++++++++++++++
 sysdeps/arc/stackinfo.h          |  33 +++++++
 5 files changed, 249 insertions(+)
 create mode 100644 sysdeps/arc/dl-tls.h
 create mode 100644 sysdeps/arc/libc-tls.c
 create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/arc/nptl/tls.h
 create mode 100644 sysdeps/arc/stackinfo.h
sysdeps/arc/dl-tls.h new file +30 -0
new file mode 100644
index 000000000000..0f3626d197c9
@@ -0,0 +1,30 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2020 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
+   <https://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/libc-tls.c new file +27 -0
new file mode 100644
index 000000000000..234932c29512
@@ -0,0 +1,27 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2020 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
+   <https://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/nptl/tcb-offsets.sym new file +11 -0
new file mode 100644
index 000000000000..64c432c22e76
@@ -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 +148 -0

148 lines not on this page · raw message

sysdeps/arc/stackinfo.h new file +33 -0
new file mode 100644
index 000000000000..02ae1cd8c425
@@ -0,0 +1,33 @@
+/* Stack environment definitions for ARC.
+   Copyright (C) 2020 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
+   <https://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 */
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#8 lore raw

PATCH v7 3/13 ARC: Thread Local Storage support

This includes all 4 TLS addressing models
---
Changes since v7:
- Deleted unused asm macro THREAD_SELF which references r25

---
 sysdeps/arc/dl-tls.h             |  30 +++++++
 sysdeps/arc/libc-tls.c           |  27 ++++++
 sysdeps/arc/nptl/tcb-offsets.sym |  11 +++
 sysdeps/arc/nptl/tls.h           | 139 +++++++++++++++++++++++++++++++
 sysdeps/arc/stackinfo.h          |  33 ++++++++
 5 files changed, 240 insertions(+)
 create mode 100644 sysdeps/arc/dl-tls.h
 create mode 100644 sysdeps/arc/libc-tls.c
 create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/arc/nptl/tls.h
 create mode 100644 sysdeps/arc/stackinfo.h
sysdeps/arc/dl-tls.h new file +30 -0
new file mode 100644
index 000000000000..0f3626d197c9
@@ -0,0 +1,30 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2020 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
+   <https://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/libc-tls.c new file +27 -0
new file mode 100644
index 000000000000..234932c29512
@@ -0,0 +1,27 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2020 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
+   <https://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/nptl/tcb-offsets.sym new file +11 -0
new file mode 100644
index 000000000000..64c432c22e76
@@ -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 +139 -0

139 lines not on this page · raw message

sysdeps/arc/stackinfo.h new file +33 -0
new file mode 100644
index 000000000000..02ae1cd8c425
@@ -0,0 +1,33 @@
+/* Stack environment definitions for ARC.
+   Copyright (C) 2020 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
+   <https://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 */
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#9 lore raw

PATCH v7 4/13 ARC: Atomics and Locking primitives

In reply to Vineet Gupta
---
 sysdeps/arc/atomic-machine.h | 69 ++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 sysdeps/arc/atomic-machine.h
sysdeps/arc/atomic-machine.h new file +69 -0
new file mode 100644
index 000000000000..1c8638bb44ef
@@ -0,0 +1,69 @@
+/* Low-level functions for atomic operations. ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ARC_BITS_ATOMIC_H
+#define _ARC_BITS_ATOMIC_H 1
+
+#include <stdint.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int_fast32_t atomic_fast32_t;
+typedef uint_fast32_t uatomic_fast32_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define __HAVE_64B_ATOMICS 0
+#define USE_ATOMIC_COMPILER_BUILTINS 1
+
+/* ARC does have legacy atomic EX reg, [mem] instruction but the micro-arch
+   is not as optimal as LLOCK/SCOND specially for SMP.  */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
+#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval)	\
+  (abort (), 0)
+#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval)	\
+  (abort (), 0)
+#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval)	\
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model)	\
+  (abort (), (__typeof (*mem)) 0)
+#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model)	\
+  (abort (), (__typeof (*mem)) 0)
+#define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model)	\
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model)	\
+  ({										\
+    typeof (*mem) __oldval = (oldval);                                  	\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,    	\
+                                 model, __ATOMIC_RELAXED);              	\
+    __oldval;                                                           	\
+  })
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old)		\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,		\
+		       mem, new, old, __ATOMIC_ACQUIRE)
+
+#define atomic_full_barrier()  ({ asm volatile ("dmb 3":::"memory"); })
+
+#endif /* _ARC_BITS_ATOMIC_H */
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#10 lore raw

PATCH v7 5/13 ARC: math soft float support

In reply to Vineet Gupta
---
 sysdeps/arc/bits/fenv.h                   | 78 +++++++++++++++++++++++
 sysdeps/arc/nofpu/Implies                 |  1 +
 sysdeps/arc/nofpu/math-tests-exceptions.h | 27 ++++++++
 sysdeps/arc/nofpu/math-tests-rounding.h   | 27 ++++++++
 sysdeps/arc/sfp-machine.h                 | 70 ++++++++++++++++++++
 5 files changed, 203 insertions(+)
 create mode 100644 sysdeps/arc/bits/fenv.h
 create mode 100644 sysdeps/arc/nofpu/Implies
 create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/arc/sfp-machine.h
sysdeps/arc/bits/fenv.h new file +78 -0
new file mode 100644
index 000000000000..b375641e6248
@@ -0,0 +1,78 @@
+/* Floating point environment.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+enum
+  {
+    FE_INVALID   =
+# define FE_INVALID	(0x01)
+      FE_INVALID,
+    FE_DIVBYZERO =
+# define FE_DIVBYZERO	(0x02)
+      FE_DIVBYZERO,
+    FE_OVERFLOW  =
+# define FE_OVERFLOW	(0x04)
+      FE_OVERFLOW,
+    FE_UNDERFLOW =
+# define FE_UNDERFLOW	(0x08)
+      FE_UNDERFLOW,
+    FE_INEXACT   =
+# define FE_INEXACT	(0x10)
+      FE_INEXACT
+  };
+
+# define FE_ALL_EXCEPT \
+	(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
+
+enum
+  {
+    FE_TOWARDZERO =
+# define FE_TOWARDZERO	(0x0)
+      FE_TOWARDZERO,
+    FE_TONEAREST  =
+# define FE_TONEAREST	(0x1)	/* default */
+      FE_TONEAREST,
+    FE_UPWARD     =
+# define FE_UPWARD	(0x2)
+      FE_UPWARD,
+    FE_DOWNWARD   =
+# define FE_DOWNWARD	(0x3)
+      FE_DOWNWARD
+  };
+
+typedef unsigned int fexcept_t;
+
+typedef struct
+{
+  unsigned int __fpcr;
+  unsigned int __fpsr;
+} fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((const fenv_t *) -1)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes.  */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes.  */
+# define FE_DFL_MODE	((const femode_t *) -1L)
+#endif
sysdeps/arc/nofpu/Implies new file +1 -0
new file mode 100644
index 000000000000..abcbadb25f22
@@ -0,0 +1 @@
+ieee754/soft-fp
sysdeps/arc/nofpu/math-tests-exceptions.h new file +27 -0
new file mode 100644
index 000000000000..b2a712c8c254
@@ -0,0 +1,27 @@
+/* Configuration for math tests.  Exceptions support ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H
+#define ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H 1
+
+/* Soft-float does not support exceptions.  */
+#define EXCEPTION_TESTS_float		0
+#define EXCEPTION_TESTS_double		0
+#define EXCEPTION_TESTS_long_double	0
+
+#endif
sysdeps/arc/nofpu/math-tests-rounding.h new file +27 -0
new file mode 100644
index 000000000000..2f67483db20d
@@ -0,0 +1,27 @@
+/* Configuration for math tests: rounding mode support.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef ARC_NOFPU_MATH_TESTS_ROUNDING_H
+#define ARC_NOFPU_MATH_TESTS_ROUNDING_H 1
+
+/* Soft-float only supports to-nearest rounding mode.  */
+#define ROUNDING_TESTS_float(MODE)		((MODE) == FE_TONEAREST)
+#define ROUNDING_TESTS_double(MODE)		((MODE) == FE_TONEAREST)
+#define ROUNDING_TESTS_long_double(MODE)	((MODE) == FE_TONEAREST)
+
+#endif
sysdeps/arc/sfp-machine.h new file +70 -0

70 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#11 lore raw

PATCH v7 6/13 ARC: hardware floating point support

In reply to Vineet Gupta
---
 sysdeps/arc/fpu/fclrexcpt.c         |  36 ++++++++++
 sysdeps/arc/fpu/fegetenv.c          |  37 ++++++++++
 sysdeps/arc/fpu/fegetmode.c         |  31 ++++++++
 sysdeps/arc/fpu/fegetround.c        |  32 +++++++++
 sysdeps/arc/fpu/feholdexcpt.c       |  43 +++++++++++
 sysdeps/arc/fpu/fesetenv.c          |  48 +++++++++++++
 sysdeps/arc/fpu/fesetexcept.c       |  32 +++++++++
 sysdeps/arc/fpu/fesetmode.c         |  40 +++++++++++
 sysdeps/arc/fpu/fesetround.c        |  40 +++++++++++
 sysdeps/arc/fpu/feupdateenv.c       |  51 +++++++++++++
 sysdeps/arc/fpu/fgetexcptflg.c      |  31 ++++++++
 sysdeps/arc/fpu/fraiseexcpt.c       |  39 ++++++++++
 sysdeps/arc/fpu/fsetexcptflg.c      |  38 ++++++++++
 sysdeps/arc/fpu/ftestexcept.c       |  33 +++++++++
 sysdeps/arc/fpu/math-use-builtins.h |  70 ++++++++++++++++++
 sysdeps/arc/fpu_control.h           | 106 ++++++++++++++++++++++++++++
 sysdeps/arc/get-rounding-mode.h     |  38 ++++++++++
 sysdeps/arc/math-tests-trap.h       |  27 +++++++
 sysdeps/arc/tininess.h              |   1 +
 19 files changed, 773 insertions(+)
 create mode 100644 sysdeps/arc/fpu/fclrexcpt.c
 create mode 100644 sysdeps/arc/fpu/fegetenv.c
 create mode 100644 sysdeps/arc/fpu/fegetmode.c
 create mode 100644 sysdeps/arc/fpu/fegetround.c
 create mode 100644 sysdeps/arc/fpu/feholdexcpt.c
 create mode 100644 sysdeps/arc/fpu/fesetenv.c
 create mode 100644 sysdeps/arc/fpu/fesetexcept.c
 create mode 100644 sysdeps/arc/fpu/fesetmode.c
 create mode 100644 sysdeps/arc/fpu/fesetround.c
 create mode 100644 sysdeps/arc/fpu/feupdateenv.c
 create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/ftestexcept.c
 create mode 100644 sysdeps/arc/fpu/math-use-builtins.h
 create mode 100644 sysdeps/arc/fpu_control.h
 create mode 100644 sysdeps/arc/get-rounding-mode.h
 create mode 100644 sysdeps/arc/math-tests-trap.h
 create mode 100644 sysdeps/arc/tininess.h
sysdeps/arc/fpu/fclrexcpt.c new file +36 -0
new file mode 100644
index 000000000000..7653d99a008c
@@ -0,0 +1,36 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  /* Clear the relevant bits, FWE is preserved.  */
+  fpsr &= ~excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
+libm_hidden_def (feclearexcept)
sysdeps/arc/fpu/fegetenv.c new file +37 -0
new file mode 100644
index 000000000000..bbb3b477b423
@@ -0,0 +1,37 @@
+/* Store current floating-point environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  unsigned int fpcr;
+  unsigned int fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETS (fpsr);
+  envp->__fpcr = fpcr;
+  envp->__fpsr = fpsr;
+
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
sysdeps/arc/fpu/fegetmode.c new file +31 -0
new file mode 100644
index 000000000000..f02c9119f222
@@ -0,0 +1,31 @@
+/* Store current floating-point control modes.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  unsigned int fpcr;
+
+  _FPU_GETCW (fpcr);
+  *modep = fpcr;
+
+  return 0;
+}
sysdeps/arc/fpu/fegetround.c new file +32 -0
new file mode 100644
index 000000000000..c5496bcbf7b4
@@ -0,0 +1,32 @@
+/* Return current rounding direction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fegetround (void)
+{
+  unsigned int fpcr;
+  _FPU_GETCW (fpcr);
+
+  return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK;
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
sysdeps/arc/fpu/feholdexcpt.c new file +43 -0

43 lines not on this page · raw message

sysdeps/arc/fpu/fesetenv.c new file +48 -0

48 lines not on this page · raw message

sysdeps/arc/fpu/fesetexcept.c new file +32 -0
new file mode 100644
index 000000000000..77517d0b25ab
@@ -0,0 +1,32 @@
+/* Set given exception flags.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+  fpsr |= excepts;
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
sysdeps/arc/fpu/fesetmode.c new file +40 -0
new file mode 100644
index 000000000000..c4ea02d8d15b
@@ -0,0 +1,40 @@
+/* Install given floating-point control modes.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  unsigned int fpcr;
+
+  if (modep == FE_DFL_MODE)
+    {
+      fpcr = _FPU_DEFAULT;
+    }
+  else
+    {
+      /* No need to mask out reserved bits as they are IoW.  */
+      fpcr = *modep;
+    }
+
+  _FPU_SETCW (fpcr);
+
+  return 0;
+}
sysdeps/arc/fpu/fesetround.c new file +40 -0
new file mode 100644
index 000000000000..701c0b2dcb42
@@ -0,0 +1,40 @@
+/* Set current rounding direction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fesetround (int round)
+{
+  unsigned int fpcr;
+
+  _FPU_GETCW (fpcr);
+
+  if (((fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK) != round)
+    {
+      fpcr &= ~(__FPU_RND_MASK << __FPU_RND_SHIFT);
+      fpcr |= (round & __FPU_RND_MASK) << __FPU_RND_SHIFT;
+      _FPU_SETCW (fpcr);
+    }
+
+  return 0;
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
sysdeps/arc/fpu/feupdateenv.c new file +51 -0

51 lines not on this page · raw message

sysdeps/arc/fpu/fgetexcptflg.c new file +31 -0
new file mode 100644
index 000000000000..a816121fd9b7
@@ -0,0 +1,31 @@
+/* Store current representation for exceptions, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+  *flagp = fpsr & excepts;
+
+  return 0;
+}
sysdeps/arc/fpu/fraiseexcpt.c new file +39 -0
new file mode 100644
index 000000000000..067c0607784f
@@ -0,0 +1,39 @@
+/* Raise given exceptions.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <float.h>
+#include <math.h>
+
+int
+__feraiseexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  /* currently raised exceptions are not cleared.  */
+  _FPU_GETS (fpsr);
+  fpsr |= excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
sysdeps/arc/fpu/fsetexcptflg.c new file +38 -0
new file mode 100644
index 000000000000..f9e08d504418
@@ -0,0 +1,38 @@
+/* Set floating-point environment exception handling, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  /* Clear the bits first.  */
+  fpsr &= ~excepts;
+
+  /* Now set those bits, copying them over from @flagp.  */
+  fpsr |= *flagp & excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
sysdeps/arc/fpu/ftestexcept.c new file +33 -0
new file mode 100644
index 000000000000..bb8ed27ab22b
@@ -0,0 +1,33 @@
+/* Test exception in current environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+#include <stdio.h>
+
+int
+fetestexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  return fpsr & excepts;
+}
+libm_hidden_def (fetestexcept)
sysdeps/arc/fpu/math-use-builtins.h new file +70 -0

70 lines not on this page · raw message

sysdeps/arc/fpu_control.h new file +106 -0

106 lines not on this page · raw message

sysdeps/arc/get-rounding-mode.h new file +38 -0
new file mode 100644
index 000000000000..15173e37aa4f
@@ -0,0 +1,38 @@
+/* Determine floating-point rounding mode within libc.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ARC_GET_ROUNDING_MODE_H
+#define _ARC_GET_ROUNDING_MODE_H	1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+static inline int
+get_rounding_mode (void)
+{
+#if defined(__ARC_FPU_SP__) ||  defined(__ARC_FPU_DP__)
+  unsigned int fpcr;
+  _FPU_GETCW (fpcr);
+
+  return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK;
+#else
+  return FE_TONEAREST;
+#endif
+}
+
+#endif /* get-rounding-mode.h */
sysdeps/arc/math-tests-trap.h new file +27 -0
new file mode 100644
index 000000000000..08b16f57976a
@@ -0,0 +1,27 @@
+/* Configuration for math tests: support for enabling exception traps.
+   ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef ARC_MATH_TESTS_TRAP_H
+#define ARC_MATH_TESTS_TRAP_H 1
+
+/* Trapping exceptions are optional on ARC
+   and not supported in Linux kernel just yet.  */
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)	((EXCEPT) == 0)
+
+#endif /* math-tests-trap.h.  */
sysdeps/arc/tininess.h new file +1 -0
new file mode 100644
index 000000000000..1db37790f881
@@ -0,0 +1 @@
+#define TININESS_AFTER_ROUNDING	1
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#12 lore raw

PATCH v7 6/13 ARC: hardware floating point support

---
Changes since v7:
- Disintegrated math-use-builtins.h (deleted) and added math-use-builtins-{fma,sqrt}.h

---
 sysdeps/arc/fpu/fclrexcpt.c              |  36 ++++++++
 sysdeps/arc/fpu/fegetenv.c               |  37 ++++++++
 sysdeps/arc/fpu/fegetmode.c              |  31 +++++++
 sysdeps/arc/fpu/fegetround.c             |  32 +++++++
 sysdeps/arc/fpu/feholdexcpt.c            |  43 +++++++++
 sysdeps/arc/fpu/fesetenv.c               |  48 ++++++++++
 sysdeps/arc/fpu/fesetexcept.c            |  32 +++++++
 sysdeps/arc/fpu/fesetmode.c              |  40 +++++++++
 sysdeps/arc/fpu/fesetround.c             |  40 +++++++++
 sysdeps/arc/fpu/feupdateenv.c            |  51 +++++++++++
 sysdeps/arc/fpu/fgetexcptflg.c           |  31 +++++++
 sysdeps/arc/fpu/fraiseexcpt.c            |  39 +++++++++
 sysdeps/arc/fpu/fsetexcptflg.c           |  38 ++++++++
 sysdeps/arc/fpu/ftestexcept.c            |  33 +++++++
 sysdeps/arc/fpu/math-use-builtins-fma.h  |   4 +
 sysdeps/arc/fpu/math-use-builtins-sqrt.h |   4 +
 sysdeps/arc/fpu_control.h                | 106 +++++++++++++++++++++++
 sysdeps/arc/get-rounding-mode.h          |  38 ++++++++
 sysdeps/arc/math-tests-trap.h            |  27 ++++++
 sysdeps/arc/tininess.h                   |   1 +
 20 files changed, 711 insertions(+)
 create mode 100644 sysdeps/arc/fpu/fclrexcpt.c
 create mode 100644 sysdeps/arc/fpu/fegetenv.c
 create mode 100644 sysdeps/arc/fpu/fegetmode.c
 create mode 100644 sysdeps/arc/fpu/fegetround.c
 create mode 100644 sysdeps/arc/fpu/feholdexcpt.c
 create mode 100644 sysdeps/arc/fpu/fesetenv.c
 create mode 100644 sysdeps/arc/fpu/fesetexcept.c
 create mode 100644 sysdeps/arc/fpu/fesetmode.c
 create mode 100644 sysdeps/arc/fpu/fesetround.c
 create mode 100644 sysdeps/arc/fpu/feupdateenv.c
 create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/ftestexcept.c
 create mode 100644 sysdeps/arc/fpu/math-use-builtins-fma.h
 create mode 100644 sysdeps/arc/fpu/math-use-builtins-sqrt.h
 create mode 100644 sysdeps/arc/fpu_control.h
 create mode 100644 sysdeps/arc/get-rounding-mode.h
 create mode 100644 sysdeps/arc/math-tests-trap.h
 create mode 100644 sysdeps/arc/tininess.h
sysdeps/arc/fpu/fclrexcpt.c new file +36 -0
new file mode 100644
index 000000000000..7653d99a008c
@@ -0,0 +1,36 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  /* Clear the relevant bits, FWE is preserved.  */
+  fpsr &= ~excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
+libm_hidden_def (feclearexcept)
sysdeps/arc/fpu/fegetenv.c new file +37 -0
new file mode 100644
index 000000000000..bbb3b477b423
@@ -0,0 +1,37 @@
+/* Store current floating-point environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  unsigned int fpcr;
+  unsigned int fpsr;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETS (fpsr);
+  envp->__fpcr = fpcr;
+  envp->__fpsr = fpsr;
+
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
sysdeps/arc/fpu/fegetmode.c new file +31 -0
new file mode 100644
index 000000000000..f02c9119f222
@@ -0,0 +1,31 @@
+/* Store current floating-point control modes.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  unsigned int fpcr;
+
+  _FPU_GETCW (fpcr);
+  *modep = fpcr;
+
+  return 0;
+}
sysdeps/arc/fpu/fegetround.c new file +32 -0
new file mode 100644
index 000000000000..c5496bcbf7b4
@@ -0,0 +1,32 @@
+/* Return current rounding direction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fegetround (void)
+{
+  unsigned int fpcr;
+  _FPU_GETCW (fpcr);
+
+  return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK;
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
sysdeps/arc/fpu/feholdexcpt.c new file +43 -0

43 lines not on this page · raw message

sysdeps/arc/fpu/fesetenv.c new file +48 -0

48 lines not on this page · raw message

sysdeps/arc/fpu/fesetexcept.c new file +32 -0
new file mode 100644
index 000000000000..77517d0b25ab
@@ -0,0 +1,32 @@
+/* Set given exception flags.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+  fpsr |= excepts;
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
sysdeps/arc/fpu/fesetmode.c new file +40 -0
new file mode 100644
index 000000000000..c4ea02d8d15b
@@ -0,0 +1,40 @@
+/* Install given floating-point control modes.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  unsigned int fpcr;
+
+  if (modep == FE_DFL_MODE)
+    {
+      fpcr = _FPU_DEFAULT;
+    }
+  else
+    {
+      /* No need to mask out reserved bits as they are IoW.  */
+      fpcr = *modep;
+    }
+
+  _FPU_SETCW (fpcr);
+
+  return 0;
+}
sysdeps/arc/fpu/fesetround.c new file +40 -0
new file mode 100644
index 000000000000..701c0b2dcb42
@@ -0,0 +1,40 @@
+/* Set current rounding direction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fesetround (int round)
+{
+  unsigned int fpcr;
+
+  _FPU_GETCW (fpcr);
+
+  if (((fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK) != round)
+    {
+      fpcr &= ~(__FPU_RND_MASK << __FPU_RND_SHIFT);
+      fpcr |= (round & __FPU_RND_MASK) << __FPU_RND_SHIFT;
+      _FPU_SETCW (fpcr);
+    }
+
+  return 0;
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
sysdeps/arc/fpu/feupdateenv.c new file +51 -0

51 lines not on this page · raw message

sysdeps/arc/fpu/fgetexcptflg.c new file +31 -0
new file mode 100644
index 000000000000..a816121fd9b7
@@ -0,0 +1,31 @@
+/* Store current representation for exceptions, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+  *flagp = fpsr & excepts;
+
+  return 0;
+}
sysdeps/arc/fpu/fraiseexcpt.c new file +39 -0
new file mode 100644
index 000000000000..067c0607784f
@@ -0,0 +1,39 @@
+/* Raise given exceptions.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <float.h>
+#include <math.h>
+
+int
+__feraiseexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  /* currently raised exceptions are not cleared.  */
+  _FPU_GETS (fpsr);
+  fpsr |= excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
sysdeps/arc/fpu/fsetexcptflg.c new file +38 -0
new file mode 100644
index 000000000000..f9e08d504418
@@ -0,0 +1,38 @@
+/* Set floating-point environment exception handling, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  /* Clear the bits first.  */
+  fpsr &= ~excepts;
+
+  /* Now set those bits, copying them over from @flagp.  */
+  fpsr |= *flagp & excepts;
+
+  _FPU_SETS (fpsr);
+
+  return 0;
+}
sysdeps/arc/fpu/ftestexcept.c new file +33 -0
new file mode 100644
index 000000000000..bb8ed27ab22b
@@ -0,0 +1,33 @@
+/* Test exception in current environment.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+#include <stdio.h>
+
+int
+fetestexcept (int excepts)
+{
+  unsigned int fpsr;
+
+  _FPU_GETS (fpsr);
+
+  return fpsr & excepts;
+}
+libm_hidden_def (fetestexcept)
sysdeps/arc/fpu/math-use-builtins-fma.h new file +4 -0
new file mode 100644
index 000000000000..eede75aa41be
@@ -0,0 +1,4 @@
+#define USE_FMA_BUILTIN 1
+#define USE_FMAF_BUILTIN 1
+#define USE_FMAL_BUILTIN 0
+#define USE_FMAF128_BUILTIN 0
sysdeps/arc/fpu/math-use-builtins-sqrt.h new file +4 -0
new file mode 100644
index 000000000000..e94c915ba66a
@@ -0,0 +1,4 @@
+#define USE_SQRT_BUILTIN 1
+#define USE_SQRTF_BUILTIN 1
+#define USE_SQRTL_BUILTIN 0
+#define USE_SQRTF128_BUILTIN 0
sysdeps/arc/fpu_control.h new file +106 -0

106 lines not on this page · raw message

sysdeps/arc/get-rounding-mode.h new file +38 -0
new file mode 100644
index 000000000000..15173e37aa4f
@@ -0,0 +1,38 @@
+/* Determine floating-point rounding mode within libc.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ARC_GET_ROUNDING_MODE_H
+#define _ARC_GET_ROUNDING_MODE_H	1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+static inline int
+get_rounding_mode (void)
+{
+#if defined(__ARC_FPU_SP__) ||  defined(__ARC_FPU_DP__)
+  unsigned int fpcr;
+  _FPU_GETCW (fpcr);
+
+  return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK;
+#else
+  return FE_TONEAREST;
+#endif
+}
+
+#endif /* get-rounding-mode.h */
sysdeps/arc/math-tests-trap.h new file +27 -0
new file mode 100644
index 000000000000..08b16f57976a
@@ -0,0 +1,27 @@
+/* Configuration for math tests: support for enabling exception traps.
+   ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef ARC_MATH_TESTS_TRAP_H
+#define ARC_MATH_TESTS_TRAP_H 1
+
+/* Trapping exceptions are optional on ARC
+   and not supported in Linux kernel just yet.  */
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)	((EXCEPT) == 0)
+
+#endif /* math-tests-trap.h.  */
sysdeps/arc/tininess.h new file +1 -0
new file mode 100644
index 000000000000..1db37790f881
@@ -0,0 +1 @@
+#define TININESS_AFTER_ROUNDING	1
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#13 lore raw

PATCH v7 7/13 ARC: Linux Syscall Interface

In reply to Vineet Gupta
---
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    | 303 ++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |  21 ++
 sysdeps/unix/sysv/linux/arc/clone.S           |  93 ++++++
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |  41 +++
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |   6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |  27 ++
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |  26 ++
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |  27 ++
 sysdeps/unix/sysv/linux/arc/sigaction.c       |  31 ++
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |  29 ++
 sysdeps/unix/sysv/linux/arc/syscall.S         |  33 ++
 sysdeps/unix/sysv/linux/arc/syscalls.list     |   3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |  33 ++
 sysdeps/unix/sysv/linux/arc/sysdep.h          | 224 +++++++++++++
 sysdeps/unix/sysv/linux/arc/vfork.S           |  42 +++
 15 files changed, 939 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
 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/vfork.S
sysdeps/unix/sysv/linux/arc/arch-syscall.h new file +303 -0
new file mode 100644
index 000000000000..2b017eb5bbaa
@@ -0,0 +1,303 @@
+/* AUTOGENERATED by update-syscall-lists.py.  */
+#define __NR_accept 202
+#define __NR_accept4 242
+#define __NR_acct 89
+#define __NR_add_key 217
+#define __NR_adjtimex 171
+#define __NR_arc_gettls 246
+#define __NR_arc_settls 245
+#define __NR_arc_usr_cmpxchg 248
+#define __NR_bind 200
+#define __NR_bpf 280
+#define __NR_brk 214
+#define __NR_cacheflush 244
+#define __NR_capget 90
+#define __NR_capset 91
+#define __NR_chdir 49
+#define __NR_chroot 51
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_gettime 113
+#define __NR_clock_gettime64 403
+#define __NR_clock_nanosleep 115
+#define __NR_clock_nanosleep_time64 407
+#define __NR_clock_settime 112
+#define __NR_clock_settime64 404
+#define __NR_clone 220
+#define __NR_clone3 435
+#define __NR_close 57
+#define __NR_connect 203
+#define __NR_copy_file_range 285
+#define __NR_delete_module 106
+#define __NR_dup 23
+#define __NR_dup3 24
+#define __NR_epoll_create1 20
+#define __NR_epoll_ctl 21
+#define __NR_epoll_pwait 22
+#define __NR_eventfd2 19
+#define __NR_execve 221
+#define __NR_execveat 281
+#define __NR_exit 93
+#define __NR_exit_group 94
+#define __NR_faccessat 48
+#define __NR_fadvise64_64 223
+#define __NR_fallocate 47
+#define __NR_fanotify_init 262
+#define __NR_fanotify_mark 263
+#define __NR_fchdir 50
+#define __NR_fchmod 52
+#define __NR_fchmodat 53
+#define __NR_fchown 55
+#define __NR_fchownat 54
+#define __NR_fcntl64 25
+#define __NR_fdatasync 83
+#define __NR_fgetxattr 10
+#define __NR_finit_module 273
+#define __NR_flistxattr 13
+#define __NR_flock 32
+#define __NR_fremovexattr 16
+#define __NR_fsconfig 431
+#define __NR_fsetxattr 7
+#define __NR_fsmount 432
+#define __NR_fsopen 430
+#define __NR_fspick 433
+#define __NR_fstatfs64 44
+#define __NR_fsync 82
+#define __NR_ftruncate64 46
+#define __NR_futex_time64 422
+#define __NR_get_mempolicy 236
+#define __NR_get_robust_list 100
+#define __NR_getcpu 168
+#define __NR_getcwd 17
+#define __NR_getdents64 61
+#define __NR_getegid 177
+#define __NR_geteuid 175
+#define __NR_getgid 176
+#define __NR_getgroups 158
+#define __NR_getitimer 102
+#define __NR_getpeername 205
+#define __NR_getpgid 155
+#define __NR_getpid 172
+#define __NR_getppid 173
+#define __NR_getpriority 141
+#define __NR_getrandom 278
+#define __NR_getresgid 150
+#define __NR_getresuid 148
+#define __NR_getrlimit 163
+#define __NR_getrusage 165
+#define __NR_getsid 156
+#define __NR_getsockname 204
+#define __NR_getsockopt 209
+#define __NR_gettid 178
+#define __NR_gettimeofday 169
+#define __NR_getuid 174
+#define __NR_getxattr 8
+#define __NR_init_module 105
+#define __NR_inotify_add_watch 27
+#define __NR_inotify_init1 26
+#define __NR_inotify_rm_watch 28
+#define __NR_io_cancel 3
+#define __NR_io_destroy 1
+#define __NR_io_getevents 4
+#define __NR_io_pgetevents 292
+#define __NR_io_pgetevents_time64 416
+#define __NR_io_setup 0
+#define __NR_io_submit 2
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
+#define __NR_io_uring_setup 425
+#define __NR_ioctl 29
+#define __NR_ioprio_get 31
+#define __NR_ioprio_set 30
+#define __NR_kcmp 272
+#define __NR_kexec_file_load 294
+#define __NR_kexec_load 104
+#define __NR_keyctl 219
+#define __NR_kill 129
+#define __NR_lgetxattr 9
+#define __NR_linkat 37
+#define __NR_listen 201
+#define __NR_listxattr 11
+#define __NR_llistxattr 12
+#define __NR_llseek 62
+#define __NR_lookup_dcookie 18
+#define __NR_lremovexattr 15
+#define __NR_lsetxattr 6
+#define __NR_madvise 233
+#define __NR_mbind 235
+#define __NR_membarrier 283
+#define __NR_memfd_create 279
+#define __NR_migrate_pages 238
+#define __NR_mincore 232
+#define __NR_mkdirat 34
+#define __NR_mknodat 33
+#define __NR_mlock 228
+#define __NR_mlock2 284
+#define __NR_mlockall 230
+#define __NR_mmap2 222
+#define __NR_mount 40
+#define __NR_move_mount 429
+#define __NR_move_pages 239
+#define __NR_mprotect 226
+#define __NR_mq_getsetattr 185
+#define __NR_mq_notify 184
+#define __NR_mq_open 180
+#define __NR_mq_timedreceive_time64 419
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_unlink 181
+#define __NR_mremap 216
+#define __NR_msgctl 187
+#define __NR_msgget 186
+#define __NR_msgrcv 188
+#define __NR_msgsnd 189
+#define __NR_msync 227
+#define __NR_munlock 229
+#define __NR_munlockall 231
+#define __NR_munmap 215
+#define __NR_name_to_handle_at 264
+#define __NR_nanosleep 101
+#define __NR_nfsservctl 42
+#define __NR_open_by_handle_at 265
+#define __NR_open_tree 428
+#define __NR_openat 56
+#define __NR_openat2 437
+#define __NR_perf_event_open 241
+#define __NR_personality 92
+#define __NR_pidfd_getfd 438
+#define __NR_pidfd_open 434
+#define __NR_pidfd_send_signal 424
+#define __NR_pipe2 59
+#define __NR_pivot_root 41
+#define __NR_pkey_alloc 289
+#define __NR_pkey_free 290
+#define __NR_pkey_mprotect 288
+#define __NR_ppoll_time64 414
+#define __NR_prctl 167
+#define __NR_pread64 67
+#define __NR_preadv 69
+#define __NR_preadv2 286
+#define __NR_prlimit64 261
+#define __NR_process_vm_readv 270
+#define __NR_process_vm_writev 271
+#define __NR_pselect6_time64 413
+#define __NR_ptrace 117
+#define __NR_pwrite64 68
+#define __NR_pwritev 70
+#define __NR_pwritev2 287
+#define __NR_quotactl 60
+#define __NR_read 63
+#define __NR_readahead 213
+#define __NR_readlinkat 78
+#define __NR_readv 65
+#define __NR_reboot 142
+#define __NR_recvfrom 207
+#define __NR_recvmmsg_time64 417
+#define __NR_recvmsg 212
+#define __NR_remap_file_pages 234
+#define __NR_removexattr 14
+#define __NR_renameat 38
+#define __NR_renameat2 276
+#define __NR_request_key 218
+#define __NR_restart_syscall 128
+#define __NR_rseq 293
+#define __NR_rt_sigaction 134
+#define __NR_rt_sigpending 136
+#define __NR_rt_sigprocmask 135
+#define __NR_rt_sigqueueinfo 138
+#define __NR_rt_sigreturn 139
+#define __NR_rt_sigsuspend 133
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_rt_tgsigqueueinfo 240
+#define __NR_sched_get_priority_max 125
+#define __NR_sched_get_priority_min 126
+#define __NR_sched_getaffinity 123
+#define __NR_sched_getattr 275
+#define __NR_sched_getparam 121
+#define __NR_sched_getscheduler 120
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_sched_setaffinity 122
+#define __NR_sched_setattr 274
+#define __NR_sched_setparam 118
+#define __NR_sched_setscheduler 119
+#define __NR_sched_yield 124
+#define __NR_seccomp 277
+#define __NR_semctl 191
+#define __NR_semget 190
+#define __NR_semop 193
+#define __NR_semtimedop_time64 420
+#define __NR_sendfile64 71
+#define __NR_sendmmsg 269
+#define __NR_sendmsg 211
+#define __NR_sendto 206
+#define __NR_set_mempolicy 237
+#define __NR_set_robust_list 99
+#define __NR_set_tid_address 96
+#define __NR_setdomainname 162
+#define __NR_setfsgid 152
+#define __NR_setfsuid 151
+#define __NR_setgid 144
+#define __NR_setgroups 159
+#define __NR_sethostname 161
+#define __NR_setitimer 103
+#define __NR_setns 268
+#define __NR_setpgid 154
+#define __NR_setpriority 140
+#define __NR_setregid 143
+#define __NR_setresgid 149
+#define __NR_setresuid 147
+#define __NR_setreuid 145
+#define __NR_setrlimit 164
+#define __NR_setsid 157
+#define __NR_setsockopt 208
+#define __NR_settimeofday 170
+#define __NR_setuid 146
+#define __NR_setxattr 5
+#define __NR_shmat 196
+#define __NR_shmctl 195
+#define __NR_shmdt 197
+#define __NR_shmget 194
+#define __NR_shutdown 210
+#define __NR_sigaltstack 132
+#define __NR_signalfd4 74
+#define __NR_socket 198
+#define __NR_socketpair 199
+#define __NR_splice 76
+#define __NR_statfs64 43
+#define __NR_statx 291
+#define __NR_swapoff 225
+#define __NR_swapon 224
+#define __NR_symlinkat 36
+#define __NR_sync 81
+#define __NR_sync_file_range 84
+#define __NR_syncfs 267
+#define __NR_sysfs 247
+#define __NR_sysinfo 179
+#define __NR_syslog 116
+#define __NR_tee 77
+#define __NR_tgkill 131
+#define __NR_timer_create 107
+#define __NR_timer_delete 111
+#define __NR_timer_getoverrun 109
+#define __NR_timer_gettime 108
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime 110
+#define __NR_timer_settime64 409
+#define __NR_timerfd_create 85
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_times 153
+#define __NR_tkill 130
+#define __NR_truncate64 45
+#define __NR_umask 166
+#define __NR_umount2 39
+#define __NR_uname 160
+#define __NR_unlinkat 35
+#define __NR_unshare 97
+#define __NR_userfaultfd 282
+#define __NR_utimensat_time64 412
+#define __NR_vhangup 58
+#define __NR_vmsplice 75
+#define __NR_wait4 260
+#define __NR_waitid 95
+#define __NR_write 64
+#define __NR_writev 66
sysdeps/unix/sysv/linux/arc/bits/timesize.h new file +21 -0
new file mode 100644
index 000000000000..bf44f09f7619
@@ -0,0 +1,21 @@
+/* Bit size of the time_t type at glibc build time, general case.
+   Copyright (C) 2020 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 <bits/wordsize.h>
+
+#define __TIMESIZE	64
sysdeps/unix/sysv/linux/arc/clone.S new file +93 -0

93 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h new file +41 -0

41 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h new file +6 -0
new file mode 100644
index 000000000000..296f3197ee31
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define SIGJMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define JMP_BUF_ALIGN		__alignof__ (unsigned long int)
+#define SIGJMP_BUF_ALIGN	__alignof__ (unsigned long int)
+#define MASK_WAS_SAVED_OFFSET	(32 * sizeof (unsigned long int))
+#define SAVED_MASK_OFFSET	(33 * sizeof (unsigned long int))
sysdeps/unix/sysv/linux/arc/kernel-features.h new file +27 -0
new file mode 100644
index 000000000000..0a5c9e21fbf2
@@ -0,0 +1,27 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+/* The minimum supported kernel version for ARC is 5.1 (64-bit time, offsets),
+   although the asm-generic ABI is from 3.9 (when Linux port was merged).  */
+
+#include_next <kernel-features.h>
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
sysdeps/unix/sysv/linux/arc/kernel_stat.h new file +26 -0
new file mode 100644
index 000000000000..8fdd86b9e843
@@ -0,0 +1,26 @@
+/* Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <bits/wordsize.h>
+
+/* Needed to elide the itemized copy code in common xstatconv.c.  */
+#define STAT_IS_KERNEL_STAT 1
+
+/* Nice side-effect of 64-bit time_t switch is these are same.  */
+#define XSTAT_IS_XSTAT64 1
+
+#define STATFS_IS_STATFS64 0
sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +27 -0
new file mode 100644
index 000000000000..5293d670adaa
@@ -0,0 +1,27 @@
+/* mmap - map files or devices into memory.  Linux/ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef MMAP_ARC_INTERNAL_H
+#define MMAP_ARC_INTERNAL_H
+
+/* 8K is default but determine the shift dynamically with getpagesize.  */
+#define MMAP2_PAGE_UNIT -1
+
+#include_next <mmap_internal.h>
+
+#endif
sysdeps/unix/sysv/linux/arc/sigaction.c new file +31 -0
new file mode 100644
index 000000000000..dd590ecb6dd7
@@ -0,0 +1,31 @@
+/* ARC specific sigaction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define SA_RESTORER	0x04000000
+
+extern void __default_rt_sa_restorer (void);
+
+#define SET_SA_RESTORER(kact, act)				\
+ ({								\
+   (kact)->sa_restorer = __default_rt_sa_restorer;		\
+   (kact)->sa_flags |= SA_RESTORER;				\
+ })
+
+#define RESET_SA_RESTORER(act, kact)
+
+#include <sysdeps/unix/sysv/linux/sigaction.c>
sysdeps/unix/sysv/linux/arc/sigrestorer.S new file +29 -0
new file mode 100644
index 000000000000..eaabef505ec2
@@ -0,0 +1,29 @@
+/* Default sigreturn stub for ARC Linux.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/syscall.h>
+#include <sysdep.h>
+#include <tcb-offsets.h>
+
+/* Note the NOP has to be outside body.  */
+	nop
+ENTRY (__default_rt_sa_restorer)
+	mov r8, __NR_rt_sigreturn
+	ARC_TRAP_INSN
+	j_s     [blink]
+PSEUDO_END_NOERRNO (__default_rt_sa_restorer)
sysdeps/unix/sysv/linux/arc/syscall.S new file +33 -0
new file mode 100644
index 000000000000..bb98ef029dd7
@@ -0,0 +1,33 @@
+/* syscall - indirect system call.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (syscall)
+	mov_s	r8, r0
+	mov_s	r0, r1
+	mov_s	r1, r2
+	mov_s	r2, r3
+	mov_s	r3, r4
+	mov_s	r4, r5
+	mov_s	r5, r6
+
+	ARC_TRAP_INSN
+	brhi	r0, -1024, L (call_syscall_err)
+	j	[blink]
+PSEUDO_END (syscall)
sysdeps/unix/sysv/linux/arc/syscalls.list new file +3 -0
new file mode 100644
index 000000000000..d0ef5977ee06
@@ -0,0 +1,3 @@
+# File name	Caller	Syscall name	Args	Strong name	Weak names
+
+cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush
sysdeps/unix/sysv/linux/arc/sysdep.c new file +33 -0
new file mode 100644
index 000000000000..28d0d4b6640f
@@ -0,0 +1,33 @@
+/* ARC wrapper for setting errno.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <errno.h>
+
+/* All syscall handlers land here to avoid generated code bloat due to
+   GOT reference  to errno_location or it's equivalent.  */
+int
+__syscall_error (int err_no)
+{
+  __set_errno (-err_no);
+  return -1;
+}
+
+#if IS_IN (libc)
+hidden_def (__syscall_error)
+#endif
sysdeps/unix/sysv/linux/arc/sysdep.h new file +224 -0

224 lines not on this page · raw message

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

42 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#14 lore raw

PATCH v7 7/13 ARC: Linux Syscall Interface

---
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

---
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    | 303 ++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |  21 ++
 sysdeps/unix/sysv/linux/arc/clone.S           |  93 ++++++
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |  41 +++
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |   6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |  27 ++
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |  26 ++
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |  27 ++
 sysdeps/unix/sysv/linux/arc/sigaction.c       |  31 ++
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |  29 ++
 sysdeps/unix/sysv/linux/arc/syscall.S         |  33 ++
 sysdeps/unix/sysv/linux/arc/syscalls.list     |   3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |  33 ++
 sysdeps/unix/sysv/linux/arc/sysdep.h          | 224 +++++++++++++
 sysdeps/unix/sysv/linux/arc/vfork.S           |  42 +++
 15 files changed, 939 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
 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/vfork.S
sysdeps/unix/sysv/linux/arc/arch-syscall.h new file +303 -0
new file mode 100644
index 000000000000..2b017eb5bbaa
@@ -0,0 +1,303 @@
+/* AUTOGENERATED by update-syscall-lists.py.  */
+#define __NR_accept 202
+#define __NR_accept4 242
+#define __NR_acct 89
+#define __NR_add_key 217
+#define __NR_adjtimex 171
+#define __NR_arc_gettls 246
+#define __NR_arc_settls 245
+#define __NR_arc_usr_cmpxchg 248
+#define __NR_bind 200
+#define __NR_bpf 280
+#define __NR_brk 214
+#define __NR_cacheflush 244
+#define __NR_capget 90
+#define __NR_capset 91
+#define __NR_chdir 49
+#define __NR_chroot 51
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_gettime 113
+#define __NR_clock_gettime64 403
+#define __NR_clock_nanosleep 115
+#define __NR_clock_nanosleep_time64 407
+#define __NR_clock_settime 112
+#define __NR_clock_settime64 404
+#define __NR_clone 220
+#define __NR_clone3 435
+#define __NR_close 57
+#define __NR_connect 203
+#define __NR_copy_file_range 285
+#define __NR_delete_module 106
+#define __NR_dup 23
+#define __NR_dup3 24
+#define __NR_epoll_create1 20
+#define __NR_epoll_ctl 21
+#define __NR_epoll_pwait 22
+#define __NR_eventfd2 19
+#define __NR_execve 221
+#define __NR_execveat 281
+#define __NR_exit 93
+#define __NR_exit_group 94
+#define __NR_faccessat 48
+#define __NR_fadvise64_64 223
+#define __NR_fallocate 47
+#define __NR_fanotify_init 262
+#define __NR_fanotify_mark 263
+#define __NR_fchdir 50
+#define __NR_fchmod 52
+#define __NR_fchmodat 53
+#define __NR_fchown 55
+#define __NR_fchownat 54
+#define __NR_fcntl64 25
+#define __NR_fdatasync 83
+#define __NR_fgetxattr 10
+#define __NR_finit_module 273
+#define __NR_flistxattr 13
+#define __NR_flock 32
+#define __NR_fremovexattr 16
+#define __NR_fsconfig 431
+#define __NR_fsetxattr 7
+#define __NR_fsmount 432
+#define __NR_fsopen 430
+#define __NR_fspick 433
+#define __NR_fstatfs64 44
+#define __NR_fsync 82
+#define __NR_ftruncate64 46
+#define __NR_futex_time64 422
+#define __NR_get_mempolicy 236
+#define __NR_get_robust_list 100
+#define __NR_getcpu 168
+#define __NR_getcwd 17
+#define __NR_getdents64 61
+#define __NR_getegid 177
+#define __NR_geteuid 175
+#define __NR_getgid 176
+#define __NR_getgroups 158
+#define __NR_getitimer 102
+#define __NR_getpeername 205
+#define __NR_getpgid 155
+#define __NR_getpid 172
+#define __NR_getppid 173
+#define __NR_getpriority 141
+#define __NR_getrandom 278
+#define __NR_getresgid 150
+#define __NR_getresuid 148
+#define __NR_getrlimit 163
+#define __NR_getrusage 165
+#define __NR_getsid 156
+#define __NR_getsockname 204
+#define __NR_getsockopt 209
+#define __NR_gettid 178
+#define __NR_gettimeofday 169
+#define __NR_getuid 174
+#define __NR_getxattr 8
+#define __NR_init_module 105
+#define __NR_inotify_add_watch 27
+#define __NR_inotify_init1 26
+#define __NR_inotify_rm_watch 28
+#define __NR_io_cancel 3
+#define __NR_io_destroy 1
+#define __NR_io_getevents 4
+#define __NR_io_pgetevents 292
+#define __NR_io_pgetevents_time64 416
+#define __NR_io_setup 0
+#define __NR_io_submit 2
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
+#define __NR_io_uring_setup 425
+#define __NR_ioctl 29
+#define __NR_ioprio_get 31
+#define __NR_ioprio_set 30
+#define __NR_kcmp 272
+#define __NR_kexec_file_load 294
+#define __NR_kexec_load 104
+#define __NR_keyctl 219
+#define __NR_kill 129
+#define __NR_lgetxattr 9
+#define __NR_linkat 37
+#define __NR_listen 201
+#define __NR_listxattr 11
+#define __NR_llistxattr 12
+#define __NR_llseek 62
+#define __NR_lookup_dcookie 18
+#define __NR_lremovexattr 15
+#define __NR_lsetxattr 6
+#define __NR_madvise 233
+#define __NR_mbind 235
+#define __NR_membarrier 283
+#define __NR_memfd_create 279
+#define __NR_migrate_pages 238
+#define __NR_mincore 232
+#define __NR_mkdirat 34
+#define __NR_mknodat 33
+#define __NR_mlock 228
+#define __NR_mlock2 284
+#define __NR_mlockall 230
+#define __NR_mmap2 222
+#define __NR_mount 40
+#define __NR_move_mount 429
+#define __NR_move_pages 239
+#define __NR_mprotect 226
+#define __NR_mq_getsetattr 185
+#define __NR_mq_notify 184
+#define __NR_mq_open 180
+#define __NR_mq_timedreceive_time64 419
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_unlink 181
+#define __NR_mremap 216
+#define __NR_msgctl 187
+#define __NR_msgget 186
+#define __NR_msgrcv 188
+#define __NR_msgsnd 189
+#define __NR_msync 227
+#define __NR_munlock 229
+#define __NR_munlockall 231
+#define __NR_munmap 215
+#define __NR_name_to_handle_at 264
+#define __NR_nanosleep 101
+#define __NR_nfsservctl 42
+#define __NR_open_by_handle_at 265
+#define __NR_open_tree 428
+#define __NR_openat 56
+#define __NR_openat2 437
+#define __NR_perf_event_open 241
+#define __NR_personality 92
+#define __NR_pidfd_getfd 438
+#define __NR_pidfd_open 434
+#define __NR_pidfd_send_signal 424
+#define __NR_pipe2 59
+#define __NR_pivot_root 41
+#define __NR_pkey_alloc 289
+#define __NR_pkey_free 290
+#define __NR_pkey_mprotect 288
+#define __NR_ppoll_time64 414
+#define __NR_prctl 167
+#define __NR_pread64 67
+#define __NR_preadv 69
+#define __NR_preadv2 286
+#define __NR_prlimit64 261
+#define __NR_process_vm_readv 270
+#define __NR_process_vm_writev 271
+#define __NR_pselect6_time64 413
+#define __NR_ptrace 117
+#define __NR_pwrite64 68
+#define __NR_pwritev 70
+#define __NR_pwritev2 287
+#define __NR_quotactl 60
+#define __NR_read 63
+#define __NR_readahead 213
+#define __NR_readlinkat 78
+#define __NR_readv 65
+#define __NR_reboot 142
+#define __NR_recvfrom 207
+#define __NR_recvmmsg_time64 417
+#define __NR_recvmsg 212
+#define __NR_remap_file_pages 234
+#define __NR_removexattr 14
+#define __NR_renameat 38
+#define __NR_renameat2 276
+#define __NR_request_key 218
+#define __NR_restart_syscall 128
+#define __NR_rseq 293
+#define __NR_rt_sigaction 134
+#define __NR_rt_sigpending 136
+#define __NR_rt_sigprocmask 135
+#define __NR_rt_sigqueueinfo 138
+#define __NR_rt_sigreturn 139
+#define __NR_rt_sigsuspend 133
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_rt_tgsigqueueinfo 240
+#define __NR_sched_get_priority_max 125
+#define __NR_sched_get_priority_min 126
+#define __NR_sched_getaffinity 123
+#define __NR_sched_getattr 275
+#define __NR_sched_getparam 121
+#define __NR_sched_getscheduler 120
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_sched_setaffinity 122
+#define __NR_sched_setattr 274
+#define __NR_sched_setparam 118
+#define __NR_sched_setscheduler 119
+#define __NR_sched_yield 124
+#define __NR_seccomp 277
+#define __NR_semctl 191
+#define __NR_semget 190
+#define __NR_semop 193
+#define __NR_semtimedop_time64 420
+#define __NR_sendfile64 71
+#define __NR_sendmmsg 269
+#define __NR_sendmsg 211
+#define __NR_sendto 206
+#define __NR_set_mempolicy 237
+#define __NR_set_robust_list 99
+#define __NR_set_tid_address 96
+#define __NR_setdomainname 162
+#define __NR_setfsgid 152
+#define __NR_setfsuid 151
+#define __NR_setgid 144
+#define __NR_setgroups 159
+#define __NR_sethostname 161
+#define __NR_setitimer 103
+#define __NR_setns 268
+#define __NR_setpgid 154
+#define __NR_setpriority 140
+#define __NR_setregid 143
+#define __NR_setresgid 149
+#define __NR_setresuid 147
+#define __NR_setreuid 145
+#define __NR_setrlimit 164
+#define __NR_setsid 157
+#define __NR_setsockopt 208
+#define __NR_settimeofday 170
+#define __NR_setuid 146
+#define __NR_setxattr 5
+#define __NR_shmat 196
+#define __NR_shmctl 195
+#define __NR_shmdt 197
+#define __NR_shmget 194
+#define __NR_shutdown 210
+#define __NR_sigaltstack 132
+#define __NR_signalfd4 74
+#define __NR_socket 198
+#define __NR_socketpair 199
+#define __NR_splice 76
+#define __NR_statfs64 43
+#define __NR_statx 291
+#define __NR_swapoff 225
+#define __NR_swapon 224
+#define __NR_symlinkat 36
+#define __NR_sync 81
+#define __NR_sync_file_range 84
+#define __NR_syncfs 267
+#define __NR_sysfs 247
+#define __NR_sysinfo 179
+#define __NR_syslog 116
+#define __NR_tee 77
+#define __NR_tgkill 131
+#define __NR_timer_create 107
+#define __NR_timer_delete 111
+#define __NR_timer_getoverrun 109
+#define __NR_timer_gettime 108
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime 110
+#define __NR_timer_settime64 409
+#define __NR_timerfd_create 85
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_times 153
+#define __NR_tkill 130
+#define __NR_truncate64 45
+#define __NR_umask 166
+#define __NR_umount2 39
+#define __NR_uname 160
+#define __NR_unlinkat 35
+#define __NR_unshare 97
+#define __NR_userfaultfd 282
+#define __NR_utimensat_time64 412
+#define __NR_vhangup 58
+#define __NR_vmsplice 75
+#define __NR_wait4 260
+#define __NR_waitid 95
+#define __NR_write 64
+#define __NR_writev 66
sysdeps/unix/sysv/linux/arc/bits/timesize.h new file +21 -0
new file mode 100644
index 000000000000..bf44f09f7619
@@ -0,0 +1,21 @@
+/* Bit size of the time_t type at glibc build time, general case.
+   Copyright (C) 2020 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 <bits/wordsize.h>
+
+#define __TIMESIZE	64
sysdeps/unix/sysv/linux/arc/clone.S new file +93 -0

93 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h new file +41 -0

41 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h new file +6 -0
new file mode 100644
index 000000000000..296f3197ee31
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define SIGJMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define JMP_BUF_ALIGN		__alignof__ (unsigned long int)
+#define SIGJMP_BUF_ALIGN	__alignof__ (unsigned long int)
+#define MASK_WAS_SAVED_OFFSET	(32 * sizeof (unsigned long int))
+#define SAVED_MASK_OFFSET	(33 * sizeof (unsigned long int))
sysdeps/unix/sysv/linux/arc/kernel-features.h new file +27 -0
new file mode 100644
index 000000000000..0a5c9e21fbf2
@@ -0,0 +1,27 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+/* The minimum supported kernel version for ARC is 5.1 (64-bit time, offsets),
+   although the asm-generic ABI is from 3.9 (when Linux port was merged).  */
+
+#include_next <kernel-features.h>
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
sysdeps/unix/sysv/linux/arc/kernel_stat.h new file +26 -0
new file mode 100644
index 000000000000..8fdd86b9e843
@@ -0,0 +1,26 @@
+/* Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <bits/wordsize.h>
+
+/* Needed to elide the itemized copy code in common xstatconv.c.  */
+#define STAT_IS_KERNEL_STAT 1
+
+/* Nice side-effect of 64-bit time_t switch is these are same.  */
+#define XSTAT_IS_XSTAT64 1
+
+#define STATFS_IS_STATFS64 0
sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +27 -0
new file mode 100644
index 000000000000..5293d670adaa
@@ -0,0 +1,27 @@
+/* mmap - map files or devices into memory.  Linux/ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef MMAP_ARC_INTERNAL_H
+#define MMAP_ARC_INTERNAL_H
+
+/* 8K is default but determine the shift dynamically with getpagesize.  */
+#define MMAP2_PAGE_UNIT -1
+
+#include_next <mmap_internal.h>
+
+#endif
sysdeps/unix/sysv/linux/arc/sigaction.c new file +31 -0
new file mode 100644
index 000000000000..dd590ecb6dd7
@@ -0,0 +1,31 @@
+/* ARC specific sigaction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define SA_RESTORER	0x04000000
+
+extern void __default_rt_sa_restorer (void);
+
+#define SET_SA_RESTORER(kact, act)				\
+ ({								\
+   (kact)->sa_restorer = __default_rt_sa_restorer;		\
+   (kact)->sa_flags |= SA_RESTORER;				\
+ })
+
+#define RESET_SA_RESTORER(act, kact)
+
+#include <sysdeps/unix/sysv/linux/sigaction.c>
sysdeps/unix/sysv/linux/arc/sigrestorer.S new file +29 -0
new file mode 100644
index 000000000000..eaabef505ec2
@@ -0,0 +1,29 @@
+/* Default sigreturn stub for ARC Linux.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/syscall.h>
+#include <sysdep.h>
+#include <tcb-offsets.h>
+
+/* Note the NOP has to be outside body.  */
+	nop
+ENTRY (__default_rt_sa_restorer)
+	mov r8, __NR_rt_sigreturn
+	ARC_TRAP_INSN
+	j_s     [blink]
+PSEUDO_END_NOERRNO (__default_rt_sa_restorer)
sysdeps/unix/sysv/linux/arc/syscall.S new file +33 -0
new file mode 100644
index 000000000000..6227dbf49917
@@ -0,0 +1,33 @@
+/* syscall - indirect system call.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (syscall)
+	mov_s	r8, r0
+	mov_s	r0, r1
+	mov_s	r1, r2
+	mov_s	r2, r3
+	mov_s	r3, r4
+	mov_s	r4, r5
+	mov_s	r5, r6
+
+	ARC_TRAP_INSN
+	brhi	r0, -4096, L (call_syscall_err)
+	j	[blink]
+PSEUDO_END (syscall)
sysdeps/unix/sysv/linux/arc/syscalls.list new file +3 -0
new file mode 100644
index 000000000000..d0ef5977ee06
@@ -0,0 +1,3 @@
+# File name	Caller	Syscall name	Args	Strong name	Weak names
+
+cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush
sysdeps/unix/sysv/linux/arc/sysdep.c new file +33 -0
new file mode 100644
index 000000000000..f33d64679886
@@ -0,0 +1,33 @@
+/* ARC wrapper for setting errno.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <errno.h>
+
+/* All syscall handlers land here to avoid generated code bloat due to
+   GOT reference  to errno_location or it's equivalent.  */
+long int
+__syscall_error (long int err_no)
+{
+  __set_errno (-err_no);
+  return -1;
+}
+
+#if IS_IN (libc)
+hidden_def (__syscall_error)
+#endif
sysdeps/unix/sysv/linux/arc/sysdep.h new file +224 -0

224 lines not on this page · raw message

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

42 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 11 lines · Adhemerval Zanella via Libc-alpha
Quoted 3 lines · Vineet Gupta via Libc-alpha

---
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Patch looks ok, but I have question on the __NR_* undef/define.

Quoted 1 line
sysdeps/unix/sysv/linux/arc/arch-syscall.h +0 -0

...

Quoted 6 lines

sysdeps/unix/sysv/linux/arc/arch-syscall.h line 303

Quoted 2 lines
sysdeps/unix/sysv/linux/arc/arch-syscall.h +2 -0
+#define __NR_write 64
+#define __NR_writev 66

Looks good. As side note I think an improvement would be to add an annotation on update-syscall-lists.py to specify which kernel version it used.

Very good idea indeed. I've asked myself the very question atleast once.

Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/clone.S +0 -0

..

Quoted 4 lines

sysdeps/unix/sysv/linux/arc/clone.S

Quoted 2 lines
sysdeps/unix/sysv/linux/arc/clone.S +2 -0
+
+	; adjust libc args for syscall

Use the C comment style for constency with rest of the file.

Done.

Quoted 10 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 24

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +8 -0
 
+
+/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
+   support.  */
+
+/* fstat64 and fstatat64 need to be replaced with statx.  */
+
+#undef __NR_fstat64
+#undef __NR_fstatat64

This is certainly needed as they are present in ARC arch-syscall.h but we need to use statx.

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +11 -0
+/* Replace all other 32-bit time syscalls with 64-bit variants.  */
+
+# undef __NR_clock_adjtime
+# undef __NR_clock_getres
+# undef __NR_futex
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_ppoll
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_rt_sigtimedwait
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 41

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +5 -0
+# undef __NR_sched_rr_get_interval
+# undef __NR_semtimedop
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_utimensat

I am trying to understand why these are required since arc does not define them in arch-syscall.h.

arch-syscall.h doesn't define them precisely due to these being here. When update-syscalls is run, the 32-bit syscalls are generated for ARC (since kernel ABI provides these because that was v3.9 circa 2013). Adding them fixup-asm-unistd.h removes them (perhaps I need to add this in changelog to clarify - atleast for myself).

Quoted 2 lines

And the generic implementation should handle the time64 variant. If they are not this is something we need to handle it.

At the time we we doing this, arch-syscall.h generation was not yet in place, however I tried to undef in generic/sysdep.h for TIMESIZE==64. However I was asked me to add this to ARC specific fixup-asm-unistd.h
https://sourceware.org/pipermail/libc-alpha/2020-March/112395.html
https://sourceware.org/pipermail/libc-alpha/2020-April/112909.html

Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/kernel_stat.h +0 -0

...

Quoted 3 lines
Quoted 1 line

+#define STATFS_IS_STATFS64 0

Ok.

This specific one is actually dead code. I did post a patch to this effect and followed up with supporting data that enabling it on 64-bit arches doesn't lead to any changes in generated code.

https://sourceware.org/pipermail/libc-alpha/2020-February/111259.html
https://sourceware.org/pipermail/libc-alpha/2020-June/115217.html

Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/sysdep.h +0 -0

...

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +11 -0
+/* 32-bit time syscalls are not available, but the redefines allow generic
+   wrappers to work.  */
+#define __NR_clock_adjtime	__NR_clock_adjtime64
+#define __NR_clock_getres	__NR_clock_getres_time64
+#define __NR_futex		__NR_futex_time64
+#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
+#define __NR_mq_timedsend	__NR_mq_timedsend_time64
+#define __NR_ppoll		__NR_ppoll_time64
+#define __NR_pselect6		__NR_pselect6_time64
+#define __NR_recvmmsg		__NR_recvmmsg_time64
+#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 40

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +5 -0
+#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
+#define __NR_semtimedop		__NR_semtimedop_time64
+#define __NR_timerfd_gettime	__NR_timerfd_gettime64
+#define __NR_timerfd_settime	__NR_timerfd_settime64
+#define __NR_utimensat		__NR_utimensat_time64

As for the fixup-asm-unistd.h, the generic implementation should handle it without the requirement of the ABI to add such tricks.

fixup-asm-unistd.h is different, but this could be avoided. I know for sure that ll code literally expects __NR_futex (atleast used to). But I can remove this and see what comes out.

Quoted 9 lines

However it seems that we are still missing support for pselect (__NR_pselect6_time64), recvmmsg (__NR_recvmmsg_time64), sigtimedwait (__NR_rt_sigtimedwait_time64), and semtimeop (__NR_semtimedop_time64).

I think we can add the redefine hack only the aforementioned symbols for now and removed them once we implement the y2038 support on such symbols (since the expected ABI won't change for ARC, only for old ABIs with 32 time_t support).

Sorry /me horribly confused here.

Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 48

Quoted 3 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +3 -0
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)   __NR_##syscall_name

The code mixes __NR_* and SYS_ify macro. This macro is really superflous and I am preparing some patches to cleanup this up along with C asm macros to generate syscall. So I would suggest to just use the __NR_* way and drop this definition.

I don't mind, but it seems that the wrapper was a simply way to avoid open-coding the macro concatenation. e.g.

# define DO_CALL(syscall_name, args)                    \
-    mov    r8, SYS_ify (syscall_name)  ASM_LINE_SEP    \
+    mov    r8, __NR__##syscall_name  ASM_LINE_SEP    \
     ARC_TRAP_INSN
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#17 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 72 lines · Vineet Gupta
Quoted 11 lines · Adhemerval Zanella via Libc-alpha
Quoted 3 lines · Vineet Gupta via Libc-alpha

---
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Patch looks ok, but I have question on the __NR_* undef/define.

Quoted 1 line
sysdeps/unix/sysv/linux/arc/arch-syscall.h +0 -0

...

Quoted 6 lines

sysdeps/unix/sysv/linux/arc/arch-syscall.h line 303

Quoted 2 lines
sysdeps/unix/sysv/linux/arc/arch-syscall.h +2 -0
+#define __NR_write 64
+#define __NR_writev 66

Looks good. As side note I think an improvement would be to add an annotation on update-syscall-lists.py to specify which kernel version it used.

Very good idea indeed. I've asked myself the very question atleast once.

Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/clone.S +0 -0

..

Quoted 4 lines

sysdeps/unix/sysv/linux/arc/clone.S

Quoted 2 lines
sysdeps/unix/sysv/linux/arc/clone.S +2 -0
+
+	; adjust libc args for syscall

Use the C comment style for constency with rest of the file.

Done.

Quoted 10 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 24

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +8 -0
 
+
+/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
+   support.  */
+
+/* fstat64 and fstatat64 need to be replaced with statx.  */
+
+#undef __NR_fstat64
+#undef __NR_fstatat64

This is certainly needed as they are present in ARC arch-syscall.h but we need to use statx.

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +11 -0
+/* Replace all other 32-bit time syscalls with 64-bit variants.  */
+
+# undef __NR_clock_adjtime
+# undef __NR_clock_getres
+# undef __NR_futex
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_ppoll
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_rt_sigtimedwait
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 41

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +5 -0
+# undef __NR_sched_rr_get_interval
+# undef __NR_semtimedop
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_utimensat

I am trying to understand why these are required since arc does not define them in arch-syscall.h.

arch-syscall.h doesn't define them precisely due to these being here. When update-syscalls is run, the 32-bit syscalls are generated for ARC (since kernel ABI provides these because that was v3.9 circa 2013). Adding them fixup-asm-unistd.h removes them (perhaps I need to add this in changelog to clarify - atleast for myself).

Quoted 8 lines
Quoted 2 lines

And the generic implementation should handle the time64 variant. If they are not this is something we need to handle it.

At the time we we doing this, arch-syscall.h generation was not yet in place, however I tried to undef in generic/sysdep.h for TIMESIZE==64. However I was asked me to add this to ARC specific fixup-asm-unistd.h
https://sourceware.org/pipermail/libc-alpha/2020-March/112395.html
https://sourceware.org/pipermail/libc-alpha/2020-April/112909.html

My confusion here, I forgot that this header is only used glibcsyscalls.py to actually generate arch-syscall.h.

You changes does look correct.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
sysdeps/unix/sysv/linux/arc/kernel_stat.h +0 -0

...

Quoted 2 lines
Quoted 1 line

+#define STATFS_IS_STATFS64 0

Quoted 9 lines
Quoted 1 line

Ok.

This specific one is actually dead code. I did post a patch to this effect and followed up with supporting data that enabling it on 64-bit arches doesn't lead to any changes in generated code.

https://sourceware.org/pipermail/libc-alpha/2020-February/111259.html
https://sourceware.org/pipermail/libc-alpha/2020-June/115217.html

Ack.

Quoted 34 lines
Quoted 2 lines
Quoted 2 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +0 -0

...

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +11 -0
+/* 32-bit time syscalls are not available, but the redefines allow generic
+   wrappers to work.  */
+#define __NR_clock_adjtime	__NR_clock_adjtime64
+#define __NR_clock_getres	__NR_clock_getres_time64
+#define __NR_futex		__NR_futex_time64
+#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
+#define __NR_mq_timedsend	__NR_mq_timedsend_time64
+#define __NR_ppoll		__NR_ppoll_time64
+#define __NR_pselect6		__NR_pselect6_time64
+#define __NR_recvmmsg		__NR_recvmmsg_time64
+#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 40

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +5 -0
+#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
+#define __NR_semtimedop		__NR_semtimedop_time64
+#define __NR_timerfd_gettime	__NR_timerfd_gettime64
+#define __NR_timerfd_settime	__NR_timerfd_settime64
+#define __NR_utimensat		__NR_utimensat_time64

As for the fixup-asm-unistd.h, the generic implementation should handle it without the requirement of the ABI to add such tricks.

fixup-asm-unistd.h is different, but this could be avoided. I know for sure that ll code literally expects __NR_futex (atleast used to). But I can remove this and see what comes out.

Quoted 5 lines

However it seems that we are still missing support for pselect (__NR_pselect6_time64), recvmmsg (__NR_recvmmsg_time64), sigtimedwait (__NR_rt_sigtimedwait_time64), and semtimeop (__NR_semtimedop_time64).

Quoted 6 lines
Quoted 4 lines

I think we can add the redefine hack only the aforementioned symbols for now and removed them once we implement the y2038 support on such symbols (since the expected ABI won't change for ARC, only for old ABIs with 32 time_t support).

Sorry /me horribly confused here.

Sorry for the confusion, I meant that some of these re-defines are superfluous and I would like to have the minimum required re-define to enable the ARC support, so we can cleanup these later once we enable time64_t support on old ABIs as well.

(ignore my comment about fixup-asm-unistd.h, it is related to my confusion about its internal usage).

Quoted 15 lines
Quoted 9 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 48

Quoted 4 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +3 -0
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)   __NR_##syscall_name

The code mixes __NR_* and SYS_ify macro. This macro is really superflous and I am preparing some patches to cleanup this up along with C asm macros to generate syscall. So I would suggest to just use the __NR_* way and drop this definition.

I don't mind, but it seems that the wrapper was a simply way to avoid open-coding the macro concatenation. e.g.

# define DO_CALL(syscall_name, args)                    \

Review

Quoted 3 lines
(quoted diff) +1 -1
-    mov    r8, SYS_ify (syscall_name)  ASM_LINE_SEP    \
+    mov    r8, __NR__##syscall_name  ASM_LINE_SEP    \
     ARC_TRAP_INSN

My understand was in fact parametrized way to define syscall numbers when glibc added support to future multiple Unix implementation (which never actually happened). I don't have a strong opinion here in fact, any is fine in the end.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#18 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 51 lines · Adhemerval Zanella via Libc-alpha
Quoted 42 lines
Quoted 4 lines
Quoted 3 lines
sysdeps/unix/sysv/linux/arc/clone.S +0 -0
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +0 -0
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 24

Quoted 8 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +8 -0
+
+/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
+   support.  */
+
+/* fstat64 and fstatat64 need to be replaced with statx.  */
+
+#undef __NR_fstat64
+#undef __NR_fstatat64

This is certainly needed as they are present in ARC arch-syscall.h but we need to use statx.

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +11 -0
+/* Replace all other 32-bit time syscalls with 64-bit variants.  */
+
+# undef __NR_clock_adjtime
+# undef __NR_clock_getres
+# undef __NR_futex
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_ppoll
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_rt_sigtimedwait
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 41

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +5 -0
+# undef __NR_sched_rr_get_interval
+# undef __NR_semtimedop
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_utimensat

I am trying to understand why these are required since arc does not define them in arch-syscall.h.

arch-syscall.h doesn't define them precisely due to these being here. When update-syscalls is run, the 32-bit syscalls are generated for ARC (since kernel ABI provides these because that was v3.9 circa 2013). Adding them fixup-asm-unistd.h removes them (perhaps I need to add this in changelog to clarify - atleast for myself).

Quoted 8 lines
Quoted 2 lines

And the generic implementation should handle the time64 variant. If they are not this is something we need to handle it.

At the time we we doing this, arch-syscall.h generation was not yet in place, however I tried to undef in generic/sysdep.h for TIMESIZE==64. However I was asked me to add this to ARC specific fixup-asm-unistd.h
https://sourceware.org/pipermail/libc-alpha/2020-March/112395.html
https://sourceware.org/pipermail/libc-alpha/2020-April/112909.html

Quoted 4 lines

My confusion here, I forgot that this header is only used glibcsyscalls.py to actually generate arch-syscall.h.

You changes does look correct.

Actually we can add a few more entries here which have 64-bit variants.

+# undef __NR_clock_gettime
+# undef __NR_clock_nanosleep
+# undef __NR_clock_settime
+# undef __NR_timer_gettime
+# undef __NR_timer_settime

Quoted 11 lines
Quoted 9 lines
Quoted 1 line

sysdeps/unix/sysv/linux/arc/kernel_stat.h

Quoted 1 line
sysdeps/unix/sysv/linux/arc/kernel_stat.h +0 -0

This specific one is actually dead code. I did post a patch to this effect and followed up with supporting data that enabling it on 64-bit arches doesn't lead to any changes in generated code.

https://sourceware.org/pipermail/libc-alpha/2020-February/111259.html
https://sourceware.org/pipermail/libc-alpha/2020-June/115217.html

Ack.

Thx. I'll repost this after things settle at bit.

Quoted 38 lines
Quoted 38 lines
Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/sysdep.h +0 -0

...

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +11 -0
+/* 32-bit time syscalls are not available, but the redefines allow generic
+   wrappers to work.  */
+#define __NR_clock_adjtime	__NR_clock_adjtime64
+#define __NR_clock_getres	__NR_clock_getres_time64
+#define __NR_futex		__NR_futex_time64
+#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
+#define __NR_mq_timedsend	__NR_mq_timedsend_time64
+#define __NR_ppoll		__NR_ppoll_time64
+#define __NR_pselect6		__NR_pselect6_time64
+#define __NR_recvmmsg		__NR_recvmmsg_time64
+#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 40

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +5 -0
+#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
+#define __NR_semtimedop		__NR_semtimedop_time64
+#define __NR_timerfd_gettime	__NR_timerfd_gettime64
+#define __NR_timerfd_settime	__NR_timerfd_settime64
+#define __NR_utimensat		__NR_utimensat_time64

As for the fixup-asm-unistd.h, the generic implementation should handle it without the requirement of the ABI to add such tricks.

fixup-asm-unistd.h is different, but this could be avoided. I know for sure that ll code literally expects __NR_futex (atleast used to). But I can remove this and see what comes out.

Quoted 9 lines

However it seems that we are still missing support for pselect (__NR_pselect6_time64), recvmmsg (__NR_recvmmsg_time64), sigtimedwait (__NR_rt_sigtimedwait_time64), and semtimeop (__NR_semtimedop_time64).

I think we can add the redefine hack only the aforementioned symbols for now and removed them once we implement the y2038 support on such symbols (since the expected ABI won't change for ARC, only for old ABIs with 32 time_t support).

Quoted 5 lines
Quoted 1 line

Sorry /me horribly confused here.

Sorry for the confusion, I meant that some of these re-defines are superfluous and I would like to have the minimum required re-define to enable the ARC support,

Right. The generic code needs a bit more work to eliminate the redefines altogether.

1. Following is not needed

-#define __NR_clock_adjtime __NR_clock_adjtime64
-#define __NR_sched_rr_get_interval __NR_sched_rr_get_interval_time64

-#define __NR_mq_timedreceive   __NR_mq_timedreceive_time64
-#define __NR_mq_timedsend      __NR_mq_timedsend_time64
-#define __NR_timerfd_gettime   __NR_timerfd_gettime64
-#define __NR_timerfd_settime   __NR_timerfd_settime64

2. The minimum list needed for ARC (with annotations as to which generic file needs fixing).

/* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */
#define __NR_clock_getres __NR_clock_getres_time64
/* Fix sysdeps/nptl/lowlevellock-futex.h. */
#define __NR_futex __NR_futex_time64
/* Fix sysdeps/unix/sysv/linux/pause.c. */
#define __NR_ppoll __NR_ppoll_time64
/* Fix sysdeps/unix/sysv/linux/select.c. */
#define __NR_pselect6 __NR_pselect6_time64
/* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */
#define __NR_recvmmsg __NR_recvmmsg_time64
/* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */
#define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
/* Fix sysdeps/unix/sysv/linux/semtimedop.c. */
#define __NR_semtimedop __NR_semtimedop_time64
/* Hack sysdeps/unix/sysv/linux/generic/utimes.c (need linux/utimes.c). */
#define __NR_utimensat __NR_utimensat_time64

Quoted 2 lines

so we can cleanup these later once we enable time64_t support on old ABIs as well.

IMO the cleanup applies to new ABIs too as generic code should handle those cases w/o these workarounds. But that would delay things further for new ports so I suggest we keep the workarounds and clean things up going fwd.

BTW, if one were to actually go about fixing those, whats the best approach. Consider the simplest case pause(). For !__NR_pause do we replicate the code for ppoll/ppoll64 handling or simply just call ppoll(). Later has a function call overhead) ? Or there is a paradigm to use __syscallxxx_helper() although that still has a function call overhead.

Actually the pause case is really simple as there are no args, so just redefine __NR_xxx trick should suffice w/o going into all the explicit interworking/conversion etc.

__libc_pause (void)
{
#ifdef __NR_pause
return SYSCALL_CANCEL (pause);
#else

return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
#endif

Quoted 17 lines
Quoted 13 lines
Quoted 7 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 48

Quoted 2 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +2 -0
+#undef SYS_ify
+#define SYS_ify(syscall_name)   __NR_##syscall_name

The code mixes __NR_* and SYS_ify macro. This macro is really superflous and I am preparing some patches to cleanup this up along with C asm macros to generate syscall. So I would suggest to just use the __NR_* way and drop this definition.

I don't mind, but it seems that the wrapper was a simply way to avoid open-coding the macro concatenation. e.g.

# define DO_CALL(syscall_name, args)                    \

Review

Quoted 3 lines
(quoted diff) +1 -1
-    mov    r8, SYS_ify (syscall_name)  ASM_LINE_SEP    \
+    mov    r8, __NR__##syscall_name  ASM_LINE_SEP    \
     ARC_TRAP_INSN
Quoted 4 lines

My understand was in fact parametrized way to define syscall numbers when glibc added support to future multiple Unix implementation (which never actually happened). I don't have a strong opinion here in fact, any is fine in the end.

I open-coded the 2 calls to SYS_ify() in ARC code and deleted SYS_ify()...

... and 2 hrs later, after mysterious build failures, find that SYS_ify() needs to be retained (even if not used in ARC port) it is expected/used by generic make-syscalls.h :-(
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#19 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 59 lines · Vineet Gupta
Quoted 51 lines · Adhemerval Zanella via Libc-alpha
Quoted 42 lines
Quoted 4 lines
Quoted 3 lines
sysdeps/unix/sysv/linux/arc/clone.S +0 -0
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +0 -0
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 24

Quoted 8 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +8 -0
+
+/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
+   support.  */
+
+/* fstat64 and fstatat64 need to be replaced with statx.  */
+
+#undef __NR_fstat64
+#undef __NR_fstatat64

This is certainly needed as they are present in ARC arch-syscall.h but we need to use statx.

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +11 -0
+/* Replace all other 32-bit time syscalls with 64-bit variants.  */
+
+# undef __NR_clock_adjtime
+# undef __NR_clock_getres
+# undef __NR_futex
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_ppoll
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_rt_sigtimedwait
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 41

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +5 -0
+# undef __NR_sched_rr_get_interval
+# undef __NR_semtimedop
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_utimensat

I am trying to understand why these are required since arc does not define them in arch-syscall.h.

arch-syscall.h doesn't define them precisely due to these being here. When update-syscalls is run, the 32-bit syscalls are generated for ARC (since kernel ABI provides these because that was v3.9 circa 2013). Adding them fixup-asm-unistd.h removes them (perhaps I need to add this in changelog to clarify - atleast for myself).

Quoted 8 lines
Quoted 2 lines

And the generic implementation should handle the time64 variant. If they are not this is something we need to handle it.

At the time we we doing this, arch-syscall.h generation was not yet in place, however I tried to undef in generic/sysdep.h for TIMESIZE==64. However I was asked me to add this to ARC specific fixup-asm-unistd.h
https://sourceware.org/pipermail/libc-alpha/2020-March/112395.html
https://sourceware.org/pipermail/libc-alpha/2020-April/112909.html

Quoted 4 lines

My confusion here, I forgot that this header is only used glibcsyscalls.py to actually generate arch-syscall.h.

You changes does look correct.

Actually we can add a few more entries here which have 64-bit variants.

Review

Quoted 5 lines
(quoted diff) +5 -0
+# undef __NR_clock_gettime
+# undef __NR_clock_nanosleep
+# undef __NR_clock_settime
+# undef __NR_timer_gettime
+# undef __NR_timer_settime

It should not intefere since ARC also defines __ASSUME_TIME64_SYSCALLS and the 32-bit fallback syscalls won't be used in this case.

As a side note, now that arch-syscall.h is based on latest kernel version and all the 32-bit ABIs with old 32-bit time_t have upstream support for 64-bit time_t we can simplify a bit some implementation by assuming the 64-bit time_t is always defined and adding a fallback only for !define __ASSUME_TIME64_SYSCALLS.

Quoted 64 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

sysdeps/unix/sysv/linux/arc/kernel_stat.h

Quoted 3 lines
sysdeps/unix/sysv/linux/arc/kernel_stat.h +0 -0

This specific one is actually dead code. I did post a patch to this effect and followed up with supporting data that enabling it on 64-bit arches doesn't lead to any changes in generated code.

Quoted 5 lines
Quoted 3 lines

https://sourceware.org/pipermail/libc-alpha/2020-February/111259.html
https://sourceware.org/pipermail/libc-alpha/2020-June/115217.html

Ack.

Thx. I'll repost this after things settle at bit.

Quoted 38 lines
Quoted 38 lines
Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/sysdep.h +0 -0

...

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +11 -0
+/* 32-bit time syscalls are not available, but the redefines allow generic
+   wrappers to work.  */
+#define __NR_clock_adjtime	__NR_clock_adjtime64
+#define __NR_clock_getres	__NR_clock_getres_time64
+#define __NR_futex		__NR_futex_time64
+#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
+#define __NR_mq_timedsend	__NR_mq_timedsend_time64
+#define __NR_ppoll		__NR_ppoll_time64
+#define __NR_pselect6		__NR_pselect6_time64
+#define __NR_recvmmsg		__NR_recvmmsg_time64
+#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 40

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +5 -0
+#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
+#define __NR_semtimedop		__NR_semtimedop_time64
+#define __NR_timerfd_gettime	__NR_timerfd_gettime64
+#define __NR_timerfd_settime	__NR_timerfd_settime64
+#define __NR_utimensat		__NR_utimensat_time64

As for the fixup-asm-unistd.h, the generic implementation should handle it without the requirement of the ABI to add such tricks.

fixup-asm-unistd.h is different, but this could be avoided. I know for sure that ll code literally expects __NR_futex (atleast used to). But I can remove this and see what comes out.

Quoted 9 lines

However it seems that we are still missing support for pselect (__NR_pselect6_time64), recvmmsg (__NR_recvmmsg_time64), sigtimedwait (__NR_rt_sigtimedwait_time64), and semtimeop (__NR_semtimedop_time64).

I think we can add the redefine hack only the aforementioned symbols for now and removed them once we implement the y2038 support on such symbols (since the expected ABI won't change for ARC, only for old ABIs with 32 time_t support).

Quoted 5 lines
Quoted 1 line

Sorry /me horribly confused here.

Sorry for the confusion, I meant that some of these re-defines are superfluous and I would like to have the minimum required re-define to enable the ARC support,

Right. The generic code needs a bit more work to eliminate the redefines altogether.

1. Following is not needed

Review

Quoted 6 lines
(quoted diff) +0 -6
-#define __NR_clock_adjtime     __NR_clock_adjtime64
-#define __NR_sched_rr_get_interval     __NR_sched_rr_get_interval_time64
-#define __NR_mq_timedreceive   __NR_mq_timedreceive_time64
-#define __NR_mq_timedsend      __NR_mq_timedsend_time64
-#define __NR_timerfd_gettime   __NR_timerfd_gettime64
-#define __NR_timerfd_settime   __NR_timerfd_settime64

Ok.

Quoted 6 lines

2. The minimum list needed for ARC (with annotations as to which generic file needs fixing).

/* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */
#define __NR_clock_getres __NR_clock_getres_time64

It should be simple since there is no need to provide an extra symbol for old ABIs, it would be to just use __NR_clock_getres_time64 if it is defined.

Quoted 2 lines

/* Fix sysdeps/nptl/lowlevellock-futex.h. */
#define __NR_futex __NR_futex_time64

It seems Lukasz Majewski has sent a patchset to address it (I haven't checked the detail yet).

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/pause.c. */
#define __NR_ppoll __NR_ppoll_time64

This is another one similar to clock_getcpuclockid.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/select.c. */
#define __NR_pselect6 __NR_pselect6_time64

I have a patch for select [1], it a bit more complex because we need to handle both the timeout and the microblaze lacking support of pselect6.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */
#define __NR_recvmmsg __NR_recvmmsg_time64

I also have a patch for this [1], although it still does not have the ancillary data from struct msghdr which might return SCM_TIMESTAMP information (which returns struct timespec). The recvmsg also has the same issue regarding ancillary data.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */
#define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64

The patch for is more straighfoward [1].

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/semtimedop.c. */
#define __NR_semtimedop __NR_semtimedop_time64

The patch for is also straighfoward [1].

Quoted 2 lines

/* Hack sysdeps/unix/sysv/linux/generic/utimes.c (need linux/utimes.c). */
#define __NR_utimensat __NR_utimensat_time64

Lukasz Majewski also has a patchset for this, I will check this out.

Quoted 8 lines
Quoted 4 lines

so we can cleanup these later once we enable time64_t support on old ABIs as well.

IMO the cleanup applies to new ABIs too as generic code should handle those cases w/o these workarounds. But that would delay things further for new ports so I suggest we keep the workarounds and clean things up going fwd.

I agree, this can be worked in parallel.

Quoted 11 lines

BTW, if one were to actually go about fixing those, whats the best approach. Consider the simplest case pause(). For !__NR_pause do we replicate the code for ppoll/ppoll64 handling or simply just call ppoll(). Later has a function call overhead) ? Or there is a paradigm to use __syscallxxx_helper() although that still has a function call overhead.

Actually the pause case is really simple as there are no args, so just redefine __NR_xxx trick should suffice w/o going into all the explicit interworking/conversion etc.

Quoted 9 lines

__libc_pause (void)
{
#ifdef __NR_pause
return SYSCALL_CANCEL (pause);
#else

return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
#endif

Each implementation has it ows requirements so I can't really say if a helper function does make sense for all of them. For pause specifically we can even simplify to since all architectures have either ppoll or ppoll_time64:

int
__libc_pause (void)
{

  #ifdef __NR_ppoll_time64
    return SYSCALL_CANCEL (ppoll_time64, NULL, 0, NULL, NULL);
  #else
    return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);

#endif
}

Quoted 23 lines
Quoted 18 lines
Quoted 14 lines
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 48

Quoted 3 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +2 -0
+#undef SYS_ify
+#define SYS_ify(syscall_name)   __NR_##syscall_name

The code mixes __NR_* and SYS_ify macro. This macro is really superflous and I am preparing some patches to cleanup this up along with C asm macros to generate syscall. So I would suggest to just use the __NR_* way and drop this definition.

I don't mind, but it seems that the wrapper was a simply way to avoid open-coding the macro concatenation. e.g.

# define DO_CALL(syscall_name, args)                    \

Review

Quoted 3 lines
(quoted diff) +1 -1
-    mov    r8, SYS_ify (syscall_name)  ASM_LINE_SEP    \
+    mov    r8, __NR__##syscall_name  ASM_LINE_SEP    \
     ARC_TRAP_INSN
Quoted 4 lines

My understand was in fact parametrized way to define syscall numbers when glibc added support to future multiple Unix implementation (which never actually happened). I don't have a strong opinion here in fact, any is fine in the end.

Quoted 5 lines

I open-coded the 2 calls to SYS_ify() in ARC code and deleted SYS_ify()...

... and 2 hrs later, after mysterious build failures, find that SYS_ify() needs to be retained (even if not used in ARC port) it is expected/used by generic make-syscalls.h :-(

Sigh, alright let keep it then.

[1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/y2038-fixes

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#20 lore raw

PATCH v7 7/13 ARC: Linux Syscall Interface

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime, __NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

---
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    | 298 ++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |  21 ++
 sysdeps/unix/sysv/linux/arc/clone.S           |  93 ++++++
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |  46 +++
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |   6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |  27 ++
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |  26 ++
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |  27 ++
 sysdeps/unix/sysv/linux/arc/sigaction.c       |  31 ++
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |  29 ++
 sysdeps/unix/sysv/linux/arc/syscall.S         |  33 ++
 sysdeps/unix/sysv/linux/arc/syscalls.list     |   3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |  33 ++
 sysdeps/unix/sysv/linux/arc/sysdep.h          | 226 +++++++++++++
 sysdeps/unix/sysv/linux/arc/vfork.S           |  42 +++
 15 files changed, 941 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
 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/vfork.S
sysdeps/unix/sysv/linux/arc/arch-syscall.h new file +298 -0
new file mode 100644
index 000000000000..58cd927da81b
@@ -0,0 +1,298 @@
+/* AUTOGENERATED by update-syscall-lists.py.  */
+#define __NR_accept 202
+#define __NR_accept4 242
+#define __NR_acct 89
+#define __NR_add_key 217
+#define __NR_adjtimex 171
+#define __NR_arc_gettls 246
+#define __NR_arc_settls 245
+#define __NR_arc_usr_cmpxchg 248
+#define __NR_bind 200
+#define __NR_bpf 280
+#define __NR_brk 214
+#define __NR_cacheflush 244
+#define __NR_capget 90
+#define __NR_capset 91
+#define __NR_chdir 49
+#define __NR_chroot 51
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_gettime64 403
+#define __NR_clock_nanosleep_time64 407
+#define __NR_clock_settime64 404
+#define __NR_clone 220
+#define __NR_clone3 435
+#define __NR_close 57
+#define __NR_connect 203
+#define __NR_copy_file_range 285
+#define __NR_delete_module 106
+#define __NR_dup 23
+#define __NR_dup3 24
+#define __NR_epoll_create1 20
+#define __NR_epoll_ctl 21
+#define __NR_epoll_pwait 22
+#define __NR_eventfd2 19
+#define __NR_execve 221
+#define __NR_execveat 281
+#define __NR_exit 93
+#define __NR_exit_group 94
+#define __NR_faccessat 48
+#define __NR_fadvise64_64 223
+#define __NR_fallocate 47
+#define __NR_fanotify_init 262
+#define __NR_fanotify_mark 263
+#define __NR_fchdir 50
+#define __NR_fchmod 52
+#define __NR_fchmodat 53
+#define __NR_fchown 55
+#define __NR_fchownat 54
+#define __NR_fcntl64 25
+#define __NR_fdatasync 83
+#define __NR_fgetxattr 10
+#define __NR_finit_module 273
+#define __NR_flistxattr 13
+#define __NR_flock 32
+#define __NR_fremovexattr 16
+#define __NR_fsconfig 431
+#define __NR_fsetxattr 7
+#define __NR_fsmount 432
+#define __NR_fsopen 430
+#define __NR_fspick 433
+#define __NR_fstatfs64 44
+#define __NR_fsync 82
+#define __NR_ftruncate64 46
+#define __NR_futex_time64 422
+#define __NR_get_mempolicy 236
+#define __NR_get_robust_list 100
+#define __NR_getcpu 168
+#define __NR_getcwd 17
+#define __NR_getdents64 61
+#define __NR_getegid 177
+#define __NR_geteuid 175
+#define __NR_getgid 176
+#define __NR_getgroups 158
+#define __NR_getitimer 102
+#define __NR_getpeername 205
+#define __NR_getpgid 155
+#define __NR_getpid 172
+#define __NR_getppid 173
+#define __NR_getpriority 141
+#define __NR_getrandom 278
+#define __NR_getresgid 150
+#define __NR_getresuid 148
+#define __NR_getrlimit 163
+#define __NR_getrusage 165
+#define __NR_getsid 156
+#define __NR_getsockname 204
+#define __NR_getsockopt 209
+#define __NR_gettid 178
+#define __NR_gettimeofday 169
+#define __NR_getuid 174
+#define __NR_getxattr 8
+#define __NR_init_module 105
+#define __NR_inotify_add_watch 27
+#define __NR_inotify_init1 26
+#define __NR_inotify_rm_watch 28
+#define __NR_io_cancel 3
+#define __NR_io_destroy 1
+#define __NR_io_getevents 4
+#define __NR_io_pgetevents 292
+#define __NR_io_pgetevents_time64 416
+#define __NR_io_setup 0
+#define __NR_io_submit 2
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
+#define __NR_io_uring_setup 425
+#define __NR_ioctl 29
+#define __NR_ioprio_get 31
+#define __NR_ioprio_set 30
+#define __NR_kcmp 272
+#define __NR_kexec_file_load 294
+#define __NR_kexec_load 104
+#define __NR_keyctl 219
+#define __NR_kill 129
+#define __NR_lgetxattr 9
+#define __NR_linkat 37
+#define __NR_listen 201
+#define __NR_listxattr 11
+#define __NR_llistxattr 12
+#define __NR_llseek 62
+#define __NR_lookup_dcookie 18
+#define __NR_lremovexattr 15
+#define __NR_lsetxattr 6
+#define __NR_madvise 233
+#define __NR_mbind 235
+#define __NR_membarrier 283
+#define __NR_memfd_create 279
+#define __NR_migrate_pages 238
+#define __NR_mincore 232
+#define __NR_mkdirat 34
+#define __NR_mknodat 33
+#define __NR_mlock 228
+#define __NR_mlock2 284
+#define __NR_mlockall 230
+#define __NR_mmap2 222
+#define __NR_mount 40
+#define __NR_move_mount 429
+#define __NR_move_pages 239
+#define __NR_mprotect 226
+#define __NR_mq_getsetattr 185
+#define __NR_mq_notify 184
+#define __NR_mq_open 180
+#define __NR_mq_timedreceive_time64 419
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_unlink 181
+#define __NR_mremap 216
+#define __NR_msgctl 187
+#define __NR_msgget 186
+#define __NR_msgrcv 188
+#define __NR_msgsnd 189
+#define __NR_msync 227
+#define __NR_munlock 229
+#define __NR_munlockall 231
+#define __NR_munmap 215
+#define __NR_name_to_handle_at 264
+#define __NR_nanosleep 101
+#define __NR_nfsservctl 42
+#define __NR_open_by_handle_at 265
+#define __NR_open_tree 428
+#define __NR_openat 56
+#define __NR_openat2 437
+#define __NR_perf_event_open 241
+#define __NR_personality 92
+#define __NR_pidfd_getfd 438
+#define __NR_pidfd_open 434
+#define __NR_pidfd_send_signal 424
+#define __NR_pipe2 59
+#define __NR_pivot_root 41
+#define __NR_pkey_alloc 289
+#define __NR_pkey_free 290
+#define __NR_pkey_mprotect 288
+#define __NR_ppoll_time64 414
+#define __NR_prctl 167
+#define __NR_pread64 67
+#define __NR_preadv 69
+#define __NR_preadv2 286
+#define __NR_prlimit64 261
+#define __NR_process_vm_readv 270
+#define __NR_process_vm_writev 271
+#define __NR_pselect6_time64 413
+#define __NR_ptrace 117
+#define __NR_pwrite64 68
+#define __NR_pwritev 70
+#define __NR_pwritev2 287
+#define __NR_quotactl 60
+#define __NR_read 63
+#define __NR_readahead 213
+#define __NR_readlinkat 78
+#define __NR_readv 65
+#define __NR_reboot 142
+#define __NR_recvfrom 207
+#define __NR_recvmmsg_time64 417
+#define __NR_recvmsg 212
+#define __NR_remap_file_pages 234
+#define __NR_removexattr 14
+#define __NR_renameat 38
+#define __NR_renameat2 276
+#define __NR_request_key 218
+#define __NR_restart_syscall 128
+#define __NR_rseq 293
+#define __NR_rt_sigaction 134
+#define __NR_rt_sigpending 136
+#define __NR_rt_sigprocmask 135
+#define __NR_rt_sigqueueinfo 138
+#define __NR_rt_sigreturn 139
+#define __NR_rt_sigsuspend 133
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_rt_tgsigqueueinfo 240
+#define __NR_sched_get_priority_max 125
+#define __NR_sched_get_priority_min 126
+#define __NR_sched_getaffinity 123
+#define __NR_sched_getattr 275
+#define __NR_sched_getparam 121
+#define __NR_sched_getscheduler 120
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_sched_setaffinity 122
+#define __NR_sched_setattr 274
+#define __NR_sched_setparam 118
+#define __NR_sched_setscheduler 119
+#define __NR_sched_yield 124
+#define __NR_seccomp 277
+#define __NR_semctl 191
+#define __NR_semget 190
+#define __NR_semop 193
+#define __NR_semtimedop_time64 420
+#define __NR_sendfile64 71
+#define __NR_sendmmsg 269
+#define __NR_sendmsg 211
+#define __NR_sendto 206
+#define __NR_set_mempolicy 237
+#define __NR_set_robust_list 99
+#define __NR_set_tid_address 96
+#define __NR_setdomainname 162
+#define __NR_setfsgid 152
+#define __NR_setfsuid 151
+#define __NR_setgid 144
+#define __NR_setgroups 159
+#define __NR_sethostname 161
+#define __NR_setitimer 103
+#define __NR_setns 268
+#define __NR_setpgid 154
+#define __NR_setpriority 140
+#define __NR_setregid 143
+#define __NR_setresgid 149
+#define __NR_setresuid 147
+#define __NR_setreuid 145
+#define __NR_setrlimit 164
+#define __NR_setsid 157
+#define __NR_setsockopt 208
+#define __NR_settimeofday 170
+#define __NR_setuid 146
+#define __NR_setxattr 5
+#define __NR_shmat 196
+#define __NR_shmctl 195
+#define __NR_shmdt 197
+#define __NR_shmget 194
+#define __NR_shutdown 210
+#define __NR_sigaltstack 132
+#define __NR_signalfd4 74
+#define __NR_socket 198
+#define __NR_socketpair 199
+#define __NR_splice 76
+#define __NR_statfs64 43
+#define __NR_statx 291
+#define __NR_swapoff 225
+#define __NR_swapon 224
+#define __NR_symlinkat 36
+#define __NR_sync 81
+#define __NR_sync_file_range 84
+#define __NR_syncfs 267
+#define __NR_sysfs 247
+#define __NR_sysinfo 179
+#define __NR_syslog 116
+#define __NR_tee 77
+#define __NR_tgkill 131
+#define __NR_timer_create 107
+#define __NR_timer_delete 111
+#define __NR_timer_getoverrun 109
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime64 409
+#define __NR_timerfd_create 85
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_times 153
+#define __NR_tkill 130
+#define __NR_truncate64 45
+#define __NR_umask 166
+#define __NR_umount2 39
+#define __NR_uname 160
+#define __NR_unlinkat 35
+#define __NR_unshare 97
+#define __NR_userfaultfd 282
+#define __NR_utimensat_time64 412
+#define __NR_vhangup 58
+#define __NR_vmsplice 75
+#define __NR_wait4 260
+#define __NR_waitid 95
+#define __NR_write 64
+#define __NR_writev 66
sysdeps/unix/sysv/linux/arc/bits/timesize.h new file +21 -0
new file mode 100644
index 000000000000..bf44f09f7619
@@ -0,0 +1,21 @@
+/* Bit size of the time_t type at glibc build time, general case.
+   Copyright (C) 2020 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 <bits/wordsize.h>
+
+#define __TIMESIZE	64
sysdeps/unix/sysv/linux/arc/clone.S new file +93 -0

93 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h new file +46 -0

46 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h new file +6 -0
new file mode 100644
index 000000000000..296f3197ee31
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define SIGJMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
+#define JMP_BUF_ALIGN		__alignof__ (unsigned long int)
+#define SIGJMP_BUF_ALIGN	__alignof__ (unsigned long int)
+#define MASK_WAS_SAVED_OFFSET	(32 * sizeof (unsigned long int))
+#define SAVED_MASK_OFFSET	(33 * sizeof (unsigned long int))
sysdeps/unix/sysv/linux/arc/kernel-features.h new file +27 -0
new file mode 100644
index 000000000000..0a5c9e21fbf2
@@ -0,0 +1,27 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+/* The minimum supported kernel version for ARC is 5.1 (64-bit time, offsets),
+   although the asm-generic ABI is from 3.9 (when Linux port was merged).  */
+
+#include_next <kernel-features.h>
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
sysdeps/unix/sysv/linux/arc/kernel_stat.h new file +26 -0
new file mode 100644
index 000000000000..8fdd86b9e843
@@ -0,0 +1,26 @@
+/* Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <bits/wordsize.h>
+
+/* Needed to elide the itemized copy code in common xstatconv.c.  */
+#define STAT_IS_KERNEL_STAT 1
+
+/* Nice side-effect of 64-bit time_t switch is these are same.  */
+#define XSTAT_IS_XSTAT64 1
+
+#define STATFS_IS_STATFS64 0
sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +27 -0
new file mode 100644
index 000000000000..5293d670adaa
@@ -0,0 +1,27 @@
+/* mmap - map files or devices into memory.  Linux/ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef MMAP_ARC_INTERNAL_H
+#define MMAP_ARC_INTERNAL_H
+
+/* 8K is default but determine the shift dynamically with getpagesize.  */
+#define MMAP2_PAGE_UNIT -1
+
+#include_next <mmap_internal.h>
+
+#endif
sysdeps/unix/sysv/linux/arc/sigaction.c new file +31 -0
new file mode 100644
index 000000000000..dd590ecb6dd7
@@ -0,0 +1,31 @@
+/* ARC specific sigaction.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define SA_RESTORER	0x04000000
+
+extern void __default_rt_sa_restorer (void);
+
+#define SET_SA_RESTORER(kact, act)				\
+ ({								\
+   (kact)->sa_restorer = __default_rt_sa_restorer;		\
+   (kact)->sa_flags |= SA_RESTORER;				\
+ })
+
+#define RESET_SA_RESTORER(act, kact)
+
+#include <sysdeps/unix/sysv/linux/sigaction.c>
sysdeps/unix/sysv/linux/arc/sigrestorer.S new file +29 -0
new file mode 100644
index 000000000000..eaabef505ec2
@@ -0,0 +1,29 @@
+/* Default sigreturn stub for ARC Linux.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/syscall.h>
+#include <sysdep.h>
+#include <tcb-offsets.h>
+
+/* Note the NOP has to be outside body.  */
+	nop
+ENTRY (__default_rt_sa_restorer)
+	mov r8, __NR_rt_sigreturn
+	ARC_TRAP_INSN
+	j_s     [blink]
+PSEUDO_END_NOERRNO (__default_rt_sa_restorer)
sysdeps/unix/sysv/linux/arc/syscall.S new file +33 -0
new file mode 100644
index 000000000000..6227dbf49917
@@ -0,0 +1,33 @@
+/* syscall - indirect system call.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+ENTRY (syscall)
+	mov_s	r8, r0
+	mov_s	r0, r1
+	mov_s	r1, r2
+	mov_s	r2, r3
+	mov_s	r3, r4
+	mov_s	r4, r5
+	mov_s	r5, r6
+
+	ARC_TRAP_INSN
+	brhi	r0, -4096, L (call_syscall_err)
+	j	[blink]
+PSEUDO_END (syscall)
sysdeps/unix/sysv/linux/arc/syscalls.list new file +3 -0
new file mode 100644
index 000000000000..d0ef5977ee06
@@ -0,0 +1,3 @@
+# File name	Caller	Syscall name	Args	Strong name	Weak names
+
+cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush
sysdeps/unix/sysv/linux/arc/sysdep.c new file +33 -0
new file mode 100644
index 000000000000..f33d64679886
@@ -0,0 +1,33 @@
+/* ARC wrapper for setting errno.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <errno.h>
+
+/* All syscall handlers land here to avoid generated code bloat due to
+   GOT reference  to errno_location or it's equivalent.  */
+long int
+__syscall_error (long int err_no)
+{
+  __set_errno (-err_no);
+  return -1;
+}
+
+#if IS_IN (libc)
+hidden_def (__syscall_error)
+#endif
sysdeps/unix/sysv/linux/arc/sysdep.h new file +226 -0

226 lines not on this page · raw message

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

42 lines not on this page · raw message

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

A message that is not in the archive (sent off-list or not yet received): [email protected]

#22 lore raw

Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface

Quoted 14 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime,

Quoted 8 lines

__NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Quoted 3 lines

LGTM, thanks.

Thx a lot. I now have Reviewed-by tags on all ARC patches so we just need the sysvipc/semctl y2038 patches to hit upstream before I can commit.

Thx,
-Vineet

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#23 lore raw

Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface

Quoted 15 lines · Vineet Gupta
Quoted 14 lines · Adhemerval Zanella via Libc-alpha
Quoted 12 lines · Vineet Gupta via Libc-alpha

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime, __NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Quoted 6 lines
Quoted 3 lines

LGTM, thanks.

Thx a lot. I now have Reviewed-by tags on all ARC patches so we just need the sysvipc/semctl y2038 patches to hit upstream before I can commit.

The patches are in, if you could just to a sanity check I will be grateful.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#24 lore raw

Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface

Quoted 20 lines · Adhemerval Zanella via Libc-alpha
Quoted 17 lines · Vineet Gupta
Quoted 16 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime,

Quoted 8 lines

__NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

LGTM, thanks.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Thx a lot. I now have Reviewed-by tags on all ARC patches so we just need the sysvipc/semctl y2038 patches to hit upstream before I can commit.

The patches are in, if you could just to a sanity check I will be grateful.

Thx.

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run and if thats same as before, I'm good to push ARC port ?
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#25 lore raw

Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface

Quoted 26 lines · Vineet Gupta
Quoted 25 lines · Adhemerval Zanella via Libc-alpha
Quoted 21 lines · Vineet Gupta
Quoted 14 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime,

Quoted 8 lines

__NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Quoted 3 lines

LGTM, thanks.

Thx a lot. I now have Reviewed-by tags on all ARC patches so we just need the sysvipc/semctl y2038 patches to hit upstream before I can commit.

Quoted 9 lines
Quoted 2 lines

The patches are in, if you could just to a sanity check I will be grateful.

Thx.

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run and if thats same as before, I'm good to push ARC port ?

I think it should suffice, just to avoid some issue with recent traffic on repository recently.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#26 lore raw

Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface

In reply to Vineet Gupta
Quoted 26 lines · Vineet Gupta via Libc-alpha
Quoted 25 lines · Adhemerval Zanella via Libc-alpha
Quoted 21 lines · Vineet Gupta
Quoted 14 lines · Adhemerval Zanella via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

---
Changes since v7.1:
- Added a few more 32-bit time_t syscalls to fixup-asm-unistd.h and regen arch-syscall.h to remove them: __NR_timer{g,s}ettime,

Quoted 8 lines

__NR_clock_{gettime,nanosleep,settime}
- minimal/annotated list of 32-bit syscall aliases in ARC sysdeps.h for 64-bit time_t support
- Open-coded SYS_ify() but retained the macro as used by common code
- No functional changes in generated dsos.
Changes since v7:
- used long int (iso int) in sysdep.h/syscall_error for handling registers

Quoted 3 lines

LGTM, thanks.

Thx a lot. I now have Reviewed-by tags on all ARC patches so we just need the sysvipc/semctl y2038 patches to hit upstream before I can commit.

Quoted 7 lines
Quoted 2 lines

The patches are in, if you could just to a sanity check I will be grateful.

Thx.

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#27 lore raw

ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static
..

Could it be due to recent TLS optimizations...

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

-Vineet
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#28 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 12 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

Quoted 9 lines

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

I see the same recent-ish regressions for RV32.

Alistair

Quoted 8 lines

..

Could it be due to recent TLS optimizations...

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

-Vineet

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#29 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 24 lines · Alistair Francis via Libc-alpha
Quoted 12 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

Quoted 9 lines

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 3 lines

I see the same recent-ish regressions for RV32.

Alistair

Thx for confirming !

Quoted 5 lines
Quoted 5 lines

Could it be due to recent TLS optimizations...

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#30 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

In reply to Alistair Francis

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 12 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

Quoted 9 lines

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#31 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 26 lines · Florian Weimer via Libc-alpha

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 21 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 5 lines
Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

Also while we figure this out, does this prevent ARC port from being committed. It is a functioning system otherwise: I'm doing doing cross run of testsuite with sshd etc involved and these addition 10+ failures don't seem to be getting in the way.
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#32 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

* Vineet Gupta via Libc-alpha:

Quoted 3 lines

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

No, rebuilding glibc from scratch should be fine.

Quoted 5 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

This suggests to me that the static initialization code does not produce sufficient alignment for the TCB, given the 32-byte alignment required by the rseq area.

You could try and see what happens if you change
sysdeps/arc/nptl/pthreaddef.h to this:

/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 32

If that helps, we have more of a generic issue here. 8-/

The problem is that the TLS memory allocator does not add alignment padding on its own. This could meet additional alignment requirements if there is just one thread yet when higher-aligned TLS is loaded.

Quoted 2 lines

Also while we figure this out, does this prevent ARC port from being committed.

I don't think so. We just have to make sure that it does not block the release, i.e. resolve this during the next week or two. Do you think that would that be possible?

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#33 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 7 lines · Florian Weimer via Libc-alpha

* Vineet Gupta via Libc-alpha:

Quoted 3 lines

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

No, rebuilding glibc from scratch should be fine.

Right, I clean built the entire toolchain and that didn't help - but turned out to be sane thing anyways as installed headers seems were not rebuilt/installed and I needed the signum.h -> signum-arch.h fixup in vfork.S

Quoted 10 lines
Quoted 5 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

This suggests to me that the static initialization code does not produce sufficient alignment for the TCB, given the 32-byte alignment required by the rseq area.

Quoted 7 lines

You could try and see what happens if you change
sysdeps/arc/nptl/pthreaddef.h to this:

/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 32

If that helps, we have more of a generic issue here. 8-/

Bingo, that fixes all the dlfcn/* failures (full testsuite still running)

PASS: dlfcn/tststatic
PASS: dlfcn/tststatic2
PASS: dlfcn/tststatic3
PASS: dlfcn/tststatic4
PASS: dlfcn/tststatic5

So is that the fix or more is needed ?

Quoted 10 lines

The problem is that the TLS memory allocator does not add alignment padding on its own. This could meet additional alignment requirements if there is just one thread yet when higher-aligned TLS is loaded.

Quoted 2 lines

Also while we figure this out, does this prevent ARC port from being committed.

I don't think so. We just have to make sure that it does not block the release, i.e. resolve this during the next week or two. Do you think that would that be possible?

So it makes sens to commit ARC port now and your fix along the lines can then say what it fixed in-tree.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#34 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

* Vineet Gupta:

Quoted 34 lines · Florian Weimer via Libc-alpha
Quoted 7 lines

* Vineet Gupta via Libc-alpha:

Quoted 3 lines

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

No, rebuilding glibc from scratch should be fine.

Right, I clean built the entire toolchain and that didn't help - but turned out to be sane thing anyways as installed headers seems were not rebuilt/installed and I needed the signum.h -> signum-arch.h fixup in vfork.S

Quoted 10 lines
Quoted 5 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

This suggests to me that the static initialization code does not produce sufficient alignment for the TCB, given the 32-byte alignment required by the rseq area.

Quoted 7 lines

You could try and see what happens if you change
sysdeps/arc/nptl/pthreaddef.h to this:

/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 32

If that helps, we have more of a generic issue here. 8-/

Bingo, that fixes all the dlfcn/* failures (full testsuite still running)

Quoted 7 lines

PASS: dlfcn/tststatic
PASS: dlfcn/tststatic2
PASS: dlfcn/tststatic3
PASS: dlfcn/tststatic4
PASS: dlfcn/tststatic5

So is that the fix or more is needed ?

I have just posted an architecture-independent change here:

<https://sourceware.org/pipermail/libc-alpha/2020-July/116143.html>

I had forgotten about the similar code for static dlopen when I made the adjustment in elf/dl-tls.c. I think we need to clean this up eventually, it's fairly broken unfortunately. But the patch I posted should paper over this problem as far libc.so is concerned (like the previous patch for dynamic TLS).

Would you mind reverting the TCB_ALIGNMENT change and test this patch?

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#35 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

In reply to Vineet Gupta
Quoted 28 lines · Vineet Gupta via Libc-alpha
Quoted 26 lines · Florian Weimer via Libc-alpha

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 21 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

That's the same with me. The toolchain wasn't rebuilt but glibc was built from a clean directory. I am rebuilding now with a rebuilt toolchain.

Quoted 3 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

I see the same messages.

Quoted 3 lines

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

That's what I see as well.

Quoted 4 lines

Also while we figure this out, does this prevent ARC port from being committed. It is a functioning system otherwise: I'm doing doing cross run of testsuite with sshd etc involved and these addition 10+ failures don't seem to be getting in the way.

Good question!

Alistair

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#36 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

* Alistair Francis:

Quoted 47 lines
Quoted 28 lines · Vineet Gupta via Libc-alpha
Quoted 26 lines · Florian Weimer via Libc-alpha

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 21 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

That's the same with me. The toolchain wasn't rebuilt but glibc was built from a clean directory. I am rebuilding now with a rebuilt toolchain.

Quoted 3 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

Quoted 7 lines

I see the same messages.

Quoted 3 lines

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

That's what I see as well.

Sorry, my fault. I posted a patch that should fix static dlopen:

<https://sourceware.org/pipermail/libc-alpha/2020-July/116143.html>

Would you mind testing it?

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#37 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

Quoted 56 lines · Florian Weimer

* Alistair Francis:

Quoted 53 lines
Quoted 28 lines · Vineet Gupta via Libc-alpha
Quoted 26 lines · Florian Weimer via Libc-alpha

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 21 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

From scratch meaning glibc alone or the whole toolchain. I used buildroot and glibc-dirclean to nuke entire glibc but gcc was not rebuilt. I can try that too.

That's the same with me. The toolchain wasn't rebuilt but glibc was built from a clean directory. I am rebuilding now with a rebuilt toolchain.

Quoted 3 lines

Some of the failed tests have prints about static TLS block ... so I'm wondering if they could be related ?

I see the same messages.

Quoted 3 lines

| $ cat dlfcn/tststatic.out
| .../build/libc.so.6: cannot allocate memory in static TLS block

Quoted 7 lines
Quoted 1 line

That's what I see as well.

Sorry, my fault. I posted a patch that should fix static dlopen:

<https://sourceware.org/pipermail/libc-alpha/2020-July/116143.html>

Would you mind testing it?

Yep, I'm currently in the middle of a different test. When that finishes I'll test again, that'll take around 48 hours though

Alistair

Quoted 4 lines

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#38 lore raw

Re: ARC testsuite regressions (was Re: [PATCH v7.2 07/13] ARC: Linux Syscall Interface)

In reply to Florian Weimer
Quoted 27 lines · Florian Weimer

* Alistair Francis via Libc-alpha:

Quoted 24 lines
Quoted 21 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha
Quoted 2 lines

Rebased ARC port on master and fired a build-many-glibcs <glibcs> now (expect some abilist updates). Will do a full testsuite run

No regressions in sysvipc tests !

But quite a few regressions. Baseline is ARC port off of upstream 81b1c8cbb5b4 "(hurd: Simplify usleep timeout computation)" and failures below seen in ARC port off of today's master ffd178c651b8 "(sysv: linux: Add 64-bit time_t variant for shmctl)"

FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-tls9-static

Quoted 5 lines
Quoted 1 line

I see the same recent-ish regressions for RV32.

Did you rebuild from scratch? After the libc.so/ld.so ABI changes that went in recently, it could be the result of incomplete make dependencies.

I re-built glibc from scratch on a RV32 setup.

I have now updated the RV32 host (GCC and host glibc) to be built from the latest master and am rebuilding now.

Alistair

Quoted 4 lines

Thanks,
Florian

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#39 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

In reply to Adhemerval Zanella
Quoted 62 lines · Adhemerval Zanella via Libc-alpha
Quoted 59 lines · Vineet Gupta
Quoted 51 lines · Adhemerval Zanella via Libc-alpha
Quoted 42 lines
Quoted 4 lines
Quoted 3 lines
sysdeps/unix/sysv/linux/arc/clone.S +0 -0
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +0 -0
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 24

Quoted 8 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +8 -0
+
+/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
+   support.  */
+
+/* fstat64 and fstatat64 need to be replaced with statx.  */
+
+#undef __NR_fstat64
+#undef __NR_fstatat64

This is certainly needed as they are present in ARC arch-syscall.h but we need to use statx.

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +11 -0
+/* Replace all other 32-bit time syscalls with 64-bit variants.  */
+
+# undef __NR_clock_adjtime
+# undef __NR_clock_getres
+# undef __NR_futex
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_ppoll
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_rt_sigtimedwait
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h line 41

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h +5 -0
+# undef __NR_sched_rr_get_interval
+# undef __NR_semtimedop
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_utimensat

I am trying to understand why these are required since arc does not define them in arch-syscall.h.

arch-syscall.h doesn't define them precisely due to these being here. When update-syscalls is run, the 32-bit syscalls are generated for ARC (since kernel ABI provides these because that was v3.9 circa 2013). Adding them fixup-asm-unistd.h removes them (perhaps I need to add this in changelog to clarify - atleast for myself).

Quoted 8 lines
Quoted 2 lines

And the generic implementation should handle the time64 variant. If they are not this is something we need to handle it.

At the time we we doing this, arch-syscall.h generation was not yet in place, however I tried to undef in generic/sysdep.h for TIMESIZE==64. However I was asked me to add this to ARC specific fixup-asm-unistd.h
https://sourceware.org/pipermail/libc-alpha/2020-March/112395.html
https://sourceware.org/pipermail/libc-alpha/2020-April/112909.html

Quoted 4 lines

My confusion here, I forgot that this header is only used glibcsyscalls.py to actually generate arch-syscall.h.

You changes does look correct.

Actually we can add a few more entries here which have 64-bit variants.

Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+# undef __NR_clock_gettime
+# undef __NR_clock_nanosleep
+# undef __NR_clock_settime
+# undef __NR_timer_gettime
+# undef __NR_timer_settime

It should not intefere since ARC also defines __ASSUME_TIME64_SYSCALLS and the 32-bit fallback syscalls won't be used in this case.

In an ideal world yes, but as we see from hacks in sysdep.h, there's code which build/works inadvertently. If nothing else, this documents that those syscalls are not to be used.

Quoted 5 lines

As a side note, now that arch-syscall.h is based on latest kernel version and all the 32-bit ABIs with old 32-bit time_t have upstream support for 64-bit time_t we can simplify a bit some implementation by assuming the 64-bit time_t is always defined and adding a fallback only for !define __ASSUME_TIME64_SYSCALLS.

OK.

Quoted 102 lines
Quoted 48 lines
Quoted 38 lines
Quoted 38 lines
Quoted 1 line
Quoted 1 line
sysdeps/unix/sysv/linux/arc/sysdep.h +0 -0

...

Quoted 11 lines
Quoted 11 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +11 -0
+/* 32-bit time syscalls are not available, but the redefines allow generic
+   wrappers to work.  */
+#define __NR_clock_adjtime	__NR_clock_adjtime64
+#define __NR_clock_getres	__NR_clock_getres_time64
+#define __NR_futex		__NR_futex_time64
+#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
+#define __NR_mq_timedsend	__NR_mq_timedsend_time64
+#define __NR_ppoll		__NR_ppoll_time64
+#define __NR_pselect6		__NR_pselect6_time64
+#define __NR_recvmmsg		__NR_recvmmsg_time64
+#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
Quoted 8 lines

sysdeps/unix/sysv/linux/arc/sysdep.h line 40

Quoted 5 lines
sysdeps/unix/sysv/linux/arc/sysdep.h +5 -0
+#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
+#define __NR_semtimedop		__NR_semtimedop_time64
+#define __NR_timerfd_gettime	__NR_timerfd_gettime64
+#define __NR_timerfd_settime	__NR_timerfd_settime64
+#define __NR_utimensat		__NR_utimensat_time64

As for the fixup-asm-unistd.h, the generic implementation should handle it without the requirement of the ABI to add such tricks.

fixup-asm-unistd.h is different, but this could be avoided. I know for sure that ll code literally expects __NR_futex (atleast used to). But I can remove this and see what comes out.

Quoted 9 lines

However it seems that we are still missing support for pselect (__NR_pselect6_time64), recvmmsg (__NR_recvmmsg_time64), sigtimedwait (__NR_rt_sigtimedwait_time64), and semtimeop (__NR_semtimedop_time64).

I think we can add the redefine hack only the aforementioned symbols for now and removed them once we implement the y2038 support on such symbols (since the expected ABI won't change for ARC, only for old ABIs with 32 time_t support).

Quoted 5 lines
Quoted 1 line

Sorry /me horribly confused here.

Sorry for the confusion, I meant that some of these re-defines are superfluous and I would like to have the minimum required re-define to enable the ARC support,

Right. The generic code needs a bit more work to eliminate the redefines altogether.

1. Following is not needed

Review

Quoted 6 lines
(quoted diff) +0 -6
-#define __NR_clock_adjtime     __NR_clock_adjtime64
-#define __NR_sched_rr_get_interval     __NR_sched_rr_get_interval_time64
-#define __NR_mq_timedreceive   __NR_mq_timedreceive_time64
-#define __NR_mq_timedsend      __NR_mq_timedsend_time64
-#define __NR_timerfd_gettime   __NR_timerfd_gettime64
-#define __NR_timerfd_settime   __NR_timerfd_settime64

Ok.

Quoted 6 lines

2. The minimum list needed for ARC (with annotations as to which generic file needs fixing).

/* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */
#define __NR_clock_getres __NR_clock_getres_time64

It should be simple since there is no need to provide an extra symbol for old ABIs, it would be to just use __NR_clock_getres_time64 if it is defined.

Quoted 2 lines

/* Fix sysdeps/nptl/lowlevellock-futex.h. */
#define __NR_futex __NR_futex_time64

It seems Lukasz Majewski has sent a patchset to address it (I haven't checked the detail yet).

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/pause.c. */
#define __NR_ppoll __NR_ppoll_time64

This is another one similar to clock_getcpuclockid.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/select.c. */
#define __NR_pselect6 __NR_pselect6_time64

I have a patch for select [1], it a bit more complex because we need to handle both the timeout and the microblaze lacking support of pselect6.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */
#define __NR_recvmmsg __NR_recvmmsg_time64

I also have a patch for this [1], although it still does not have the ancillary data from struct msghdr which might return SCM_TIMESTAMP information (which returns struct timespec). The recvmsg also has the same issue regarding ancillary data.

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */
#define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64

The patch for is more straighfoward [1].

Quoted 2 lines

/* Fix sysdeps/unix/sysv/linux/semtimedop.c. */
#define __NR_semtimedop __NR_semtimedop_time64

Quoted 7 lines

The patch for is also straighfoward [1].

Quoted 2 lines

/* Hack sysdeps/unix/sysv/linux/generic/utimes.c (need linux/utimes.c). */
#define __NR_utimensat __NR_utimensat_time64

Lukasz Majewski also has a patchset for this, I will check this out.

Thanks for tacking this.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

so we can cleanup these later once we enable time64_t support on old ABIs as well.

IMO the cleanup applies to new ABIs too as generic code should handle those cases w/o these workarounds. But that would delay things further for new ports so I suggest we keep the workarounds and clean things up going fwd.

I agree, this can be worked in parallel.

Thx for being pragmatic. Given ABI freeze we will merge ARC with workarounds and clean them up in 2.33 ?

Quoted 25 lines
Quoted 10 lines

BTW, if one were to actually go about fixing those, whats the best approach. Consider the simplest case pause(). For !__NR_pause do we replicate the code for ppoll/ppoll64 handling or simply just call ppoll(). Later has a function call overhead) ? Or there is a paradigm to use __syscallxxx_helper() although that still has a function call overhead.

Actually the pause case is really simple as there are no args, so just redefine __NR_xxx trick should suffice w/o going into all the explicit interworking/conversion etc.

Quoted 9 lines

__libc_pause (void)
{
#ifdef __NR_pause
return SYSCALL_CANCEL (pause);
#else

return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
#endif

Each implementation has it ows requirements so I can't really say if a helper function does make sense for all of them. For pause specifically we can even simplify to since all architectures have either ppoll or ppoll_time64:

Quoted 9 lines
  int
  __libc_pause (void)
  {
  #ifdef __NR_ppoll_time64
    return SYSCALL_CANCEL (ppoll_time64, NULL, 0, NULL, NULL);
  #else
    return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
  #endif
  }

But how is this compatible with older kernels (and perhaps this is a general question). I mean one/more ABIs minimum kernel would not have the ppoll or ppoll64 so how will new glibc work with such a kernel ? Is it not required to ?
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#40 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 15 lines · Vineet Gupta via Libc-alpha
Quoted 5 lines

Each implementation has it ows requirements so I can't really say if a helper function does make sense for all of them. For pause specifically we can even simplify to since all architectures have either ppoll or ppoll_time64:

Quoted 9 lines
  int
  __libc_pause (void)
  {
  #ifdef __NR_ppoll_time64
    return SYSCALL_CANCEL (ppoll_time64, NULL, 0, NULL, NULL);
  #else
    return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
  #endif
  }
Quoted 3 lines

But how is this compatible with older kernels (and perhaps this is a general question). I mean one/more ABIs minimum kernel would not have the ppoll or ppoll64 so how will new glibc work with such a kernel ? Is it not required to ?

See commit 089b772f98afd9eb6264c6489bc96a30bf6af4ac, where I removed __ASSUME_PPOLL because all supported kernel versions now had that syscall for all glibc architectures.

In general this sort of thing needs a review of whether a given syscall is available for all glibc architectures in their minimum kernel versions. For the old kernels in question, that means checking the architecture-specific syscall table as used to dispatch syscalls at runtime, which used to have an architecture-specific format before unification work was done; it used to mean checking asm/unistd.h as well, but now we have syscall tables in glibc that's probably no longer required. It also involves checking compat syscall tables for 32-bit binaries on 64-bit kernels, as sometimes a syscall didn't get added to the native and compat syscall tables at the same time (see the comments in sparc/kernel-features.h about various socket-related syscalls, for example).

Signature · 7 lines
Joseph S. Myers
[email protected]

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#41 lore raw

Re: [PATCH v7.1 07/13] ARC: Linux Syscall Interface

Quoted 17 lines · Joseph Myers
Quoted 15 lines · Vineet Gupta via Libc-alpha
Quoted 14 lines

Each implementation has it ows requirements so I can't really say if a helper function does make sense for all of them. For pause specifically we can even simplify to since all architectures have either ppoll or ppoll_time64:

  int
  __libc_pause (void)
  {
  #ifdef __NR_ppoll_time64
    return SYSCALL_CANCEL (ppoll_time64, NULL, 0, NULL, NULL);
  #else
    return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
  #endif
  }
Quoted 7 lines
Quoted 3 lines

But how is this compatible with older kernels (and perhaps this is a general question). I mean one/more ABIs minimum kernel would not have the ppoll or ppoll64 so how will new glibc work with such a kernel ? Is it not required to ?

See commit 089b772f98afd9eb6264c6489bc96a30bf6af4ac, where I removed __ASSUME_PPOLL because all supported kernel versions now had that syscall for all glibc architectures.

But that still doesn't explain how new glibc works with old kernels (for say when a port support was first merged, with say asm-generic ABI).

Ah it seems any glibc is only required to work with "arch_minimum_kernel" (generic or architecture override) which over time itself keeps moving forward due to various reasons (e.g. 64-bit time support etc). So indeed a bleeding edge glibc of today won't necessarily work with an arch kernel for say when its glibc port was first merged, but will for the corresponding arch_minimum_kernel.

Quoted 4 lines

In general this sort of thing needs a review of whether a given syscall is available for all glibc architectures in their minimum kernel versions. For the old kernels in question, that means checking the architecture-specific syscall table as used to dispatch syscalls at

Quoted 9 lines

runtime, which used to have an architecture-specific format before unification work was done; it used to mean checking asm/unistd.h as well, but now we have syscall tables in glibc that's probably no longer required. It also involves checking compat syscall tables for 32-bit binaries on 64-bit kernels, as sometimes a syscall didn't get added to the native and compat syscall tables at the same time (see the comments in sparc/kernel-features.h about various socket-related syscalls, for example).

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#42 lore raw

PATCH v7 8/13 ARC: Linux ABI

In reply to Vineet Gupta
---
 sysdeps/arc/nptl/pthreaddef.h                 | 32 +++++++
 sysdeps/unix/sysv/linux/arc/bits/procfs.h     | 35 +++++++
 .../sysv/linux/arc/bits/types/__sigset_t.h    | 12 +++
 sysdeps/unix/sysv/linux/arc/getcontext.S      | 64 +++++++++++++
 sysdeps/unix/sysv/linux/arc/makecontext.c     | 73 ++++++++++++++
 sysdeps/unix/sysv/linux/arc/setcontext.S      | 93 ++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h  | 28 ++++++
 sysdeps/unix/sysv/linux/arc/swapcontext.S     | 94 +++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h    | 35 +++++++
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h    | 57 +++++++++++
 sysdeps/unix/sysv/linux/arc/sys/user.h        | 31 ++++++
 sysdeps/unix/sysv/linux/arc/ucontext-macros.h | 25 +++++
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym    | 20 ++++
 13 files changed, 599 insertions(+)
 create mode 100644 sysdeps/arc/nptl/pthreaddef.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.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/ucontext-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
sysdeps/arc/nptl/pthreaddef.h new file +32 -0
new file mode 100644
index 000000000000..5c2b752becad
@@ -0,0 +1,32 @@
+/* pthread machine parameter definitions, ARC version.
+   Copyright (C) 2020 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
+   <https://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/unix/sysv/linux/arc/bits/procfs.h new file +35 -0
new file mode 100644
index 000000000000..9fabca2c4747
@@ -0,0 +1,35 @@
+/* Types for registers for sys/procfs.h.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_PROCFS_H
+# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
+#endif
+
+#include <sys/ucontext.h>
+
+/* And the whole bunch of them.  We could have used `struct
+   user_regs' directly in the typedef, but tradition says that
+   the register set is an array, which does have some peculiar
+   semantics, so leave it that way.  */
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t))
+
+typedef unsigned long int elf_greg_t;
+typedef unsigned long int elf_gregset_t[ELF_NGREG];
+
+/* There's no seperate floating point reg file in ARCv2.  */
+typedef struct { } elf_fpregset_t;
sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h new file +12 -0
new file mode 100644
index 000000000000..795638a30bd3
@@ -0,0 +1,12 @@
+/* Architecture-specific __sigset_t definition.  ARC version.  */
+#ifndef ____sigset_t_defined
+#define ____sigset_t_defined
+
+/* Linux asm-generic syscall ABI expects sigset_t to hold 64 signals.  */
+#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long int)))
+typedef struct
+{
+  unsigned long int __val[_SIGSET_NWORDS];
+} __sigset_t;
+
+#endif
sysdeps/unix/sysv/linux/arc/getcontext.S new file +64 -0

64 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/makecontext.c new file +73 -0

73 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/setcontext.S new file +93 -0

93 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sigcontextinfo.h new file +28 -0
new file mode 100644
index 000000000000..c674da7b8f1f
@@ -0,0 +1,28 @@
+/* ARC definitions for signal handling calling conventions.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SIGCONTEXTINFO_H
+#define _SIGCONTEXTINFO_H
+
+static inline uintptr_t
+sigcontext_get_pc (const ucontext_t *ctx)
+{
+  return ctx->uc_mcontext.__ret;
+}
+
+#endif
sysdeps/unix/sysv/linux/arc/swapcontext.S new file +94 -0

94 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sys/cachectl.h new file +35 -0
new file mode 100644
index 000000000000..b98c81aa2b3d
@@ -0,0 +1,35 @@
+/* cacheflush - flush contents of instruction and/or data cache.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/* Get the kernel definition for the op bits.  */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW;
+#endif
+
+__END_DECLS
+
+#endif
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +57 -0

57 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/sys/user.h new file +31 -0
new file mode 100644
index 000000000000..3f867d78f9d4
@@ -0,0 +1,31 @@
+/* ptrace register data format definitions.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+/* Struct user_regs_struct is exported by kernel header
+   However apps like strace also expect a struct user, so it's better to
+   have a dummy implementation.  */
+#include <asm/ptrace.h>
+
+struct user {
+  int dummy;
+};
+
+#endif
sysdeps/unix/sysv/linux/arc/ucontext-macros.h new file +25 -0
new file mode 100644
index 000000000000..891a5e71f2da
@@ -0,0 +1,25 @@
+/* Macros for ucontext routines, ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LINUX_ARC_UCONTEXT_MACROS_H
+#define _LINUX_ARC_UCONTEXT_MACROS_H
+
+#include <sysdep.h>
+#include "ucontext_i.h"
+
+#endif
sysdeps/unix/sysv/linux/arc/ucontext_i.sym new file +20 -0
new file mode 100644
index 000000000000..d84e92f9f543
@@ -0,0 +1,20 @@
+#include <inttypes.h>
+#include <signal.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+SIG_BLOCK
+SIG_SETMASK
+
+-- sizeof(sigset_t) expected by kernel: see comment in ARC sigaction.c for details
+_NSIG8				(_NSIG / 8)
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member)	offsetof (ucontext_t, member)
+
+UCONTEXT_FLAGS			ucontext (__uc_flags)
+UCONTEXT_LINK			ucontext (uc_link)
+UCONTEXT_STACK			ucontext (uc_stack)
+UCONTEXT_MCONTEXT		ucontext (uc_mcontext)
+UCONTEXT_SIGMASK		ucontext (uc_sigmask)
+UCONTEXT_SIZE			sizeof (ucontext_t)
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#43 lore raw

PATCH v7 9/13 ARC: Linux Startup and Dynamic Loading

In reply to Vineet Gupta
---
 sysdeps/unix/sysv/linux/arc/dl-static.c | 84 +++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/arc/ldsodefs.h  | 32 ++++++++++
 2 files changed, 116 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldsodefs.h
sysdeps/unix/sysv/linux/arc/dl-static.c new file +84 -0
new file mode 100644
index 000000000000..30bcd899d42d
@@ -0,0 +1,84 @@
+/* Variable initialization.  ARC version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <ldsodefs.h>
+
+#ifdef SHARED
+
+void
+_dl_var_init (void *array[])
+{
+  /* It has to match "variables" below. */
+  enum
+    {
+      DL_PAGESIZE = 0
+    };
+
+  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+}
+
+#else
+
+static void *variables[] =
+{
+  &GLRO(dl_pagesize)
+};
+
+static void
+_dl_unprotect_relro (struct link_map *l)
+{
+  ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
+		      & ~(GLRO(dl_pagesize) - 1));
+  ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
+		    & ~(GLRO(dl_pagesize) - 1));
+
+  if (start != end)
+    __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE);
+}
+
+void
+_dl_static_init (struct link_map *l)
+{
+  struct link_map *rtld_map = l;
+  struct r_scope_elem **scope;
+  const ElfW(Sym) *ref = NULL;
+  lookup_t loadbase;
+  void (*f) (void *[]);
+  size_t i;
+
+  loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
+				  NULL, 0, 1, NULL);
+
+  for (scope = l->l_local_scope; *scope != NULL; scope++)
+    for (i = 0; i < (*scope)->r_nlist; i++)
+      if ((*scope)->r_list[i] == loadbase)
+	{
+	  rtld_map = (*scope)->r_list[i];
+	  break;
+	}
+
+  if (ref != NULL)
+    {
+      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+      _dl_unprotect_relro (rtld_map);
+      f (variables);
+      _dl_protect_relro (rtld_map);
+    }
+}
+
+#endif
sysdeps/unix/sysv/linux/arc/ldsodefs.h new file +32 -0
new file mode 100644
index 000000000000..204a0ff8946c
@@ -0,0 +1,32 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects. ARC
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef	_LDSODEFS_H
+
+/* Get the real definitions.  */
+#include_next <ldsodefs.h>
+
+/* Now define our stuff.  */
+
+/* We need special support to initialize DSO loaded for statically linked
+   binaries.  */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* ldsodefs.h */
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#44 lore raw

PATCH v7 10/13 ARC: ABI lists

In reply to Vineet Gupta
---
 sysdeps/arc/fpu/libm-test-ulps                | 1140 +++++++++
 sysdeps/arc/fpu/libm-test-ulps-name           |    1 +
 sysdeps/arc/nofpu/libm-test-ulps              |  270 +++
 sysdeps/arc/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/unix/sysv/linux/arc/c++-types.data    |   67 +
 sysdeps/unix/sysv/linux/arc/ld.abilist        |    5 +
 .../sysv/linux/arc/libBrokenLocale.abilist    |    1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist    |    4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      | 2082 +++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist  |    2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist     |    9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist      |  699 ++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  213 ++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist     |   35 +
 .../unix/sysv/linux/arc/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |    6 +
 sysdeps/unix/sysv/linux/arc/localplt.data     |   12 +
 18 files changed, 4666 insertions(+)
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist
 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/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
sysdeps/arc/fpu/libm-test-ulps new file +1140 -0
new file mode 100644
index 000000000000..00262925b75b
@@ -0,0 +1,1140 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+double: 1
+float: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+
+Function: "acosh":
+double: 3
+float: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+
+Function: "acosh_upward":
+double: 3
+float: 3
+
+Function: "asin":
+double: 1
+float: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+
+Function: "asinh":
+double: 3
+float: 2
+
+Function: "asinh_downward":
+double: 3
+float: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+
+Function: "atan":
+double: 1
+float: 1
+
+Function: "atan2":
+double: 7
+float: 2
+
+Function: "atan2_downward":
+double: 5
+float: 2
+
+Function: "atan2_towardzero":
+double: 5
+float: 2
+
+Function: "atan2_upward":
+double: 8
+float: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+
+Function: "atan_upward":
+double: 2
+float: 2
+
+Function: "atanh":
+double: 2
+float: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+
+Function: "cabs":
+double: 1
+float: 1
+
+Function: "cabs_downward":
+double: 1
+
+Function: "cabs_towardzero":
+double: 1
+
+Function: "cabs_upward":
+double: 2
+float: 1
+
+Function: Real part of "cacos":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacos":
+double: 5
+float: 3
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 3
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+
+Function: Real part of "cacosh":
+double: 5
+float: 4
+
+Function: Imaginary part of "cacosh":
+double: 2
+float: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "cacosh_upward":
+double: 5
+float: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 3
+
+Function: "carg":
+double: 7
+float: 2
+
+Function: "carg_downward":
+double: 5
+float: 2
+
+Function: "carg_towardzero":
+double: 5
+float: 2
+
+Function: "carg_upward":
+double: 8
+float: 2
+
+Function: Real part of "casin":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin":
+double: 5
+float: 4
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+
+Function: Real part of "casinh":
+double: 5
+float: 4
+
+Function: Imaginary part of "casinh":
+double: 3
+float: 2
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+
+Function: Imaginary part of "catan":
+double: 3
+float: 3
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "catan_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catan_upward":
+double: 3
+float: 3
+
+Function: Real part of "catanh":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 2
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+
+Function: Real part of "catanh_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 2
+float: 2
+
+Function: "cbrt":
+double: 4
+float: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+
+Function: Real part of "ccos":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccos":
+double: 3
+float: 3
+
+Function: Real part of "ccos_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccos_upward":
+double: 4
+float: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 4
+float: 4
+
+Function: Real part of "ccosh":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccosh":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_upward":
+double: 4
+float: 3
+
+Function: Imaginary part of "ccosh_upward":
+double: 4
+float: 4
+
+Function: Real part of "cexp":
+double: 4
+float: 3
+
+Function: Imaginary part of "cexp":
+double: 4
+float: 3
+
+Function: Real part of "cexp_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+
+Function: Real part of "cexp_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "cexp_upward":
+double: 5
+float: 3
+
+Function: Imaginary part of "cexp_upward":
+double: 4
+float: 4
+
+Function: Real part of "clog":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog":
+double: 7
+float: 2
+
+Function: Real part of "clog10":
+double: 6
+float: 5
+
+Function: Imaginary part of "clog10":
+double: 8
+float: 4
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 8
+float: 4
+
+Function: Real part of "clog10_towardzero":
+double: 6
+float: 6
+
+Function: Imaginary part of "clog10_towardzero":
+double: 9
+float: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 6
+
+Function: Imaginary part of "clog10_upward":
+double: 9
+float: 5
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+
+Function: Imaginary part of "clog_downward":
+double: 5
+float: 2
+
+Function: Real part of "clog_towardzero":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 5
+float: 3
+
+Function: Real part of "clog_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog_upward":
+double: 8
+float: 2
+
+Function: "cos":
+double: 4
+float: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+
+Function: "cos_towardzero":
+double: 4
+float: 2
+
+Function: "cos_upward":
+double: 4
+float: 2
+
+Function: "cosh":
+double: 3
+float: 3
+
+Function: "cosh_downward":
+double: 2
+float: 1
+
+Function: "cosh_towardzero":
+double: 2
+float: 1
+
+Function: "cosh_upward":
+double: 3
+float: 2
+
+Function: Real part of "cpow":
+double: 9
+float: 8
+
+Function: Imaginary part of "cpow":
+double: 3
+float: 6
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 2
+float: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "cpow_upward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_upward":
+double: 2
+float: 2
+
+Function: Real part of "csin":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin":
+double: 3
+float: 3
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_downward":
+double: 3
+float: 1
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "csin_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "csin_upward":
+double: 4
+float: 2
+
+Function: Real part of "csinh":
+double: 3
+float: 3
+
+Function: Imaginary part of "csinh":
+double: 3
+float: 3
+
+Function: Real part of "csinh_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+
+Function: Real part of "csinh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "csinh_upward":
+double: 4
+float: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 4
+float: 4
+
+Function: Real part of "csqrt":
+double: 4
+float: 3
+
+Function: Imaginary part of "csqrt":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 4
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 4
+float: 4
+
+Function: Real part of "ctan":
+double: 4
+float: 6
+
+Function: Imaginary part of "ctan":
+double: 3
+float: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 3
+float: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 6
+
+Function: Imaginary part of "ctan_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "ctan_upward":
+double: 5
+float: 6
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 2
+
+Function: Real part of "ctanh":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh":
+double: 4
+float: 6
+
+Function: Real part of "ctanh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 6
+
+Function: Real part of "ctanh_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 5
+float: 6
+
+Function: "erf":
+double: 1
+float: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 2
+
+Function: "erf_upward":
+double: 2
+float: 2
+
+Function: "erfc":
+double: 5
+float: 5
+
+Function: "erfc_downward":
+double: 4
+float: 4
+
+Function: "erfc_towardzero":
+double: 4
+float: 4
+
+Function: "erfc_upward":
+double: 5
+float: 5
+
+Function: "exp":
+double: 1
+float: 1
+
+Function: "exp10":
+double: 4
+float: 1
+
+Function: "exp10_downward":
+double: 3
+
+Function: "exp10_towardzero":
+double: 3
+
+Function: "exp10_upward":
+double: 4
+float: 1
+
+Function: "exp2":
+double: 1
+float: 1
+
+Function: "exp2_downward":
+double: 1
+
+Function: "exp2_towardzero":
+double: 1
+
+Function: "exp2_upward":
+double: 2
+float: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+
+Function: "exp_upward":
+double: 2
+float: 2
+
+Function: "expm1":
+double: 2
+float: 2
+
+Function: "expm1_downward":
+double: 1
+float: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+
+Function: "expm1_upward":
+double: 2
+float: 2
+
+Function: "gamma":
+double: 7
+float: 6
+
+Function: "gamma_downward":
+double: 6
+float: 5
+
+Function: "gamma_towardzero":
+double: 7
+float: 6
+
+Function: "gamma_upward":
+double: 7
+float: 6
+
+Function: "hypot":
+double: 2
+float: 1
+
+Function: "hypot_downward":
+double: 1
+
+Function: "hypot_towardzero":
+double: 1
+
+Function: "hypot_upward":
+double: 2
+float: 1
+
+Function: "j0":
+double: 4
+float: 6
+
+Function: "j0_downward":
+double: 2
+float: 4
+
+Function: "j0_towardzero":
+double: 4
+float: 5
+
+Function: "j0_upward":
+double: 3
+float: 5
+
+Function: "j1":
+double: 5
+float: 9
+
+Function: "j1_downward":
+double: 4
+float: 6
+
+Function: "j1_towardzero":
+double: 4
+float: 3
+
+Function: "j1_upward":
+double: 5
+float: 5
+
+Function: "jn":
+double: 9
+float: 8
+
+Function: "jn_downward":
+double: 7
+float: 9
+
+Function: "jn_towardzero":
+double: 7
+float: 9
+
+Function: "jn_upward":
+double: 9
+float: 9
+
+Function: "lgamma":
+double: 7
+float: 6
+
+Function: "lgamma_downward":
+double: 6
+float: 5
+
+Function: "lgamma_towardzero":
+double: 7
+float: 6
+
+Function: "lgamma_upward":
+double: 7
+float: 6
+
+Function: "log":
+double: 1
+float: 1
+
+Function: "log10":
+double: 2
+float: 3
+
+Function: "log10_downward":
+double: 2
+float: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 4
+
+Function: "log10_upward":
+double: 3
+float: 4
+
+Function: "log1p":
+double: 1
+float: 1
+
+Function: "log1p_downward":
+double: 1
+float: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+
+Function: "log2":
+double: 2
+float: 1
+
+Function: "log2_towardzero":
+double: 1
+float: 1
+
+Function: "log2_upward":
+double: 1
+float: 1
+
+Function: "log_towardzero":
+double: 1
+float: 1
+
+Function: "log_upward":
+double: 1
+float: 1
+
+Function: "pow":
+double: 1
+float: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+
+Function: "pow_upward":
+double: 2
+float: 2
+
+Function: "sin":
+double: 7
+float: 1
+
+Function: "sin_downward":
+double: 4
+float: 1
+
+Function: "sin_towardzero":
+double: 3
+float: 1
+
+Function: "sin_upward":
+double: 7
+float: 1
+
+Function: "sincos":
+double: 1
+float: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+
+Function: "sincos_towardzero":
+double: 4
+float: 1
+
+Function: "sincos_upward":
+double: 2
+float: 1
+
+Function: "sinh":
+double: 3
+float: 3
+
+Function: "sinh_downward":
+double: 3
+float: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+
+Function: "tan":
+double: 1
+float: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 2
+
+Function: "tan_upward":
+double: 1
+float: 2
+
+Function: "tanh":
+double: 3
+float: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+
+Function: "tanh_towardzero":
+double: 3
+float: 3
+
+Function: "tanh_upward":
+double: 3
+float: 3
+
+Function: "tgamma":
+double: 9
+float: 9
+
+Function: "tgamma_downward":
+double: 9
+float: 9
+
+Function: "tgamma_towardzero":
+double: 9
+float: 8
+
+Function: "tgamma_upward":
+double: 9
+float: 9
+
+Function: "y0":
+double: 3
+float: 6
+
+Function: "y0_downward":
+double: 3
+float: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 4
+
+Function: "y0_upward":
+double: 4
+float: 5
+
+Function: "y1":
+double: 7
+float: 6
+
+Function: "y1_downward":
+double: 6
+float: 6
+
+Function: "y1_towardzero":
+double: 7
+float: 7
+
+Function: "y1_upward":
+double: 7
+float: 7
+
+Function: "yn":
+double: 9
+float: 9
+
+Function: "yn_downward":
+double: 8
+float: 8
+
+Function: "yn_towardzero":
+double: 9
+float: 9
+
+Function: "yn_upward":
+double: 9
+float: 9
+
+# end of automatic generation
sysdeps/arc/fpu/libm-test-ulps-name new file +1 -0
new file mode 100644
index 000000000000..8c4fba4f9ae0
@@ -0,0 +1 @@
+ARC
sysdeps/arc/nofpu/libm-test-ulps new file +270 -0

270 lines not on this page · raw message

sysdeps/arc/nofpu/libm-test-ulps-name new file +1 -0
new file mode 100644
index 000000000000..8a9879ebd635
@@ -0,0 +1 @@
+ARC soft-float
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/ld.abilist new file +5 -0
new file mode 100644
index 000000000000..048f17c8486f
@@ -0,0 +1,5 @@
+GLIBC_2.32 __libc_stack_end D 0x4
+GLIBC_2.32 __stack_chk_guard D 0x4
+GLIBC_2.32 __tls_get_addr F
+GLIBC_2.32 _dl_mcount F
+GLIBC_2.32 _r_debug D 0x14
sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist new file +1 -0
new file mode 100644
index 000000000000..b0869cec1fb8
@@ -0,0 +1 @@
+GLIBC_2.32 __ctype_get_mb_cur_max F
sysdeps/unix/sysv/linux/arc/libanl.abilist new file +4 -0
new file mode 100644
index 000000000000..ba513bd0289d
@@ -0,0 +1,4 @@
+GLIBC_2.32 gai_cancel F
+GLIBC_2.32 gai_error F
+GLIBC_2.32 gai_suspend F
+GLIBC_2.32 getaddrinfo_a F
sysdeps/unix/sysv/linux/arc/libc.abilist new file +2082 -0

1,511 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libcrypt.abilist new file +2 -0
new file mode 100644
index 000000000000..6bd253453e99

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

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

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

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

699 lines not on this page · raw message

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

213 lines not on this page · raw message

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

79 lines not on this page · raw message

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

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

sysdeps/unix/sysv/linux/arc/libthread_db.abilist new file +40 -0
new file mode 100644
index 000000000000..dcbc4a8fbef5

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

sysdeps/unix/sysv/linux/arc/libutil.abilist new file +6 -0
new file mode 100644
index 000000000000..61f73bc34ef8

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

sysdeps/unix/sysv/linux/arc/localplt.data new file +12 -0
new file mode 100644
index 000000000000..4479e8ee8a26

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

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

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

#45 lore raw

PATCH v7 10/13 ARC: ABI lists

---
Changes since v7:
- rebase artifact, some symbols got added to libc.abilist

---
 sysdeps/arc/fpu/libm-test-ulps                | 1140 +++++++++
 sysdeps/arc/fpu/libm-test-ulps-name           |    1 +
 sysdeps/arc/nofpu/libm-test-ulps              |  270 +++
 sysdeps/arc/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/unix/sysv/linux/arc/c++-types.data    |   67 +
 sysdeps/unix/sysv/linux/arc/ld.abilist        |    5 +
 .../sysv/linux/arc/libBrokenLocale.abilist    |    1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist    |    4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      | 2086 +++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist  |    2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist     |    9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist      |  699 ++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  213 ++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist     |   35 +
 .../unix/sysv/linux/arc/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |    6 +
 sysdeps/unix/sysv/linux/arc/localplt.data     |   12 +
 18 files changed, 4670 insertions(+)
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist
 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/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
sysdeps/arc/fpu/libm-test-ulps new file +1140 -0
new file mode 100644
index 000000000000..00262925b75b
@@ -0,0 +1,1140 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+double: 1
+float: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+
+Function: "acosh":
+double: 3
+float: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+
+Function: "acosh_upward":
+double: 3
+float: 3
+
+Function: "asin":
+double: 1
+float: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+
+Function: "asinh":
+double: 3
+float: 2
+
+Function: "asinh_downward":
+double: 3
+float: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+
+Function: "atan":
+double: 1
+float: 1
+
+Function: "atan2":
+double: 7
+float: 2
+
+Function: "atan2_downward":
+double: 5
+float: 2
+
+Function: "atan2_towardzero":
+double: 5
+float: 2
+
+Function: "atan2_upward":
+double: 8
+float: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+
+Function: "atan_upward":
+double: 2
+float: 2
+
+Function: "atanh":
+double: 2
+float: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+
+Function: "cabs":
+double: 1
+float: 1
+
+Function: "cabs_downward":
+double: 1
+
+Function: "cabs_towardzero":
+double: 1
+
+Function: "cabs_upward":
+double: 2
+float: 1
+
+Function: Real part of "cacos":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacos":
+double: 5
+float: 3
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 3
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+
+Function: Real part of "cacosh":
+double: 5
+float: 4
+
+Function: Imaginary part of "cacosh":
+double: 2
+float: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "cacosh_upward":
+double: 5
+float: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 3
+
+Function: "carg":
+double: 7
+float: 2
+
+Function: "carg_downward":
+double: 5
+float: 2
+
+Function: "carg_towardzero":
+double: 5
+float: 2
+
+Function: "carg_upward":
+double: 8
+float: 2
+
+Function: Real part of "casin":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin":
+double: 5
+float: 4
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+
+Function: Real part of "casinh":
+double: 5
+float: 4
+
+Function: Imaginary part of "casinh":
+double: 3
+float: 2
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+
+Function: Imaginary part of "catan":
+double: 3
+float: 3
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "catan_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catan_upward":
+double: 3
+float: 3
+
+Function: Real part of "catanh":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 2
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+
+Function: Real part of "catanh_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 2
+float: 2
+
+Function: "cbrt":
+double: 4
+float: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+
+Function: Real part of "ccos":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccos":
+double: 3
+float: 3
+
+Function: Real part of "ccos_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccos_upward":
+double: 4
+float: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 4
+float: 4
+
+Function: Real part of "ccosh":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccosh":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_upward":
+double: 4
+float: 3
+
+Function: Imaginary part of "ccosh_upward":
+double: 4
+float: 4
+
+Function: Real part of "cexp":
+double: 4
+float: 3
+
+Function: Imaginary part of "cexp":
+double: 4
+float: 3
+
+Function: Real part of "cexp_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+
+Function: Real part of "cexp_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "cexp_upward":
+double: 5
+float: 3
+
+Function: Imaginary part of "cexp_upward":
+double: 4
+float: 4
+
+Function: Real part of "clog":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog":
+double: 7
+float: 2
+
+Function: Real part of "clog10":
+double: 6
+float: 5
+
+Function: Imaginary part of "clog10":
+double: 8
+float: 4
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 8
+float: 4
+
+Function: Real part of "clog10_towardzero":
+double: 6
+float: 6
+
+Function: Imaginary part of "clog10_towardzero":
+double: 9
+float: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 6
+
+Function: Imaginary part of "clog10_upward":
+double: 9
+float: 5
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+
+Function: Imaginary part of "clog_downward":
+double: 5
+float: 2
+
+Function: Real part of "clog_towardzero":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 5
+float: 3
+
+Function: Real part of "clog_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "clog_upward":
+double: 8
+float: 2
+
+Function: "cos":
+double: 4
+float: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+
+Function: "cos_towardzero":
+double: 4
+float: 2
+
+Function: "cos_upward":
+double: 4
+float: 2
+
+Function: "cosh":
+double: 3
+float: 3
+
+Function: "cosh_downward":
+double: 2
+float: 1
+
+Function: "cosh_towardzero":
+double: 2
+float: 1
+
+Function: "cosh_upward":
+double: 3
+float: 2
+
+Function: Real part of "cpow":
+double: 9
+float: 8
+
+Function: Imaginary part of "cpow":
+double: 3
+float: 6
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 2
+float: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "cpow_upward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_upward":
+double: 2
+float: 2
+
+Function: Real part of "csin":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin":
+double: 3
+float: 3
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_downward":
+double: 3
+float: 1
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "csin_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "csin_upward":
+double: 4
+float: 2
+
+Function: Real part of "csinh":
+double: 3
+float: 3
+
+Function: Imaginary part of "csinh":
+double: 3
+float: 3
+
+Function: Real part of "csinh_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+
+Function: Real part of "csinh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "csinh_upward":
+double: 4
+float: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 4
+float: 4
+
+Function: Real part of "csqrt":
+double: 4
+float: 3
+
+Function: Imaginary part of "csqrt":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 4
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 4
+float: 4
+
+Function: Real part of "ctan":
+double: 4
+float: 6
+
+Function: Imaginary part of "ctan":
+double: 3
+float: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 3
+float: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 6
+
+Function: Imaginary part of "ctan_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "ctan_upward":
+double: 5
+float: 6
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 2
+
+Function: Real part of "ctanh":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh":
+double: 4
+float: 6
+
+Function: Real part of "ctanh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 6
+
+Function: Real part of "ctanh_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 5
+float: 6
+
+Function: "erf":
+double: 1
+float: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 2
+
+Function: "erf_upward":
+double: 2
+float: 2
+
+Function: "erfc":
+double: 5
+float: 5
+
+Function: "erfc_downward":
+double: 4
+float: 4
+
+Function: "erfc_towardzero":
+double: 4
+float: 4
+
+Function: "erfc_upward":
+double: 5
+float: 5
+
+Function: "exp":
+double: 1
+float: 1
+
+Function: "exp10":
+double: 4
+float: 1
+
+Function: "exp10_downward":
+double: 3
+
+Function: "exp10_towardzero":
+double: 3
+
+Function: "exp10_upward":
+double: 4
+float: 1
+
+Function: "exp2":
+double: 1
+float: 1
+
+Function: "exp2_downward":
+double: 1
+
+Function: "exp2_towardzero":
+double: 1
+
+Function: "exp2_upward":
+double: 2
+float: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+
+Function: "exp_upward":
+double: 2
+float: 2
+
+Function: "expm1":
+double: 2
+float: 2
+
+Function: "expm1_downward":
+double: 1
+float: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+
+Function: "expm1_upward":
+double: 2
+float: 2
+
+Function: "gamma":
+double: 7
+float: 6
+
+Function: "gamma_downward":
+double: 6
+float: 5
+
+Function: "gamma_towardzero":
+double: 7
+float: 6
+
+Function: "gamma_upward":
+double: 7
+float: 6
+
+Function: "hypot":
+double: 2
+float: 1
+
+Function: "hypot_downward":
+double: 1
+
+Function: "hypot_towardzero":
+double: 1
+
+Function: "hypot_upward":
+double: 2
+float: 1
+
+Function: "j0":
+double: 4
+float: 6
+
+Function: "j0_downward":
+double: 2
+float: 4
+
+Function: "j0_towardzero":
+double: 4
+float: 5
+
+Function: "j0_upward":
+double: 3
+float: 5
+
+Function: "j1":
+double: 5
+float: 9
+
+Function: "j1_downward":
+double: 4
+float: 6
+
+Function: "j1_towardzero":
+double: 4
+float: 3
+
+Function: "j1_upward":
+double: 5
+float: 5
+
+Function: "jn":
+double: 9
+float: 8
+
+Function: "jn_downward":
+double: 7
+float: 9
+
+Function: "jn_towardzero":
+double: 7
+float: 9
+
+Function: "jn_upward":
+double: 9
+float: 9
+
+Function: "lgamma":
+double: 7
+float: 6
+
+Function: "lgamma_downward":
+double: 6
+float: 5
+
+Function: "lgamma_towardzero":
+double: 7
+float: 6
+
+Function: "lgamma_upward":
+double: 7
+float: 6
+
+Function: "log":
+double: 1
+float: 1
+
+Function: "log10":
+double: 2
+float: 3
+
+Function: "log10_downward":
+double: 2
+float: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 4
+
+Function: "log10_upward":
+double: 3
+float: 4
+
+Function: "log1p":
+double: 1
+float: 1
+
+Function: "log1p_downward":
+double: 1
+float: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+
+Function: "log2":
+double: 2
+float: 1
+
+Function: "log2_towardzero":
+double: 1
+float: 1
+
+Function: "log2_upward":
+double: 1
+float: 1
+
+Function: "log_towardzero":
+double: 1
+float: 1
+
+Function: "log_upward":
+double: 1
+float: 1
+
+Function: "pow":
+double: 1
+float: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+
+Function: "pow_upward":
+double: 2
+float: 2
+
+Function: "sin":
+double: 7
+float: 1
+
+Function: "sin_downward":
+double: 4
+float: 1
+
+Function: "sin_towardzero":
+double: 3
+float: 1
+
+Function: "sin_upward":
+double: 7
+float: 1
+
+Function: "sincos":
+double: 1
+float: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+
+Function: "sincos_towardzero":
+double: 4
+float: 1
+
+Function: "sincos_upward":
+double: 2
+float: 1
+
+Function: "sinh":
+double: 3
+float: 3
+
+Function: "sinh_downward":
+double: 3
+float: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+
+Function: "tan":
+double: 1
+float: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 2
+
+Function: "tan_upward":
+double: 1
+float: 2
+
+Function: "tanh":
+double: 3
+float: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+
+Function: "tanh_towardzero":
+double: 3
+float: 3
+
+Function: "tanh_upward":
+double: 3
+float: 3
+
+Function: "tgamma":
+double: 9
+float: 9
+
+Function: "tgamma_downward":
+double: 9
+float: 9
+
+Function: "tgamma_towardzero":
+double: 9
+float: 8
+
+Function: "tgamma_upward":
+double: 9
+float: 9
+
+Function: "y0":
+double: 3
+float: 6
+
+Function: "y0_downward":
+double: 3
+float: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 4
+
+Function: "y0_upward":
+double: 4
+float: 5
+
+Function: "y1":
+double: 7
+float: 6
+
+Function: "y1_downward":
+double: 6
+float: 6
+
+Function: "y1_towardzero":
+double: 7
+float: 7
+
+Function: "y1_upward":
+double: 7
+float: 7
+
+Function: "yn":
+double: 9
+float: 9
+
+Function: "yn_downward":
+double: 8
+float: 8
+
+Function: "yn_towardzero":
+double: 9
+float: 9
+
+Function: "yn_upward":
+double: 9
+float: 9
+
+# end of automatic generation
sysdeps/arc/fpu/libm-test-ulps-name new file +1 -0
new file mode 100644
index 000000000000..8c4fba4f9ae0
@@ -0,0 +1 @@
+ARC
sysdeps/arc/nofpu/libm-test-ulps new file +270 -0

270 lines not on this page · raw message

sysdeps/arc/nofpu/libm-test-ulps-name new file +1 -0
new file mode 100644
index 000000000000..8a9879ebd635
@@ -0,0 +1 @@
+ARC soft-float
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/ld.abilist new file +5 -0
new file mode 100644
index 000000000000..048f17c8486f
@@ -0,0 +1,5 @@
+GLIBC_2.32 __libc_stack_end D 0x4
+GLIBC_2.32 __stack_chk_guard D 0x4
+GLIBC_2.32 __tls_get_addr F
+GLIBC_2.32 _dl_mcount F
+GLIBC_2.32 _r_debug D 0x14
sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist new file +1 -0
new file mode 100644
index 000000000000..b0869cec1fb8
@@ -0,0 +1 @@
+GLIBC_2.32 __ctype_get_mb_cur_max F
sysdeps/unix/sysv/linux/arc/libanl.abilist new file +4 -0
new file mode 100644
index 000000000000..ba513bd0289d
@@ -0,0 +1,4 @@
+GLIBC_2.32 gai_cancel F
+GLIBC_2.32 gai_error F
+GLIBC_2.32 gai_suspend F
+GLIBC_2.32 getaddrinfo_a F
sysdeps/unix/sysv/linux/arc/libc.abilist new file +2086 -0

1,511 lines not on this page · raw message

sysdeps/unix/sysv/linux/arc/libcrypt.abilist new file +2 -0
new file mode 100644
index 000000000000..6bd253453e99

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

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

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

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

699 lines not on this page · raw message

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

213 lines not on this page · raw message

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

79 lines not on this page · raw message

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

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

sysdeps/unix/sysv/linux/arc/libthread_db.abilist new file +40 -0
new file mode 100644
index 000000000000..dcbc4a8fbef5

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

sysdeps/unix/sysv/linux/arc/libutil.abilist new file +6 -0
new file mode 100644
index 000000000000..61f73bc34ef8

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

sysdeps/unix/sysv/linux/arc/localplt.data new file +12 -0
new file mode 100644
index 000000000000..4479e8ee8a26

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

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

Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

#46 lore raw

PATCH v7 11/13 ARC: Build Infrastructure

In reply to Vineet Gupta
---
 config.h.in                                |   3 +
 sysdeps/arc/Implies                        |   3 +
 sysdeps/arc/Makefile                       |  21 +++
 sysdeps/arc/Versions                       |   8 +
 sysdeps/arc/configure                      | 182 +++++++++++++++++++++
 sysdeps/arc/configure.ac                   |  26 +++
 sysdeps/arc/nptl/Makefile                  |  22 +++
 sysdeps/arc/preconfigure                   |  14 ++
 sysdeps/unix/sysv/linux/arc/Implies        |   3 +
 sysdeps/unix/sysv/linux/arc/Makefile       |  29 ++++
 sysdeps/unix/sysv/linux/arc/Versions       |  16 ++
 sysdeps/unix/sysv/linux/arc/configure      |   4 +
 sysdeps/unix/sysv/linux/arc/configure.ac   |   4 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h     |  27 +++
 sysdeps/unix/sysv/linux/arc/shlib-versions |   7 +
 15 files changed, 369 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 create mode 100644 sysdeps/arc/Versions
 create mode 100644 sysdeps/arc/configure
 create mode 100644 sysdeps/arc/configure.ac
 create mode 100644 sysdeps/arc/nptl/Makefile
 create mode 100644 sysdeps/arc/preconfigure
 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/configure
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions
config.h.in +3 -0
index 831eca2fe14e..2ed684b7d4e4 100644
@@ -109,6 +109,9 @@
 /* AArch64 big endian ABI */
 #undef HAVE_AARCH64_BE
 
+/* ARC big endian ABI */
+#undef HAVE_ARC_BE
+
 /* C-SKY ABI version.  */
 #undef CSKYABI
 
sysdeps/arc/Implies new file +3 -0
new file mode 100644
index 000000000000..780c4e246769
@@ -0,0 +1,3 @@
+wordsize-32
+ieee754/flt-32
+ieee754/dbl-64
sysdeps/arc/Makefile new file +21 -0
new file mode 100644
index 000000000000..d5a702e29e58
@@ -0,0 +1,21 @@
+# ARC Makefile
+# Copyright (C) 2020 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
+# <https://www.gnu.org/licenses/>.
+
+# 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
sysdeps/arc/Versions new file +8 -0
new file mode 100644
index 000000000000..6ac7b8e49505
@@ -0,0 +1,8 @@
+libc {
+  GLIBC_2.32 {
+    __mcount;
+  }
+  GLIBC_PRIVATE {
+    __syscall_error;
+  }
+}
sysdeps/arc/configure new file +182 -0

182 lines not on this page · raw message

sysdeps/arc/configure.ac new file +26 -0
new file mode 100644
index 000000000000..cb490e47b356
@@ -0,0 +1,26 @@
+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)
+
+# For big endian ABI, generate a symbol for selecting right dynamic linker
+AC_CACHE_CHECK([for big endian],
+  [libc_cv_arc_be],
+  [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__
+                      yes
+                     #endif
+  ], libc_cv_arc_be=yes, libc_cv_arc_be=no)])
+if test $libc_cv_arc_be = yes; then
+  # For shlib-versions.
+  AC_DEFINE(HAVE_ARC_BE)
+  LIBC_CONFIG_VAR([default-abi], [arcbe])
+else
+  LIBC_CONFIG_VAR([default-abi], [arcle])
+fi
sysdeps/arc/nptl/Makefile new file +22 -0
new file mode 100644
index 000000000000..42be62451749
@@ -0,0 +1,22 @@
+# NPTL makefile fragment for ARC.
+# Copyright (C) 2020 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
+# <https://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
sysdeps/arc/preconfigure new file +14 -0
new file mode 100644
index 000000000000..a79db0239ae6
@@ -0,0 +1,14 @@
+case "$machine" in
+arc*)
+  base_machine=arc
+  machine=arc
+
+  gccfloat=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __ARC_FPU_| wc -l`
+  if test "$gccfloat" != "0"; then
+    with_fp_cond=1
+  else
+    with_fp_cond=0
+  fi
+  ;;
+
+esac
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 +29 -0
new file mode 100644
index 000000000000..25d7bbecac07
@@ -0,0 +1,29 @@
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir),signal)
+sysdep_routines += sigrestorer
+endif
+
+ifeq ($(subdir),misc)
+# MIPS/Tile-style cacheflush routine
+sysdep_headers += sys/cachectl.h
+sysdep_routines += cacheflush
+endif
+
+ifeq ($(subdir),elf)
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif
+endif
+
+abi-variants := arcle arcbe
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+$(error Unknown ABI $(default-abi), must be one of $(abi-variants))
+endif
+
+abi-arcle-condition := !defined __BIG_ENDIAN__
+abi-arcbe-condition := defined __BIG_ENDIAN__
sysdeps/unix/sysv/linux/arc/Versions new file +16 -0
new file mode 100644
index 000000000000..292f1974b02a
@@ -0,0 +1,16 @@
+ld {
+  GLIBC_PRIVATE {
+    # used for loading by static libraries
+    _dl_var_init;
+  }
+}
+libc {
+  GLIBC_2.32 {
+    _flush_cache;
+    cacheflush;
+  }
+  GLIBC_PRIVATE {
+    # A copy of sigaction lives in libpthread, and needs these.
+    __default_rt_sa_restorer;
+  }
+}
sysdeps/unix/sysv/linux/arc/configure new file +4 -0
new file mode 100644
index 000000000000..56ec14357507
@@ -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=5.1.0
sysdeps/unix/sysv/linux/arc/configure.ac new file +4 -0
new file mode 100644
index 000000000000..8af5a12cc248
@@ -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=5.1.0
sysdeps/unix/sysv/linux/arc/ldconfig.h new file +27 -0
new file mode 100644
index 000000000000..0d6368e4df02
@@ -0,0 +1,27 @@
+/* ldconfig default paths and libraries.  Linux/RISC-V version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES 		\
+  { "/lib/ld-linux-arc.so.2", FLAG_ELF_LIBC6 },	\
+  { "/lib/ld-linux-arceb.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/shlib-versions new file +7 -0
new file mode 100644
index 000000000000..343c0a04500e
@@ -0,0 +1,7 @@
+DEFAULT                 GLIBC_2.32
+
+%ifdef HAVE_ARC_BE
+ld=ld-linux-arceb.so.2
+%else
+ld=ld-linux-arc.so.2
+%endif
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Reviewed-by on v7 11/13
#47 lore raw

Re: [PATCH v7 11/13] ARC: Build Infrastructure

Quoted 8 lines · Vineet Gupta via Libc-alpha
---
 config.h.in                                |   3 +
 sysdeps/arc/Implies                        |   3 +
 sysdeps/arc/Makefile                       |  21 +++
 sysdeps/arc/Versions                       |   8 +
 sysdeps/arc/configure                      | 182 +++++++++++++++++++++
 sysdeps/arc/configure.ac                   |  26 +++
 sysdeps/arc/nptl/Makefile                  |  22 +++
Quoted 8 lines
 sysdeps/arc/preconfigure                   |  14 ++
 sysdeps/unix/sysv/linux/arc/Implies        |   3 +
 sysdeps/unix/sysv/linux/arc/Makefile       |  29 ++++
 sysdeps/unix/sysv/linux/arc/Versions       |  16 ++
 sysdeps/unix/sysv/linux/arc/configure      |   4 +
 sysdeps/unix/sysv/linux/arc/configure.ac   |   4 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h     |  27 +++
 sysdeps/unix/sysv/linux/arc/shlib-versions |   7 +

LGTM, thanks.

Quoted 21 lines
 15 files changed, 369 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 create mode 100644 sysdeps/arc/Versions
 create mode 100644 sysdeps/arc/configure
 create mode 100644 sysdeps/arc/configure.ac
 create mode 100644 sysdeps/arc/nptl/Makefile
 create mode 100644 sysdeps/arc/preconfigure
 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/configure
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions
config.h.in +0 -0
index 831eca2fe14e..2ed684b7d4e4 100644

config.h.in line 117

Quoted 9 lines
config.h.in +3 -0
@@ -109,6 +109,9 @@
 /* AArch64 big endian ABI */
 #undef HAVE_AARCH64_BE
 
+/* ARC big endian ABI */
+#undef HAVE_ARC_BE
+
 /* C-SKY ABI version.  */
 #undef CSKYABI
 

Ok.

sysdeps/arc/Implies line 3

Quoted 9 lines
sysdeps/arc/Implies new file +3 -0
new file mode 100644
index 000000000000..780c4e246769
@@ -0,0 +1,3 @@
+wordsize-32
+ieee754/flt-32
+ieee754/dbl-64

Ok.

Quoted 17 lines
sysdeps/arc/Makefile new file +11 -0
new file mode 100644
index 000000000000..d5a702e29e58
@@ -0,0 +1,21 @@
+# ARC Makefile
+# Copyright (C) 2020 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

sysdeps/arc/Makefile line 21

Quoted 10 lines
sysdeps/arc/Makefile new file +10 -0
+# 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
+# <https://www.gnu.org/licenses/>.
+
+# 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

Ok.

Quoted 6 lines
sysdeps/arc/Versions new file +0 -0
new file mode 100644
index 000000000000..6ac7b8e49505

sysdeps/arc/Versions line 8

Quoted 8 lines
sysdeps/arc/Versions new file +8 -0
@@ -0,0 +1,8 @@
+libc {
+  GLIBC_2.32 {
+    __mcount;
+  }
+  GLIBC_PRIVATE {
+    __syscall_error;
+  }
+}

Ok.

Quoted 178 lines
sysdeps/arc/configure new file +172 -0
new file mode 100644
index 000000000000..bce7d3c3773d
@@ -0,0 +1,182 @@
+# 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
+
+
+# For big endian ABI, generate a symbol for selecting right dynamic linker
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
+$as_echo_n "checking for big endian... " >&6; }
+if ${libc_cv_arc_be+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __BIG_ENDIAN__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_arc_be=yes
+else
+  libc_cv_arc_be=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arc_be" >&5
+$as_echo "$libc_cv_arc_be" >&6; }

sysdeps/arc/configure line 182

Quoted 10 lines
sysdeps/arc/configure new file +10 -0
+if test $libc_cv_arc_be = yes; then
+  # For shlib-versions.
+  $as_echo "#define HAVE_ARC_BE 1" >>confdefs.h
+
+  config_vars="$config_vars
+default-abi = arcbe"
+else
+  config_vars="$config_vars
+default-abi = arcle"
+fi

Ok.

Quoted 22 lines
sysdeps/arc/configure.ac new file +16 -0
new file mode 100644
index 000000000000..cb490e47b356
@@ -0,0 +1,26 @@
+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)
+
+# For big endian ABI, generate a symbol for selecting right dynamic linker
+AC_CACHE_CHECK([for big endian],
+  [libc_cv_arc_be],
+  [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__

sysdeps/arc/configure.ac line 26

Quoted 10 lines
sysdeps/arc/configure.ac new file +10 -0
+                      yes
+                     #endif
+  ], libc_cv_arc_be=yes, libc_cv_arc_be=no)])
+if test $libc_cv_arc_be = yes; then
+  # For shlib-versions.
+  AC_DEFINE(HAVE_ARC_BE)
+  LIBC_CONFIG_VAR([default-abi], [arcbe])
+else
+  LIBC_CONFIG_VAR([default-abi], [arcle])
+fi

Ok.

Quoted 18 lines
sysdeps/arc/nptl/Makefile new file +12 -0
new file mode 100644
index 000000000000..42be62451749
@@ -0,0 +1,22 @@
+# NPTL makefile fragment for ARC.
+# Copyright (C) 2020 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

sysdeps/arc/nptl/Makefile line 22

Quoted 10 lines
sysdeps/arc/nptl/Makefile new file +10 -0
+# 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
+# <https://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif

Ok.

Quoted 10 lines
sysdeps/arc/preconfigure new file +4 -0
new file mode 100644
index 000000000000..a79db0239ae6
@@ -0,0 +1,14 @@
+case "$machine" in
+arc*)
+  base_machine=arc
+  machine=arc

sysdeps/arc/preconfigure line 14

Quoted 10 lines
sysdeps/arc/preconfigure new file +10 -0
+
+  gccfloat=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __ARC_FPU_| wc -l`
+  if test "$gccfloat" != "0"; then
+    with_fp_cond=1
+  else
+    with_fp_cond=0
+  fi
+  ;;
+
+esac

Ok.

Quoted 34 lines
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 +19 -0
new file mode 100644
index 000000000000..25d7bbecac07
@@ -0,0 +1,29 @@
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir),signal)
+sysdep_routines += sigrestorer
+endif
+
+ifeq ($(subdir),misc)
+# MIPS/Tile-style cacheflush routine
+sysdep_headers += sys/cachectl.h
+sysdep_routines += cacheflush
+endif
+
+ifeq ($(subdir),elf)
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif

sysdeps/unix/sysv/linux/arc/Makefile line 29

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/Makefile new file +10 -0
+endif
+
+abi-variants := arcle arcbe
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+$(error Unknown ABI $(default-abi), must be one of $(abi-variants))
+endif
+
+abi-arcle-condition := !defined __BIG_ENDIAN__
+abi-arcbe-condition := defined __BIG_ENDIAN__

Ok.

Quoted 12 lines
sysdeps/unix/sysv/linux/arc/Versions new file +6 -0
new file mode 100644
index 000000000000..292f1974b02a
@@ -0,0 +1,16 @@
+ld {
+  GLIBC_PRIVATE {
+    # used for loading by static libraries
+    _dl_var_init;
+  }
+}

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

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/Versions new file +10 -0
+libc {
+  GLIBC_2.32 {
+    _flush_cache;
+    cacheflush;
+  }
+  GLIBC_PRIVATE {
+    # A copy of sigaction lives in libpthread, and needs these.
+    __default_rt_sa_restorer;
+  }
+}

Ok.

sysdeps/unix/sysv/linux/arc/configure line 4

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/configure new file +4 -0
new file mode 100644
index 000000000000..56ec14357507
@@ -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=5.1.0

Ok.

sysdeps/unix/sysv/linux/arc/configure.ac line 4

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/configure.ac new file +4 -0
new file mode 100644
index 000000000000..8af5a12cc248
@@ -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=5.1.0

Ok.

Quoted 23 lines
sysdeps/unix/sysv/linux/arc/ldconfig.h new file +17 -0
new file mode 100644
index 000000000000..0d6368e4df02
@@ -0,0 +1,27 @@
+/* ldconfig default paths and libraries.  Linux/RISC-V version.
+   Copyright (C) 2020 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
+   <https://www.gnu.org/licenses/>.  */

sysdeps/unix/sysv/linux/arc/ldconfig.h line 27

Quoted 10 lines
sysdeps/unix/sysv/linux/arc/ldconfig.h new file +10 -0
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES 		\
+  { "/lib/ld-linux-arc.so.2", FLAG_ELF_LIBC6 },	\
+  { "/lib/ld-linux-arceb.so.2", FLAG_ELF_LIBC6 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES 	\
+  { "libc.so.6", FLAG_ELF_LIBC6 },	\
+  { "libm.so.6", FLAG_ELF_LIBC6 },

Ok.

Quoted 7 lines
sysdeps/unix/sysv/linux/arc/shlib-versions new file +0 -0
new file mode 100644
index 000000000000..343c0a04500e

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

Quoted 7 lines
sysdeps/unix/sysv/linux/arc/shlib-versions new file +7 -0
@@ -0,0 +1,7 @@
+DEFAULT                 GLIBC_2.32
+
+%ifdef HAVE_ARC_BE
+ld=ld-linux-arceb.so.2
+%else
+ld=ld-linux-arc.so.2
+%endif

Ok.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#48 lore raw

PATCH v7 12/13 build-many-glibcs.py: Enable ARC builds

In reply to Vineet Gupta
---
 scripts/build-many-glibcs.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
scripts/build-many-glibcs.py +10 -0
index 6c6615b200d9..64f5713530bd 100755
@@ -162,6 +162,15 @@ class Context(object):
                                        'cfg': ['--disable-multi-arch']}])
         self.add_config(arch='aarch64_be',
                         os_name='linux-gnu')
+        self.add_config(arch='arc',
+                        os_name='linux-gnu',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38'])
+        self.add_config(arch='arc',
+                        os_name='linux-gnuhf',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38_linux'])
+        self.add_config(arch='arceb',
+                        os_name='linux-gnu',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38'])
         self.add_config(arch='alpha',
                         os_name='linux-gnu')
         self.add_config(arch='arm',
@@ -1224,6 +1233,7 @@ def install_linux_headers(policy, cmdlist):
     """Install Linux kernel headers."""
     arch_map = {'aarch64': 'arm64',
                 'alpha': 'alpha',
+                'arc': 'arc',
                 'arm': 'arm',
                 'csky': 'csky',
                 'hppa': 'parisc',
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Reviewed-by on v7 12/13
#49 lore raw

Re: [PATCH v7 12/13] build-many-glibcs.py: Enable ARC builds

Quoted 3 lines · Vineet Gupta via Libc-alpha
---
 scripts/build-many-glibcs.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

LGTM, thanks.

Quoted 23 lines
scripts/build-many-glibcs.py +9 -0
index 6c6615b200d9..64f5713530bd 100755
@@ -162,6 +162,15 @@ class Context(object):
                                        'cfg': ['--disable-multi-arch']}])
         self.add_config(arch='aarch64_be',
                         os_name='linux-gnu')
+        self.add_config(arch='arc',
+                        os_name='linux-gnu',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38'])
+        self.add_config(arch='arc',
+                        os_name='linux-gnuhf',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38_linux'])
+        self.add_config(arch='arceb',
+                        os_name='linux-gnu',
+                        gcc_cfg=['--disable-multilib', '--with-cpu=hs38'])
         self.add_config(arch='alpha',
                         os_name='linux-gnu')
         self.add_config(arch='arm',

scripts/build-many-glibcs.py def install_linux_headers(policy, cmdlist): · line 1239

Quoted 7 lines
scripts/build-many-glibcs.py +1 -0
@@ -1224,6 +1233,7 @@ def install_linux_headers(policy, cmdlist):
     """Install Linux kernel headers."""
     arch_map = {'aarch64': 'arm64',
                 'alpha': 'alpha',
+                'arc': 'arc',
                 'arm': 'arm',
                 'csky': 'csky',
                 'hppa': 'parisc',

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#50 lore raw

PATCH v7 13/13 Documentation for ARC port

In reply to Vineet Gupta
---
 NEWS                | 11 +++++++++++
 README              |  1 +
 manual/install.texi |  4 ++++
 3 files changed, 16 insertions(+)
NEWS +11 -0
index a660fc59a89e..db65fea8b6ec 100644
@@ -15,6 +15,17 @@ Major new features:
 
 * New locale added: ckb_IQ (Kurdish/Sorani spoken in Iraq)
 
+* Support for Synopsys ARC HS cores (ARCv2 ISA) running Linux has been
+  added. This port requires at least binutils-2.32, gcc-8.3 and Linux-5.1.
+  Three ABIs are supported:
+
+     - arc-linux-gnu
+     - arc-linux-gnuhf
+     - arceb-linux-gnu
+
+  The arc* ABI is little-endian while arceb is big-endian. All ABIs use
+  64-bit time (y2038 safe) and 64-bit file offsets (LFS default).
+
 * The GNU C Library now loads audit modules listed in the DT_AUDIT and
   DT_DEPAUDIT dynamic section entries of the main executable.
 
README +1 -0
index 31c5da0405bd..903f07e4840a 100644
@@ -24,6 +24,7 @@ The GNU C Library supports these configurations for using Linux kernels:
 
 	aarch64*-*-linux-gnu
 	alpha*-*-linux-gnu
+	arc*-*-linux-gnu
 	arm-*-linux-gnueabi
 	csky-*-linux-gnuabiv2
 	hppa-*-linux-gnu
manual/install.texi +4 -0
index c1e49a94fed3..74cb90a91331 100644
@@ -522,6 +522,8 @@ Library with support for IEEE long double.
 @c powerpc64le performs an autoconf test to verify the compiler compiles with
 @c commands like "$CC -c foo.c -mabi=ibmlongdouble -mlong-double-128".
 
+For ARC architecture builds, GCC 8.3 or higher is needed.
+
 For multi-arch support it is recommended to use a GCC which has been built with
 support for GNU indirect functions.  This ensures that correct debugging
 information is generated for functions selected by IFUNC resolvers.  This
@@ -547,6 +549,8 @@ For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
 to support @option{--update-section}.  This option requires binutils 2.26 or
 newer.
 
+ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
+
 @item
 GNU @code{texinfo} 4.7 or later
 
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Reviewed-by on v7 13/13
#51 lore raw

Re: [PATCH v7 13/13] Documentation for ARC port

Quoted 4 lines · Vineet Gupta via Libc-alpha
---
 NEWS                | 11 +++++++++++
 README              |  1 +
 manual/install.texi |  4 ++++

LGTM, thanks.

Quoted 14 lines
 3 files changed, 16 insertions(+)
NEWS +4 -0
index a660fc59a89e..db65fea8b6ec 100644
@@ -15,6 +15,17 @@ Major new features:
 
 * New locale added: ckb_IQ (Kurdish/Sorani spoken in Iraq)
 
+* Support for Synopsys ARC HS cores (ARCv2 ISA) running Linux has been
+  added. This port requires at least binutils-2.32, gcc-8.3 and Linux-5.1.
+  Three ABIs are supported:
+

NEWS Major new features: · line 31

Quoted 10 lines
NEWS +7 -0
+     - arc-linux-gnu
+     - arc-linux-gnuhf
+     - arceb-linux-gnu
+
+  The arc* ABI is little-endian while arceb is big-endian. All ABIs use
+  64-bit time (y2038 safe) and 64-bit file offsets (LFS default).
+
 * The GNU C Library now loads audit modules listed in the DT_AUDIT and
   DT_DEPAUDIT dynamic section entries of the main executable.
 

Ok.

README The GNU C Library supports these configurations for using Linux kernels: · line 30

Quoted 12 lines
README +1 -0
index 31c5da0405bd..903f07e4840a 100644
@@ -24,6 +24,7 @@ The GNU C Library supports these configurations for using Linux kernels:
 
 	aarch64*-*-linux-gnu
 	alpha*-*-linux-gnu
+	arc*-*-linux-gnu
 	arm-*-linux-gnueabi
 	csky-*-linux-gnuabiv2
 	hppa-*-linux-gnu

Ok.

Quoted 15 lines
manual/install.texi +2 -0
index c1e49a94fed3..74cb90a91331 100644
@@ -522,6 +522,8 @@ Library with support for IEEE long double.
 @c powerpc64le performs an autoconf test to verify the compiler compiles with
 @c commands like "$CC -c foo.c -mabi=ibmlongdouble -mlong-double-128".
 
+For ARC architecture builds, GCC 8.3 or higher is needed.
+
 For multi-arch support it is recommended to use a GCC which has been built with
 support for GNU indirect functions.  This ensures that correct debugging
 information is generated for functions selected by IFUNC resolvers.  This

manual/install.texi For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required · line 556

Quoted 8 lines
manual/install.texi +2 -0
@@ -547,6 +549,8 @@ For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
 to support @option{--update-section}.  This option requires binutils 2.26 or
 newer.
 
+ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
+
 @item
 GNU @code{texinfo} 4.7 or later
 

Ok.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#52 lore raw
In reply to Vineet Gupta
Quoted 3 lines · Vineet Gupta

Hi,

This patchset implements glibc port to ARC HS48x processor from Synopsys.

ping !

Quoted 369 lines

[email protected]:foss-for-synopsys-dwc-arc-processors/glibc.git upstream-v7

v7:
* Addresses review comments from Adhemerval Zanella and Florian Weimer (many thx to you both)
* Dropped ARC specific semaphore.h (following upstream 1270fbaaeebe)
* ARC specific dl-runtime.h (following upstream 8dbb7a08ec52)
* ARC specific math-use-builtins.h and dropped ARC specific sqrt/fma routines (math-use-builtins.h will be disintegrated once done upstream)
* setjmp/longjmp to save GP, no need to save r25 (thread pointer)
* makecontext/startcontext use r14/r15 (vs. r13/r14)
* flatten out register file in mcontext_t (remove scratch/callee)
* Use of 'C' comments in asm code, LDR/STR macros
* Use of L (..) in asm code
* Dropped asm global register r25 specification for thread pointer and rely on __builtin_thread_pointer
* NEWS update rewording
* Sweeping update of Copyright year 2020
v6:
* Dropped 11/14: merged upstream
* _FPU_SETS() inline asm reworked
* Introduce fixup-asm-unistd.h to elide 32-bit time, offset syscalls and regenerate arch-syscall.h
* Fix snafu in updating build-many-glibcs for ARC
* More code sytle fixes flagged by Joseph
v5:
* Big Endian formally supported as multi-ABI
* Removed code for ARC700 processors
* Hard-float code updates: fegetmode, fesetround, feupdateenv
* socket-constant.h update for 64-bit ABI spun off as standalone patch
* __syscall_error made glibc_private
* math ulps regen
* gmp-mparam.h removed
* lint fixes as flagged by Joseph
v4:
* Dropped 1/17: Merged upstream
* Dropped 17/17:
- 64-bit time/offset code chunked up into respective patches
* sysctl removed
* Updated README for arc gnu triplet
* Updated install files for ARC gcc/binutils requirements
* Updated NEWS with brief ISA/ABI info

v3:
* Support for Hardware Floating Point
* 64-bit time and offsets ABI (although all such changes are confined to a single patch)

v5: https://sourceware.org/pipermail/libc-alpha/2020-April/112657.html
v4: https://sourceware.org/pipermail/libc-alpha/2020-March/111855.html
v3: https://sourceware.org/legacy-ml/libc-alpha/2020-03/msg00167.html
v2: https://sourceware.org/legacy-ml/libc-alpha/2019-01/msg00681.html
v1: https://sourceware.org/legacy-ml/libc-alpha/2018-12/msg00678.html

Documentation:
--------------

(a) ABI doc:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki/files/ARCv2_ABI.pdf

(b) Programmer's Reference Manual (PRM) : needs a download request to be filled
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs44-hs46-hs48
https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf

Test Results:
--------------
(a) build-many-glibcs.py

| Summary of test results:
|   1251 PASS
|     15 XFAIL

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Bulk of failures come from cross testing setup and I intend to improve things with native testing going forward.

| Summary of test results:
|     30 FAIL   (-3)
|
| FAIL: csu/test-as-const-tcb-offsets

+ FAIL: elf/tst-audit14
+ FAIL: elf/tst-audit15
+ FAIL: elf/tst-audit16
| FAIL: elf/tst-ldconfig-ld_so_conf-update # not true: dlopen
| FAIL: iconv/test-iconvconfig # Needs gconv installed
- FAIL: iconv/tst-gconv-init-failure
| FAIL: io/ftwtest # Requires execution by non-root
- FAIL: io/tst-futimesat

| FAIL: io/tst-lockf
| FAIL: libio/tst-wfile-sync
| FAIL: locale/tst-C-locale
| FAIL: locale/tst-duplocale
| FAIL: locale/tst-locale-locpath
| FAIL: locale/tst-locname
| FAIL: localedata/sort-test
| FAIL: nptl/test-cond-printers		# needs Python3 and target GDB on target
| FAIL: nptl/test-condattr-printers	#    ditto
| FAIL: nptl/test-mutex-printers	#    ditto
| FAIL: nptl/test-mutexattr-printers	#    ditto
| FAIL: nptl/test-rwlock-printers	#    ditto
| FAIL: nptl/test-rwlockattr-printers	#    ditto
| FAIL: nptl/tst-umask1			# passes if run natively on target (NFS ACLv3 support needed)
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent	# Timed out
| FAIL: nss/tst-nss-files-hosts-multi	# Timed out
| FAIL: posix/bug-ga2			# DNS issue: google DNS vs. SNPS
| FAIL: posix/globtest			# require same user on target and host
| FAIL: posix/tst-getaddrinfo5		# passes outside corporate network

- FAIL: resolv/tst-resolv-basic
- FAIL: resolv/tst-resolv-edns
- FAIL: resolv/tst-resolv-rotate
- FAIL: resolv/tst-resolv-search

| FAIL: stdio-common/bug22		# Needs more RAM: 2 GB memory
| FAIL: sunrpc/bug20790			# missing cpp on target
| FAIL: timezone/tst-tzset		# passes outside corporate network

kindly review.

Thx,
-Vineet

Vineet Gupta (13):
ARC: ABI Implementation
ARC: startup and dynamic linking code
ARC: Thread Local Storage support
ARC: Atomics and Locking primitives
ARC: math soft float support
ARC: hardware floating point support
ARC: Linux Syscall Interface
ARC: Linux ABI
ARC: Linux Startup and Dynamic Loading
ARC: ABI lists
ARC: Build Infrastructure
build-many-glibcs.py: Enable ARC builds
Documentation for ARC port

 NEWS                                          |   11 +
 README                                        |    1 +
 config.h.in                                   |    3 +
 manual/install.texi                           |    4 +
 scripts/build-many-glibcs.py                  |   10 +
 sysdeps/arc/Implies                           |    3 +
 sysdeps/arc/Makefile                          |   21 +
 sysdeps/arc/Versions                          |    8 +
 sysdeps/arc/__longjmp.S                       |   49 +
 sysdeps/arc/abort-instr.h                     |    2 +
 sysdeps/arc/atomic-machine.h                  |   69 +
 sysdeps/arc/bits/endianness.h                 |   15 +
 sysdeps/arc/bits/fenv.h                       |   78 +
 sysdeps/arc/bits/link.h                       |   52 +
 sysdeps/arc/bits/setjmp.h                     |   26 +
 sysdeps/arc/bsd-_setjmp.S                     |    1 +
 sysdeps/arc/bsd-setjmp.S                      |    1 +
 sysdeps/arc/configure                         |  182 ++
 sysdeps/arc/configure.ac                      |   26 +
 sysdeps/arc/dl-machine.h                      |  341 +++
 sysdeps/arc/dl-runtime.h                      |   42 +
 sysdeps/arc/dl-sysdep.h                       |   25 +
 sysdeps/arc/dl-tls.h                          |   30 +
 sysdeps/arc/dl-trampoline.S                   |   72 +
 sysdeps/arc/entry.h                           |    5 +
 sysdeps/arc/fpu/fclrexcpt.c                   |   36 +
 sysdeps/arc/fpu/fegetenv.c                    |   37 +
 sysdeps/arc/fpu/fegetmode.c                   |   31 +
 sysdeps/arc/fpu/fegetround.c                  |   32 +
 sysdeps/arc/fpu/feholdexcpt.c                 |   43 +
 sysdeps/arc/fpu/fesetenv.c                    |   48 +
 sysdeps/arc/fpu/fesetexcept.c                 |   32 +
 sysdeps/arc/fpu/fesetmode.c                   |   40 +
 sysdeps/arc/fpu/fesetround.c                  |   40 +
 sysdeps/arc/fpu/feupdateenv.c                 |   51 +
 sysdeps/arc/fpu/fgetexcptflg.c                |   31 +
 sysdeps/arc/fpu/fraiseexcpt.c                 |   39 +
 sysdeps/arc/fpu/fsetexcptflg.c                |   38 +
 sysdeps/arc/fpu/ftestexcept.c                 |   33 +
 sysdeps/arc/fpu/libm-test-ulps                | 1140 +++++++++
 sysdeps/arc/fpu/libm-test-ulps-name           |    1 +
 sysdeps/arc/fpu/math-use-builtins.h           |   70 +
 sysdeps/arc/fpu_control.h                     |  106 +
 sysdeps/arc/gccframe.h                        |   21 +
 sysdeps/arc/get-rounding-mode.h               |   38 +
 sysdeps/arc/jmpbuf-offsets.h                  |   22 +
 sysdeps/arc/jmpbuf-unwind.h                   |   47 +
 sysdeps/arc/ldsodefs.h                        |   43 +
 sysdeps/arc/libc-tls.c                        |   27 +
 sysdeps/arc/machine-gmon.h                    |   35 +
 sysdeps/arc/math-tests-trap.h                 |   27 +
 sysdeps/arc/memusage.h                        |   23 +
 sysdeps/arc/nofpu/Implies                     |    1 +
 sysdeps/arc/nofpu/libm-test-ulps              |  270 +++
 sysdeps/arc/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/arc/nofpu/math-tests-exceptions.h     |   27 +
 sysdeps/arc/nofpu/math-tests-rounding.h       |   27 +
 sysdeps/arc/nptl/Makefile                     |   22 +
 sysdeps/arc/nptl/pthreaddef.h                 |   32 +
 sysdeps/arc/nptl/tcb-offsets.sym              |   11 +
 sysdeps/arc/nptl/tls.h                        |  148 ++
 sysdeps/arc/preconfigure                      |   14 +
 sysdeps/arc/setjmp.S                          |   66 +
 sysdeps/arc/sfp-machine.h                     |   70 +
 sysdeps/arc/sotruss-lib.c                     |   50 +
 sysdeps/arc/stackinfo.h                       |   33 +
 sysdeps/arc/start.S                           |   74 +
 sysdeps/arc/sysdep.h                          |   53 +
 sysdeps/arc/tininess.h                        |    1 +
 sysdeps/arc/tls-macros.h                      |   47 +
 sysdeps/arc/tst-audit.h                       |   23 +
 sysdeps/unix/sysv/linux/arc/Implies           |    3 +
 sysdeps/unix/sysv/linux/arc/Makefile          |   29 +
 sysdeps/unix/sysv/linux/arc/Versions          |   16 +
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    |  303 +++
 sysdeps/unix/sysv/linux/arc/bits/procfs.h     |   35 +
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |   21 +
 .../sysv/linux/arc/bits/types/__sigset_t.h    |   12 +
 sysdeps/unix/sysv/linux/arc/c++-types.data    |   67 +
 sysdeps/unix/sysv/linux/arc/clone.S           |   93 +
 sysdeps/unix/sysv/linux/arc/configure         |    4 +
 sysdeps/unix/sysv/linux/arc/configure.ac      |    4 +
 sysdeps/unix/sysv/linux/arc/dl-static.c       |   84 +
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |   41 +
 sysdeps/unix/sysv/linux/arc/getcontext.S      |   64 +
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |    6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |   27 +
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |   26 +
 sysdeps/unix/sysv/linux/arc/ld.abilist        |    5 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h        |   27 +
 sysdeps/unix/sysv/linux/arc/ldsodefs.h        |   32 +
 .../sysv/linux/arc/libBrokenLocale.abilist    |    1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist    |    4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      | 2084 +++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist  |    2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist     |    9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist      |  699 ++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  213 ++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist     |   35 +
 .../unix/sysv/linux/arc/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |    6 +
 sysdeps/unix/sysv/linux/arc/localplt.data     |   12 +
 sysdeps/unix/sysv/linux/arc/makecontext.c     |   73 +
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |   27 +
 sysdeps/unix/sysv/linux/arc/setcontext.S      |   93 +
 sysdeps/unix/sysv/linux/arc/shlib-versions    |    7 +
 sysdeps/unix/sysv/linux/arc/sigaction.c       |   31 +
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h  |   28 +
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |   29 +
 sysdeps/unix/sysv/linux/arc/swapcontext.S     |   94 +
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h    |   35 +
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h    |   57 +
 sysdeps/unix/sysv/linux/arc/sys/user.h        |   31 +
 sysdeps/unix/sysv/linux/arc/syscall.S         |   33 +
 sysdeps/unix/sysv/linux/arc/syscalls.list     |    3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |   33 +
 sysdeps/unix/sysv/linux/arc/sysdep.h          |  224 ++
 sysdeps/unix/sysv/linux/arc/ucontext-macros.h |   25 +
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym    |   20 +
 sysdeps/unix/sysv/linux/arc/vfork.S           |   42 +
 121 files changed, 9146 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 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/bits/endianness.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/dl-machine.h
 create mode 100644 sysdeps/arc/dl-runtime.h
 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/fpu/fclrexcpt.c
 create mode 100644 sysdeps/arc/fpu/fegetenv.c
 create mode 100644 sysdeps/arc/fpu/fegetmode.c
 create mode 100644 sysdeps/arc/fpu/fegetround.c
 create mode 100644 sysdeps/arc/fpu/feholdexcpt.c
 create mode 100644 sysdeps/arc/fpu/fesetenv.c
 create mode 100644 sysdeps/arc/fpu/fesetexcept.c
 create mode 100644 sysdeps/arc/fpu/fesetmode.c
 create mode 100644 sysdeps/arc/fpu/fesetround.c
 create mode 100644 sysdeps/arc/fpu/feupdateenv.c
 create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/ftestexcept.c
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/fpu/math-use-builtins.h
 create mode 100644 sysdeps/arc/fpu_control.h
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/get-rounding-mode.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/machine-gmon.h
 create mode 100644 sysdeps/arc/math-tests-trap.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/nofpu/Implies
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/arc/nptl/Makefile
 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/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/tininess.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-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 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/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.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/ldsodefs.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/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/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.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/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h
Quoted 9 lines
 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/syscalls.list
 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-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#53 lore raw
Quoted 6 lines · Vineet Gupta via Libc-alpha
Quoted 3 lines · Vineet Gupta

Hi,

This patchset implements glibc port to ARC HS48x processor from Synopsys.

ping !

ping ^2 !

I've posted the incremental series (v7.1) as a followup to include rebase fixes since v7. The changes are minimal and documented in respective patches. Kindly review so we can get this in, in this cycle.

Thx,
-Vineet

Quoted 371 lines
Quoted 371 lines

[email protected]:foss-for-synopsys-dwc-arc-processors/glibc.git upstream-v7

v7:
* Addresses review comments from Adhemerval Zanella and Florian Weimer (many thx to you both)
* Dropped ARC specific semaphore.h (following upstream 1270fbaaeebe)
* ARC specific dl-runtime.h (following upstream 8dbb7a08ec52)
* ARC specific math-use-builtins.h and dropped ARC specific sqrt/fma routines (math-use-builtins.h will be disintegrated once done upstream)
* setjmp/longjmp to save GP, no need to save r25 (thread pointer)
* makecontext/startcontext use r14/r15 (vs. r13/r14)
* flatten out register file in mcontext_t (remove scratch/callee)
* Use of 'C' comments in asm code, LDR/STR macros
* Use of L (..) in asm code
* Dropped asm global register r25 specification for thread pointer and rely on __builtin_thread_pointer
* NEWS update rewording
* Sweeping update of Copyright year 2020
v6:
* Dropped 11/14: merged upstream
* _FPU_SETS() inline asm reworked
* Introduce fixup-asm-unistd.h to elide 32-bit time, offset syscalls and regenerate arch-syscall.h
* Fix snafu in updating build-many-glibcs for ARC
* More code sytle fixes flagged by Joseph
v5:
* Big Endian formally supported as multi-ABI
* Removed code for ARC700 processors
* Hard-float code updates: fegetmode, fesetround, feupdateenv
* socket-constant.h update for 64-bit ABI spun off as standalone patch
* __syscall_error made glibc_private
* math ulps regen
* gmp-mparam.h removed
* lint fixes as flagged by Joseph
v4:
* Dropped 1/17: Merged upstream
* Dropped 17/17:
- 64-bit time/offset code chunked up into respective patches
* sysctl removed
* Updated README for arc gnu triplet
* Updated install files for ARC gcc/binutils requirements
* Updated NEWS with brief ISA/ABI info

v3:
* Support for Hardware Floating Point
* 64-bit time and offsets ABI (although all such changes are confined to a single patch)

v5: https://sourceware.org/pipermail/libc-alpha/2020-April/112657.html
v4: https://sourceware.org/pipermail/libc-alpha/2020-March/111855.html
v3: https://sourceware.org/legacy-ml/libc-alpha/2020-03/msg00167.html
v2: https://sourceware.org/legacy-ml/libc-alpha/2019-01/msg00681.html
v1: https://sourceware.org/legacy-ml/libc-alpha/2018-12/msg00678.html

Documentation:
--------------

(a) ABI doc:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki/files/ARCv2_ABI.pdf

(b) Programmer's Reference Manual (PRM) : needs a download request to be filled
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs44-hs46-hs48
https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf

Test Results:
--------------
(a) build-many-glibcs.py

| Summary of test results:
|   1251 PASS
|     15 XFAIL

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Bulk of failures come from cross testing setup and I intend to improve things with native testing going forward.

| Summary of test results:
|     30 FAIL   (-3)
|
| FAIL: csu/test-as-const-tcb-offsets

+ FAIL: elf/tst-audit14
+ FAIL: elf/tst-audit15
+ FAIL: elf/tst-audit16
| FAIL: elf/tst-ldconfig-ld_so_conf-update # not true: dlopen
| FAIL: iconv/test-iconvconfig # Needs gconv installed
- FAIL: iconv/tst-gconv-init-failure
| FAIL: io/ftwtest # Requires execution by non-root
- FAIL: io/tst-futimesat

| FAIL: io/tst-lockf
| FAIL: libio/tst-wfile-sync
| FAIL: locale/tst-C-locale
| FAIL: locale/tst-duplocale
| FAIL: locale/tst-locale-locpath
| FAIL: locale/tst-locname
| FAIL: localedata/sort-test
| FAIL: nptl/test-cond-printers		# needs Python3 and target GDB on target
| FAIL: nptl/test-condattr-printers	#    ditto
| FAIL: nptl/test-mutex-printers	#    ditto
| FAIL: nptl/test-mutexattr-printers	#    ditto
| FAIL: nptl/test-rwlock-printers	#    ditto
| FAIL: nptl/test-rwlockattr-printers	#    ditto
| FAIL: nptl/tst-umask1			# passes if run natively on target (NFS ACLv3 support needed)
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent	# Timed out
| FAIL: nss/tst-nss-files-hosts-multi	# Timed out
| FAIL: posix/bug-ga2			# DNS issue: google DNS vs. SNPS
| FAIL: posix/globtest			# require same user on target and host
| FAIL: posix/tst-getaddrinfo5		# passes outside corporate network

- FAIL: resolv/tst-resolv-basic
- FAIL: resolv/tst-resolv-edns
- FAIL: resolv/tst-resolv-rotate
- FAIL: resolv/tst-resolv-search

| FAIL: stdio-common/bug22		# Needs more RAM: 2 GB memory
| FAIL: sunrpc/bug20790			# missing cpp on target
| FAIL: timezone/tst-tzset		# passes outside corporate network

kindly review.

Thx,
-Vineet

Vineet Gupta (13):
ARC: ABI Implementation
ARC: startup and dynamic linking code
ARC: Thread Local Storage support
ARC: Atomics and Locking primitives
ARC: math soft float support
ARC: hardware floating point support
ARC: Linux Syscall Interface
ARC: Linux ABI
ARC: Linux Startup and Dynamic Loading
ARC: ABI lists
ARC: Build Infrastructure
build-many-glibcs.py: Enable ARC builds
Documentation for ARC port

 NEWS                                          |   11 +
 README                                        |    1 +
 config.h.in                                   |    3 +
 manual/install.texi                           |    4 +
 scripts/build-many-glibcs.py                  |   10 +
 sysdeps/arc/Implies                           |    3 +
 sysdeps/arc/Makefile                          |   21 +
 sysdeps/arc/Versions                          |    8 +
 sysdeps/arc/__longjmp.S                       |   49 +
 sysdeps/arc/abort-instr.h                     |    2 +
 sysdeps/arc/atomic-machine.h                  |   69 +
 sysdeps/arc/bits/endianness.h                 |   15 +
 sysdeps/arc/bits/fenv.h                       |   78 +
 sysdeps/arc/bits/link.h                       |   52 +
 sysdeps/arc/bits/setjmp.h                     |   26 +
 sysdeps/arc/bsd-_setjmp.S                     |    1 +
 sysdeps/arc/bsd-setjmp.S                      |    1 +
 sysdeps/arc/configure                         |  182 ++
 sysdeps/arc/configure.ac                      |   26 +
 sysdeps/arc/dl-machine.h                      |  341 +++
 sysdeps/arc/dl-runtime.h                      |   42 +
 sysdeps/arc/dl-sysdep.h                       |   25 +
 sysdeps/arc/dl-tls.h                          |   30 +
 sysdeps/arc/dl-trampoline.S                   |   72 +
 sysdeps/arc/entry.h                           |    5 +
 sysdeps/arc/fpu/fclrexcpt.c                   |   36 +
 sysdeps/arc/fpu/fegetenv.c                    |   37 +
 sysdeps/arc/fpu/fegetmode.c                   |   31 +
 sysdeps/arc/fpu/fegetround.c                  |   32 +
 sysdeps/arc/fpu/feholdexcpt.c                 |   43 +
 sysdeps/arc/fpu/fesetenv.c                    |   48 +
 sysdeps/arc/fpu/fesetexcept.c                 |   32 +
 sysdeps/arc/fpu/fesetmode.c                   |   40 +
 sysdeps/arc/fpu/fesetround.c                  |   40 +
 sysdeps/arc/fpu/feupdateenv.c                 |   51 +
 sysdeps/arc/fpu/fgetexcptflg.c                |   31 +
 sysdeps/arc/fpu/fraiseexcpt.c                 |   39 +
 sysdeps/arc/fpu/fsetexcptflg.c                |   38 +
 sysdeps/arc/fpu/ftestexcept.c                 |   33 +
 sysdeps/arc/fpu/libm-test-ulps                | 1140 +++++++++
 sysdeps/arc/fpu/libm-test-ulps-name           |    1 +
 sysdeps/arc/fpu/math-use-builtins.h           |   70 +
 sysdeps/arc/fpu_control.h                     |  106 +
 sysdeps/arc/gccframe.h                        |   21 +
 sysdeps/arc/get-rounding-mode.h               |   38 +
 sysdeps/arc/jmpbuf-offsets.h                  |   22 +
 sysdeps/arc/jmpbuf-unwind.h                   |   47 +
 sysdeps/arc/ldsodefs.h                        |   43 +
 sysdeps/arc/libc-tls.c                        |   27 +
 sysdeps/arc/machine-gmon.h                    |   35 +
 sysdeps/arc/math-tests-trap.h                 |   27 +
 sysdeps/arc/memusage.h                        |   23 +
 sysdeps/arc/nofpu/Implies                     |    1 +
 sysdeps/arc/nofpu/libm-test-ulps              |  270 +++
 sysdeps/arc/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/arc/nofpu/math-tests-exceptions.h     |   27 +
 sysdeps/arc/nofpu/math-tests-rounding.h       |   27 +
 sysdeps/arc/nptl/Makefile                     |   22 +
 sysdeps/arc/nptl/pthreaddef.h                 |   32 +
 sysdeps/arc/nptl/tcb-offsets.sym              |   11 +
 sysdeps/arc/nptl/tls.h                        |  148 ++
 sysdeps/arc/preconfigure                      |   14 +
 sysdeps/arc/setjmp.S                          |   66 +
 sysdeps/arc/sfp-machine.h                     |   70 +
 sysdeps/arc/sotruss-lib.c                     |   50 +
 sysdeps/arc/stackinfo.h                       |   33 +
 sysdeps/arc/start.S                           |   74 +
 sysdeps/arc/sysdep.h                          |   53 +
 sysdeps/arc/tininess.h                        |    1 +
 sysdeps/arc/tls-macros.h                      |   47 +
 sysdeps/arc/tst-audit.h                       |   23 +
 sysdeps/unix/sysv/linux/arc/Implies           |    3 +
 sysdeps/unix/sysv/linux/arc/Makefile          |   29 +
 sysdeps/unix/sysv/linux/arc/Versions          |   16 +
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    |  303 +++
 sysdeps/unix/sysv/linux/arc/bits/procfs.h     |   35 +
 sysdeps/unix/sysv/linux/arc/bits/timesize.h   |   21 +
 .../sysv/linux/arc/bits/types/__sigset_t.h    |   12 +
 sysdeps/unix/sysv/linux/arc/c++-types.data    |   67 +
 sysdeps/unix/sysv/linux/arc/clone.S           |   93 +
 sysdeps/unix/sysv/linux/arc/configure         |    4 +
 sysdeps/unix/sysv/linux/arc/configure.ac      |    4 +
 sysdeps/unix/sysv/linux/arc/dl-static.c       |   84 +
 .../unix/sysv/linux/arc/fixup-asm-unistd.h    |   41 +
 sysdeps/unix/sysv/linux/arc/getcontext.S      |   64 +
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |    6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |   27 +
 sysdeps/unix/sysv/linux/arc/kernel_stat.h     |   26 +
 sysdeps/unix/sysv/linux/arc/ld.abilist        |    5 +
 sysdeps/unix/sysv/linux/arc/ldconfig.h        |   27 +
 sysdeps/unix/sysv/linux/arc/ldsodefs.h        |   32 +
 .../sysv/linux/arc/libBrokenLocale.abilist    |    1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist    |    4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      | 2084 +++++++++++++++++
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist  |    2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist     |    9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist      |  699 ++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  213 ++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist     |   35 +
 .../unix/sysv/linux/arc/libthread_db.abilist  |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |    6 +
 sysdeps/unix/sysv/linux/arc/localplt.data     |   12 +
 sysdeps/unix/sysv/linux/arc/makecontext.c     |   73 +
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |   27 +
 sysdeps/unix/sysv/linux/arc/setcontext.S      |   93 +
 sysdeps/unix/sysv/linux/arc/shlib-versions    |    7 +
 sysdeps/unix/sysv/linux/arc/sigaction.c       |   31 +
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h  |   28 +
 sysdeps/unix/sysv/linux/arc/sigrestorer.S     |   29 +
 sysdeps/unix/sysv/linux/arc/swapcontext.S     |   94 +
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h    |   35 +
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h    |   57 +
 sysdeps/unix/sysv/linux/arc/sys/user.h        |   31 +
 sysdeps/unix/sysv/linux/arc/syscall.S         |   33 +
 sysdeps/unix/sysv/linux/arc/syscalls.list     |    3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c          |   33 +
 sysdeps/unix/sysv/linux/arc/sysdep.h          |  224 ++
 sysdeps/unix/sysv/linux/arc/ucontext-macros.h |   25 +
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym    |   20 +
 sysdeps/unix/sysv/linux/arc/vfork.S           |   42 +
 121 files changed, 9146 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 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/bits/endianness.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/dl-machine.h
 create mode 100644 sysdeps/arc/dl-runtime.h
 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/fpu/fclrexcpt.c
 create mode 100644 sysdeps/arc/fpu/fegetenv.c
 create mode 100644 sysdeps/arc/fpu/fegetmode.c
 create mode 100644 sysdeps/arc/fpu/fegetround.c
 create mode 100644 sysdeps/arc/fpu/feholdexcpt.c
 create mode 100644 sysdeps/arc/fpu/fesetenv.c
 create mode 100644 sysdeps/arc/fpu/fesetexcept.c
 create mode 100644 sysdeps/arc/fpu/fesetmode.c
 create mode 100644 sysdeps/arc/fpu/fesetround.c
 create mode 100644 sysdeps/arc/fpu/feupdateenv.c
 create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/arc/fpu/ftestexcept.c
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/fpu/math-use-builtins.h
 create mode 100644 sysdeps/arc/fpu_control.h
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/get-rounding-mode.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/machine-gmon.h
 create mode 100644 sysdeps/arc/math-tests-trap.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/nofpu/Implies
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/arc/nptl/Makefile
 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/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/tininess.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-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 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/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.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/ldsodefs.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/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/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.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/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/user.h
Quoted 9 lines
Quoted 8 lines
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
 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-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#54 lore raw
Quoted 6 lines · Vineet Gupta
Quoted 5 lines · Vineet Gupta via Libc-alpha
Quoted 3 lines · Vineet Gupta

Hi,

This patchset implements glibc port to ARC HS48x processor from Synopsys.

Quoted 7 lines
Quoted 1 line

ping !

ping ^2 !

I've posted the incremental series (v7.1) as a followup to include rebase fixes since v7. The changes are minimal and documented in respective patches. Kindly review so we can get this in, in this cycle.

Thanks for your patience, I will help wrap this up so we can include in on 2.32.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Bulk of failures come from cross testing setup and I intend to improve things with native testing going forward.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
| Summary of test results:
|     30 FAIL   (-3)
|
| FAIL: csu/test-as-const-tcb-offsets

+ FAIL: elf/tst-audit14
+ FAIL: elf/tst-audit15
+ FAIL: elf/tst-audit16

Any idea what it might the culprit here?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

| FAIL: elf/tst-ldconfig-ld_so_conf-update # not true: dlopen
| FAIL: iconv/test-iconvconfig # Needs gconv installed
- FAIL: iconv/tst-gconv-init-failure
| FAIL: io/ftwtest # Requires execution by non-root
- FAIL: io/tst-futimesat
| FAIL: io/tst-lockf
| FAIL: libio/tst-wfile-sync

Could it be related to NFS usage as well?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
| FAIL: locale/tst-C-locale
| FAIL: locale/tst-duplocale
| FAIL: locale/tst-locale-locpath
| FAIL: locale/tst-locname
| FAIL: localedata/sort-test

Any idea why locale is not being working here (these tests are really simple, maybe another issue related to the filesystem)?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
| FAIL: nptl/test-cond-printers		# needs Python3 and target GDB on target
| FAIL: nptl/test-condattr-printers	#    ditto
| FAIL: nptl/test-mutex-printers	#    ditto
| FAIL: nptl/test-mutexattr-printers	#    ditto
| FAIL: nptl/test-rwlock-printers	#    ditto
| FAIL: nptl/test-rwlockattr-printers	#    ditto
| FAIL: nptl/tst-umask1			# passes if run natively on target (NFS ACLv3 support needed)
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent	# Timed out
| FAIL: nss/tst-nss-files-hosts-multi	# Timed out
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
| FAIL: posix/bug-ga2			# DNS issue: google DNS vs. SNPS
| FAIL: posix/globtest			# require same user on target and host
| FAIL: posix/tst-getaddrinfo5		# passes outside corporate network

- FAIL: resolv/tst-resolv-basic
- FAIL: resolv/tst-resolv-edns
- FAIL: resolv/tst-resolv-rotate
- FAIL: resolv/tst-resolv-search
| FAIL: stdio-common/bug22 # Needs more RAM: 2 GB memory

We might try to enhance this test to avoid require too much memory.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

| FAIL: sunrpc/bug20790 # missing cpp on target
| FAIL: timezone/tst-tzset # passes outside corporate network

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#55 lore raw
Quoted 6 lines · Adhemerval Zanella via Libc-alpha
Quoted 3 lines

I've posted the incremental series (v7.1) as a followup to include rebase fixes since v7. The changes are minimal and documented in respective patches. Kindly review so we can get this in, in this cycle.

Thanks for your patience, I will help wrap this up so we can include in on 2.32.

And thx to you for your help and time.

Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Bulk of failures come from cross testing setup and I intend to improve things with native testing going forward.

| Summary of test results:
|     30 FAIL   (-3)
|
| FAIL: csu/test-as-const-tcb-offsets

+ FAIL: elf/tst-audit14
+ FAIL: elf/tst-audit15
+ FAIL: elf/tst-audit16

Quoted 1 line

Any idea what it might the culprit here?

These are newly introduced so I didn't probe deeply. strace showed wait() time out

statx(1, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS, stx_attrib0
kill(-1805, SIGKILL) = 0
kill(1805, SIGKILL) = 0
wait4(1805, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGKILL}], WNOHANG|WSTOPPED, NULL) = 1805
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1805, si_uid=0, si_status=SIGKILL, si_utime=0, si_-
write(1, "Timed out: killed the child proc"..., 35Timed out: killed the child process) = 35
write(1, "\n", 1
) = 1

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
| FAIL: elf/tst-ldconfig-ld_so_conf-update # not true: dlopen
| FAIL: iconv/test-iconvconfig		# Needs gconv installed
| FAIL: io/ftwtest			# Requires execution by non-root
| FAIL: io/tst-lockf
| FAIL: libio/tst-wfile-sync

Could it be related to NFS usage as well?

Very likely so.

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
| FAIL: locale/tst-C-locale
| FAIL: locale/tst-duplocale
| FAIL: locale/tst-locale-locpath
| FAIL: locale/tst-locname
| FAIL: localedata/sort-test

Any idea why locale is not being working here (these tests are really simple, maybe another issue related to the filesystem)?

Actually these are all OK. cross setup sometimes has issues (e.g. nfs automount at boot not working) these tests hit first and fail. When testing is resumed the failures stick. I have a clean list of current failure with v7.1 at the end of this msg.

Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
| FAIL: nptl/test-cond-printers		# needs Python3 and target GDB on target
| FAIL: nptl/test-condattr-printers	#    ditto
| FAIL: nptl/test-mutex-printers	#    ditto
| FAIL: nptl/test-mutexattr-printers	#    ditto
| FAIL: nptl/test-rwlock-printers	#    ditto
| FAIL: nptl/test-rwlockattr-printers	#    ditto
| FAIL: nptl/tst-umask1			# passes if run natively on target (NFS ACLv3 support needed)
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent	# Timed out
| FAIL: nss/tst-nss-files-hosts-multi	# Timed out
| FAIL: posix/bug-ga2			# DNS issue: google DNS vs. SNPS
| FAIL: posix/globtest			# require same user on target and host
| FAIL: posix/tst-getaddrinfo5		# passes outside corporate network
| FAIL: stdio-common/bug22		# Needs more RAM: 2 GB memory
Quoted 1 line

We might try to enhance this test to avoid require too much memory.

Indeed.

current list of failures:
Currently debugging the math errors, they are regression from recent rework for reviews.

FAIL: elf/tst-audit14
FAIL: elf/tst-audit15
FAIL: elf/tst-audit16
FAIL: elf/tst-ldconfig-ld_so_conf-update
FAIL: iconv/test-iconvconfig
FAIL: io/ftwtest
FAIL: io/tst-lockf
FAIL: libio/tst-wfile-sync
FAIL: locale/tst-localedef-path-norm
FAIL: math/test-double-acos
FAIL: math/test-double-asin
FAIL: math/test-float-exp10
FAIL: math/test-float32-exp10
FAIL: math/test-float32x-acos
FAIL: math/test-float32x-asin
FAIL: math/test-float64-acos
FAIL: math/test-float64-asin
FAIL: math/test-ldouble-acos
FAIL: math/test-ldouble-asin
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: nptl/tst-umask1
FAIL: nss/bug-erange
FAIL: nss/tst-nss-files-hosts-getent
FAIL: nss/tst-nss-files-hosts-multi
FAIL: posix/bug-ga2
FAIL: posix/globtest
FAIL: posix/tst-getaddrinfo5
FAIL: stdio-common/bug22
FAIL: sunrpc/bug20790
FAIL: timezone/tst-tzset
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#56 lore raw

ARC math test regressions (was Re: [PATCH v7 00/13] glibc port to ARC processors)

Quoted 5 lines · Vineet Gupta via Libc-alpha

On 6/30/20 6:44 PM, Adhemerval Zanella via Libc-alpha wrote:

FAIL: math/test-float-exp10
FAIL: math/test-float32-exp10

The exp10 tests needed regen-ulps and now fixed.

Quoted 6 lines

FAIL: math/test-float32x-acos
FAIL: math/test-float32x-asin
FAIL: math/test-float64-acos
FAIL: math/test-float64-asin
FAIL: math/test-ldouble-acos
FAIL: math/test-ldouble-asin

This is a regression, as we had no math errors before.

Here's my analysis of the issue so far (I don't have prior builds to corroborate here).

The failures are following

| Failure: acos (inf): Exception "Invalid operation" not set
| Failure: acos (-inf): Exception "Invalid operation" not set
| Failure: acos (1.125): Exception "Invalid operation" not set
| Failure: acos (-1.125): Exception "Invalid operation" not set
| Failure: acos (max_value): Exception "Invalid operation" not set
| Failure: acos (-max_value): Exception "Invalid operation" not set

...
...
| similarly 6 for each of acos_downward(), acos_towardzero (), acos_upward ()

Simple testcase which confirms that Invalid Exception is *not* being raised

| double in = __builtin_inf ();
| acos(in);
| pass = fetestexcept(FE_INVALID);

Exception *is* raised for @in = __builtin_nans("")

Now acos can come from 2 places depending on LIBM_SVID_COMPAT
- math/w_acos_template.c <-- sets errno only
- math/w_acos_compat.c <-- raises exception FE_INVALID

For ARC, 1st variant is building, so explicit exception is NOT raised. Is this the issue ?

Or is Invalid Exception supposed to be set by the prologue in acos (both variants) which looks like following:

__acos (double x)
{
if (__builtin_expect ((__builtin_isgreater(fabs (x), 1.0)), 0))

isgreater() is not unordered so it is not supposed to raise exception unless signaling so it can't be, and fabs() doesn't seem be doing much except clipping off some bits.

So I'm confused where the issue is
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#57 lore raw

Re: ARC math test regressions (was Re: [PATCH v7 00/13] glibc port to ARC processors)

Quoted 5 lines · Vineet Gupta via Libc-alpha

Now acos can come from 2 places depending on LIBM_SVID_COMPAT
- math/w_acos_template.c <-- sets errno only
- math/w_acos_compat.c <-- raises exception FE_INVALID

For ARC, 1st variant is building, so explicit exception is NOT raised.

LIBM_SVID_COMPAT is a compat feature, thus not relevant and always off for new ports.

It's a bug in the testsuite that it doesn't handle that case yet.

Andreas.

Signature · 8 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#58 lore raw

Re: ARC math test regressions (was Re: [PATCH v7 00/13] glibc port to ARC processors)

In reply to Vineet Gupta
Quoted 2 lines · Vineet Gupta via Libc-alpha

Now acos can come from 2 places depending on LIBM_SVID_COMPAT
- math/w_acos_template.c <-- sets errno only

This wrapper, unlike the compat one, always calls __ieee754_acos (appropriately suffixed), relying on it to raise appropriate exceptions. The implementation in sysdeps/ieee754/dbl-64/e_asin.c raises the exception by doing an Inf / Inf computation.

    u.i[HIGH_HALF]=0x7ff00000;
    v.i[HIGH_HALF]=0x7ff00000;
    u.i[LOW_HALF]=0;
    v.i[LOW_HALF]=0;
    return u.x/v.x;

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115

The right place to fix this is in GCC, to stop it constant-folding Inf / Inf when flag_trapping_math. That should be a straightforward fix.

It would also be reasonable to change the above code to just "return 0.0 / 0.0;", as a simpler, more idiomatic way of returning a NaN with "invalid" raised. (Any code constructing infinities / NaNs via bit patterns likely predates built-in functions that can be used to represent such values directly. Though the GCC bug means a literal replacement with "return __builtin_inf () / __builtin_inf ();" wouldn't fix the present problem.)

Signature · 7 lines
Joseph S. Myers
[email protected]

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#59 lore raw

Re: ARC math test regressions (was Re: [PATCH v7 00/13] glibc port to ARC processors)

Quoted 10 lines · Joseph Myers
Quoted 2 lines · Vineet Gupta via Libc-alpha

Now acos can come from 2 places depending on LIBM_SVID_COMPAT
- math/w_acos_template.c <-- sets errno only

This wrapper, unlike the compat one, always calls __ieee754_acos (appropriately suffixed), relying on it to raise appropriate exceptions. The implementation in sysdeps/ieee754/dbl-64/e_asin.c raises the exception by doing an Inf / Inf computation.

Quoted 7 lines
    u.i[HIGH_HALF]=0x7ff00000;
    v.i[HIGH_HALF]=0x7ff00000;
    u.i[LOW_HALF]=0;
    v.i[LOW_HALF]=0;
    return u.x/v.x;

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115

Aha. I almost forgot that this was upstream gcc-10 for ARC too (and problem doesn't happen with gcc-9). So my glibc updates didn't trigger this, phew !

Quoted 9 lines

The right place to fix this is in GCC, to stop it constant-folding Inf / Inf when flag_trapping_math. That should be a straightforward fix.

It would also be reasonable to change the above code to just "return 0.0 / 0.0;", as a simpler, more idiomatic way of returning a NaN with "invalid" raised. (Any code constructing infinities / NaNs via bit patterns likely predates built-in functions that can be used to represent such values directly. Though the GCC bug means a literal replacement with "return __builtin_inf () / __builtin_inf ();" wouldn't fix the present problem.)

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#60 lore raw
In reply to Adhemerval Zanella
Quoted 3 lines · Adhemerval Zanella via Libc-alpha
Quoted 1 line
Quoted 1 line
Quoted 1 line

| FAIL: stdio-common/bug22 # Needs more RAM: 2 GB memory

We might try to enhance this test to avoid require too much memory.

Note this is bug 14231 (covering test-vfprintf as well, which also requires a large amount of memory). Although arguably the real bug is in the printf code, which shouldn't need so much memory (bugs 17829, 21127, 24988, maybe others).

Signature · 7 lines
Joseph S. Myers
[email protected]

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc