glibc port to ARC processors
v2 cover glibc port to ARC processors
Hi,
v2 of glibc port to ARC processors from Synopsys.
Thx for reviewing the v1 [1], I've hopefully addressed all the comments. Any unlikely omissions are unintended.
Also apologies for the bad timing given the imminent release, but that ship has likely already sailed, so we might as well continue our march independently.
The main changes since v1 are
* sigaction updates
- drop sigaction.h, use generic version
- sigaction.c to use generic linux/sigaction.c
- arch specific __sigset_t.h to enable __sigset_t [2] vs. [128]
* atomics: Enable USE_ATOMIC_COMPILER_BUILTINS
* switch to init_array, removed crt{i,n}
* Build: remove libc_cv_fpie=no
* __startcontext: use cfi_undefined to terminate unwinder
* dropped ldconfig.h, libnsl.abilist, cacheflush.c (use syscalls.list), procfs-id.h, math_private.h
* cosmetics
- Trying to follow the coding style and conventions
- Folded the testsuite fixes patches into main port patches
- Update copyright headers to 2019
Customary test results: Built against
binutils-2_32-branch
gcc-8-stable (commit 0d5ba57508c5 as of today with prerequisite backport)
(a) build-many-glibcs.py
| Summary of test results: | 1173 PASS # same as v1 | 15 XFAIL # same as v1 | | PASS: glibcs-arc-linux-gnu check
(b) Full testsuite ran in a cross compile setup using buildroot on HSDK development platform. Full log at [2].
| Summary of test results: | 22 FAIL # 2 fewer than v1 | 5151 PASS # 27 more than v1 | 23 UNSUPPORTED # 4 fewer | 19 XFAIL # no change | | FAIL: localedata/sort-test | FAIL: stdio-common/bug22 | FAIL: sunrpc/bug20790 | FAIL: nptl/test-mutexattr-printers | FAIL: nptl/test-mutex-printers | FAIL: nptl/test-condattr-printers | FAIL: nptl/test-cond-printers | FAIL: nptl/test-rwlockattr-printers | FAIL: nptl/test-rwlock-printers | FAIL: iconv/test-iconvconfig | FAIL: posix/bug-ga2 | FAIL: posix/tst-getaddrinfo5 | FAIL: posix/globtest | FAIL: gmon/tst-sprofil | FAIL: io/ftwtest | FAIL: nptl/tst-cond17 | FAIL: nptl/tst-cond25 | FAIL: nptl/tst-umask1 | FAIL: nss/bug-erange | FAIL: nss/tst-nss-files-hosts-getent | FAIL: nss/tst-nss-files-hosts-multi | FAIL: nss/tst-nss-test3
Kindly review.
Thx,
-Vineet
[1] https://sourceware.org/ml/libc-alpha/2018-12/msg00678.html
[2] https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/files/2810200/glibc-testsuite-results-commit-2f9a78f208a7.log.gz
Vineet Gupta (15):
ARC: add definitions to elf/elf.h
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: Linux Syscall Interface
ARC: Linux ABI
ARC: Linux Startup and Dynamic Loading
ARC: ABI lists
ARC: Update syscall-names.list for ARC specific syscalls
ARC: Build Infrastructure
build-many-glibcs.py: Enable ARC builds
NEWS: mention ARC port
make-syscalls.sh: fix comment referencing syscall-template
ChangeLog | 106 + NEWS | 7 + elf/elf.h | 70 +- scripts/build-many-glibcs.py | 4 + sysdeps/arc/Implies | 4 + sysdeps/arc/Makefile | 25 + sysdeps/arc/Versions | 6 + sysdeps/arc/__longjmp.S | 50 + sysdeps/arc/abort-instr.h | 2 + sysdeps/arc/atomic-machine.h | 73 + sysdeps/arc/bits/endian.h | 12 + sysdeps/arc/bits/fenv.h | 72 + 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 | 14 + sysdeps/arc/configure.ac | 11 + sysdeps/arc/dl-machine.h | 340 ++++ sysdeps/arc/dl-runtime.c | 39 + sysdeps/arc/dl-sysdep.h | 25 + sysdeps/arc/dl-tls.h | 30 + sysdeps/arc/dl-trampoline.S | 80 + sysdeps/arc/entry.h | 5 + sysdeps/arc/gccframe.h | 21 + sysdeps/arc/gmp-mparam.h | 23 + sysdeps/arc/jmpbuf-offsets.h | 47 + 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/memusage.h | 23 + sysdeps/arc/nofpu/Implies | 1 + sysdeps/arc/nofpu/libm-test-ulps | 390 ++++ 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/bits/pthreadtypes-arch.h | 72 + sysdeps/arc/nptl/bits/semaphore.h | 32 + sysdeps/arc/nptl/pthread-offsets.h | 5 + sysdeps/arc/nptl/pthreaddef.h | 32 + sysdeps/arc/nptl/tcb-offsets.sym | 11 + sysdeps/arc/nptl/tls.h | 150 ++ sysdeps/arc/preconfigure | 14 + sysdeps/arc/setjmp.S | 66 + sysdeps/arc/sfp-machine.h | 73 + sysdeps/arc/sotruss-lib.c | 51 + sysdeps/arc/stackinfo.h | 33 + sysdeps/arc/start.S | 89 + sysdeps/arc/sysdep.h | 48 + sysdeps/arc/tls-macros.h | 47 + sysdeps/arc/tst-audit.h | 23 + sysdeps/unix/make-syscalls.sh | 2 +- sysdeps/unix/sysv/linux/arc/Implies | 3 + sysdeps/unix/sysv/linux/arc/Makefile | 20 + sysdeps/unix/sysv/linux/arc/Versions | 16 + sysdeps/unix/sysv/linux/arc/bits/procfs.h | 35 + .../unix/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 | 98 + sysdeps/unix/sysv/linux/arc/configure | 4 + sysdeps/unix/sysv/linux/arc/configure.ac | 4 + sysdeps/unix/sysv/linux/arc/dl-static.c | 84 + sysdeps/unix/sysv/linux/arc/getcontext.S | 63 + sysdeps/unix/sysv/linux/arc/ipc_priv.h | 21 + sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h | 6 + sysdeps/unix/sysv/linux/arc/kernel-features.h | 28 + sysdeps/unix/sysv/linux/arc/ld.abilist | 9 + sysdeps/unix/sysv/linux/arc/ldsodefs.h | 32 + .../unix/sysv/linux/arc/libBrokenLocale.abilist | 1 + sysdeps/unix/sysv/linux/arc/libanl.abilist | 4 + sysdeps/unix/sysv/linux/arc/libc.abilist | 2089 ++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/libcrypt.abilist | 2 + sysdeps/unix/sysv/linux/arc/libdl.abilist | 9 + sysdeps/unix/sysv/linux/arc/libm.abilist | 753 +++++++ sysdeps/unix/sysv/linux/arc/libpthread.abilist | 235 +++ sysdeps/unix/sysv/linux/arc/libresolv.abilist | 79 + sysdeps/unix/sysv/linux/arc/librt.abilist | 35 + sysdeps/unix/sysv/linux/arc/libthread_db.abilist | 40 + sysdeps/unix/sysv/linux/arc/libutil.abilist | 6 + sysdeps/unix/sysv/linux/arc/localplt.data | 16 + sysdeps/unix/sysv/linux/arc/makecontext.c | 75 + sysdeps/unix/sysv/linux/arc/mmap_internal.h | 27 + sysdeps/unix/sysv/linux/arc/profil-counter.h | 2 + sysdeps/unix/sysv/linux/arc/pt-vfork.S | 1 + sysdeps/unix/sysv/linux/arc/setcontext.S | 92 + sysdeps/unix/sysv/linux/arc/shlib-versions | 2 + sysdeps/unix/sysv/linux/arc/sigaction.c | 31 + sysdeps/unix/sysv/linux/arc/sigcontextinfo.h | 23 + sysdeps/unix/sysv/linux/arc/sigrestorer.S | 29 + sysdeps/unix/sysv/linux/arc/swapcontext.S | 92 + sysdeps/unix/sysv/linux/arc/sys/cachectl.h | 36 + sysdeps/unix/sysv/linux/arc/sys/ucontext.h | 63 + sysdeps/unix/sysv/linux/arc/sys/user.h | 31 + sysdeps/unix/sysv/linux/arc/syscall.S | 38 + sysdeps/unix/sysv/linux/arc/syscalls.list | 3 + sysdeps/unix/sysv/linux/arc/sysdep.c | 33 + sysdeps/unix/sysv/linux/arc/sysdep.h | 251 +++ sysdeps/unix/sysv/linux/arc/ucontext-macros.h | 29 + sysdeps/unix/sysv/linux/arc/ucontext_i.sym | 20 + sysdeps/unix/sysv/linux/arc/vfork.S | 42 + sysdeps/unix/sysv/linux/syscall-names.list | 3 + 103 files changed, 7229 insertions(+), 2 deletions(-) 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/endian.h create mode 100644 sysdeps/arc/bits/fenv.h create mode 100644 sysdeps/arc/bits/link.h create mode 100644 sysdeps/arc/bits/setjmp.h create mode 100644 sysdeps/arc/bsd-_setjmp.S create mode 100644 sysdeps/arc/bsd-setjmp.S create mode 100644 sysdeps/arc/configure create mode 100644 sysdeps/arc/configure.ac create mode 100644 sysdeps/arc/dl-machine.h create mode 100644 sysdeps/arc/dl-runtime.c create mode 100644 sysdeps/arc/dl-sysdep.h create mode 100644 sysdeps/arc/dl-tls.h create mode 100644 sysdeps/arc/dl-trampoline.S create mode 100644 sysdeps/arc/entry.h create mode 100644 sysdeps/arc/gccframe.h create mode 100644 sysdeps/arc/gmp-mparam.h create mode 100644 sysdeps/arc/jmpbuf-offsets.h create mode 100644 sysdeps/arc/jmpbuf-unwind.h create mode 100644 sysdeps/arc/ldsodefs.h create mode 100644 sysdeps/arc/libc-tls.c create mode 100644 sysdeps/arc/machine-gmon.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/bits/pthreadtypes-arch.h create mode 100644 sysdeps/arc/nptl/bits/semaphore.h create mode 100644 sysdeps/arc/nptl/pthread-offsets.h 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/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/bits/procfs.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/getcontext.S create mode 100644 sysdeps/unix/sysv/linux/arc/ipc_priv.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/ld.abilist 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/profil-counter.h create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S 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 · 1 line
2.7.4
PATCH v2 1/15 ARC: add definitions to elf/elf.h
--- ChangeLog | 4 ++++ elf/elf.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-)
ChangeLog +4 -0
@@ -1,3 +1,7 @@ +2019-01-21 Vineet Gupta <vgupta at synopsys.com> + + * elf/elf.h: add defines for ARC. + 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org> * po/be.po: Update translations.
elf/elf.h +69 -1
82 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/15 ARC: ABI Implementation
In reply to Vineet GuptaThis code deals with the ARC ABI.
--- ChangeLog | 18 ++++++++++ sysdeps/arc/__longjmp.S | 50 +++++++++++++++++++++++++++ sysdeps/arc/abort-instr.h | 2 ++ sysdeps/arc/bits/endian.h | 12 +++++++ sysdeps/arc/bits/setjmp.h | 26 ++++++++++++++ sysdeps/arc/bsd-_setjmp.S | 1 + sysdeps/arc/bsd-setjmp.S | 1 + sysdeps/arc/dl-runtime.c | 39 +++++++++++++++++++++ sysdeps/arc/dl-sysdep.h | 25 ++++++++++++++ sysdeps/arc/dl-trampoline.S | 80 ++++++++++++++++++++++++++++++++++++++++++++ sysdeps/arc/gccframe.h | 21 ++++++++++++ sysdeps/arc/gmp-mparam.h | 23 +++++++++++++ sysdeps/arc/jmpbuf-offsets.h | 47 ++++++++++++++++++++++++++ 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 | 48 ++++++++++++++++++++++++++ sysdeps/arc/tls-macros.h | 47 ++++++++++++++++++++++++++ 19 files changed, 611 insertions(+) create mode 100644 sysdeps/arc/__longjmp.S create mode 100644 sysdeps/arc/abort-instr.h create mode 100644 sysdeps/arc/bits/endian.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.c 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/gmp-mparam.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
ChangeLog +18 -0
@@ -1,6 +1,24 @@ 2019-01-21 Vineet Gupta <vgupta at synopsys.com> * elf/elf.h: add defines for ARC. + * sysdeps/arc/__longjmp.S: New file. + * sysdeps/arc/abort-instr.h: New file. + * sysdeps/arc/bits/endian.h: New file. + * sysdeps/arc/bits/setjmp.h: New file. + * sysdeps/arc/bsd-_setjmp.S: New file. + * sysdeps/arc/bsd-setjmp.S: New file. + * sysdeps/arc/dl-runtime.c: New file. + * sysdeps/arc/dl-sysdep.h: New file. + * sysdeps/arc/dl-trampoline.S: New file. + * sysdeps/arc/gccframe.h: New file. + * sysdeps/arc/gmp-mparam.h: New file. + * sysdeps/arc/jmpbuf-offsets.h: New file. + * sysdeps/arc/jmpbuf-unwind.h: New file. + * sysdeps/arc/machine-gmon.h: New file. + * sysdeps/arc/memusage.h: New file. + * sysdeps/arc/setjmp.S: New file. + * sysdeps/arc/sysdep.h: New file. + * sysdeps/arc/tls-macros.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/__longjmp.S new file +50 -0
50 lines not on this page · raw message
sysdeps/arc/abort-instr.h new file +2 -0
@@ -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/endian.h new file +12 -0
@@ -0,0 +1,12 @@ +/* Although ARC CPU can do BE, it is not supported. */ + +#ifndef _ENDIAN_H +# error "Never use <bits/endian.h> directly; include <endian.h> instead." +#endif + +#ifdef __LITTLE_ENDIAN__ +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif +#ifdef __BIG_ENDIAN__ +# error "Big Endian NOt supported on ARC" +#endif
sysdeps/arc/bits/setjmp.h new file +26 -0
@@ -0,0 +1,26 @@ +/* Define the machine-dependent type `jmp_buf'. ARC version. +Copyright (C) 1992-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _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
@@ -0,0 +1 @@ +/* _setjmp is in setjmp.S. */
sysdeps/arc/bsd-setjmp.S new file +1 -0
@@ -0,0 +1 @@ +/* setjmp is in setjmp.S. */
sysdeps/arc/dl-runtime.c new file +39 -0
@@ -0,0 +1,39 @@ +/* dl-runtime helpers for ARC. +Copyright (C) 2017-2019 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/>. */ + +/* PLT jump into resolver passes PC of PLTn, while _dl_fixup expects the +address of corresponding .rela.plt entry. */ + +#ifdef __A7__ +# define ARC_PLT_SIZE 12 +#else +# define ARC_PLT_SIZE 16 +#endif + +#define reloc_index \ +({ \ + unsigned long int plt0 = D_PTR (l, l_info[DT_PLTGOT]); \ + unsigned long int pltn = reloc_arg; \ + /* Exclude PL0 and PLT1. */ \ + unsigned long int idx = (pltn - plt0)/ARC_PLT_SIZE - 2; \ + idx; \ +}) + +#define reloc_offset reloc_index * sizeof (PLTREL) + +#include <elf/dl-runtime.c>
sysdeps/arc/dl-sysdep.h new file +25 -0
@@ -0,0 +1,25 @@ +/* System-specific settings for dynamic linker code. ARC version. +Copyright (C) 2009-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include_next <dl-sysdep.h> + +/* _dl_argv cannot be attribute_relro, because _dl_start_user +might write into it after _dl_start returns. */ +#define DL_ARGV_NOT_RELRO 1 + +#define DL_EXTERN_PROTECTED_DATA
sysdeps/arc/dl-trampoline.S new file +80 -0
80 lines not on this page · raw message
sysdeps/arc/gccframe.h new file +21 -0
@@ -0,0 +1,21 @@ +/* Definition of object in frame unwind info. ARC version. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#define FIRST_PSEUDO_REGISTER 40 + +#include <sysdeps/generic/gccframe.h>
sysdeps/arc/gmp-mparam.h new file +23 -0
@@ -0,0 +1,23 @@ +/* gmp-mparam.h -- Compiler/machine parameter header file. + +Copyright (C) 2017-2019 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/gmp-mparam.h> + +#define IEEE_DOUBLE_BIG_ENDIAN 0
sysdeps/arc/jmpbuf-offsets.h new file +47 -0
47 lines not on this page · raw message
sysdeps/arc/jmpbuf-unwind.h new file +47 -0
47 lines not on this page · raw message
sysdeps/arc/machine-gmon.h new file +35 -0
@@ -0,0 +1,35 @@ +/* Machine-dependent definitions for profiling support. ARC version. +Copyright (C) 1996-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define _MCOUNT_DECL (frompc, selfpc) \ +static void \ +__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
@@ -0,0 +1,23 @@ +/* Machine-specific definitions for memory usage profiling, ARC version. +Copyright (C) 2000-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#define GETSP () ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) + +#define uatomic32_t unsigned int + +#include <sysdeps/generic/memusage.h>
sysdeps/arc/setjmp.S new file +66 -0
66 lines not on this page · raw message
sysdeps/arc/sysdep.h new file +48 -0
48 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 · 1 line
2.7.4
PATCH v2 3/15 ARC: startup and dynamic linking code
In reply to Vineet GuptaCode for C runtime startup and dynamic loading including PLT layout.
--- ChangeLog | 7 + sysdeps/arc/bits/link.h | 52 +++++++ sysdeps/arc/dl-machine.h | 340 ++++++++++++++++++++++++++++++++++++++++++++++ sysdeps/arc/entry.h | 5 + sysdeps/arc/ldsodefs.h | 43 ++++++ sysdeps/arc/sotruss-lib.c | 51 +++++++ sysdeps/arc/start.S | 89 ++++++++++++ sysdeps/arc/tst-audit.h | 23 ++++ 8 files changed, 610 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
ChangeLog +7 -0
@@ -19,6 +19,13 @@ * sysdeps/arc/setjmp.S: New file. * sysdeps/arc/sysdep.h: New file. * sysdeps/arc/tls-macros.h: New file. + * sysdeps/arc/bits/link.h: New file. + * sysdeps/arc/dl-machine.h: New file. + * sysdeps/arc/entry.h: New file. + * sysdeps/arc/ldsodefs.h: New file. + * sysdeps/arc/sotruss-lib.c: New file. + * sysdeps/arc/start.S: New file. + * sysdeps/arc/tst-audit.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/bits/link.h new file +52 -0
52 lines not on this page · raw message
sysdeps/arc/dl-machine.h new file +340 -0
340 lines not on this page · raw message
sysdeps/arc/entry.h new file +5 -0
@@ -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 +51 -0
51 lines not on this page · raw message
sysdeps/arc/start.S new file +89 -0
89 lines not on this page · raw message
sysdeps/arc/tst-audit.h new file +23 -0
@@ -0,0 +1,23 @@ +/* Definitions for testing PLT entry/exit auditing. ARC version. +Copyright (C) 2009-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#define pltenter la_arc_gnu_pltenter +#define pltexit la_arc_gnu_pltexit +#define La_regs La_arc_regs +#define La_retval La_arc_retval +#define int_retval lrv_reg[0]
Signature · 1 line
2.7.4
PATCH v2 4/15 ARC: Thread Local Storage support
In reply to Vineet GuptaThis includes all 4 TLS addressing models
--- ChangeLog | 5 ++ sysdeps/arc/dl-tls.h | 30 ++++++++ sysdeps/arc/libc-tls.c | 27 +++++++ sysdeps/arc/nptl/tcb-offsets.sym | 11 +++ sysdeps/arc/nptl/tls.h | 150 +++++++++++++++++++++++++++++++++++++++ sysdeps/arc/stackinfo.h | 33 +++++++++ 6 files changed, 256 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
ChangeLog +5 -0
@@ -26,6 +26,11 @@ * sysdeps/arc/sotruss-lib.c: New file. * sysdeps/arc/start.S: New file. * sysdeps/arc/tst-audit.h: New file. + * sysdeps/arc/dl-tls.h: New file. + * sysdeps/arc/libc-tls.c: New file. + * sysdeps/arc/nptl/tcb-offsets.sym: New file. + * sysdeps/arc/nptl/tls.h: New file. + * sysdeps/arc/stackinfo.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/dl-tls.h new file +30 -0
@@ -0,0 +1,30 @@ +/* Thread-local storage handling in the ELF dynamic linker. ARC version. +Copyright (C) 2012-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + + +/* Type used for the representation of TLS information in the GOT. */ +typedef struct +{ +unsigned long int ti_module; +unsigned long int ti_offset; +}tls_index ; + +extern void *__tls_get_addr (tls_index *ti); + +/* Value used for dtv entries for which the allocation is delayed. */ +#define TLS_DTV_UNALLOCATED ((void *) -1l)
sysdeps/arc/libc-tls.c new file +27 -0
@@ -0,0 +1,27 @@ +/* Thread-local storage handling in the ELF dynamic linker. ARC version. +Copyright (C) 2005-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <csu/libc-tls.c> +#include <dl-tls.h> + +void * +__tls_get_addr (tls_index *ti) +{ +dtv_t *dtv =THREAD_DTV (); +return (char *) dtv[1 ].pointer.val + ti->ti_offset; +}
sysdeps/arc/nptl/tcb-offsets.sym new file +11 -0
@@ -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 +150 -0
150 lines not on this page · raw message
sysdeps/arc/stackinfo.h new file +33 -0
@@ -0,0 +1,33 @@ +/* Stack environment definitions for ARC. +Copyright (C) 2012-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +/* This file contains a bit of information about the stack allocation +of the processor. */ + +#ifndef _STACKINFO_H +#define _STACKINFO_H 1 + +#include <elf.h> + +/* On ARC the stack grows down. */ +#define _STACK_GROWS_DOWN 1 + +/* Default to a non-executable stack. */ +#define DEFAULT_STACK_PERMS (PF_R|PF_W) + +#endif /* stackinfo.h */
Signature · 1 line
2.7.4
PATCH v2 5/15 ARC: Atomics and Locking primitives
In reply to Vineet Gupta--- ChangeLog | 3 ++ sysdeps/arc/atomic-machine.h | 73 +++++++++++++++++++++++++++++++ sysdeps/arc/nptl/bits/pthreadtypes-arch.h | 72 ++++++++++++++++++++++++++++++ sysdeps/arc/nptl/bits/semaphore.h | 32 ++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 sysdeps/arc/atomic-machine.h create mode 100644 sysdeps/arc/nptl/bits/pthreadtypes-arch.h create mode 100644 sysdeps/arc/nptl/bits/semaphore.h
ChangeLog +3 -0
@@ -31,6 +31,9 @@ * sysdeps/arc/nptl/tcb-offsets.sym: New file. * sysdeps/arc/nptl/tls.h: New file. * sysdeps/arc/stackinfo.h: New file. + * sysdeps/arc/atomic-machine.h: New file. + * sysdeps/arc/nptl/bits/pthreadtypes-arch.h: New file. + * sysdeps/arc/nptl/bits/semaphore.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/atomic-machine.h new file +73 -0
73 lines not on this page · raw message
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +72 -0
72 lines not on this page · raw message
sysdeps/arc/nptl/bits/semaphore.h new file +32 -0
@@ -0,0 +1,32 @@ +/* Machine-specific POSIX semaphore type layouts. ARC version. +Copyright (C) 2002-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + +#define __SIZEOF_SEM_T 16 + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + +typedef union +{ +char __size[__SIZEOF_SEM_T]; +long int __align; +}sem_t ;
Signature · 1 line
2.7.4
PATCH v2 5/15 ARC: Atomics and Locking primitives
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines · Vineet Gupta
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1
New ports should use the preferred values for these macros.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH v2 5/15 ARC: Atomics and Locking primitives
Quoted 5 lines · Andreas Schwab
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines · Vineet Gupta
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1New ports should use the preferred values for these macros.
OK, changed to 0 and 0 per commit 06be6368da16104 ("nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}")
Thx,
-Vineet
Need for arch pthread-offsets.h (was Re: [PATCH v2 05/15] ARC: Atomics and Locking primitives)
Quoted 9 lines · Vineet Gupta
Quoted 5 lines · Andreas Schwab
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines · Vineet Gupta
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1New ports should use the preferred values for these macros.
OK, changed to 0 and 0 per commit
06be6368da16104("nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}")
So this required a bunch of tricking changes to _SIZEOF_PTHREAD_*.
However what was not obvious is adjustment to sysdeps/<arch>/nptl/pthread-offsets.h to __PTHREAD_MUTEX_*_OFFSET. But these don't seem to be *actually* used anywhere. Sure there are assert checks in pthread_mutext_init.c but what's the point: the struct is generic anyways. IOW I'm not sure what port specific errors/inconsistency they are catching, other than the fact that they need to be hand calculating when starting a new port.
Am I missing something ?
Need for arch pthread-offsets.h (was Re: [PATCH v2 05/15] ARC: Atomics and Locking primitives)
Quoted 8 lines · Vineet Gupta
However what was not obvious is adjustment to sysdeps/<arch>/nptl/pthread-offsets.h to __PTHREAD_MUTEX_*_OFFSET. But these don't seem to be *actually* used anywhere. Sure there are assert checks in
pthread_mutext_init.cbut what's the point: the struct is generic anyways. IOW I'm not sure what port specific errors/inconsistency they are catching, other than the fact that they need to be hand calculating when starting a new port.Am I missing something ?
The _OFFSET macros are for ensuring binary compatibility.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH v2 5/15 ARC: Atomics and Locking primitives
In reply to Andreas SchwabQuoted 6 lines · Andreas Schwab
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines · Vineet Gupta
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1New ports should use the preferred values for these macros.
This seems like something that could be a common issue for new ports, so worth a mention at <https://sourceware.org/glibc/wiki/NewPorts> alongside such things as using init_array and USE_ATOMIC_COMPILER_BUILTINS.
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
PATCH v2 5/15 ARC: Atomics and Locking primitives
Quoted 6 lines · Joseph Myers
Quoted 3 lines
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1New ports should use the preferred values for these macros.
This seems like something that could be a common issue for new ports, so worth a mention at <https://sourceware.org/glibc/wiki/NewPorts> alongside such things as using
init_arrayandUSE_ATOMIC_COMPILER_BUILTINS.
Updated wiki page !
PATCH v2 5/15 ARC: Atomics and Locking primitives
Quoted 9 lines · Vineet Gupta
Quoted 6 lines · Joseph Myers
Quoted 3 lines
sysdeps/arc/nptl/bits/pthreadtypes-arch.h line 39
Quoted 2 lines
sysdeps/arc/nptl/bits/pthreadtypes-arch.h new file +2
-0+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 +#define __PTHREAD_MUTEX_USE_UNION 1New ports should use the preferred values for these macros.
This seems like something that could be a common issue for new ports, so worth a mention at <https://sourceware.org/glibc/wiki/NewPorts> alongside such things as using
init_arrayandUSE_ATOMIC_COMPILER_BUILTINS.Updated wiki page !
Now it's saying those macros are in atomic-machine.h. That's not right; the information about those macros needs to go in a separate paragraph.
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
PATCH v2 5/15 ARC: Atomics and Locking primitives
Quoted 6 lines · Joseph Myers
Quoted 4 lines
Quoted 3 lines
This seems like something that could be a common issue for new ports, so worth a mention at <https://sourceware.org/glibc/wiki/NewPorts> alongside such things as using
init_arrayandUSE_ATOMIC_COMPILER_BUILTINS.Updated wiki page !
Now it's saying those macros are in
atomic-machine.h. That's not right; the information about those macros needs to go in a separate paragraph.
Does it look any better now ?
PATCH v2 5/15 ARC: Atomics and Locking primitives
Quoted 9 lines · Vineet Gupta
Quoted 6 lines · Joseph Myers
Quoted 4 lines
Quoted 3 lines
This seems like something that could be a common issue for new ports, so worth a mention at <https://sourceware.org/glibc/wiki/NewPorts> alongside such things as using
init_arrayandUSE_ATOMIC_COMPILER_BUILTINS.Updated wiki page !
Now it's saying those macros are in
atomic-machine.h. That's not right; the information about those macros needs to go in a separate paragraph.Does it look any better now ?
Yes, that looks better.
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
PATCH v2 6/15 ARC: math soft float support
In reply to Vineet Gupta--- ChangeLog | 5 +++ sysdeps/arc/bits/fenv.h | 72 ++++++++++++++++++++++++++++++ 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 | 73 +++++++++++++++++++++++++++++++ 6 files changed, 205 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
ChangeLog +5 -0
@@ -34,6 +34,11 @@ * sysdeps/arc/atomic-machine.h: New file. * sysdeps/arc/nptl/bits/pthreadtypes-arch.h: New file. * sysdeps/arc/nptl/bits/semaphore.h: New file. + * sysdeps/arc/bits/fenv.h: New file. + * sysdeps/arc/nofpu/Implies: New file. + * sysdeps/arc/nofpu/math-tests-exceptions.h: New file. + * sysdeps/arc/nofpu/math-tests-rounding.h: New file. + * sysdeps/arc/sfp-machine.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/bits/fenv.h new file +72 -0
72 lines not on this page · raw message
sysdeps/arc/nofpu/Implies new file +1 -0
@@ -0,0 +1 @@ +ieee754/soft-fp
sysdeps/arc/nofpu/math-tests-exceptions.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Configuration for math tests. exceptions support ARC version. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H +#define ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H 1 + +/* Soft-float doesnot 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
@@ -0,0 +1,27 @@ +/* Configuration for math tests: rounding mode support. ARC version. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef 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 +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 7/15 ARC: Linux Syscall Interface
In reply to Vineet Gupta--- ChangeLog | 13 ++ sysdeps/unix/sysv/linux/arc/clone.S | 98 ++++++++++ sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h | 6 + sysdeps/unix/sysv/linux/arc/kernel-features.h | 28 +++ sysdeps/unix/sysv/linux/arc/mmap_internal.h | 27 +++ sysdeps/unix/sysv/linux/arc/profil-counter.h | 2 + sysdeps/unix/sysv/linux/arc/pt-vfork.S | 1 + sysdeps/unix/sysv/linux/arc/sigaction.c | 31 ++++ sysdeps/unix/sysv/linux/arc/sigrestorer.S | 29 +++ sysdeps/unix/sysv/linux/arc/syscall.S | 38 ++++ sysdeps/unix/sysv/linux/arc/syscalls.list | 3 + sysdeps/unix/sysv/linux/arc/sysdep.c | 33 ++++ sysdeps/unix/sysv/linux/arc/sysdep.h | 251 ++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/vfork.S | 42 +++++ 14 files changed, 602 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arc/clone.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/mmap_internal.h create mode 100644 sysdeps/unix/sysv/linux/arc/profil-counter.h create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S create mode 100644 sysdeps/unix/sysv/linux/arc/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
ChangeLog +13 -0
@@ -39,6 +39,19 @@ * sysdeps/arc/nofpu/math-tests-exceptions.h: New file. * sysdeps/arc/nofpu/math-tests-rounding.h: New file. * sysdeps/arc/sfp-machine.h: New file. + * sysdeps/unix/sysv/linux/arc/clone.S: New file. + * sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h: New file. + * sysdeps/unix/sysv/linux/arc/kernel-features.h: New file. + * sysdeps/unix/sysv/linux/arc/mmap_internal.h: New file. + * sysdeps/unix/sysv/linux/arc/profil-counter.h: New file. + * sysdeps/unix/sysv/linux/arc/pt-vfork.S: New file. + * sysdeps/unix/sysv/linux/arc/sigaction.c: New file. + * sysdeps/unix/sysv/linux/arc/sigrestorer.S: New file. + * sysdeps/unix/sysv/linux/arc/syscall.S: New file. + * sysdeps/unix/sysv/linux/arc/syscalls.list: New file. + * sysdeps/unix/sysv/linux/arc/sysdep.c: New file. + * sysdeps/unix/sysv/linux/arc/sysdep.h: New file. + * sysdeps/unix/sysv/linux/arc/vfork.S: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/unix/sysv/linux/arc/clone.S new file +98 -0
98 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h new file +6 -0
@@ -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 +28 -0
@@ -0,0 +1,28 @@ +/* Set flags signalling availability of kernel features based on given +kernel version number. + +Copyright (C) 2009-2019 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/>. */ + +/* The minimum supported kernel version for ARC is 3.9, +guaranteeing many kernel features. */ + +#include_next <kernel-features.h> + +#undef __ASSUME_CLONE_DEFAULT +#define __ASSUME_CLONE_BACKWARDS 1
sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +27 -0
@@ -0,0 +1,27 @@ +/* mmap - map files or devices into memory. Linux/ARC version. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef MMAP_ARC_INTERNAL_H +#define MMAP_ARC_INTERNAL_H + +/* 8K page is default for ARC. */ +#define MMAP2_PAGE_UNIT 8192ULL + +#include_next <mmap_internal.h> + +#endif
sysdeps/unix/sysv/linux/arc/profil-counter.h new file +2 -0
@@ -0,0 +1,2 @@ +/* We can use the ix86 version. */ +#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>
sysdeps/unix/sysv/linux/arc/pt-vfork.S new file +1 -0
@@ -0,0 +1 @@ +/* Not needed. */
sysdeps/unix/sysv/linux/arc/sigaction.c new file +31 -0
@@ -0,0 +1,31 @@ +/* ARC specific sigaction. +Copyright (C) 1997-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#define 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
@@ -0,0 +1,29 @@ +/* Default sigreturn stub for ARC Linux. + Copyright (C) 2005-2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/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 +38 -0
@@ -0,0 +1,38 @@ +/* syscall - indirect system call. + Copyright (C) 2017-2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +ENTRY (syscall) + mov_s r8, r0 + mov_s r0, r1 + mov_s r1, r2 + mov_s r2, r3 + mov_s r3, r4 +#ifdef __ARC700__ + mov r4, r5 + mov r5, r6 +#else + mov_s r4, r5 + mov_s r5, r6 +#endif + + ARC_TRAP_INSN + brhi r0, -1024, .Lcall_syscall_err + j [blink] +PSEUDO_END (syscall)
sysdeps/unix/sysv/linux/arc/syscalls.list new file +3 -0
@@ -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
@@ -0,0 +1,33 @@ +/* ARC wrapper for setting errno. +Copyright (C) 1997-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <errno.h> + +/* All syscall handler come 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 +251 -0
251 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 · 1 line
2.7.4
PATCH v2 8/15 ARC: Linux ABI
In reply to Vineet Gupta--- ChangeLog | 15 ++++ sysdeps/arc/nptl/pthread-offsets.h | 5 ++ sysdeps/arc/nptl/pthreaddef.h | 32 ++++++++ sysdeps/unix/sysv/linux/arc/bits/procfs.h | 35 ++++++++ .../unix/sysv/linux/arc/bits/types/__sigset_t.h | 12 +++ sysdeps/unix/sysv/linux/arc/getcontext.S | 63 +++++++++++++++ sysdeps/unix/sysv/linux/arc/ipc_priv.h | 21 +++++ sysdeps/unix/sysv/linux/arc/makecontext.c | 75 ++++++++++++++++++ sysdeps/unix/sysv/linux/arc/setcontext.S | 92 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/sigcontextinfo.h | 23 ++++++ sysdeps/unix/sysv/linux/arc/swapcontext.S | 92 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/sys/cachectl.h | 36 +++++++++ sysdeps/unix/sysv/linux/arc/sys/ucontext.h | 63 +++++++++++++++ sysdeps/unix/sysv/linux/arc/sys/user.h | 31 ++++++++ sysdeps/unix/sysv/linux/arc/ucontext-macros.h | 29 +++++++ sysdeps/unix/sysv/linux/arc/ucontext_i.sym | 20 +++++ 16 files changed, 644 insertions(+) create mode 100644 sysdeps/arc/nptl/pthread-offsets.h 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/ipc_priv.h 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
ChangeLog +15 -0
@@ -52,6 +52,21 @@ * sysdeps/unix/sysv/linux/arc/sysdep.c: New file. * sysdeps/unix/sysv/linux/arc/sysdep.h: New file. * sysdeps/unix/sysv/linux/arc/vfork.S: New file. + * sysdeps/arc/nptl/pthread-offsets.h: New file. + * sysdeps/arc/nptl/pthreaddef.h: New file. + * sysdeps/unix/sysv/linux/arc/bits/procfs.h: New file. + * sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h: New file. + * sysdeps/unix/sysv/linux/arc/getcontext.S: New file. + * sysdeps/unix/sysv/linux/arc/ipc_priv.h: New file. + * sysdeps/unix/sysv/linux/arc/makecontext.c: New file. + * sysdeps/unix/sysv/linux/arc/setcontext.S: New file. + * sysdeps/unix/sysv/linux/arc/sigcontextinfo.h: New file. + * sysdeps/unix/sysv/linux/arc/swapcontext.S: New file. + * sysdeps/unix/sysv/linux/arc/sys/cachectl.h: New file. + * sysdeps/unix/sysv/linux/arc/sys/ucontext.h: New file. + * sysdeps/unix/sysv/linux/arc/sys/user.h: New file. + * sysdeps/unix/sysv/linux/arc/ucontext-macros.h: New file. + * sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/nptl/pthread-offsets.h new file +5 -0
@@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20
sysdeps/arc/nptl/pthreaddef.h new file +32 -0
@@ -0,0 +1,32 @@ +/* pthread machine parameter definitions, ARC version. +Copyright (C) 2002-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +/* Default stack size. */ +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) + +/* Required stack pointer alignment at beginning. */ +#define STACK_ALIGN 4 + +/* Minimal stack size after allocating thread descriptor and guard size. */ +#define MINIMAL_REST_STACK 2048 + +/* Alignment requirement for TCB. */ +#define TCB_ALIGNMENT 4 + +/* Location of current stack frame. */ +#define CURRENT_STACK_FRAME __builtin_frame_address (0)
sysdeps/unix/sysv/linux/arc/bits/procfs.h new file +35 -0
@@ -0,0 +1,35 @@ +/* Types for registers for sys/procfs.h. ARC version. +Copyright (C) 1996-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# 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
@@ -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 +63 -0
63 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/ipc_priv.h new file +21 -0
@@ -0,0 +1,21 @@ +/* Old SysV permission definition for Linux. ARC version. +Copyright (C) 2016-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <sys/ipc.h> /* For __key_t */ + +#define __IPC_64 0x0
sysdeps/unix/sysv/linux/arc/makecontext.c new file +75 -0
75 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/setcontext.S new file +92 -0
92 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sigcontextinfo.h new file +23 -0
@@ -0,0 +1,23 @@ +/* ARC definitions for signal handling calling conventions. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <sys/ucontext.h> +#include "kernel-features.h" + +#define SIGCONTEXT int _code, struct ucontext_t * +#define GET_PC (ctx) ((void *) (ctx)->uc_mcontext.__scratch.__ret)
sysdeps/unix/sysv/linux/arc/swapcontext.S new file +92 -0
92 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sys/cachectl.h new file +36 -0
@@ -0,0 +1,36 @@ +/* cacheflush - flush contents of instruction and/or data cache. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include <features.h> + +/* Get the kernel definition for the op bits. */ +#include <asm/cachectl.h> + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; + +__END_DECLS + +#endif /* sys/cachectl.h */
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +63 -0
63 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sys/user.h new file +31 -0
@@ -0,0 +1,31 @@ +/* ptrace register data format definitions. +Copyright (C) 1998-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +/* Struct user_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 /* sys/user.h */
sysdeps/unix/sysv/linux/arc/ucontext-macros.h new file +29 -0
@@ -0,0 +1,29 @@ +/* Macros for ucontext routines, ARC version. +Copyright (C) 2017-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_ARC_UCONTEXT_MACROS_H +#define _LINUX_ARC_UCONTEXT_MACROS_H + +#include <sysdep.h> + +#include "ucontext_i.h" + +#define SAVE_REG (reg, rbase, off) st reg, [rbase, UCONTEXT_MCONTEXT + off * 4] +#define LOAD_REG (reg, rbase, off) ld reg, [rbase, UCONTEXT_MCONTEXT + off * 4] + +#endif
sysdeps/unix/sysv/linux/arc/ucontext_i.sym new file +20 -0
@@ -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 · 1 line
2.7.4
PATCH v2 9/15 ARC: Linux Startup and Dynamic Loading
In reply to Vineet Gupta--- ChangeLog | 2 + sysdeps/unix/sysv/linux/arc/dl-static.c | 84 +++++++++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/ldsodefs.h | 32 +++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arc/dl-static.c create mode 100644 sysdeps/unix/sysv/linux/arc/ldsodefs.h
ChangeLog +2 -0
@@ -67,6 +67,8 @@ * sysdeps/unix/sysv/linux/arc/sys/user.h: New file. * sysdeps/unix/sysv/linux/arc/ucontext-macros.h: New file. * sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file. + * sysdeps/unix/sysv/linux/arc/dl-static.c: New file. + * sysdeps/unix/sysv/linux/arc/ldsodefs.h: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/unix/sysv/linux/arc/dl-static.c new file +84 -0
84 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/ldsodefs.h new file +32 -0
@@ -0,0 +1,32 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. ARC +Copyright (C) 2001-2019 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#ifndef _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 · 1 line
2.7.4
PATCH v2 10/15 ARC: ABI lists
In reply to Vineet Gupta--- ChangeLog | 16 + sysdeps/arc/nofpu/libm-test-ulps | 390 ++++ sysdeps/arc/nofpu/libm-test-ulps-name | 1 + sysdeps/unix/sysv/linux/arc/c++-types.data | 67 + sysdeps/unix/sysv/linux/arc/ld.abilist | 9 + .../unix/sysv/linux/arc/libBrokenLocale.abilist | 1 + sysdeps/unix/sysv/linux/arc/libanl.abilist | 4 + sysdeps/unix/sysv/linux/arc/libc.abilist | 2089 ++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/libcrypt.abilist | 2 + sysdeps/unix/sysv/linux/arc/libdl.abilist | 9 + sysdeps/unix/sysv/linux/arc/libm.abilist | 753 +++++++ sysdeps/unix/sysv/linux/arc/libpthread.abilist | 235 +++ sysdeps/unix/sysv/linux/arc/libresolv.abilist | 79 + sysdeps/unix/sysv/linux/arc/librt.abilist | 35 + sysdeps/unix/sysv/linux/arc/libthread_db.abilist | 40 + sysdeps/unix/sysv/linux/arc/libutil.abilist | 6 + sysdeps/unix/sysv/linux/arc/localplt.data | 16 + 17 files changed, 3752 insertions(+) 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
ChangeLog +16 -0
@@ -69,6 +69,22 @@ * sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/arc/dl-static.c: New file. * sysdeps/unix/sysv/linux/arc/ldsodefs.h: New file. + * sysdeps/arc/nofpu/libm-test-ulps: New file. + * sysdeps/arc/nofpu/libm-test-ulps-name: New file. + * sysdeps/unix/sysv/linux/arc/c++-types.data: New file. + * sysdeps/unix/sysv/linux/arc/ld.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libanl.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libc.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libcrypt.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libdl.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libm.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libpthread.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libresolv.abilist: New file. + * sysdeps/unix/sysv/linux/arc/librt.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libthread_db.abilist: New file. + * sysdeps/unix/sysv/linux/arc/libutil.abilist: New file. + * sysdeps/unix/sysv/linux/arc/localplt.data: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/nofpu/libm-test-ulps new file +390 -0
390 lines not on this page · raw message
sysdeps/arc/nofpu/libm-test-ulps-name new file +1 -0
@@ -0,0 +1 @@ +ARC
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 +9 -0
@@ -0,0 +1,9 @@ +GLIBC_2.29 __libc_stack_end D 0x4 +GLIBC_2.29 __stack_chk_guard D 0x4 +GLIBC_2.29 __tls_get_addr F +GLIBC_2.29 _dl_mcount F +GLIBC_2.29 _r_debug D 0x14 +GLIBC_2.29 calloc F +GLIBC_2.29 free F +GLIBC_2.29 malloc F +GLIBC_2.29 realloc F
sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist new file +1 -0
@@ -0,0 +1 @@ +GLIBC_2.29 __ctype_get_mb_cur_max F
sysdeps/unix/sysv/linux/arc/libanl.abilist new file +4 -0
@@ -0,0 +1,4 @@ +GLIBC_2.29 gai_cancel F +GLIBC_2.29 gai_error F +GLIBC_2.29 gai_suspend F +GLIBC_2.29 getaddrinfo_a F
sysdeps/unix/sysv/linux/arc/libc.abilist new file +2089 -0
2,089 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/libcrypt.abilist new file +2 -0
@@ -0,0 +1,2 @@ +GLIBC_2.29 crypt F +GLIBC_2.29 crypt_r F
sysdeps/unix/sysv/linux/arc/libdl.abilist new file +9 -0
@@ -0,0 +1,9 @@ +GLIBC_2.29 dladdr F +GLIBC_2.29 dladdr1 F +GLIBC_2.29 dlclose F +GLIBC_2.29 dlerror F +GLIBC_2.29 dlinfo F +GLIBC_2.29 dlmopen F +GLIBC_2.29 dlopen F +GLIBC_2.29 dlsym F +GLIBC_2.29 dlvsym F
sysdeps/unix/sysv/linux/arc/libm.abilist new file +753 -0
406 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/libpthread.abilist new file +235 -0
235 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
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libthread_db.abilist new file +40 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libutil.abilist new file +6 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/localplt.data new file +16 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
PATCH v2 11/15 ARC: Update syscall-names.list for ARC specific syscalls
In reply to Vineet Gupta--- ChangeLog | 1 + sysdeps/unix/sysv/linux/syscall-names.list | 3 +++ 2 files changed, 4 insertions(+)
ChangeLog +1 -0
@@ -85,6 +85,7 @@ * sysdeps/unix/sysv/linux/arc/libthread_db.abilist: New file. * sysdeps/unix/sysv/linux/arc/libutil.abilist: New file. * sysdeps/unix/sysv/linux/arc/localplt.data: New file. + * sysdeps/unix/sysv/linux/syscall-names.list: Update for ARC. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/unix/sysv/linux/syscall-names.list +3 -0
@@ -42,6 +42,9 @@ adjtimex afs_syscall alarm alloc_hugepages +arc_gettls +arc_settls +arc_usr_cmpxchg arch_prctl arm_fadvise64_64 arm_sync_file_range
Signature · 1 line
2.7.4
PATCH v2 12/15 ARC: Build Infrastructure
In reply to Vineet Gupta--- ChangeLog | 13 +++++++++++++ sysdeps/arc/Implies | 4 ++++ sysdeps/arc/Makefile | 25 +++++++++++++++++++++++++ sysdeps/arc/Versions | 6 ++++++ sysdeps/arc/configure | 14 ++++++++++++++ sysdeps/arc/configure.ac | 11 +++++++++++ sysdeps/arc/nptl/Makefile | 22 ++++++++++++++++++++++ sysdeps/arc/preconfigure | 14 ++++++++++++++ sysdeps/unix/sysv/linux/arc/Implies | 3 +++ sysdeps/unix/sysv/linux/arc/Makefile | 20 ++++++++++++++++++++ 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/shlib-versions | 2 ++ 14 files changed, 158 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/shlib-versions
ChangeLog +13 -0
@@ -86,6 +86,19 @@ * sysdeps/unix/sysv/linux/arc/libutil.abilist: New file. * sysdeps/unix/sysv/linux/arc/localplt.data: New file. * sysdeps/unix/sysv/linux/syscall-names.list: Update for ARC. + * sysdeps/arc/Implies: New file. + * sysdeps/arc/Makefile: New file. + * sysdeps/arc/Versions: New file. + * sysdeps/arc/configure: New file. + * sysdeps/arc/configure.ac: New file. + * sysdeps/arc/nptl/Makefile: New file. + * sysdeps/arc/preconfigure: New file. + * sysdeps/unix/sysv/linux/arc/Implies: New file. + * sysdeps/unix/sysv/linux/arc/Makefile: New file. + * sysdeps/unix/sysv/linux/arc/Versions: New file. + * sysdeps/unix/sysv/linux/arc/configure: New file. + * sysdeps/unix/sysv/linux/arc/configure.ac: New file. + * sysdeps/unix/sysv/linux/arc/shlib-versions: New file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/arc/Implies new file +4 -0
@@ -0,0 +1,4 @@ +init_array +wordsize-32 +ieee754/flt-32 +ieee754/dbl-64
sysdeps/arc/Makefile new file +25 -0
@@ -0,0 +1,25 @@ +# ARC Makefile +# Copyright (C) 1993-2019 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/>. + +# We don't support long doubles as a distinct type. We don't need to set +# this variable; it's here mostly for documentational purposes. +long-double-fcts = no + +ifeq ($(subdir),debug) +CFLAGS-backtrace.c += -funwind-tables +endif
sysdeps/arc/Versions new file +6 -0
@@ -0,0 +1,6 @@ +libc { + GLIBC_2.29 { + __syscall_error; + __mcount; + } +}
sysdeps/arc/configure new file +14 -0
@@ -0,0 +1,14 @@ +# 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
sysdeps/arc/configure.ac new file +11 -0
@@ -0,0 +1,11 @@ +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)
sysdeps/arc/nptl/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# NPTL makefile fragment for ARC. +# Copyright (C) 2005-2019 Free Software Foundation, Inc. +# +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library. If not, see +# <http://www.gnu.org/licenses/>. + +ifeq ($(subdir),csu) +gen-as-const-headers += tcb-offsets.sym +endif
sysdeps/arc/preconfigure new file +14 -0
@@ -0,0 +1,14 @@ +case "$machine" in +arc*) + base_machine=arc + machine=arc + ;; +esac + +gccfloat=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __ARC_FPU_| wc -l` +if test "$gccfloat" != "0"; then + echo "glibc being configured for double precision floating point" + with_fp_cond=1 +else + with_fp_cond=0 +fi
sysdeps/unix/sysv/linux/arc/Implies new file +3 -0
@@ -0,0 +1,3 @@ +arc/nptl +unix/sysv/linux/generic/wordsize-32 +unix/sysv/linux/generic
sysdeps/unix/sysv/linux/arc/Makefile new file +20 -0
@@ -0,0 +1,20 @@ +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
sysdeps/unix/sysv/linux/arc/Versions new file +16 -0
@@ -0,0 +1,16 @@ +ld { + GLIBC_PRIVATE { + # used for loading by static libraries + _dl_var_init; + } +} +libc { + GLIBC_2.29 { + _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
@@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/arc. + +arch_minimum_kernel=3.9.0
sysdeps/unix/sysv/linux/arc/configure.ac new file +4 -0
@@ -0,0 +1,4 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/arc. + +arch_minimum_kernel=3.9.0
sysdeps/unix/sysv/linux/arc/shlib-versions new file +2 -0
@@ -0,0 +1,2 @@ +DEFAULT GLIBC_2.29 +ld=ld-linux-arc.so.2
Signature · 1 line
2.7.4
PATCH v2 13/15 build-many-glibcs.py: Enable ARC builds
In reply to Vineet Gupta--- ChangeLog | 1 + scripts/build-many-glibcs.py | 4 ++++ 2 files changed, 5 insertions(+)
ChangeLog +1 -0
@@ -99,6 +99,7 @@ * sysdeps/unix/sysv/linux/arc/configure: New file. * sysdeps/unix/sysv/linux/arc/configure.ac: New file. * sysdeps/unix/sysv/linux/arc/shlib-versions: New file. + * scripts/build-many-glibcs.py: Enable building for ARC. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
scripts/build-many-glibcs.py +4 -0
@@ -155,6 +155,9 @@ 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=archs']) self.add_config(arch='alpha', os_name='linux-gnu') self.add_config(arch='arm',
@@ -1265,6 +1268,7 @@ class Config(object): def install_linux_headers(self, cmdlist): """Install Linux kernel headers.""" arch_map = {'aarch64': 'arm64', + 'arc': 'arc', 'alpha': 'alpha', 'arm': 'arm', 'csky': 'csky',
Signature · 1 line
2.7.4
PATCH v2 14/15 NEWS: mention ARC port
In reply to Vineet Gupta--- ChangeLog | 1 + NEWS | 7 +++++++ 2 files changed, 8 insertions(+)
ChangeLog +1 -0
@@ -100,6 +100,7 @@ * sysdeps/unix/sysv/linux/arc/configure.ac: New file. * sysdeps/unix/sysv/linux/arc/shlib-versions: New file. * scripts/build-many-glibcs.py: Enable building for ARC. + * NEW: Mention ARC port. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
NEWS +7 -0
@@ -64,6 +64,13 @@ Major new features: "%EY" to control how the year number is formatted; they have the same effect that they would on "%Ey". +* Support for ARC HS cores running Linux has been contributed by Synopsys. + Port requires atleast + - binutils-2.31 (binutils-2_31-branch: commit 6ce881c15fc4, 2018-10-04) + - gcc 8.2 (gcc-8-stable: commit 0d5ba57508c5, 2019-01-29) + - Linux kernel 3.9+ + Soft-float ABI is currently supported. + Deprecated and removed features, and other changes affecting compatibility: * The glibc.tune tunable namespace has been renamed to glibc.cpu and the
Signature · 1 line
2.7.4
PATCH v2 15/15 make-syscalls.sh: fix comment referencing syscall-template
In reply to Vineet Gupta--- ChangeLog | 2 ++ sysdeps/unix/make-syscalls.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
ChangeLog +2 -0
@@ -101,6 +101,8 @@ * sysdeps/unix/sysv/linux/arc/shlib-versions: New file. * scripts/build-many-glibcs.py: Enable building for ARC. * NEW: Mention ARC port. + * sysdeps/unix/make-syscalls.sh: Fix comment referencing + syscall-template file. 2019-01-25 Siddhesh Poyarekar <siddhesh at sourceware.org>
sysdeps/unix/make-syscalls.sh +1 -1
@@ -7,7 +7,7 @@ # # This script is used to process the syscall data encoded in the various # syscalls.list files to produce thin assembly syscall wrappers around the -# appropriate OS syscall. See syscall-template.s for more details on the +# appropriate OS syscall. See syscall-template.S for more details on the # actual wrapper. # # Syscall Signature Prefixes:
Signature · 1 line
2.7.4
PATCH v2 15/15 make-syscalls.sh: fix comment referencing syscall-template
This particular patch is OK after 2.29 has been released and master has opened for 2.30 development, but such architecture-independent fixes ought not be considered part of the port submission (see
<https://sourceware.org/glibc/wiki/NewPorts>).
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
v2 cover glibc port to ARC processors
In reply to Vineet GuptaIn the absence of clear consensus regarding consideration of new ports to undocumented architectures (which would need to result in consensus on suitable rules on the subject to go in
<https://sourceware.org/glibc/wiki/NewPorts>), and in the absence of suitable public architecture and ABI documentation, I don't intend to attempt review of this or subsequent versions of the port submission. (I am supposing that the documentation available at
<http://me.bios.io/ARC_disassembly> - which in any case does not include an ABI reference - is for an architecture version too old to be sufficient for understanding and maintaining the port code as may be needed in the course of glibc maintenance.)
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
v2 cover glibc port to ARC processors
Quoted 6 lines · Joseph Myers
In the absence of clear consensus regarding consideration of new ports to undocumented architectures (which would need to result in consensus on suitable rules on the subject to go in
<https://sourceware.org/glibc/wiki/NewPorts>), and in the absence of suitable public architecture and ABI documentation, I don't intend to attempt review of this or subsequent versions of the port submission.
That would be really unfortunate. Your prior reviews of RFC and v1 have been immensely helpful, it would be a shame to not continue to get this privilege goinf fwd.
Having said that, wheels were already set in motion after your initial request in December. The ARCv2 ABI spec was opened up quickly (and mea culpa for not referencing it v2 submission). It is now publicly accessibly at [1]
The public version of PRM is being worked on, but it will take time to come to fruition. I hope you appreciate these things take time, considering where we came from - and it seems you found a workaround anyways ;-)
Quoted 6 lines
(I
am supposing that the documentation available at
<http://me.bios.io/ARC_disassembly> - which in any case does not include an ABI reference - is for an architecture version too old to be sufficient for understanding and maintaining the port code as may be needed in the course of glibc maintenance.)
Not really. It sure pertains to the predecessor ARCompact ISA, but in ARCv2 the bulk of changes were to Interrupt architecture, micro-architecture optimizations, SMP support etc, which are not relevant for glibc or general userspace coding. While the encodings etc did change, much of the baseline instruction set is pretty much the same, so ARCv2 assembly or generated code easily maps to ARCompact.
I do hope this is enough for you to reconsider reviewing the code.
Thx,
-Vineet
[1]
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki/files/ARCv2_ABI.pdf
v2 cover glibc port to ARC processors
Quoted 3 lines · Vineet Gupta
Having said that, wheels were already set in motion after your initial request in December. The ARCv2 ABI spec was opened up quickly (and mea culpa for not referencing it v2 submission). It is now publicly accessibly at [1]
Thanks. To be clear, the description at
<https://sourceware.org/glibc/wiki/NewPorts> of what should go in the summary message for a new port submission should be considered to apply to every version of that submission, so that each submission is self-contained. That is, every version of the submission should include information such as pointers to relevant manuals (in addition to whatever's appropriate about changes from the previous version of the submission).
Quoted 4 lines
The public version of PRM is being worked on, but it will take time to come to fruition. I hope you appreciate these things take time, considering where we came from - and it seems you found a workaround anyways ;-)
There are five months until the freeze for 2.30 starts (obviously the port will need its symbol versions updated for 2.30).
Signature · 2 lines
Joseph S. Myers joseph at codesourcery.com
ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
In reply to Vineet GuptaHi Joseph,
Quoted 12 lines · Vineet Gupta
Quoted 6 lines · Joseph Myers
In the absence of clear consensus regarding consideration of new ports to undocumented architectures (which would need to result in consensus on suitable rules on the subject to go in
<https://sourceware.org/glibc/wiki/NewPorts>), and in the absence of suitable public architecture and ABI documentation, I don't intend to attempt review of this or subsequent versions of the port submission.That would be really unfortunate. Your prior reviews of RFC and v1 have been immensely helpful, it would be a shame to not continue to get this privilege goinf fwd.
Quoted 7 lines
Having said that, wheels were already set in motion after your initial request in December. The ARCv2 ABI spec was opened up quickly (and mea culpa for not referencing it v2 submission). It is now publicly accessibly at [1]
The public version of PRM is being worked on, but it will take time to come to fruition. I hope you appreciate these things take time, considering where we came from - and it seems you found a workaround anyways ;-)
The public PRM is now available and I would like you to try and access it so that any bureaucracy is out of the way before I re-post ARC port for 2.32 !
Do note you still need to register to download but that is no different than say ARM.
The landing page is
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs44-hs46-hs48
And there in the link to actual doc is
https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf
Let me know how it goes.
Thx,
-Vineet
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Quoted 3 lines · Vineet Gupta
The public PRM is now available and I would like you to try and access it so that any bureaucracy is out of the way before I re-post ARC port for 2.32 !
Thanks!
There was one technical point regarding the glibc port I raised briefly in a discussion at the end of the Cauldron in Montreal: you should consider whether it would make sense, as a new 32-bit port, to have 64-bit times and 64-bit off_t, ino_t, etc. from the start, as RV32 is doing. We don't have a specific policy for this, but it may make sense for new ports not to include ABI variants that either are, or will become, obsolescent. If you require Linux 5.1 or later for the port then all or nearly all the architecture-independent pieces required for a 32-bit port supporting only 64-bit times should be covered by the RV32 patches, which I think are quite close to being ready to go into glibc, though you'd need to watch out for any (new or existing) #ifdef conditionals that might try to use 32-bit-time syscalls if they exist (which they don't on RV32) - and that would not prevent supporting older kernel versions later if desired, as the Y2038 support gets built out (including, in particular, the support for falling back to 32-bit-time syscalls in functions for 64-bit-time interfaces).
Signature · 7 lines
Joseph S. Myers [email protected] _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Quoted 6 lines · Joseph Myers
There was one technical point regarding the glibc port I raised briefly in a discussion at the end of the Cauldron in Montreal: you should consider whether it would make sense, as a new 32-bit port, to have 64-bit times and 64-bit
off_t,ino_t, etc. from the start, as RV32 is doing. We don't have a specific policy for this, but it may make sense for new ports not to include ABI variants that either are, or will become, obsolescent.
I agree we should do that.
Quoted 11 lines
If
you require Linux 5.1 or later for the port then all or nearly all the architecture-independent pieces required for a 32-bit port supporting only 64-bit times should be covered by the RV32 patches, which I think are quite close to being ready to go into glibc, though you'd need to watch out for any (new or existing) #ifdef conditionals that might try to use 32-bit-time syscalls if they exist (which they don't on RV32) - and that would not prevent supporting older kernel versions later if desired, as the Y2038 support gets built out (including, in particular, the support for falling back to 32-bit-time syscalls in functions for 64-bit-time interfaces).
Ok I see patches in flight on the mailing list. Would it make sense for me to start off in parallel with ARC port which will take it's due course of review and rework and in that process upstream y2038 work settles down and I then rebase/switch ARC to that. Or would rather wait for upstream to settle down and then I adjust/post ?
Thx,
-Vineet
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Quoted 12 lines · Vineet Gupta
Quoted 11 lines
If
you require Linux 5.1 or later for the port then all or nearly all the architecture-independent pieces required for a 32-bit port supporting only 64-bit times should be covered by the RV32 patches, which I think are quite close to being ready to go into glibc, though you'd need to watch out for any (new or existing) #ifdef conditionals that might try to use 32-bit-time syscalls if they exist (which they don't on RV32) - and that would not prevent supporting older kernel versions later if desired, as the Y2038 support gets built out (including, in particular, the support for falling back to 32-bit-time syscalls in functions for 64-bit-time interfaces).
Quoted 5 lines
Ok I see patches in flight on the mailing list. Would it make sense for me to start off in parallel with ARC port which will take it's due course of review and rework and in that process upstream y2038 work settles down and I then rebase/switch ARC to that. Or would rather wait for upstream to settle down and then I adjust/post ?
I'd suggest posting patches that are on top of the RV32 ones (maybe there's a git tree with RV32 changes to current glibc that could be used), and that only support Linux 5.1 and later (so you don't need anything much of the Y2038 support beyond what's in the RV32 patches).
Signature · 7 lines
Joseph S. Myers [email protected] _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Quoted 21 lines · Joseph Myers
Quoted 12 lines · Vineet Gupta
Quoted 11 lines
If
you require Linux 5.1 or later for the port then all or nearly all the architecture-independent pieces required for a 32-bit port supporting only 64-bit times should be covered by the RV32 patches, which I think are quite close to being ready to go into glibc, though you'd need to watch out for any (new or existing) #ifdef conditionals that might try to use 32-bit-time syscalls if they exist (which they don't on RV32) - and that would not prevent supporting older kernel versions later if desired, as the Y2038 support gets built out (including, in particular, the support for falling back to 32-bit-time syscalls in functions for 64-bit-time interfaces).Quoted 5 lines
Ok I see patches in flight on the mailing list. Would it make sense for me to start off in parallel with ARC port which will take it's due course of review and rework and in that process upstream y2038 work settles down and I then rebase/switch ARC to that. Or would rather wait for upstream to settle down and then I adjust/post ?
Quoted 4 lines
I'd suggest posting patches that are on top of the RV32 ones (maybe there's a git tree with RV32 changes to current glibc that could be used), and that only support Linux 5.1 and later (so you don't need anything much of the Y2038 support beyond what's in the RV32 patches).
Go for it!
My working branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.next
My latest RFC branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.rfc6
Alistair
Quoted 4 lines
--
Joseph S. Myers
[email protected]
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Quoted 6 lines · Alistair Francis
Quoted 5 lines
I'd suggest posting patches that are on top of the RV32 ones (maybe there's a git tree with RV32 changes to current glibc that could be used), and that only support Linux 5.1 and later (so you don't need anything much of the Y2038 support beyond what's in the RV32 patches).
Quoted 7 lines
Go for it!
My working branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.nextMy latest RFC branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.rfc6
Thx a bunch Alistair. I'm rebasing my stuff on top of your next branch as it seems to have more time/y2038 code so will help shake it out as well.
Thx,
-Vineet
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: ARCv2 Public PRM (was Re: [PATCH v2 00/15] glibc port to ARC processors)
Hi Vineet,
Quoted 13 lines · Alistair Francis
Quoted 12 lines
Quoted 6 lines
I'd suggest posting patches that are on top of the RV32 ones (maybe there's a git tree with RV32 changes to current glibc that could be used), and that only support Linux 5.1 and later (so you don't need anything much of the Y2038 support beyond what's in the RV32 patches).
Go for it!
My working branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.next
Quoted 6 lines
Quoted 2 lines
My latest RFC branch is here:
https://github.com/alistair23/glibc/tree/alistair/rv32.rfc6Thx a bunch Alistair. I'm rebasing my stuff on top of your next branch as it seems to have more time/y2038 code so will help shake it out as well.
If it may help a bit, please also review/check the current status of Y2038 work.
Some Y2038 related work (mostly for ARM32) may be also helpful as well (as some patches for RV32 also do the conversion for other architectures).
https://github.com/lmajewski/y2038_glibc/commits/y2038_edge
Please also find the meta layer for testing Y2038 (with some basic test suite) code on qemu-arm and Yocto/OE:
https://github.com/lmajewski/meta-y2038
(it shall also be easy to extend this meta layer to add support for ARC as well).
Quoted 3 lines
Thx,
-Vineet
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email protected]
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc