ARM64: support ILP32
cover ARM64: support ILP32
This series enables aarch64 port with ilp32 mode.
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:
ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type
- 64-bit arguments are passed in syscall as register pair, as kernel internally clears top halves for all input regs;
- standard syscall table is used;
- 32-bit time_t is used. AARCH64/ILP32 is waiting for general fix of Y2038 problem just like other 32-bit arches;
- stat{64}, statfs{64} structures are of the identical layout with LP64. Corresponding syscalls are taken from 64-bit code
- struct utmp, utmpx layouts are the same.
v1: https://sourceware.org/ml/libc-alpha/2016-06/msg00730.html
v2:
- rebased on master;
- dropped unneeded/unrelated patches;
- pread family platform implementation removed;
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);
Tested with LTP. Regressions are like this:
abort01 FAIL 2 kill11 FAIL 2 mmap16 FAIL 6 open12 FAIL 2 rename11 FAIL 2 rmdir02 FAIL 2 umount2_01 FAIL 2 umount2_02 FAIL 2 umount2_03 FAIL 2 utime06 FAIL 2
It's better than v1, and there are ~5 additional regressions comparing to aarch64, all are related to filesystem.
Andrew Pinski (17):
[AARCH64] define word size for lp64 and ilp32 [AARCH64] Add header guards to sysdep.h headers.
Add dynamic ILP32 AARCH64 relocations to elf.h [AARCH64] Add PTR_REG, PTR_LOG_SIZE, and PTR_SIZE. Use it in
LDST_PCREL and LDST_GLOBAL.
[AARCH64] Use PTR_REG in crti.S.
[AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG in dl-tlsesc.S [AARCH64] Use PTR_* macros in dl-trampoline.S [AARCH64] Use PTR_* in start.S
[AARCH64] Use PTR_REG in getcontext.S.
[AARCH64] Detect ILP32 in configure scripts. [AARCH64] Add ILP32 support to elf_machine_load_address. [AARCH64] Add ILP32 to makefiles
[AARCH64] Add support to ldconfig for ILP32 and libilp32 [AARCH64] Add ILP32 ld.so to the known interpreter names. [AARCH64] Add ldd-rewrite.sed so that ilp32 ld.so can be found [AARCH64] Make lp64 and ilp32 directories.
[AARCH64] Fix ILP32 warning
Yury Norov (6):
[AARCH64] ILP32: introduce syscalls that pass off_t [AARCH64] ILP32: support stat syscall family [AARCH64] delouse input arguments in system functions [AARCH64] Make __SIZEOF_SEM_T 16 for ILP32
off_t: fix register pair calculation for 64-bit case [AARCH64] Take utmp{,x}.h from s390 port
elf/cache.c | 3 + sysdeps/aarch64/Implies | 6 - sysdeps/aarch64/__longjmp.S | 6 +- sysdeps/aarch64/bits/wordsize.h | 25 +++ sysdeps/aarch64/configure | 15 +- sysdeps/aarch64/configure.ac | 11 +- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-irel.h | 3 +- sysdeps/aarch64/dl-machine.h | 199 ++++++++++++--------- sysdeps/aarch64/dl-tlsdesc.S | 56 +++--- sysdeps/aarch64/dl-trampoline.S | 18 +- sysdeps/aarch64/ilp32/Implies | 6 + sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/aarch64/lp64/Implies | 7 + sysdeps/aarch64/memcmp.S | 3 + sysdeps/aarch64/memcpy.S | 8 + sysdeps/aarch64/memset.S | 3 + sysdeps/aarch64/nptl/bits/semaphore.h | 4 + sysdeps/aarch64/preconfigure | 11 +- sysdeps/aarch64/setjmp.S | 5 +- sysdeps/aarch64/start.S | 20 ++- sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 + sysdeps/aarch64/strcpy.S | 2 + sysdeps/aarch64/strlen.S | 2 + sysdeps/aarch64/strncmp.S | 3 + sysdeps/aarch64/strnlen.S | 3 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 39 +++- sysdeps/generic/ldconfig.h | 1 + sysdeps/generic/stdint.h | 9 +- sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/Makefile | 16 +- sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 ++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 +++++++++ sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 7 + sysdeps/unix/sysv/linux/aarch64/configure | 24 ++- sysdeps/unix/sysv/linux/aarch64/configure.ac | 11 +- sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 +- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 +- sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 + sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++ .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 + sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 ++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 ---- sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 +++ sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 + sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 ++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 ---- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 - sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 +- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +- sysdeps/unix/sysv/linux/fallocate.c | 4 + sysdeps/unix/sysv/linux/fallocate64.c | 4 + sysdeps/unix/sysv/linux/generic/brk.c | 2 +- sysdeps/unix/sysv/linux/posix_fadvise.c | 4 + sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 + 100 files changed, 1649 insertions(+), 250 deletions(-) delete mode 100644 sysdeps/aarch64/Implies create mode 100644 sysdeps/aarch64/bits/wordsize.h mode change 100644 => 100755 sysdeps/aarch64/configure create mode 100644 sysdeps/aarch64/ilp32/Implies create mode 100644 sysdeps/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmp.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h mode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/kernel-features.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644 sysdeps/unix/sysv/linux/aarch64/mmap.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions
Signature · 1 line
2.7.4
PATCH 1/23 define word size for lp64 and ilp32
From: Andrew Pinski <[email protected]>
Additionally introduce and/or define MIN/MAX macro for size and ptrdiff types.
--- sysdeps/aarch64/bits/wordsize.h | 25 +++++++++++++++++++++++++ sysdeps/generic/stdint.h | 9 +++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 sysdeps/aarch64/bits/wordsize.h
sysdeps/aarch64/bits/wordsize.h new file +25 -0
@@ -0,0 +1,25 @@ +/* Copyright (C) 2014 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/>. */ + +#ifdef __LP64__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 1 +# define __WORDSIZE32_PTRDIFF_LONG 1 +#endif +
sysdeps/generic/stdint.h +7 -2
@@ -248,8 +248,13 @@ typedef unsigned long long int uintmax_t;# define PTRDIFF_MIN (-9223372036854775807L-1)# define PTRDIFF_MAX (9223372036854775807L)# else -# define PTRDIFF_MIN (-2147483647-1) -# define PTRDIFF_MAX (2147483647) +# if __WORDSIZE32_PTRDIFF_LONG +# define PTRDIFF_MIN (-2147483647L-1) +# define PTRDIFF_MAX (2147483647L) +# else +# define PTRDIFF_MIN (-2147483647-1) +# define PTRDIFF_MAX (2147483647) +# endif # endif /* Limits of `sig_atomic_t'. */
Signature · 1 line
2.7.4
Re: [PATCH 01/23] [AARCH64] define word size for lp64 and ilp32
sysdeps/aarch64/bits/wordsize.h
Quoted 1 line · Yury Norov
sysdeps/aarch64/bits/wordsize.h +0
-0
See what I said in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00786.html> about "make other bits/wordsize.h files define the macro to 0". This patch would break all other architectures (and AArch64 LP64 - you should test build and testsuite for that, as well as ILP32, and confirm that there are no testsuite regressions for LP64).
Quoted 1 line
+/* Copyright (C) 2014 Free Software Foundation, Inc.
See what I said in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00780.html> about one-line descriptions before copyright notices. Please check every new file in every patch in the series for this issue.
All copyright notices should have ranges of years that end in 2016.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 01/23] [AARCH64] define word size for lp64 and ilp32
Quoted 10 lines · Joseph Myers
sysdeps/aarch64/bits/wordsize.h
Quoted 1 line · Yury Norov
sysdeps/aarch64/bits/wordsize.h +0
-0See what I said in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00786.html> about "make otherbits/wordsize.hfiles define the macro to 0". This patch would break all other architectures (and AArch64 LP64 - you should test build and testsuite for that, as well as ILP32, and confirm that there are no testsuite regressions for LP64).
(Actually, for LP64, if you can confirm that the installed stripped shared libraries are byte-for-byte identical before and after the patch series, then a testsuite run is unnecessary. But you still need to run the testsuite for ILP32, and justify any failures there, and if the LP64 binaries aren't byte-for-byte identical, you should justify why they aren't.)
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 2/23 Add header guards to sysdep.h headers.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
sysdeps/aarch64/sysdep.h: Add header guards.
--- sysdeps/aarch64/sysdep.h | 5 +++++ 1 file changed, 5 insertions(+)
sysdeps/aarch64/sysdep.h +5 -0
@@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef _AARCH64_SYSDEP_H +#define _AARCH64_SYSDEP_H +#include <sysdeps/generic/sysdep.h> #ifdef __ASSEMBLER__
@@ -96,3 +99,5 @@#define mcount _mcount#endif /* __ASSEMBLER__ */ + +#endif /* _AARCH64_SYSDEP_H */
Signature · 1 line
2.7.4
PATCH 3/23 Add dynamic ILP32 AARCH64 relocations to elf.h
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
elf/elf.h (R_AARCH64_P32_ABS32, R_AARCH64_P32_COPY, R_AARCH64_P32_GLOB_DAT, R_AARCH64_P32_JUMP_SLOT, R_AARCH64_P32_RELATIVE, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC, R_AARCH64_P32_IRELATIVE): Define.
--- sysdeps/aarch64/dl-irel.h | 3 ++- sysdeps/aarch64/dl-machine.h | 53 +++++++++++++++++++++++--------------------- sysdeps/aarch64/sysdep.h | 6 +++++ 3 files changed, 36 insertions(+), 26 deletions(-)
sysdeps/aarch64/dl-irel.h +2 -1
@@ -23,6 +23,7 @@#include <stdio.h> #include <unistd.h> #include <ldsodefs.h> +#include <sysdep.h> #define ELF_MACHINE_IRELA 1
@@ -40,7 +41,7 @@ elf_irela (const ElfW(Rela) *reloc)ElfW (Addr) *const reloc_addr = (void *) reloc->r_offset;const unsigned long int r_type =ELFW (R_TYPE ) (reloc->r_info); -if (__glibc_likely (r_type ==R_AARCH64_IRELATIVE )) +if (__glibc_likely (r_type ==AARCH64_R (IRELATIVE ))) {ElfW (Addr) value =elf_ifunc_invoke (reloc->r_addend); *reloc_addr = value;
sysdeps/aarch64/dl-machine.h +28 -25
129 lines not on this page · raw message
sysdeps/aarch64/sysdep.h +6 -0
@@ -21,6 +21,12 @@#include <sysdeps/generic/sysdep.h> +#ifdef __LP64__ +# define AARCH64_R (NAME ) R_AARCH64_ ## NAME +#else +# define AARCH64_R (NAME ) R_AARCH64_P32_ ## NAME +#endif +#ifdef __ASSEMBLER__/* Syntactic details of assembler. */
Signature · 1 line
2.7.4
Re: [PATCH 03/23] Add dynamic ILP32 AARCH64 relocations to elf.h
Quoted 7 lines · Yury Norov
From: Andrew Pinski <[email protected]>
elf/elf.h(R_AARCH64_P32_ABS32,R_AARCH64_P32_COPY,R_AARCH64_P32_GLOB_DAT,R_AARCH64_P32_JUMP_SLOT,R_AARCH64_P32_RELATIVE,R_AARCH64_P32_TLS_DTPMOD,R_AARCH64_P32_TLS_DTPREL,R_AARCH64_P32_TLS_TPREL,R_AARCH64_P32_TLSDESC,R_AARCH64_P32_IRELATIVE): Define.
See what I said in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00783.html>. The patch subject and ChangeLog entries seem to have no relation to the patch contents.
Before posting any new patch series, please check that every patch description is accurate for the patch in question, both the subject line and the detailed description, and that you have a unified ChangeLog stanza that is also up to date for the change being posted.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 4/23 Add PTR_REG, PTR_LOG_SIZE, and PTR_SIZE. Use it in LDST_PCREL and LDST_GLOBAL.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This patch adds a few extra macros which are useful for ILP32 and updates PTR_MANGLE and PTR_DEMANGLE to use the some of the new macros.
* sysdeps/aarch64/sysdep.h (PTR_REG): New macro. (PTR_LOG_SIZE): New macro.
(PTR_SIZE): New macro.
(LDST_PCREL): Use arguments as register numbers rather register names. Use PTR_REG for the register when loading.
* sysdeps/unix/sysv/linux/aarch64/sysdep.h (PTR_MANGLE): Add a comment about that the arguments are register numbers rather register names. (PTR_DEMANGLE): Likewise.
* sysdeps/aarch64/__longjmp.S (__longjmp): Update calls to PTR_DEMANGLE.
* sysdeps/aarch64/setjmp.S (__sigsetjmp): Update calls to PTR_MANGLE.
--- sysdeps/aarch64/__longjmp.S | 4 ++-- sysdeps/aarch64/setjmp.S | 4 ++-- sysdeps/aarch64/sysdep.h | 28 ++++++++++++++++++---------- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 ++++++-- 4 files changed, 28 insertions(+), 16 deletions(-)
sysdeps/aarch64/__longjmp.S +2 -2
@@ -53,7 +53,7 @@ ENTRY (__longjmp) ldp x27, x28, [x0, #JB_X27<<3] #ifdef PTR_DEMANGLE ldp x29, x4, [x0, #JB_X29<<3] - PTR_DEMANGLE (x30, x4, x3, x2) + PTR_DEMANGLE (30, 4, 3, 2) #else ldp x29, x30, [x0, #JB_X29<<3] #endif
@@ -98,7 +98,7 @@ ENTRY (__longjmp) cfi_same_value(d15) #ifdef PTR_DEMANGLE ldr x4, [x0, #JB_SP<<3] - PTR_DEMANGLE (x5, x4, x3, x2) + PTR_DEMANGLE (5, 4, 3, 2) #else ldr x5, [x0, #JB_SP<<3] #endif
sysdeps/aarch64/setjmp.S +2 -2
@@ -42,7 +42,7 @@ ENTRY (__sigsetjmp) stp x27, x28, [x0, #JB_X27<<3] #ifdef PTR_MANGLE - PTR_MANGLE (x4, x30, x3, x2) + PTR_MANGLE (4, 30, 3, 2) stp x29, x4, [x0, #JB_X29<<3] #else stp x29, x30, [x0, #JB_X29<<3]
@@ -57,7 +57,7 @@ ENTRY (__sigsetjmp) stp d14, d15, [x0, #JB_D14<<3] #ifdef PTR_MANGLE mov x4, sp - PTR_MANGLE (x5, x4, x3, x2) + PTR_MANGLE (5, 4, 3, 2) str x5, [x0, #JB_SP<<3] #else mov x2, sp
sysdeps/aarch64/sysdep.h +18 -10
@@ -23,10 +23,16 @@#ifdef __LP64__# define AARCH64_R (NAME ) R_AARCH64_ ## NAME +# define PTR_REG (n) x##n +# define PTR_LOG_SIZE 3#else # define AARCH64_R (NAME ) R_AARCH64_P32_ ## NAME +# define PTR_REG (n) w##n +# define PTR_LOG_SIZE 2#endif +#define PTR_SIZE (1<<PTR_LOG_SIZE) +#ifdef __ASSEMBLER__/* Syntactic details of assembler. */
@@ -87,16 +93,18 @@# define L (name) .L##name#endif -/* Load or store to/from a pc-relative EXPR into/from R, using T. */ -#define LDST_PCREL (OP ,R ,T ,EXPR ) \ - adrp T, EXPR; \ - OP R, [T, #:lo12:EXPR];\ - -/* Load or store to/from a got-relative EXPR into/from R, using T. */ -#define LDST_GLOBAL (OP ,R ,T ,EXPR ) \ - adrp T, :got:EXPR; \ - ldr T, [T, #:got_lo12:EXPR];\ - OP R, [T]; +/* Load or store to/from a pc-relative EXPR into/from R, using T. +Note R and T are register numbers and not register names. */ +#define LDST_PCREL (OP ,R ,T ,EXPR ) \ + adrp x##T, EXPR; \ + OP PTR_REG (R), [x##T, #:lo12:EXPR]; \ + +/* Load or store to/from a got-relative EXPR into/from R, using T. +Note R and T are register numbers and not register names. */ +#define LDST_GLOBAL (OP ,R ,T ,EXPR ) \ + adrp x##T, :got:EXPR; \ + ldr PTR_REG (T), [x##T, #:got_lo12:EXPR]; \ + OP PTR_REG (R), [x##T];/* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the
sysdeps/unix/sysv/linux/aarch64/sysdep.h +6 -2
@@ -250,12 +250,14 @@ (!defined SHARED && (IS_IN (libc) \ || IS_IN (libpthread))))# ifdef __ASSEMBLER__ +/* Note, dst, src, guard, and tmp are all register numbers rather than +register names so they will work with both ILP32 and LP64. */ # define PTR_MANGLE (dst, src, guard, tmp) \ LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \ PTR_MANGLE2 (dst, src, guard)/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ # define PTR_MANGLE2 (dst, src, guard)\ - eor dst, src, guard + eor x##dst, x##src, x##guard# define PTR_DEMANGLE (dst, src, guard, tmp)\ PTR_MANGLE (dst, src, guard, tmp)# define PTR_DEMANGLE2 (dst, src, guard)\
@@ -268,12 +270,14 @@ extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;# endif #else # ifdef __ASSEMBLER__ +/* Note, dst, src, guard, and tmp are all register numbers rather than +register names so they will work with both ILP32 and LP64. */ # define PTR_MANGLE (dst, src, guard, tmp) \ LDST_GLOBAL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard)); \ PTR_MANGLE2 (dst, src, guard)/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ # define PTR_MANGLE2 (dst, src, guard)\ - eor dst, src, guard + eor x##dst, x##src, x##guard# define PTR_DEMANGLE (dst, src, guard, tmp)\ PTR_MANGLE (dst, src, guard, tmp)# define PTR_DEMANGLE2 (dst, src, guard)\
Signature · 1 line
2.7.4
PATCH 5/23 Use PTR_REG in crti.S.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
call_weak_fn loads from a pointer, so use PTR_REG so the load is 32bits for ILP32.
* sysdeps/aarch64/crti.S: Include sysdep.h
(call_weak_fn): Use PTR_REG when loading fromPREINIT_FUNCTION.
AARCH64: Make RTLD_START paramatizable
Make RTLD_START paramatizable for ILP32 and LP64 usage and provides common code between ILP32.
* sysdeps/aarch64/dl-machine.h (RTLD_START): Rename to ... (RTLD_START_1): This and add PTR, PTR_SIZE_LOG, and PTR_SP arguments. (RTLD_START): New macro which uses RTLD_START_1.
--- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-machine.h | 128 ++++++++++++++++++++++--------------------- 2 files changed, 69 insertions(+), 62 deletions(-)
sysdeps/aarch64/crti.S +2 -1
@@ -39,6 +39,7 @@ they can be called as functions. The symbols _init and _fini are magic and cause the linker to emit DT_INIT and DT_FINI. */ +#include <sysdep.h> #include <libc-symbols.h> #ifndef PREINIT_FUNCTION
@@ -60,7 +61,7 @@ .type call_weak_fn, %function call_weak_fn: adrp x0, :got:PREINIT_FUNCTION - ldr x0, [x0, #:got_lo12:PREINIT_FUNCTION] + ldr PTR_REG(0), [x0, #:got_lo12:PREINIT_FUNCTION] cbz x0, 1f b PREINIT_FUNCTION 1:
sysdeps/aarch64/dl-machine.h +67 -61
135 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH 05/23] [AARCH64] Use PTR_REG in crti.S.
Quoted 9 lines · Yury Norov
From: Andrew Pinski <[email protected]>
call_weak_fnloads from a pointer, so usePTR_REGso the load is 32bits for ILP32.*
sysdeps/aarch64/crti.S: Includesysdep.h
(call_weak_fn): UsePTR_REGwhen loading fromPREINIT_FUNCTION.
Quoted 8 lines
AARCH64: Make
RTLD_STARTparamatizableMake
RTLD_STARTparamatizable for ILP32 and LP64 usage and provides common code between ILP32.*
sysdeps/aarch64/dl-machine.h(RTLD_START): Rename to ... (RTLD_START_1): This and add PTR,PTR_SIZE_LOG, andPTR_SParguments. (RTLD_START): New macro which usesRTLD_START_1.
See what I said in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00783.html> about unified ChangeLog stanzas.
Subject
Long description
yyyy-mm-dd Author <email>
* file: description.
* file2: description.
...
*Not* separate alternating long descriptions and ChangeLog entries. If the changes are logically separable, post them separately.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 6/23 Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG in dl-tlsesc.S
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This converts dl-tlsdesc.S code over to use the new macros which allows for sharing between ILP32 and LP64 code.
* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_return): Use PTR_REG.
(_dl_tlsdesc_dynamic) : Use PTR_REG, PTR_SIZE.
(_dl_tlsdesc_resolve_hold) : Likewise.
(_dl_tlsdesc_resolve_rela) : Likewise.
(_dl_tlsdesc_return_lazy) : Likewise.
(_dl_tlsdesc_undefweak) : Likewise.
--- sysdeps/aarch64/dl-tlsdesc.S | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
sysdeps/aarch64/dl-tlsdesc.S +24 -24
@@ -74,7 +74,7 @@ cfi_startproc .align 2 _dl_tlsdesc_return: - ldr x0, [x0, #8] + ldr PTR_REG (0), [x0, #PTR_SIZE] RET cfi_endproc .size _dl_tlsdesc_return, .-_dl_tlsdesc_return
@@ -95,9 +95,9 @@ _dl_tlsdesc_return_lazy: so it reads the same value (this function is the final value of td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load - from [x0,#8] here happens after the initialization of td->arg. */ - ldar xzr, [x0] - ldr x0, [x0, #8] + from [x0,#PTR_SIZE] here happens after the initialization of td->arg. */ + ldar PTR_REG (zr), [x0] + ldr PTR_REG (0), [x0, #PTR_SIZE] RET cfi_endproc .size _dl_tlsdesc_return_lazy, .-_dl_tlsdesc_return_lazy
@@ -125,10 +125,10 @@ _dl_tlsdesc_undefweak: td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#8] here happens after the initialization of td->arg. */ - ldar xzr, [x0] - ldr x0, [x0, #8] + ldar PTR_REG (zr), [x0] + ldr PTR_REG (0), [x0, #PTR_SIZE] mrs x1, tpidr_el0 - sub x0, x0, x1 + sub PTR_REG (0), PTR_REG (0), PTR_REG (1) ldr x1, [sp], #16 cfi_adjust_cfa_offset (-16) RET
@@ -187,22 +187,22 @@ _dl_tlsdesc_dynamic: so it reads the same value (this function is the final value of td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load - from [x0,#8] here happens after the initialization of td->arg. */ - ldar xzr, [x0] - ldr x1, [x0,#8] - ldr x0, [x4] - ldr x3, [x1,#16] - ldr x2, [x0] - cmp x3, x2 + from [x0,#PTR_SIZE] here happens after the initialization of td->arg. */ + ldar PTR_REG (zr), [x0] + ldr PTR_REG (1), [x0,#PTR_SIZE] + ldr PTR_REG (0), [x4] + ldr PTR_REG (3), [x1,#(PTR_SIZE * 2)] + ldr PTR_REG (2), [x0] + cmp PTR_REG (3), PTR_REG (2) b.hi 2f - ldr x2, [x1] - add x0, x0, x2, lsl #4 - ldr x0, [x0] + ldr PTR_REG (2), [x1] + add PTR_REG (0), PTR_REG (0), PTR_REG (2), lsl #(PTR_LOG_SIZE + 1) + ldr PTR_REG (0), [x0] cmn x0, #0x1 b.eq 2f - ldr x1, [x1,#8] - add x0, x0, x1 - sub x0, x0, x4 + ldr PTR_REG (1), [x1,#(PTR_SIZE * 2)] + add PTR_REG (0), PTR_REG (0), PTR_REG (1) + sub PTR_REG (0), PTR_REG (0), PTR_REG (4) 1: ldp x1, x2, [sp, #32+16*0] ldp x3, x4, [sp, #32+16*1]
@@ -233,7 +233,7 @@ _dl_tlsdesc_dynamic: bl __tls_get_addr mrs x1, tpidr_el0 - sub x0, x0, x1 + sub PTR_REG (0), PTR_REG (0), PTR_REG (1) RESTORE_Q_REGISTERS
@@ -279,13 +279,13 @@ _dl_tlsdesc_resolve_rela: SAVE_Q_REGISTERS - ldr x1, [x3, #8] + ldr PTR_REG (1), [x3, #PTR_SIZE] bl _dl_tlsdesc_resolve_rela_fixup RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*8] - ldr x1, [x0] + ldr PTR_REG (1), [x0] blr x1 ldp x1, x4, [sp, #32+16*0]
@@ -346,7 +346,7 @@ _dl_tlsdesc_resolve_hold: RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*9] - ldr x1, [x0] + ldr PTR_REG (1), [x0] blr x1 ldp x1, x2, [sp, #32+16*0]
Signature · 1 line
2.7.4
Re: [PATCH 06/23] [AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG in dl-tlsesc.S
Quoted 6 lines · Yury Norov
*
sysdeps/aarch64/dl-tlsdesc.S(_dl_tlsdesc_return): UsePTR_REG.
(_dl_tlsdesc_dynamic) : UsePTR_REG,PTR_SIZE.
(_dl_tlsdesc_resolve_hold) : Likewise.
(_dl_tlsdesc_resolve_rela) : Likewise.
(_dl_tlsdesc_return_lazy) : Likewise.
(_dl_tlsdesc_undefweak) : Likewise.
Note this is incorrect ChangeLog formatting. No spaces before ':' and each line should be indented by one TAB. Please check formatting in all patches.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 7/23 Use PTR_* macros in dl-trampoline.S
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
Use the PTR_* macros in dl-trampoline.S so it can be used for both ILP32 and LP64. Also add a comment about what was an magic number (the size of the rela relocation entries).
* sysdeps/aarch64/dl-trampoline.S (ip0l): New define. (RELA_SIZE): New define.
(_dl_runtime_resolve): Use PTR_REG, PTR_SIZE. (_dl_runtime_profile): Likewise. Use RELA_SIZE and ip0l.
--- sysdeps/aarch64/dl-trampoline.S | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
sysdeps/aarch64/dl-trampoline.S +11 -7
@@ -22,9 +22,13 @@ #include "dl-link.h" #define ip0 x16 +#define ip0l PTR_REG (16) #define ip1 x17 #define lr x30 +/* RELA relocatons are 3 pointers */ +#define RELA_SIZE (PTR_SIZE * 3) + .text .globl _dl_runtime_resolve .type _dl_runtime_resolve, #function
@@ -79,7 +83,7 @@ _dl_runtime_resolve: cfi_rel_offset (q1, 80+7*16) /* Get pointer to linker struct. */ - ldr x0, [ip0, #-8] + ldr PTR_REG (0), [ip0, #-PTR_SIZE] /* Prepare to call _dl_fixup(). */ ldr x1, [sp, 80+8*16] /* Recover &PLTGOT[n] */
@@ -87,7 +91,7 @@ _dl_runtime_resolve: sub x1, x1, ip0 add x1, x1, x1, lsl #1 lsl x1, x1, #3 - sub x1, x1, #192 + sub x1, x1, #(RELA_SIZE<<3) lsr x1, x1, #3 /* Call fixup routine. */
@@ -191,7 +195,7 @@ _dl_runtime_profile: stp x0, x1, [x29, #OFFSET_RG + DL_OFFSET_RG_SP] /* Get pointer to linker struct. */ - ldr x0, [ip0, #-8] + ldr PTR_REG (0), [ip0, #-PTR_SIZE] /* Prepare to call _dl_profile_fixup(). */ ldr x1, [x29, OFFSET_PLTGOTN] /* Recover &PLTGOT[n] */
@@ -199,7 +203,7 @@ _dl_runtime_profile: sub x1, x1, ip0 add x1, x1, x1, lsl #1 lsl x1, x1, #3 - sub x1, x1, #192 + sub x1, x1, #(RELA_SIZE<<3) lsr x1, x1, #3 stp x0, x1, [x29, #OFFSET_SAVED_CALL_X0]
@@ -210,8 +214,8 @@ _dl_runtime_profile: add x4, x29, #OFFSET_FS /* address of framesize */ bl _dl_profile_fixup - ldr ip0, [x29, #OFFSET_FS] /* framesize == 0 */ - cmp ip0, #0 + ldr ip0l, [x29, #OFFSET_FS] /* framesize == 0 */ + cmp ip0l, #0 bge 1f cfi_remember_state
@@ -243,7 +247,7 @@ _dl_runtime_profile: 1: /* The new frame size is in ip0. */ - sub x1, x29, ip0 + sub PTR_REG (1), PTR_REG (29), ip0l and sp, x1, #0xfffffffffffffff0 str x0, [x29, #OFFSET_T1]
Signature · 1 line
2.7.4
PATCH 8/23 Use PTR_* in start.S
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
To support ILP32 without much sources changes, this changes sysdeps/aarch64/start.S to use the PTR_* macros which was defined earlier.
* sysdeps/aarch64/start.S: Include sysdep.h
(_start): Use PTR_REG, PTR_SIZE macros.
--- sysdeps/aarch64/start.S | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
sysdeps/aarch64/start.S +11 -9
@@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ +#include <sysdep.h> + /* This is the canonical entry point, usually the first thing in the text segment.
@@ -25,7 +27,7 @@ At this entry point, most registers' values are unspecified, except: - x0 Contains a function pointer to be registered with `atexit'. + x0/w0 Contains a function pointer to be registered with `atexit'. This is how the dynamic linker arranges to have DT_FINI functions called for shared libraries that have been loaded before this code runs.
@@ -52,26 +54,26 @@ _start: mov x5, x0 /* Load argc and a pointer to argv */ - ldr x1, [sp, #0] - add x2, sp, #8 + ldr PTR_REG (1), [sp, #0] + add x2, sp, #PTR_SIZE /* Setup stack limit in argument register */ mov x6, sp #ifdef SHARED adrp x0, :got:main - ldr x0, [x0, #:got_lo12:main] + ldr PTR_REG (0), [x0, #:got_lo12:main] adrp x3, :got:__libc_csu_init - ldr x3, [x3, #:got_lo12:__libc_csu_init] + ldr PTR_REG (3), [x3, #:got_lo12:__libc_csu_init] adrp x4, :got:__libc_csu_fini - ldr x4, [x4, #:got_lo12:__libc_csu_fini] + ldr PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini] #else /* Set up the other arguments in registers */ - ldr x0, =main - ldr x3, =__libc_csu_init - ldr x4, =__libc_csu_fini + ldr PTR_REG (0), =main + ldr PTR_REG (3), =__libc_csu_init + ldr PTR_REG (4), =__libc_csu_fini #endif /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
Signature · 1 line
2.7.4
PATCH 9/23 Use PTR_REG in getcontext.S.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
Just like the other patches, this patch allows for getcontext.S to be used between ILP32 and LP64.
* sysdeps/unix/sysv/linux/aarch64/getcontext.S: Use PTR_REG when doing an add so wrapping of the pointer is correct for ILP32.
--- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sysdeps/unix/sysv/linux/aarch64/getcontext.S +1 -1
@@ -90,7 +90,7 @@ ENTRY(__getcontext) /* Grab the signal mask */ /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */ - add x2, x0, #UCONTEXT_SIGMASK + add PTR_REG (2), PTR_REG (0), #UCONTEXT_SIGMASK mov x0, SIG_BLOCK mov x1, 0 mov x3, _NSIG8
Signature · 1 line
2.7.4
PATCH 10/23 Detect ILP32 in configure scripts.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This adds detecting of ILP32 to the configure scripts.
Adding to preconfigure detection of ilp32 in preconfigure and then writing out the default-abi in configure.
* sysdeps/aarch64/preconfigure: Detect ILP32 and set aarch64_config_abi to ilp32 for ilp32 and lp64 for lp64. Set machine to either aarch64/ilp32 or aarch64/lp64 depending on the ABI that is selected.
* sysdeps/aarch64/configure.ac: Define HAVE_AARCH64_ILP32 if this is ILP32. Set the default-abi to either ilp32, lp64, ilp32_be or lp64_be depending on the ABI.
* sysdeps/aarch64/configure: Regenerate.
* sysdeps/unix/sysv/linux/aarch64/configure.ac: Set arch_minimum_kernel to 3.19.0 for ILP32.
Set LIBC_SLIBDIR_RTLDDIR to libilp32/lib for ilp32.
* sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
--- sysdeps/aarch64/configure | 15 +++++++++++---- sysdeps/aarch64/configure.ac | 11 +++++++++-- sysdeps/aarch64/preconfigure | 11 ++++++++++- sysdeps/unix/sysv/linux/aarch64/configure | 22 +++++++++++++++++++--- sysdeps/unix/sysv/linux/aarch64/configure.ac | 9 +++++++-- 5 files changed, 56 insertions(+), 12 deletions(-) mode change 100644 => 100755 sysdeps/aarch64/configure mode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure
sysdeps/aarch64/configure +11 -4
@@ -163,12 +163,19 @@ rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5 $as_echo "$libc_cv_aarch64_be" >&6; } + +if test $aarch64_config_abi = ilp32; then + $as_echo "#define HAVE_AARCH64_ILP32 1" >>confdefs.h + +fi + if test $libc_cv_aarch64_be = yes; then $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h - config_vars="$config_vars -default-abi = lp64_be" + libc_aarch64_be=_be else - config_vars="$config_vars -default-abi = lp64" + libc_aarch64_be= fi + +config_vars="$config_vars +default-abi = ${aarch64_config_abi}${libc_aarch64_be}"
sysdeps/aarch64/configure.ac +9 -2
@@ -14,9 +14,16 @@ AC_CACHE_CHECK([for big endian], yes #endif ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)]) + +if test $aarch64_config_abi = ilp32; then + AC_DEFINE(HAVE_AARCH64_ILP32) +fi + if test $libc_cv_aarch64_be = yes; then AC_DEFINE(HAVE_AARCH64_BE) - LIBC_CONFIG_VAR([default-abi], [lp64_be]) + libc_aarch64_be=_be else - LIBC_CONFIG_VAR([default-abi], [lp64]) + libc_aarch64_be= fi + +LIBC_CONFIG_VAR([default-abi], [${aarch64_config_abi}${libc_aarch64_be}])
sysdeps/aarch64/preconfigure +10 -1
@@ -1,6 +1,15 @@ case "$machine" in aarch64*) base_machine=aarch64 - machine=aarch64 + case "$CC $CFLAGS $CPPFLAGS " in + *" -mabi=ilp32 "*) aarch64_config_abi=ilp32 ;; + *" -mabi=lp64 "*) aarch64_config_abi=lp64 ;; + *) aarch64_config_abi=default ;; + esac + case $aarch64_config_abi in + default) machine=aarch64/lp64 aarch64_config_abi=lp64 ;; + ilp32) machine=aarch64/ilp32 ;; + lp64) machine=aarch64/lp64 ;; + esac ;; esac
sysdeps/unix/sysv/linux/aarch64/configure +19 -3
@@ -1,9 +1,23 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. -arch_minimum_kernel=3.7.0 - -test -n "$libc_cv_slibdir" || +if test $aarch64_config_abi = ilp32; then + arch_minimum_kernel=3.19.0 + test -n "$libc_cv_slibdir" || +case "$prefix" in +/usr | /usr/) + libc_cv_slibdir=/libilp32 + libc_cv_rtlddir=/lib + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/libilp32'; + # Locale data can be shared between 32-bit and 64-bit libraries. + libc_cv_complocaledir='${exec_prefix}/lib/locale' + fi + ;; +esac +else + arch_minimum_kernel=3.7.0 + test -n "$libc_cv_slibdir" || case "$prefix" in /usr | /usr/) libc_cv_slibdir=/lib64
@@ -15,3 +29,5 @@ case "$prefix" in fi ;; esac +fi +
sysdeps/unix/sysv/linux/aarch64/configure.ac +7 -2
@@ -1,6 +1,11 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. -arch_minimum_kernel=3.7.0 +if test $aarch64_config_abi = ilp32; then + arch_minimum_kernel=10.0.0 + LIBC_SLIBDIR_RTLDDIR([libilp32], [lib]) +else + arch_minimum_kernel=3.7.0 + LIBC_SLIBDIR_RTLDDIR([lib64], [lib]) +fi -LIBC_SLIBDIR_RTLDDIR([lib64], [lib])
Signature · 1 line
2.7.4
Re: [PATCH 10/23] [AARCH64] Detect ILP32 in configure scripts.
<https://sourceware.org/ml/libc-alpha/2016-06/msg00785.html> and
<https://sourceware.org/ml/libc-alpha/2014-10/msg00639.html> still apply. Please make the changes requested there before any reposting of the patch series.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 10/23] [AARCH64] Detect ILP32 in configure scripts.
Quoted 4 lines · Joseph Myers
<https://sourceware.org/ml/libc-alpha/2016-06/msg00785.html> and
<https://sourceware.org/ml/libc-alpha/2014-10/msg00639.html> still apply. Please make the changes requested there before any reposting of the patch series.
Yes, I forgot about glibc version. I don't want to add changelogs because I think patches order should/may be changed, and as all that changelogs touch single file, there will be nightmare to rebase series.
Quoted 16 lines
Quoted 16 lines
sysdeps/aarch64/preconfigure +6
-1@@ -1,6 +1,15 @@ case "$machine" in aarch64*) base_machine=aarch64 - machine=aarch64 + case "$CC $CFLAGS $CPPFLAGS " in + *" -mabi=ilp32 "*) aarch64_config_abi=ilp32 ;; + *" -mabi=lp64 "*) aarch64_config_abi=lp64 ;; + *) aarch64_config_abi=default ;; + esac + case $aarch64_config_abi in
Quoted 8 lines
sysdeps/aarch64/preconfigure line 11
Quoted 2 lines
sysdeps/aarch64/preconfigure +1
-0+ default) machine=aarch64/lp64 aarch64_config_abi=lp64 ;;It would seem better to test how the compiler behaves (what it predefines), as now done for MIPS, so that this works with a compiler configured --with-abi=ilp32 without needing to add an explicit ABI option
to CC or CFLAGS.
I didn't understand what you mean here and forgot to ask. I didn't work much on glibc, and not familiar to it's build system. Could you explain it little more detailed please?
Re: [PATCH 10/23] [AARCH64] Detect ILP32 in configure scripts.
Quoted 10 lines · Yury Norov
Quoted 4 lines · Joseph Myers
<https://sourceware.org/ml/libc-alpha/2016-06/msg00785.html> and
<https://sourceware.org/ml/libc-alpha/2014-10/msg00639.html> still apply. Please make the changes requested there before any reposting of the patch series.Yes, I forgot about glibc version. I don't want to add changelogs because I think patches order should/may be changed, and as all that changelogs touch single file, there will be nightmare to rebase series.
The convention is that you include the ChangeLog entry as part of the patch description, rather than changing the ChangeLog file, to avoid this issue. But with the formatting exactly matching what would go in the ChangeLog file, so that for the final commit you just need to update the date in it and then prepend to the ChangeLog file.
Quoted 25 lines
Quoted 16 lines
Quoted 16 lines
sysdeps/aarch64/preconfigure +6
-1@@ -1,6 +1,15 @@ case "$machine" in aarch64*) base_machine=aarch64 - machine=aarch64 + case "$CC $CFLAGS $CPPFLAGS " in + *" -mabi=ilp32 "*) aarch64_config_abi=ilp32 ;; + *" -mabi=lp64 "*) aarch64_config_abi=lp64 ;; + *) aarch64_config_abi=default ;; + esac + case $aarch64_config_abi inQuoted 8 lines
sysdeps/aarch64/preconfigure line 11
Quoted 2 lines
sysdeps/aarch64/preconfigure +1
-0+ default) machine=aarch64/lp64 aarch64_config_abi=lp64 ;;It would seem better to test how the compiler behaves (what it predefines), as now done for MIPS, so that this works with a compiler configured --with-abi=ilp32 without needing to add an explicit ABI option
to CC or CFLAGS.
Quoted 3 lines
I didn't understand what you mean here and forgot to ask. I didn't work much on glibc, and not familiar to it's build system. Could you explain it little more detailed please?
See sysdeps/mips/preconfigure. It runs $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null and extracts predefined macros that relate to the ABI from the output. This avoids needing to hardcode anything about what the default ABI might be for a compiler if neither -mabi= option is passed.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 11/23 Add ILP32 support to elf_machine_load_address.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This adds ILP32 support to elf_machine_load_address.
Since elf_machine_load_address depends on the static address being found without relocations, we need to use 16bit relocation which gets resolved at link time for ILP32. This is just like how the 32bit relocation gets resolved at link time for LP64.
* sysdeps/aarch64/dl-machine.h (elf_machine_load_address): Add support for ILP32.
--- sysdeps/aarch64/dl-machine.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
sysdeps/aarch64/dl-machine.h +16 -2
@@ -54,19 +54,33 @@ elf_machine_load_address (void)by constructing a non GOT reference to the symbol, the dynamic address of the symbol we compute using adrp/add to compute the symbol's address relative to the PC. -This depends on 32bit relocations being resolved at link time -and that the static address fits in the 32bits. */ +This depends on 32/16bit relocations being resolved at link time +and that the static address fits in the 32/16 bits. */ ElfW (Addr) static_addr;ElfW (Addr) dynamic_addr; asm (" \n" " adrp %1, _dl_start; \n" +#ifdef __LP64__ " add %1, %1, #:lo12:_dl_start \n" +#else +" add %w1, %w1, #:lo12:_dl_start \n" +#endif " ldr %w0, 1f \n" " b 2f \n" "1: \n" +#ifdef __LP64__ " .word _dl_start \n" +#else +# ifdef __AARCH64EB__ +" .short 0 \n" +# endif +" .short _dl_start \n" +# ifndef __AARCH64EB__ +" .short 0 \n" +# endif +#endif"2: \n" :"=r" (static_addr),"=r" (dynamic_addr));return dynamic_addr - static_addr;
Signature · 1 line
2.7.4
PATCH 12/23 Add ILP32 to makefiles
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This patch adds ilp32 and ilp32_be as abi variants to the aarch64 linux makefile.
* sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants): Add ilp32 and ilp32_be.
(abi-lp64-options): Add defining of LP64 and undef of ILP32 macros. (abi-lp64-condition): Check word size macro also. (abi-lp64_be-options): Add defining of LP64 and undef of ILP32 macros. (abi-lp64_be-condition): Check word size macro also. (abi-ilp32-options): Define.
(abi-ilp32-condition): Likewise.
(abi-ilp32_be-options): Define.
(abi-ilp32_be-condition): Likewise.
--- sysdeps/unix/sysv/linux/aarch64/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
sysdeps/unix/sysv/linux/aarch64/Makefile +12 -4
@@ -23,13 +23,21 @@ endif abi-variants := lp64 abi-variants += lp64_be +abi-variants += ilp32 +abi-variants += ilp32_be ifeq (,$(filter $(default-abi),$(abi-variants))) Unknown ABI, must be one of $(abi-variants) endif -abi-lp64-options := -U__AARCH64EB__ -abi-lp64-condition := !defined __AARCH64EB__ +abi-lp64-options := -U__AARCH64EB__ -D__LP64__ -U__ILP32__ +abi-lp64-condition := __WORDSIZE == 64 && !defined __AARCH64EB__ -abi-lp64_be-options := -D__AARCH64EB__ -abi-lp64_be-condition := defined __AARCH64EB__ +abi-lp64_be-options := -D__AARCH64EB__ -D__LP64__ -U__ILP32__ +abi-lp64_be-condition := __WORDSIZE == 64 && defined __AARCH64EB__ + +abi-ilp32-options := -U__AARCH64EB__ -U__LP64__ -D__ILP32__ +abi-ilp32-condition := __WORDSIZE == 32 && !defined __AARCH64EB__ + +abi-ilp32_be-options := -D__AARCH64EB__ -U__LP64__ -D__ILP32__ +abi-ilp32_be-condition := __WORDSIZE == 32 && defined __AARCH64EB__
Signature · 1 line
2.7.4
PATCH 13/23 Add support to ldconfig for ILP32 and libilp32
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This patch adds support to ldconfig for libilp32 which is used by ILP32.
* sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB32): New define.
* elf/cache.c (print_entry): Handle FLAG_AARCH64_LIB32.
* sysdeps/unix/sysv/linux/aarch64/dl-cache.h (_DL_CACHE_DEFAULT_ID):
Define it to be the FLAG_AARCH64_LIB32 if compiling for ILP32. (add_system_dir): Add libilp32 to the list of system directories.
* sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file):
Handle ILP32 elf binaries.
--- elf/cache.c | 3 +++ sysdeps/generic/ldconfig.h | 1 + sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 ++++++++++++- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +++- 4 files changed, 19 insertions(+), 2 deletions(-)
elf/cache.c +3 -0
@@ -101,6 +101,9 @@ print_entry (const char *lib, int flag, unsigned int osversion,case FLAG_AARCH64_LIB64 :fputs (",AArch64" , stdout);break ; +case FLAG_AARCH64_LIB32 : +fputs (",ILP32" , stdout); +break ;/* Uses the ARM soft-float ABI. */ case FLAG_ARM_LIBSF :fputs (",soft-float" , stdout);
sysdeps/generic/ldconfig.h +1 -0
@@ -42,6 +42,7 @@#define FLAG_MIPS_LIB32_NAN2008 0x0c00#define FLAG_MIPS64_LIBN32_NAN2008 0x0d00#define FLAG_MIPS64_LIBN64_NAN2008 0x0e00 +#define FLAG_AARCH64_LIB32 0x0f00/* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
sysdeps/unix/sysv/linux/aarch64/dl-cache.h +12 -1
@@ -18,7 +18,11 @@#include <ldconfig.h> +#ifdef __LP64__#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6) +#else +#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6) +#endif #define _dl_cache_check_flags (flags) \ ((flags) == _DL_CACHE_DEFAULT_ID)
@@ -27,18 +31,25 @@do \ { \size_t len =strlen (dir); \ -char path[len +3 ]; \ +char path[len +6 ]; \memcpy (path, dir, len +1 ); \if (len >=6 && !memcmp (path + len -6 ,"/lib64" ,6 )) \ { \ len -=2 ; \ path[len] ='\0' ; \ } \ +if (len >=9 && !memcmp (path + len -9 ,"/libilp32" ,9 ))\ + { \ + len -=5 ; \ + path[len] ='\0' ; \ + } \add_dir (path); \if (len >=4 && !memcmp (path + len -4 ,"/lib" ,4 )) \ { \memcpy (path + len,"64" ,3 ); \add_dir (path); \ +memcpy (path + len,"ilp32" ,6 ); \ +add_dir (path); \ } \ }while (0 )
sysdeps/unix/sysv/linux/arm/readelflib.c +3 -1
@@ -41,7 +41,9 @@ process_elf_file (const char *file_name, const char *lib, int *flag, ret =process_elf32_file (file_name, lib, flag, osversion, soname, file_contents, file_length); -if (!ret &&EF_ARM_EABI_VERSION (elf32_header->e_flags) ==EF_ARM_EABI_VER5 ) +if (!ret && elf_header->e_machine ==EM_AARCH64 ) + *flag =FLAG_AARCH64_LIB32 |FLAG_ELF_LIBC6 ; +else if (!ret &&EF_ARM_EABI_VERSION (elf32_header->e_flags) ==EF_ARM_EABI_VER5 ) {if (elf32_header->e_flags &EF_ARM_ABI_FLOAT_HARD ) *flag =FLAG_ARM_LIBHF |FLAG_ELF_LIBC6 ;
Signature · 1 line
2.7.4
PATCH 14/23 Add ILP32 ld.so to the known interpreter names.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
This patch adds ILP32 ld.so names to the known interpreter names.
* sysdeps/unix/sysv/linux/aarch64/ldconfig.h (SYSDEP_KNOWN_INTERPRETER_NAMES):
Add ilp32 ld.so names.
--- sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 ++ 1 file changed, 2 insertions(+)
sysdeps/unix/sysv/linux/aarch64/ldconfig.h +2 -0
@@ -21,6 +21,8 @@#define SYSDEP_KNOWN_INTERPRETER_NAMES \ { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \ { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \ { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \ { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },#define SYSDEP_KNOWN_LIBRARY_NAMES \
Signature · 1 line
2.7.4
PATCH 15/23 Add ldd-rewrite.sed so that ilp32 ld.so can be found
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
To be support multi-lib with ldd, we need to add a ldd-rewrite.sed file to rewrite RTLDLIST to include both ld.so's.
* sysdeps/unix/sysv/linux/aarch64/configure.ac (ldd_rewrite_script):
Set.
* sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
* sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed: New file.
--- sysdeps/unix/sysv/linux/aarch64/configure | 2 ++ sysdeps/unix/sysv/linux/aarch64/configure.ac | 2 ++ sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + 3 files changed, 5 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed
sysdeps/unix/sysv/linux/aarch64/configure +2 -0
@@ -31,3 +31,5 @@ case "$prefix" in esac fi +ldd_rewrite_script=$dir/ldd-rewrite.sed +
sysdeps/unix/sysv/linux/aarch64/configure.ac +2 -0
@@ -9,3 +9,5 @@ else LIBC_SLIBDIR_RTLDDIR([lib64], [lib]) fi +ldd_rewrite_script=$dir/ldd-rewrite.sed +
sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed new file +1 -0
@@ -0,0 +1 @@ +s_^\(RTLDLIST=\)\(.*lib/\)\([^/]*\)\(-aarch64\)\(\|\_be\)\(\|\_ilp32\)\(.so\.[0-9.]*\)$_\1"\2\3-aarch64\5\7 \2\3-aarch64\5\_ilp32\7"_
Signature · 1 line
2.7.4
PATCH 16/23 Make lp64 and ilp32 directories.
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
The patch makes the ilp32 and lp64 have their own directory under aarch64. ILP32 uses most of the same system calls as AARCH32 but has a 64bit off_t, ino_t etc and 32-bit time_t.
We need make the functions that handle this set of types.
--- sysdeps/aarch64/Implies | 6 -- sysdeps/aarch64/ilp32/Implies | 6 ++ sysdeps/aarch64/lp64/Implies | 7 ++ sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 ++ sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 ++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 +++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 +++++++++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 ++ sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++++++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 -------- sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 +++++++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 ++ sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 --------- sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 -- 26 files changed, 401 insertions(+), 81 deletions(-) delete mode 100644 sysdeps/aarch64/Implies create mode 100644 sysdeps/aarch64/ilp32/Implies create mode 100644 sysdeps/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644 sysdeps/unix/sysv/linux/aarch64/mmap.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions
sysdeps/aarch64/Implies deleted +0 -6
@@ -1,6 +0,0 @@ -wordsize-64 -ieee754/ldbl-128 -ieee754/dbl-64/wordsize-64 -ieee754/dbl-64 -ieee754/flt-32 -aarch64/soft-fp
sysdeps/aarch64/ilp32/Implies new file +6 -0
@@ -0,0 +1,6 @@ +aarch64 +wordsize-32 +ieee754/ldbl-128 +ieee754/dbl-64 +ieee754/flt-32 +aarch64/soft-fp
sysdeps/aarch64/lp64/Implies new file +7 -0
@@ -0,0 +1,7 @@ +aarch64 +wordsize-64 +ieee754/ldbl-128 +ieee754/dbl-64/wordsize-64 +ieee754/dbl-64 +ieee754/flt-32 +aarch64/soft-fp
sysdeps/unix/sysv/linux/aarch64/Implies +0 -2
@@ -1,3 +1 @@ aarch64/nptl -unix/sysv/linux/generic -unix/sysv/linux/wordsize-64
sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h +5 -1
@@ -25,7 +25,11 @@#define __O_NOFOLLOW 0100000#define __O_DIRECT 0200000 -#define __O_LARGEFILE 0 +#ifdef __ILP32__ +# define __O_LARGEFILE 0400000 +#else +# define __O_LARGEFILE 0 +#endif # define F_GETLK64 5# define F_SETLK64 6
sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h new file +86 -0
86 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/Implies new file +4 -0
@@ -0,0 +1,4 @@ +aarch64/nptl +unix/sysv/linux/aarch64 +unix/sysv/linux/generic +unix/sysv/linux/generic/wordsize-32
sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c new file +7 -0
@@ -0,0 +1,7 @@ +/* In this implementation we do not really care whether the call fails +because of missing kernel support since we do not even call the +function in this case. */ +#undef __ASSUME_ATFCTS +#define __ASSUME_ATFCTS 1 +#include "fxstatat64.c" +
sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c new file +6 -0
@@ -0,0 +1,6 @@ +/* In this implementation we do not really care whether the call fails +because of missing kernel support since we do not even call the +function in this case. */ +#undef __ASSUME_ATFCTS +#define __ASSUME_ATFCTS 1 +#include "xstat64.c"
sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c new file +77 -0
77 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/generic/getdents64.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c new file +0 -0
sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/mmap64.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c new file +32 -0
@@ -0,0 +1,32 @@ +/* Copyright (C) 2007-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/msg.h> +#include <ipc_priv.h> +#include <sysdep.h> + +int __msgctl (int msqid,int cmd,struct msqid_ds *buf); + +int +__msgctl (int msqid,int cmd,struct msqid_ds *buf) +{ +return INLINE_SYSCALL (msgctl,3 , msqid, cmd | __IPC_64, buf); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __msgctl, msgctl,GLIBC_2_0 );
sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/readdir64.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c new file +53 -0
53 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions new file +7 -0
@@ -0,0 +1,7 @@ +DEFAULT GLIBC_2.21 + +%ifdef HAVE_AARCH64_BE +ld=ld-linux-aarch64_be_ilp32.so.1 +%else +ld=ld-linux-aarch64_ilp32.so.1 +%endif
sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c new file +32 -0
@@ -0,0 +1,32 @@ +/* Copyright (C) 2007-2016 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/shm.h> +#include <ipc_priv.h> +#include <sysdep.h> + +int __shmctl (int shmid,int cmd,struct shmid_ds *buf); + +int +__shmctl (int shmid,int cmd,struct shmid_ds *buf) +{ +return INLINE_SYSCALL (shmctl,3 , shmid, cmd | __IPC_64, buf); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __shmctl, shmctl,GLIBC_2_0 );
sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list new file +0 -0
sysdeps/unix/sysv/linux/aarch64/ioctl.S deleted +0 -31
@@ -1,31 +0,0 @@ -/* Copyright (C) 2012-2016 Free Software Foundation, Inc. - - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - .text -ENTRY(__ioctl) - mov x8, #__NR_ioctl - sxtw x0, w0 - svc #0x0 - cmn x0, #4095 - b.cs .Lsyscall_error - ret -PSEUDO_END (__ioctl) - -weak_alias (__ioctl, ioctl)
sysdeps/unix/sysv/linux/aarch64/lp64/Implies new file +4 -0
@@ -0,0 +1,4 @@ +aarch64/nptl +unix/sysv/linux/aarch64 +unix/sysv/linux/generic +unix/sysv/linux/wordsize-64
sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S new file +31 -0
@@ -0,0 +1,31 @@ +/* Copyright (C) 2012-2016 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + .text +ENTRY(__ioctl) + mov x8, #__NR_ioctl + sxtw x0, w0 + svc #0x0 + cmn x0, #4095 + b.cs .Lsyscall_error + ret +PSEUDO_END (__ioctl) + +weak_alias (__ioctl, ioctl)
sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c new file +34 -0
@@ -0,0 +1,34 @@ +/* Copyright (C) 2009-2016 Free Software Foundation, Inc. + +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <sys/mman.h> +#include <errno.h> +#include <sys/syscall.h> +#include <sysdep.h> +#include <unistd.h> + +__ptr_t +__mmap (__ptr_t addr,size_t len,int prot,int flags,int fd,off_t offset) +{ +return (__ptr_t )INLINE_SYSCALL (mmap,6 , addr, len, prot, flags, fd, offset); +} + +weak_alias (__mmap, mmap) +weak_alias (__mmap, mmap64) +weak_alias (__mmap, __mmap64)
sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions new file +7 -0
@@ -0,0 +1,7 @@ +DEFAULT GLIBC_2.17 + +%ifdef HAVE_AARCH64_BE +ld=ld-linux-aarch64_be.so.1 +%else +ld=ld-linux-aarch64.so.1 +%endif
sysdeps/unix/sysv/linux/aarch64/mmap.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* Copyright (C) 2009-2016 Free Software Foundation, Inc. - -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation; either version 2.1 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with the GNU C Library; if not, see -<http://www.gnu.org/licenses/>. */ - -#include <sys/types.h> -#include <sys/mman.h> -#include <errno.h> -#include <sys/syscall.h> -#include <sysdep.h> -#include <unistd.h> - -__ptr_t -__mmap (__ptr_t addr,size_t len,int prot,int flags,int fd,off_t offset) -{ -return (__ptr_t )INLINE_SYSCALL (mmap,6 , addr, len, prot, flags, fd, offset); -} - -weak_alias (__mmap, mmap) -weak_alias (__mmap, mmap64) -weak_alias (__mmap, __mmap64)
sysdeps/unix/sysv/linux/aarch64/shlib-versions deleted +0 -7
@@ -1,7 +0,0 @@ -DEFAULT GLIBC_2.17 - -%ifdef HAVE_AARCH64_BE -ld=ld-linux-aarch64_be.so.1 -%else -ld=ld-linux-aarch64.so.1 -%endif
Signature · 1 line
2.7.4
Re: [PATCH 16/23] [AARCH64] Make lp64 and ilp32 directories.
<https://sourceware.org/ml/libc-alpha/2016-06/msg00789.html> and
<https://sourceware.org/ml/libc-alpha/2014-10/msg00640.html> still apply.
It's clear this won't be ready to go in within the next two days, so use GLIBC_2.25 as symbol version, and be prepared to change it to GLIBC_2.26 or later if it doesn't get in by the end of the year.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 16/23] [AARCH64] Make lp64 and ilp32 directories.
In reply to Yury NorovQuoted 56 lines · Yury Norov
sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c new file +50
-0@@ -0,0 +1,77 @@ +/* Copyright (C) 2007-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include <dirent.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <bits/wordsize.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <linux/posix_types.h> + +struct kernel_dirent64 + { +uint64_t d_ino; +int64_t d_off; +unsigned short int d_reclen; +unsigned char d_type; +char d_name[256 ]; + }; + +static size_t conv (char *buf,size_t nbytes) +{ +char *end = buf + nbytes; +struct dirent *u = (struct dirent *) buf; +struct kernel_dirent64 *k = (struct kernel_dirent64 *) buf; +size_t sizd = offsetof(struct kernel_dirent64 , d_name) + - offsetof(struct dirent , d_name); + +while ((char *) k < end) + { +struct kernel_dirent64 *nk = (char *) k + k->d_reclen; +size_t name_len = k->d_reclen - offsetof(struct kernel_dirent64 , d_name);
sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c line 60
Quoted 10 lines
sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c new file +10
-0+ + u->d_ino = k->d_ino; + u->d_off = k->d_off; + u->d_reclen = k->d_reclen - sizd; + u->d_type = k->d_type; +memcpy (u->d_name, k->d_name, name_len); + + u = (char *) u + u->d_reclen; + k = nk; +}
../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c: In function 'conv':../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c:49:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
struct kernel_dirent64 *nk = (char *) k + k->d_reclen;
^
../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c:58:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
u = (char *) u + u->d_reclen;
^Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH 17/23 ILP32: introduce syscalls that pass off_t
In reply to Yury NorovFrom: Yury Norov <[email protected]>
ILP32 has 64-bit off_t, to follow modern requirements. But kernel clears top-halves of input registers. It means we have to pass corresponding arguments in a pair, like aarch32 does. In this patch all affected syscalls are redefined. Most of them are taken from arm code.
--- sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 ++ sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 +++ sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 ++++++++++++++++ 11 files changed, 78 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/kernel-features.h
sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c new file +1 -0
@@ -0,0 +1 @@ +/* See sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncatei64.c */
sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c new file +4 -0
@@ -0,0 +1,4 @@ +#include <sysdeps/unix/sysv/linux/arm/ftruncate64.c> + +weak_alias (__ftruncate64, __ftruncate) +weak_alias (__ftruncate64, ftruncate)
sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c new file +36 -0
@@ -0,0 +1,36 @@ +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Chris Metcalf <[email protected]>, 2011. + +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 <errno.h> +#include <unistd.h> +#include <sys/types.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +off_t +__lseek (int fd,off_t offset,int whence) +{ +loff_t res; +int rc =INLINE_SYSCALL (_llseek,5 , fd, (off_t) (offset >>32 ), + (off_t ) offset, &res, whence); +return rc ?: res; +} +libc_hidden_def (__lseek) +weak_alias (__lseek, lseek) +strong_alias (__lseek, __libc_lseek)
sysdeps/unix/sysv/linux/aarch64/ilp32/lseek64.c deleted +0 -0
sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/arm/mmap.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/arm/posix_fadvise.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c new file +2 -0
@@ -0,0 +1,2 @@ +#define __NR_arm_fadvise64_64 __NR_fadvise64_64 +#include <sysdeps/unix/sysv/linux/arm/posix_fadvise64.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/arm/readahead.c>
sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c new file +1 -0
@@ -0,0 +1 @@ +/* See sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c */
sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c new file +4 -0
@@ -0,0 +1,4 @@ +#include <sysdeps/unix/sysv/linux/arm/truncate64.c> + +weak_alias (truncate64, __truncate) +weak_alias (truncate64, truncate)
sysdeps/unix/sysv/linux/aarch64/kernel-features.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Set flags signalling availability of kernel features based on given +kernel version number. +Copyright (C) 2006-2016 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<http://www.gnu.org/licenses/>. */ + +#include_next <kernel-features.h> + +#ifdef __ILP32__ +/* Define this if your 32-bit syscall API requires 64-bit register +pairs to start with an even-number register. */ +#define __ASSUME_ALIGNED_REGISTER_PAIRS 1 +#endif /* __ILP32__ */ +
Signature · 1 line
2.7.4
Re: [PATCH 17/23] [AARCH64] ILP32: introduce syscalls that pass off_t
Quoted 5 lines · Yury Norov
ILP32 has 64-bit
off_t, to follow modern requirements. But kernel clears top-halves of input registers. It means we have to pass corresponding arguments in a pair, like aarch32 does. In this patch all affected syscalls are redefined. Most of them are taken from arm code.
Please follow the spirit of Adhemerval's recent work. Determine the appropriate abstractions for the architecture differences for these syscalls, and set up unified implementations used on all architectures, rather than increasing the number of architecture-specific variants.
sysdeps/unix/sysv/linux/aarch64/kernel-features.h line 26
Quoted 5 lines
sysdeps/unix/sysv/linux/aarch64/kernel-features.h new file +5
-0+#ifdef __ILP32__ +/* Define this if your 32-bit syscall API requires 64-bit register +pairs to start with an even-number register. */ +#define __ASSUME_ALIGNED_REGISTER_PAIRS 1 +#endif /* __ILP32__ */
Preprocessor indentation.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 17/23] [AARCH64] ILP32: introduce syscalls that pass off_t
In reply to Yury Norovrpm: ../sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c:31: __libc_pread: Assertion `sizeof (offset) == 4' failed.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Re: [PATCH 17/23] [AARCH64] ILP32: introduce syscalls that pass off_t
Sorry, I was trying to backport to 2.23, and failed. Won't happen again.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH 18/23 ILP32: support stat syscall family
In reply to Yury NorovFrom: Yury Norov <[email protected]>
stat and statfs structures has their layouts identical to lp64 after changing off_t, ino_t etc sizes to 64-bit. It means we can pass it to kernel same way as lp64 does.
--- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 +++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ 14 files changed, 759 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c
sysdeps/unix/sysv/linux/aarch64/bits/stat.h new file +195 -0
@@ -0,0 +1,195 @@ +/* Copyright (C) 1992-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +#ifdef __ILP32__ +#include <endian.h> +struct __kernel_timespec + { +unsigned long long tv_sec;/* Seconds. */ +long long tv_nsec;/* Nanoseconds. */ + }; +#define conv_timespec (u, k) do { \ + (u)->tv_sec = (k)->tv_sec; \ + (u)->tv_nsec = (k)->tv_nsec; \ +} while (0) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define __type3264 (type, name) \ + type (name); type name##_pad +#else +#define __type3264 (type, name) \ + type name##_pad; type name +#endif + +#else +#define __kernel_timespec timespec +#define conv_timespec (u, k) +#define __type3264 (type, name) type name +#endif /* __ILP32__ */ + +struct stat + { +__dev_t st_dev;/* Device. */ +__ino_t st_ino;/* File serial number. */ +__mode_t st_mode;/* File mode. */ +__nlink_t st_nlink;/* Link count. */ +__uid_t st_uid;/* User ID of the file's owner. */ +__gid_t st_gid;/* Group ID of the file's group.*/ +__dev_t st_rdev;/* Device number, if device. */ +__dev_t __pad1; +__off_t st_size;/* Size of file, in bytes. */ +__blksize_t st_blksize;/* Optimal block size for I/O. */ +int __pad2; + +__blkcnt_t st_blocks;/* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 +/* Nanosecond resolution timestamps are stored in a format +equivalent to 'struct timespec'. This is the type used +whenever possible but the Unix namespace rules do not allow the +identifier 'timespec' to appear in the <sys/stat.h> header. +Therefore we have to handle the use of this header in strictly +standard-compliant sources special. */ +union { +struct timespec st_atim;/* Time of last access. */ +struct __kernel_timespec __st_atim; + }; +union { +struct timespec st_mtim;/* Time of last modification. */ +struct __kernel_timespec __st_mtim; + }; +union { +struct timespec st_ctim;/* Time of last status change. */ +struct __kernel_timespec __st_ctim; + }; +# define st_atime st_atim.tv_sec/* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __type3264(__time_t, st_atime); /* Time of last access. */ + __type3264(unsigned long int, st_atimensec); /* Nsecs of last access. */ + __type3264(__time_t, st_mtime); /* Time of last modification. */ + __type3264(unsigned long int, st_mtimensec); /* Nsecs of last modification. */ + __type3264(__time_t, st_ctime); /* Time of last status change. */ + __type3264(unsigned long int, st_ctimensec); /* Nsecs of last status change. */ +#endif +int __glibc_reserved[2 ]; + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +__dev_t st_dev;/* Device. */ +__ino_t st_ino;/* File serial number. */ +__mode_t st_mode;/* File mode. */ +__nlink_t st_nlink;/* Link count. */ +__uid_t st_uid;/* User ID of the file's owner. */ +__gid_t st_gid;/* Group ID of the file's group.*/ +__dev_t st_rdev;/* Device number, if device. */ +__dev_t __pad1; +__off_t st_size;/* Size of file, in bytes. */ +__blksize_t st_blksize;/* Optimal block size for I/O. */ +int __pad2; + +__blkcnt_t st_blocks;/* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 +/* Nanosecond resolution timestamps are stored in a format +equivalent to 'struct timespec'. This is the type used +whenever possible but the Unix namespace rules do not allow the +identifier 'timespec' to appear in the <sys/stat.h> header. +Therefore we have to handle the use of this header in strictly +standard-compliant sources special. */ +union { +struct timespec st_atim;/* Time of last access. */ +struct __kernel_timespec __st_atim; + }; +union { +struct timespec st_mtim;/* Time of last modification. */ +struct __kernel_timespec __st_mtim; + }; +union { +struct timespec st_ctim;/* Time of last status. */ +struct __kernel_timespec __st_ctim; + }; +# define st_atime st_atim.tv_sec/* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __type3264(__time_t, st_atime); /* Time of last access. */ + __type3264(unsigned long int, st_atimensec); /* Nsecs of last access. */ + __type3264(__time_t, st_mtime); /* Time of last modification. */ + __type3264(unsigned long int, st_mtimensec); /* Nsecs of last modification. */ + __type3264(__time_t, st_ctime); /* Time of last status change. */ + __type3264(unsigned long int, st_ctimensec); /* Nsecs of last status change. */ +#endif +int __glibc_reserved[2 ]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000/* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000/* Directory. */ +#define __S_IFCHR 0020000/* Character device. */ +#define __S_IFBLK 0060000/* Block device. */ +#define __S_IFREG 0100000/* Regular file. */ +#define __S_IFIFO 0010000/* FIFO. */ +#define __S_IFLNK 0120000/* Symbolic link. */ +#define __S_IFSOCK 0140000/* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But +they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ (buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM (buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM (buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000/* Set user ID on execution. */ +#define __S_ISGID 02000/* Set group ID on execution. */ +#define __S_ISVTX 01000/* Save swapped text after use (sticky). */ +#define __S_IREAD 0400/* Read by owner. */ +#define __S_IWRITE 0200/* Write by owner. */ +#define __S_IEXEC 0100/* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */
sysdeps/unix/sysv/linux/aarch64/bits/statfs.h new file +64 -0
64 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c new file +29 -0
@@ -0,0 +1,29 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Chris Metcalf <[email protected]>, 2011. + +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 <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +/* Return information about the filesystem on which FD resides. */ +int +__fstatfs (int fd,struct statfs *buf) +{ +return INLINE_SYSCALL (fstatfs64,2 , fd, buf); +} +weak_alias (__fstatfs, fstatfs)
sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c new file +29 -0
@@ -0,0 +1,29 @@ +/* Return information about the filesystem on which FD resides. +Copyright (C) 1996-2016 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +/* Return information about the filesystem on which FD resides. */ +int +__fstatfs64 (int fd,struct statfs64 *buf) +{ +return INLINE_SYSCALL (fstatfs64,2 , fd, buf); +} +weak_alias (__fstatfs64, fstatfs64)
sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c new file +51 -0
51 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c new file +44 -0
44 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c new file +48 -0
48 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c new file +52 -0
52 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c new file +47 -0
47 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c new file +47 -0
47 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c new file +30 -0
@@ -0,0 +1,30 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Chris Metcalf <[email protected]>, 2011. + +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 <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +/* Return information about the filesystem on which FILE resides. */ +int +__statfs (const char *file,struct statfs *buf) +{ +return INLINE_SYSCALL (statfs64,2 , file, buf); +} +libc_hidden_def (__statfs) +weak_alias (__statfs, statfs)
sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c new file +29 -0
@@ -0,0 +1,29 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Chris Metcalf <[email protected]>, 2011. + +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 <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +/* Return information about the filesystem on which FILE resides. */ +int +__statfs64 (const char *file,struct statfs64 *buf) +{ +return INLINE_SYSCALL (statfs64,2 , file, buf); +} +weak_alias (__statfs64,statfs64)
sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c new file +47 -0
47 lines not on this page · raw message
sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
<https://sourceware.org/ml/libc-alpha/2016-06/msg00791.html> still applies. Unify implementations instead of proliferating variants.
Also, much of the formatting is way off the GNU Coding Standards (e.g. indentation that's not two-column, "{" not on a line by itself), and you're missing descriptions as first lines of many new files.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
Quoted 2 lines · Joseph Myers
<https://sourceware.org/ml/libc-alpha/2016-06/msg00791.html> still applies. Unify implementations instead of proliferating variants.
I think on it. I don't see simple way to unify it right now. And I plan to take a vacation in next two weeks, so I'd like to share my progress to community (mostly for kernel), as this series has some LTP tests fixed, and this is important for us.
What you talk about sounds unclear to me. If you mean to unify with one of existing ports, it looks unnecessary, as ilp32 will end up with RISC-V anyway. If you mean to use RISC-V, it's not ready yet. I was thinking that when they will finish, they simply switch this port to their code. Am I too optimistic?
Quoted 3 lines
Also, much of the formatting is way off the GNU Coding Standards (e.g. indentation that's not two-column, "{" not on a line by itself), and you're missing descriptions as first lines of many new files.
Is there glibc analogue for kernel scripts/checkpatch.pl? If yes, please point me out, and I'll briefly fix all issues. If no please be patient to whitespace rules violations. I completely understand the importance of following the coding rules, but now I am little limited in time and prefer to fix real bugs first, and then read that document carefully and check all the mess I introduced.
Yury
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
Quoted 9 lines · Yury Norov
Quoted 2 lines · Joseph Myers
<https://sourceware.org/ml/libc-alpha/2016-06/msg00791.html> still applies. Unify implementations instead of proliferating variants.
I think on it. I don't see simple way to unify it right now. And I plan to take a vacation in next two weeks, so I'd like to share my progress to community (mostly for kernel), as this series has some LTP tests fixed, and this is important for us.
Quoted 5 lines
What you talk about sounds unclear to me. If you mean to unify with one of existing ports, it looks unnecessary, as ilp32 will end up with RISC-V anyway. If you mean to use RISC-V, it's not ready yet. I was thinking that when they will finish, they simply switch this port to their code. Am I too optimistic?
The idea is to avoid the proliferation of multiple implementation of same function over multiple files. This have the advantage to make easy for new ports to add such functionality and simplify the code base. Take fstatfs{64} for instance:
$ find . -iname fstatfs* ./sysdeps/mach/hurd/fstatfs.c ./sysdeps/mach/hurd/fstatfs64.c ./sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c ./sysdeps/unix/sysv/linux/alpha/fstatfs64.c ./sysdeps/unix/sysv/linux/fstatfs64.c ./sysdeps/unix/sysv/linux/wordsize-64/fstatfs64.c ./sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c ./io/fstatfs.c ./io/fstatfs64.c
The 'io' is the default one which is just a stub that return ENOSYS. For Linux ideally we should aim to have just one implementation that cover all the architectures/kernel limitation (the same idea I am pushing with some consolidation patches).
It might be outside the scope of the port enablement, but it is usually the opportunity to the refactor on such code. And for such functions it might require some work for some architecture idiosyncrasies (such as alpha not providing fstat64), but I think it quite doable.
Quoted 11 lines
Quoted 4 lines
Also, much of the formatting is way off the GNU Coding Standards (e.g. indentation that's not two-column, "{" not on a line by itself), and you're missing descriptions as first lines of many new files.
Is there glibc analogue for kernel
scripts/checkpatch.pl? If yes, please point me out, and I'll briefly fix all issues. If no please be patient to whitespace rules violations. I completely understand the importance of following the coding rules, but now I am little limited in time and prefer to fix real bugs first, and then read that document carefully and check all the mess I introduced.
Also keep in mind to remove the 'Contributed by ...' presented in some files.
Quoted 3 lines
Yury
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
In reply to Yury NorovQuoted 5 lines · Yury Norov
What you talk about sounds unclear to me. If you mean to unify with one of existing ports, it looks unnecessary, as ilp32 will end up with RISC-V anyway. If you mean to use RISC-V, it's not ready yet. I was thinking that when they will finish, they simply switch this port to their code. Am I too optimistic?
I mean unify in sysdeps/unix/sysv/linux (or .../generic if inappropriate for the main sysdeps/unix/sysv/linux), for all architectures, both existing and new, with conditionals based on logical features of the architectures. If any architecture has its own implementation, it should only be old architectures with their special peculiarities.
Quoted 2 lines
Is there glibc analogue for kernel
scripts/checkpatch.pl? If yes, please point me out, and I'll briefly fix all issues. If no please be
I'm not aware of an analogue, although GCC's contrib/check_GNU_style.sh may well be helpful for some issues.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
In reply to Yury NorovQuoted 14 lines · Yury Norov
sysdeps/unix/sysv/linux/aarch64/bits/stat.h new file +14
-0+#ifdef __ILP32__ +#include <endian.h> +struct __kernel_timespec + { +unsigned long long tv_sec;/* Seconds. */ +long long tv_nsec;/* Nanoseconds. */ + }; +#define conv_timespec (u, k) do { \ + (u)->tv_sec = (k)->tv_sec; \ + (u)->tv_nsec = (k)->tv_nsec; \ +} while (0) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define __type3264 (type, name) \ + type (name); type name##_pad
sysdeps/unix/sysv/linux/aarch64/bits/stat.h line 56
Quoted 10 lines
sysdeps/unix/sysv/linux/aarch64/bits/stat.h new file +10
-0+#else +#define __type3264 (type, name) \ + type name##_pad; type name +#endif + +#else +#define __kernel_timespec timespec +#define conv_timespec (u, k) +#define __type3264 (type, name) type name +#endif /* __ILP32__ */
Surely conv_timespec needs to be put in an internal header.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Re: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family
In reply to Yury Norov../sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c: In function '__lxstat64':../sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c:32:7: error: unused variable 'result' [-Werror=unused-variable]
int result;
^~~~~~Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Quoted 2 lines · Yury Norov
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);
You appear to have ignored most of my comments, including comments carried over from 2014. Please check more thoroughly for any message on libc-alpha since the first patch series was posted in Oct 2014 that relates to AArch64 ILP32 patches (both comments on such patch series, and patches other people posted since the 2014 series that build on top of it), and make sure that it is addressed. If you think a comment is incorrect, say so explicitly.
Quoted 1 line
Tested with LTP. Regressions are like this:
As I said in <https://sourceware.org/ml/libc-alpha/2016-06/msg00780.html>,
test with the glibc testsuite and report the glibc testsuite results.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 19/23 delouse input arguments in system functions
In reply to Yury NorovThis patch introduces DELOUSE() macro which does nothing for lp64, and clears top bits of registers holding inputs, where needed.
AARCH64/ILP32 needs it because top bits condition is undefined according to ABI.
'Delouse' term comes from Linux kernel where similar macro does the same for compat syscall wrapper.
--- sysdeps/aarch64/__longjmp.S | 2 ++ sysdeps/aarch64/dl-tlsdesc.S | 8 ++++++++ sysdeps/aarch64/memcmp.S | 3 +++ sysdeps/aarch64/memcpy.S | 8 ++++++++ sysdeps/aarch64/memset.S | 3 +++ sysdeps/aarch64/setjmp.S | 1 + sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 ++ sysdeps/aarch64/strcpy.S | 2 ++ sysdeps/aarch64/strlen.S | 2 ++ sysdeps/aarch64/strncmp.S | 3 +++ sysdeps/aarch64/strnlen.S | 3 +++ sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 2 ++ sysdeps/unix/sysv/linux/aarch64/clone.S | 7 +++++++ sysdeps/unix/sysv/linux/aarch64/getcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + 19 files changed, 52 insertions(+)
sysdeps/aarch64/__longjmp.S +2 -0
@@ -46,6 +46,8 @@ ENTRY (__longjmp) cfi_offset(d14, JB_D14<<3) cfi_offset(d15, JB_D15<<3) + DELOUSE(0) + ldp x19, x20, [x0, #JB_X19<<3] ldp x21, x22, [x0, #JB_X21<<3] ldp x23, x24, [x0, #JB_X23<<3]
sysdeps/aarch64/dl-tlsdesc.S +8 -0
@@ -74,6 +74,7 @@ cfi_startproc .align 2 _dl_tlsdesc_return: + DELOUSE(0) ldr PTR_REG (0), [x0, #PTR_SIZE] RET cfi_endproc
@@ -96,6 +97,7 @@ _dl_tlsdesc_return_lazy: td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#PTR_SIZE] here happens after the initialization of td->arg. */ + DELOUSE(0) ldar PTR_REG (zr), [x0] ldr PTR_REG (0), [x0, #PTR_SIZE] RET
@@ -125,6 +127,7 @@ _dl_tlsdesc_undefweak: td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#8] here happens after the initialization of td->arg. */ + DELOUSE(0) ldar PTR_REG (zr), [x0] ldr PTR_REG (0), [x0, #PTR_SIZE] mrs x1, tpidr_el0
@@ -174,6 +177,7 @@ _dl_tlsdesc_dynamic: stp x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]! cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS) mov x29, sp + DELOUSE(0) /* Save just enough registers to support fast path, if we fall into slow path we will save additional registers. */
@@ -188,6 +192,7 @@ _dl_tlsdesc_dynamic: td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#PTR_SIZE] here happens after the initialization of td->arg. */ + DELOUSE(0) ldar PTR_REG (zr), [x0] ldr PTR_REG (1), [x0,#PTR_SIZE] ldr PTR_REG (0), [x4]
@@ -279,12 +284,14 @@ _dl_tlsdesc_resolve_rela: SAVE_Q_REGISTERS + DELOUSE(3) ldr PTR_REG (1), [x3, #PTR_SIZE] bl _dl_tlsdesc_resolve_rela_fixup RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*8] + DELOUSE(0) ldr PTR_REG (1), [x0] blr x1
@@ -346,6 +353,7 @@ _dl_tlsdesc_resolve_hold: RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*9] + DELOUSE(0) ldr PTR_REG (1), [x0] blr x1
sysdeps/aarch64/memcmp.S +3 -0
@@ -47,6 +47,9 @@ #define mask x13 ENTRY_ALIGN (memcmp, 6) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(ret0) eor tmp1, src1, src2 tst tmp1, #7
sysdeps/aarch64/memcpy.S +8 -0
@@ -61,6 +61,10 @@ ENTRY_ALIGN (memmove, 6) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) + sub tmp1, dstin, src cmp count, 96 ccmp tmp1, count, 2, hi
@@ -71,6 +75,10 @@ END (memmove) libc_hidden_builtin_def (memmove) ENTRY (memcpy) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) + prfm PLDL1KEEP, [src] add srcend, src, count add dstend, dstin, count
sysdeps/aarch64/memset.S +3 -0
@@ -39,6 +39,9 @@ ENTRY_ALIGN (__memset, 6) + DELOUSE(0) + DELOUSE(2) + dup v0.16B, valw add dstend, dstin, count
sysdeps/aarch64/setjmp.S +1 -0
@@ -33,6 +33,7 @@ END (_setjmp) libc_hidden_def (_setjmp) ENTRY (__sigsetjmp) + DELOUSE(0) 1: stp x19, x20, [x0, #JB_X19<<3]
sysdeps/aarch64/strchr.S +1 -0
@@ -62,6 +62,7 @@ /* Locals and temporaries. */ ENTRY (strchr) + DELOUSE(0) mov wtmp2, #0x0401 movk wtmp2, #0x4010, lsl #16 dup vrepchr.16b, chrin
sysdeps/aarch64/strchrnul.S +1 -0
@@ -60,6 +60,7 @@ identify exactly which byte is causing the termination. */ ENTRY (__strchrnul) + DELOUSE(0) /* Magic constant 0x40100401 to allow us to identify which lane matches the termination condition. */ mov wtmp2, #0x0401
sysdeps/aarch64/strcmp.S +2 -0
@@ -49,6 +49,8 @@ /* Start of performance-critical section -- one 64B cache line. */ ENTRY_ALIGN(strcmp, 6) + DELOUSE(0) + DELOUSE(1) eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7
sysdeps/aarch64/strcpy.S +2 -0
@@ -91,6 +91,8 @@ #define MIN_PAGE_SIZE (1 << MIN_PAGE_P2) ENTRY_ALIGN (STRCPY, 6) + DELOUSE(0) + DELOUSE(1) /* For moderately short strings, the fastest way to do the copy is to calculate the length of the string in the same way as strlen, then essentially do a memcpy of the result. This avoids the need for
sysdeps/aarch64/strlen.S +2 -0
@@ -85,6 +85,8 @@ boundary. */ ENTRY_ALIGN (__strlen, 6) + DELOUSE(0) + DELOUSE(1) and tmp1, srcin, MIN_PAGE_SIZE - 1 mov zeroones, REP8_01 cmp tmp1, MIN_PAGE_SIZE - 16
sysdeps/aarch64/strncmp.S +3 -0
@@ -51,6 +51,9 @@ #define endloop x15 ENTRY_ALIGN_AND_PAD (strncmp, 6, 7) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(ret0) eor tmp1, src1, src2 mov zeroones, #REP8_01
sysdeps/aarch64/strnlen.S +3 -0
@@ -50,6 +50,9 @@ #define REP8_80 0x8080808080808080 ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(hit_limit) mov zeroones, #REP8_01 bic src, srcin, #15
sysdeps/aarch64/strrchr.S +1 -0
@@ -68,6 +68,7 @@ identify exactly which byte is causing the termination, and why. */ ENTRY(strrchr) + DELOUSE(0) cbz x1, L(null_search) /* Magic constant 0x40100401 to allow us to identify which lane matches the requested byte. Magic constant 0x80200802 used
sysdeps/aarch64/sysdep.h +2 -0
@@ -25,10 +25,12 @@# define AARCH64_R (NAME ) R_AARCH64_ ## NAME# define PTR_REG (n) x##n# define PTR_LOG_SIZE 3 +# define DELOUSE (n)#else # define AARCH64_R (NAME ) R_AARCH64_P32_ ## NAME# define PTR_REG (n) w##n# define PTR_LOG_SIZE 2 +# define DELOUSE (n) mov w##n, w##n#endif #define PTR_SIZE (1<<PTR_LOG_SIZE)
sysdeps/unix/sysv/linux/aarch64/clone.S +7 -0
@@ -39,6 +39,13 @@ */ .text ENTRY(__clone) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) + DELOUSE(3) + DELOUSE(4) + DELOUSE(5) + DELOUSE(6) /* Save args for the child. */ mov x10, x0 mov x11, x2
sysdeps/unix/sysv/linux/aarch64/getcontext.S +1 -0
@@ -30,6 +30,7 @@ .text ENTRY(__getcontext) + DELOUSE(0) /* The saved context will return to the getcontext() call point with a return value of 0 */ str xzr, [x0, oX0 + 0 * SZREG]
sysdeps/unix/sysv/linux/aarch64/setcontext.S +1 -0
@@ -34,6 +34,7 @@ .text ENTRY (__setcontext) + DELOUSE(0) /* Save a copy of UCP. */ mov x9, x0
sysdeps/unix/sysv/linux/aarch64/swapcontext.S +1 -0
@@ -27,6 +27,7 @@ .text ENTRY(__swapcontext) + DELOUSE(0) /* Set the value returned when swapcontext() returns in this context. */ str xzr, [x0, oX0 + 0 * SZREG]
Signature · 1 line
2.7.4
Re: [PATCH 19/23] [AARCH64] delouse input arguments in system functions
Missing spaces before '(' in macro calls.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 19/23] [AARCH64] delouse input arguments in system functions
In reply to Yury Norovsysdeps/aarch64/dl-tlsdesc.S _dl_tlsdesc_dynamic: · line 195
Quoted 13 lines · Yury Norov
sysdeps/aarch64/dl-tlsdesc.S +2
-0@@ -174,6 +177,7 @@ _dl_tlsdesc_dynamic: stp x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]! cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS) mov x29, sp + DELOUSE(0) /* Save just enough registers to support fast path, if we fall into slow path we will save additional registers. */@@ -188,6 +192,7 @@ _dl_tlsdesc_dynamic: td->entry) and thus it synchronizes with the release store to td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#PTR_SIZE] here happens after the initialization of td->arg. */ + DELOUSE(0)
Once is enough.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH 20/23 Fix ILP32 warning
In reply to Yury NorovFrom: Andrew Pinski <[email protected]>
--- sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/generic/brk.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sysdeps/aarch64/jmpbuf-unwind.h +1 -1
@@ -27,7 +27,7 @@ ((void *) (address) < (void *) demangle (jmpbuf[JB_SP]))#define _JMPBUF_CFA_UNWINDS_ADJ (jmpbuf, context, adj) \ - _JMPBUF_UNWINDS_ADJ (jmpbuf, (void *) _Unwind_GetCFA (context), adj) + _JMPBUF_UNWINDS_ADJ (jmpbuf, (void *) (size_t) _Unwind_GetCFA (context), adj)#define _JMPBUF_UNWINDS_ADJ (_jmpbuf, _address, _adj) \ ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h +1 -1
@@ -19,7 +19,7 @@#include <sys/ucontext.h> #define SIGCONTEXT siginfo_t *_si, struct ucontext * -#define GET_PC (ctx) ((void *) (ctx)->uc_mcontext.pc) +#define GET_PC (ctx) ((void *) (size_t) (ctx)->uc_mcontext.pc)/* There is no reliable way to get the sigcontext unless we use a three-argument signal handler. */
sysdeps/unix/sysv/linux/generic/brk.c +1 -1
@@ -33,7 +33,7 @@ __brk (void *addr) {INTERNAL_SYSCALL_DECL (err); - __curbrk = (void *)INTERNAL_SYSCALL (brk, err,1 , addr); + __curbrk = (void *) (size_t )INTERNAL_SYSCALL (brk, err,1 , addr);if (__curbrk < addr) {__set_errno (ENOMEM );
Signature · 1 line
2.7.4
PATCH 21/23 Make __SIZEOF_SEM_T 16 for ILP32
In reply to Yury Norov--- sysdeps/aarch64/nptl/bits/semaphore.h | 4 ++++ 1 file changed, 4 insertions(+)
sysdeps/aarch64/nptl/bits/semaphore.h +4 -0
@@ -21,7 +21,11 @@#endif +#ifdef __ILP32__ +#define __SIZEOF_SEM_T 16 +#else #define __SIZEOF_SEM_T 32 +#endif /* Value returned if `sem_open' failed. */
Signature · 1 line
2.7.4
Re: [PATCH 21/23] [AARCH64] Make __SIZEOF_SEM_T 16 for ILP32
Missing preprocessor indentation.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 21/23] [AARCH64] Make __SIZEOF_SEM_T 16 for ILP32
In reply to Yury NorovThe same can be done for the pthread types, following the x32 example.
Andreas.
sysdeps/aarch64/nptl/bits/pthreadtypes.h +21 -10
@@ -21,16 +21,27 @@#include <endian.h> -#define __SIZEOF_PTHREAD_ATTR_T 64 -#define __SIZEOF_PTHREAD_MUTEX_T 48 -#define __SIZEOF_PTHREAD_MUTEXATTR_T 8 -#define __SIZEOF_PTHREAD_COND_T 48 -#define __SIZEOF_PTHREAD_COND_COMPAT_T 48 -#define __SIZEOF_PTHREAD_CONDATTR_T 8 -#define __SIZEOF_PTHREAD_RWLOCK_T 56 -#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -#define __SIZEOF_PTHREAD_BARRIER_T 32 -#define __SIZEOF_PTHREAD_BARRIERATTR_T 8 +#if __ILP32__ +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#else +# define __SIZEOF_PTHREAD_ATTR_T 64 +# define __SIZEOF_PTHREAD_MUTEX_T 48 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 8 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 8 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 8 +#endif /* Thread identifiers. The structure of the attribute type is not
Signature · 6 lines
2.9.0 -- Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH 22/23 off_t: fix register pair calculation for 64-bit case
In reply to Yury NorovThere are 3 syscall wrappers under sysdeps/unix/sysv/linux that calculate register pair for off_t like this:
__LONG_LONG_PAIR (offset >> 31, offset)
While it works for 32-bit off_t, new 32-bit APIs that use 64-bit off_t will be broken with it. This patch redirects affected syscalls to their 64-bit versions. It also saves few instructions and symbols in glibc, as 32-bit syscall wrappers are not generated anymore.
This patch has also been sent separately and is found correct during discussion.
--- sysdeps/unix/sysv/linux/fallocate.c | 4 ++++ sysdeps/unix/sysv/linux/fallocate64.c | 4 ++++ sysdeps/unix/sysv/linux/posix_fadvise.c | 4 ++++ sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 ++++ sysdeps/unix/sysv/linux/posix_fallocate.c | 4 ++++ sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 ++++ 6 files changed, 24 insertions(+)
sysdeps/unix/sysv/linux/fallocate.c +4 -0
@@ -20,6 +20,8 @@#include <sysdep-cancel.h> +#ifndef __OFF_T_MATCHES_OFF64_T +/* Reserve storage for the data of the file associated with FD. */ int fallocate (int fd,int mode,__off_t offset,__off_t len)
@@ -33,3 +35,5 @@ fallocate (int fd, int mode, __off_t offset, __off_t len)return -1 ; #endif } + +#endif /* __OFF_T_MATCHES_OFF64_T */
sysdeps/unix/sysv/linux/fallocate64.c +4 -0
@@ -35,3 +35,7 @@ fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)return -1 ;#endif } + +#ifdef __OFF_T_MATCHES_OFF64_T +weak_alias(fallocate64, fallocate) +#endif
sysdeps/unix/sysv/linux/posix_fadvise.c +4 -0
@@ -19,6 +19,8 @@#include <fcntl.h> #include <sysdep.h> +#ifndef __OFF_T_MATCHES_OFF64_T +/* Advice the system about the expected behaviour of the application with respect to the file associated with FD. */
@@ -46,3 +48,5 @@ posix_fadvise (int fd, off_t offset, off_t len, int advise)return ENOSYS ; #endif } + +#endif /* __OFF_T_MATCHES_OFF64_T */
sysdeps/unix/sysv/linux/posix_fadvise64.c +4 -0
@@ -56,3 +56,7 @@ compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);#else strong_alias (__posix_fadvise64_l64, posix_fadvise64);#endif + +#ifdef __OFF_T_MATCHES_OFF64_T +weak_alias(__posix_fadvise64_l64, __posix_fadvise) +#endif /* __OFF_T_MATCHES_OFF64_T */
sysdeps/unix/sysv/linux/posix_fallocate.c +4 -0
@@ -18,6 +18,8 @@#include <fcntl.h> #include <sysdep.h> +#ifndef __OFF_T_MATCHES_OFF64_T +#define posix_fallocate static internal_fallocate#include <sysdeps/posix/posix_fallocate.c> #undef posix_fallocate
@@ -37,3 +39,5 @@ posix_fallocate (int fd, __off_t offset, __off_t len)return INTERNAL_SYSCALL_ERRNO (res, err); return internal_fallocate (fd, offset, len); } + +#endif /* __OFF_T_MATCHES_OFF64_T */
sysdeps/unix/sysv/linux/posix_fallocate64.c +4 -0
@@ -40,3 +40,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)return INTERNAL_SYSCALL_ERRNO (res, err);return internal_fallocate64 (fd, offset, len); } + +#ifdef __OFF_T_MATCHES_OFF64_T +weak_alias(__posix_fallocate64_l64, posix_fallocate) +#endif
Signature · 1 line
2.7.4
Re: [PATCH 22/23] off_t: fix register pair calculation for 64-bit case
Quoted 1 line · Yury Norov
+weak_alias(__posix_fadvise64_l64,
__posix_fadvise)
Missing space before '('.
Quoted 1 line
+weak_alias(__posix_fallocate64_l64,
posix_fallocate)
Likewise.
Signature · 2 lines
Joseph S. Myers [email protected]
PATCH 23/23 Take utmp{,x}.h from s390 port
In reply to Yury Norovaarch64 and ilp32 has different size of time_t. So to have common layout for struct utmp and utmpx, corresponding headers are taken from s390 port.
This is temporary solution. Proper solution shoud come from generic code and also take care on endianness.
--- sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + 2 files changed, 2 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmp.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h
sysdeps/unix/sysv/linux/aarch64/bits/utmp.h new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/s390/bits/utmp.h>
sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h new file +1 -0
@@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/s390/bits/utmpx.h>
Signature · 1 line
2.7.4
Re: [PATCH 23/23] [AARCH64] Take utmp{,x}.h from s390 port
Quoted 3 lines · Yury Norov
aarch64 and ilp32 has different size of
time_t. So to have common layout for struct utmp and utmpx, corresponding headers are taken from s390 port.
You can't #include installed headers from other ports like this; it wouldn't work when using an installed library.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 23/23] [AARCH64] Take utmp{,x}.h from s390 port
Quoted 12 lines · Joseph Myers
Quoted 3 lines · Yury Norov
aarch64 and ilp32 has different size of
time_t. So to have common layout for struct utmp and utmpx, corresponding headers are taken from s390 port.You can't #include installed headers from other ports like this; it wouldn't work when using an installed library.
Signature · 2 lines
Joseph S. Myers [email protected]
So I should copy? Hmm...
Re: [PATCH 23/23] [AARCH64] Take utmp{,x}.h from s390 port
Quoted 8 lines · Yury Norov
Quoted 6 lines
You can't #include installed headers from other ports like this; it wouldn't work when using an installed library.
Signature · 2 lines
Joseph S. Myers [email protected]So I should copy? Hmm...
Yes, unless you can develop an additional abstraction to describe the differences between architectures, so that all architectures can share the same bits/utmp.h and bits/utmpx.h and there's only a smaller header that needs copying.
Signature · 2 lines
Joseph S. Myers [email protected]
Re: [PATCH 23/23] [AARCH64] Take utmp{,x}.h from s390 port
In reply to Yury NorovQuoted 7 lines · Yury Norov
Quoted 6 lines · Joseph Myers
Quoted 3 lines · Yury Norov
aarch64 and ilp32 has different size of
time_t. So to have common layout for struct utmp and utmpx, corresponding headers are taken from s390 port.
Quoted 9 lines
Quoted 6 lines
You can't #include installed headers from other ports like this; it wouldn't work when using an installed library.
Signature · 2 lines
Joseph S. Myers [email protected]So I should copy? Hmm...
In this case yes, since the reference will be broken because the s390 won't be installed.
Hi Yury,
Please address all previous reviews comment and concerns before send a new RFC/patch set. As Joseph pointed out, he raised different question in different patch iterations (some even back from 2014) and there is no point is just resent the same patch without first review such comments.
Quoted 225 lines · Yury Norov
This series enables aarch64 port with ilp32 mode.
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type- 64-bit arguments are passed in syscall as register pair, as kernel internally clears top halves for all input regs;
- standard syscall table is used;
- 32-bittime_tis used. AARCH64/ILP32 is waiting for general fix of Y2038 problem just like other 32-bit arches;
- stat{64}, statfs{64} structures are of the identical layout with LP64. Corresponding syscalls are taken from 64-bit code
- struct utmp, utmpx layouts are the same.v1: https://sourceware.org/ml/libc-alpha/2016-06/msg00730.html
v2:
- rebased on master;
- dropped unneeded/unrelated patches;
- pread family platform implementation removed;
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);Tested with LTP. Regressions are like this:
abort01 FAIL 2 kill11 FAIL 2 mmap16 FAIL 6 open12 FAIL 2 rename11 FAIL 2 rmdir02 FAIL 2 umount2_01 FAIL 2 umount2_02 FAIL 2 umount2_03 FAIL 2 utime06 FAIL 2It's better than v1, and there are ~5 additional regressions comparing to aarch64, all are related to filesystem.
Andrew Pinski (17):
[AARCH64] define word size for lp64 and ilp32 [AARCH64] Add header guards tosysdep.hheaders.
Add dynamic ILP32 AARCH64 relocations toelf.h[AARCH64] AddPTR_REG,PTR_LOG_SIZE, andPTR_SIZE. Use it in
LDST_PCRELandLDST_GLOBAL.
[AARCH64] UsePTR_REGincrti.S.
[AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG indl-tlsesc.S[AARCH64] Use PTR_* macros indl-trampoline.S[AARCH64] Use PTR_* instart.S
[AARCH64] UsePTR_REGingetcontext.S.
[AARCH64] Detect ILP32 in configure scripts. [AARCH64] Add ILP32 support toelf_machine_load_address. [AARCH64] Add ILP32 to makefiles
[AARCH64] Add support to ldconfig for ILP32 and libilp32 [AARCH64] Add ILP32 ld.so to the known interpreter names. [AARCH64] Add ldd-rewrite.sed so that ilp32 ld.so can be found [AARCH64] Make lp64 and ilp32 directories.
[AARCH64] Fix ILP32 warningYury Norov (6):
[AARCH64] ILP32: introduce syscalls that passoff_t[AARCH64] ILP32: support stat syscall family [AARCH64] delouse input arguments in system functions [AARCH64] Make__SIZEOF_SEM_T16 for ILP32
off_t: fix register pair calculation for 64-bit case [AARCH64] Take utmp{,x}.h from s390 portelf/cache.c | 3 + sysdeps/aarch64/Implies | 6 - sysdeps/aarch64/__longjmp.S | 6 +- sysdeps/aarch64/bits/wordsize.h | 25 +++ sysdeps/aarch64/configure | 15 +- sysdeps/aarch64/configure.ac | 11 +- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-irel.h | 3 +- sysdeps/aarch64/dl-machine.h | 199 ++++++++++++--------- sysdeps/aarch64/dl-tlsdesc.S | 56 +++--- sysdeps/aarch64/dl-trampoline.S | 18 +- sysdeps/aarch64/ilp32/Implies | 6 + sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/aarch64/lp64/Implies | 7 + sysdeps/aarch64/memcmp.S | 3 + sysdeps/aarch64/memcpy.S | 8 + sysdeps/aarch64/memset.S | 3 + sysdeps/aarch64/nptl/bits/semaphore.h | 4 + sysdeps/aarch64/preconfigure | 11 +- sysdeps/aarch64/setjmp.S | 5 +- sysdeps/aarch64/start.S | 20 ++- sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 + sysdeps/aarch64/strcpy.S | 2 + sysdeps/aarch64/strlen.S | 2 + sysdeps/aarch64/strncmp.S | 3 + sysdeps/aarch64/strnlen.S | 3 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 39 +++- sysdeps/generic/ldconfig.h | 1 + sysdeps/generic/stdint.h | 9 +- sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/Makefile | 16 +- sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 ++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 +++++++++ sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 7 + sysdeps/unix/sysv/linux/aarch64/configure | 24 ++- sysdeps/unix/sysv/linux/aarch64/configure.ac | 11 +- sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 +- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 +- sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 + sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++ .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 + sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 ++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 ---- sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 +++ sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 + sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 ++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 ---- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 - sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 +- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +- sysdeps/unix/sysv/linux/fallocate.c | 4 + sysdeps/unix/sysv/linux/fallocate64.c | 4 + sysdeps/unix/sysv/linux/generic/brk.c | 2 +- sysdeps/unix/sysv/linux/posix_fadvise.c | 4 + sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 + 100 files changed, 1649 insertions(+), 250 deletions(-) delete mode 100644 sysdeps/aarch64/Implies create mode 100644 sysdeps/aarch64/bits/wordsize.h mode change 100644 => 100755 sysdeps/aarch64/configure create mode 100644 sysdeps/aarch64/ilp32/Implies create mode 100644 sysdeps/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmp.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h mode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/kernel-features.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644 sysdeps/unix/sysv/linux/aarch64/mmap.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions
Quoted 8 lines · Yury Norov
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type
This is missing rlim_t, which is also controlled by _FILE_OFFSET_BITS.
Andreas.
sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h +1 -1
@@ -36,7 +36,7 @@#define __OFF_T_TYPE __SQUAD_TYPE#define __OFF64_T_TYPE __SQUAD_TYPE#define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM_T_TYPE __UQUAD_TYPE#define __RLIM64_T_TYPE __UQUAD_TYPE#define __BLKCNT_T_TYPE __SQUAD_TYPE#define __BLKCNT64_T_TYPE __SQUAD_TYPE
sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit.c new file +1 -0
@@ -0,0 +1 @@ +/* See sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c */
sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c new file +11 -0
@@ -0,0 +1,11 @@ +#define getrlimit __hide_getrlimit +#define __getrlimit __hide___getrlimit +#include <sysdeps/unix/sysv/linux/getrlimit64.c> +#undef getrlimit +#undef __getrlimit + +extern __typeof (__getrlimit64) __getrlimit; +libc_hidden_proto (__getrlimit) +strong_alias (__getrlimit64, __getrlimit) +libc_hidden_def (__getrlimit) +weak_alias (__getrlimit, getrlimit)
sysdeps/unix/sysv/linux/aarch64/ilp32/prlimit.c new file +1 -0
@@ -0,0 +1 @@ +/* prlimit is the same as prlimit64. */
sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit.c new file +1 -0
@@ -0,0 +1 @@ +/* See sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c */
sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c new file +11 -0
@@ -0,0 +1,11 @@ +#define setrlimit64 __setrlimit64 +#define setrlimit __hide_setrlimit +#define __setrlimit __hide___setrlimit +#include <sysdeps/unix/sysv/linux/setrlimit64.c> +#undef setrlimit64 +#undef setrlimit +#undef __setrlimit + +strong_alias (__setrlimit64, __setrlimit) +weak_alias (__setrlimit64, setrlimit64) +weak_alias (__setrlimit, setrlimit)
sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list +1 -0
@@ -0,0 +1 @@ +prlimit64 EXTRA prlimit64 i:iipp prlimit64 prlimit
Signature · 7 lines
2.9.0 -- Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Hi all,
I take 2-week vacation from monday, so I'll be not available all the time, and may response with one or two days delay.
Yury.
Hi, Guys
There was a discussion about bump vdso version of kernel. We need update the vdso version in glibc correspondingly otherwise the application could not make use of the vdso.
Is it make sense to you?
Regards
Bamvor
commit 3ffc1d798fc25ccb02e7cc325fe5fb3890c085e3
Author: Bamvor Jian Zhang <[email protected]> Date: Thu Sep 8 12:21:16 2016 +0800
[AARCH64] ILP32: bump vdso version consistent with kernel
sysdeps/unix/sysv/linux/aarch64/init-first.c +8 -4
@@ -27,17 +27,21 @@ int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);static inline void _libc_vdso_platform_setup (void ) { -PREPARE_VERSION (linux2639,"LINUX_2.6.39" ,123718537 ); +#ifndef __ILP32__ +PREPARE_VERSION (linux,"LINUX_2.6.39" ,123718537 ); +#else +PREPARE_VERSION (linux,"LINUX_4.8" ,61765624 ); +#endif /* #ifndef __ILP32__ */ -void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux2639); +void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (gettimeofday) = p; - p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_gettime) = p; - p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_getres) = p; }
Quoted 225 lines · Yury Norov
This series enables aarch64 port with ilp32 mode.
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type- 64-bit arguments are passed in syscall as register pair, as kernel internally clears top halves for all input regs;
- standard syscall table is used;
- 32-bittime_tis used. AARCH64/ILP32 is waiting for general fix of Y2038 problem just like other 32-bit arches;
- stat{64}, statfs{64} structures are of the identical layout with LP64. Corresponding syscalls are taken from 64-bit code
- struct utmp, utmpx layouts are the same.v1: https://sourceware.org/ml/libc-alpha/2016-06/msg00730.html
v2:
- rebased on master;
- dropped unneeded/unrelated patches;
- pread family platform implementation removed;
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);Tested with LTP. Regressions are like this:
abort01 FAIL 2 kill11 FAIL 2 mmap16 FAIL 6 open12 FAIL 2 rename11 FAIL 2 rmdir02 FAIL 2 umount2_01 FAIL 2 umount2_02 FAIL 2 umount2_03 FAIL 2 utime06 FAIL 2It's better than v1, and there are ~5 additional regressions comparing to aarch64, all are related to filesystem.
Andrew Pinski (17):
[AARCH64] define word size for lp64 and ilp32 [AARCH64] Add header guards tosysdep.hheaders.
Add dynamic ILP32 AARCH64 relocations toelf.h[AARCH64] AddPTR_REG,PTR_LOG_SIZE, andPTR_SIZE. Use it in
LDST_PCRELandLDST_GLOBAL.
[AARCH64] UsePTR_REGincrti.S.
[AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG indl-tlsesc.S[AARCH64] Use PTR_* macros indl-trampoline.S[AARCH64] Use PTR_* instart.S
[AARCH64] UsePTR_REGingetcontext.S.
[AARCH64] Detect ILP32 in configure scripts. [AARCH64] Add ILP32 support toelf_machine_load_address. [AARCH64] Add ILP32 to makefiles
[AARCH64] Add support to ldconfig for ILP32 and libilp32 [AARCH64] Add ILP32 ld.so to the known interpreter names. [AARCH64] Add ldd-rewrite.sed so that ilp32 ld.so can be found [AARCH64] Make lp64 and ilp32 directories.
[AARCH64] Fix ILP32 warningYury Norov (6):
[AARCH64] ILP32: introduce syscalls that passoff_t[AARCH64] ILP32: support stat syscall family [AARCH64] delouse input arguments in system functions [AARCH64] Make__SIZEOF_SEM_T16 for ILP32
off_t: fix register pair calculation for 64-bit case [AARCH64] Take utmp{,x}.h from s390 portelf/cache.c | 3 + sysdeps/aarch64/Implies | 6 - sysdeps/aarch64/__longjmp.S | 6 +- sysdeps/aarch64/bits/wordsize.h | 25 +++ sysdeps/aarch64/configure | 15 +- sysdeps/aarch64/configure.ac | 11 +- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-irel.h | 3 +- sysdeps/aarch64/dl-machine.h | 199 ++++++++++++--------- sysdeps/aarch64/dl-tlsdesc.S | 56 +++--- sysdeps/aarch64/dl-trampoline.S | 18 +- sysdeps/aarch64/ilp32/Implies | 6 + sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/aarch64/lp64/Implies | 7 + sysdeps/aarch64/memcmp.S | 3 + sysdeps/aarch64/memcpy.S | 8 + sysdeps/aarch64/memset.S | 3 + sysdeps/aarch64/nptl/bits/semaphore.h | 4 + sysdeps/aarch64/preconfigure | 11 +- sysdeps/aarch64/setjmp.S | 5 +- sysdeps/aarch64/start.S | 20 ++- sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 + sysdeps/aarch64/strcpy.S | 2 + sysdeps/aarch64/strlen.S | 2 + sysdeps/aarch64/strncmp.S | 3 + sysdeps/aarch64/strnlen.S | 3 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 39 +++- sysdeps/generic/ldconfig.h | 1 + sysdeps/generic/stdint.h | 9 +- sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/Makefile | 16 +- sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 ++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 +++++++++ sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 7 + sysdeps/unix/sysv/linux/aarch64/configure | 24 ++- sysdeps/unix/sysv/linux/aarch64/configure.ac | 11 +- sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 +- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 +- sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 + sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++ .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 + sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 ++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 ---- sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 +++ sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 + sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 ++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 ---- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 - sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 +- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +- sysdeps/unix/sysv/linux/fallocate.c | 4 + sysdeps/unix/sysv/linux/fallocate64.c | 4 + sysdeps/unix/sysv/linux/generic/brk.c | 2 +- sysdeps/unix/sysv/linux/posix_fadvise.c | 4 + sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 + 100 files changed, 1649 insertions(+), 250 deletions(-) delete mode 100644 sysdeps/aarch64/Implies create mode 100644 sysdeps/aarch64/bits/wordsize.h mode change 100644 => 100755 sysdeps/aarch64/configure create mode 100644 sysdeps/aarch64/ilp32/Implies create mode 100644 sysdeps/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmp.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h mode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/kernel-features.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644 sysdeps/unix/sysv/linux/aarch64/mmap.c delete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions
Quoted 11 lines · Zhangjian (Bamvor)
Hi, Guys
There was a discussion about bump vdso version of kernel. We need update the vdso version in glibc correspondingly otherwise the application could not make use of the vdso.
Is it make sense to you?
Regards
Bamvor
Hi Bamvor,
Is this the source of performance loss you've discovered?
Quoted 268 lines
commit
3ffc1d798fc25ccb02e7cc325fe5fb3890c085e3Author: Bamvor Jian Zhang <[email protected]> Date: Thu Sep 8 12:21:16 2016 +0800[AARCH64] ILP32: bump vdso version consistent with kernel
Signed-off-by Jun Ji <[email protected]>Signed-off-by Bamvor Jian Zhang <[email protected]>sysdeps/unix/sysv/linux/aarch64/init-first.c +8
-4@@ -27,17 +27,21 @@ int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);static inline void _libc_vdso_platform_setup (void ) { -PREPARE_VERSION (linux2639,"LINUX_2.6.39" ,123718537 ); +#ifndef __ILP32__ +PREPARE_VERSION (linux,"LINUX_2.6.39" ,123718537 ); +#else +PREPARE_VERSION (linux,"LINUX_4.8" ,61765624 ); +#endif /* #ifndef __ILP32__ */ -void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux2639); +void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (gettimeofday) = p; - p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_gettime) = p; - p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_getres) = p; }Quoted 225 lines · Yury Norov
This series enables aarch64 port with ilp32 mode.
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type- 64-bit arguments are passed in syscall as register pair, as kernel internally clears top halves for all input regs;
- standard syscall table is used;
- 32-bittime_tis used. AARCH64/ILP32 is waiting for general fix of Y2038 problem just like other 32-bit arches;
- stat{64}, statfs{64} structures are of the identical layout with LP64. Corresponding syscalls are taken from 64-bit code
- struct utmp, utmpx layouts are the same.v1: https://sourceware.org/ml/libc-alpha/2016-06/msg00730.html
v2:
- rebased on master;
- dropped unneeded/unrelated patches;
- pread family platform implementation removed;
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);Tested with LTP. Regressions are like this:
abort01 FAIL 2 kill11 FAIL 2 mmap16 FAIL 6 open12 FAIL 2 rename11 FAIL 2 rmdir02 FAIL 2 umount2_01 FAIL 2 umount2_02 FAIL 2 umount2_03 FAIL 2 utime06 FAIL 2It's better than v1, and there are ~5 additional regressions comparing to aarch64, all are related to filesystem.
Andrew Pinski (17):
[AARCH64] define word size for lp64 and ilp32 [AARCH64] Add header guards tosysdep.hheaders.
Add dynamic ILP32 AARCH64 relocations toelf.h[AARCH64] AddPTR_REG,PTR_LOG_SIZE, andPTR_SIZE. Use it in
LDST_PCRELandLDST_GLOBAL.
[AARCH64] UsePTR_REGincrti.S.
[AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG indl-tlsesc.S[AARCH64] Use PTR_* macros indl-trampoline.S[AARCH64] Use PTR_* instart.S
[AARCH64] UsePTR_REGingetcontext.S.
[AARCH64] Detect ILP32 in configure scripts. [AARCH64] Add ILP32 support toelf_machine_load_address. [AARCH64] Add ILP32 to makefiles
[AARCH64] Add support to ldconfig for ILP32 and libilp32 [AARCH64] Add ILP32 ld.so to the known interpreter names. [AARCH64] Add ldd-rewrite.sed so that ilp32 ld.so can be found [AARCH64] Make lp64 and ilp32 directories.
[AARCH64] Fix ILP32 warningYury Norov (6):
[AARCH64] ILP32: introduce syscalls that passoff_t[AARCH64] ILP32: support stat syscall family [AARCH64] delouse input arguments in system functions [AARCH64] Make__SIZEOF_SEM_T16 for ILP32
off_t: fix register pair calculation for 64-bit case [AARCH64] Take utmp{,x}.h from s390 portelf/cache.c | 3 + sysdeps/aarch64/Implies | 6 - sysdeps/aarch64/__longjmp.S | 6 +- sysdeps/aarch64/bits/wordsize.h | 25 +++ sysdeps/aarch64/configure | 15 +- sysdeps/aarch64/configure.ac | 11 +- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-irel.h | 3 +- sysdeps/aarch64/dl-machine.h | 199 ++++++++++++--------- sysdeps/aarch64/dl-tlsdesc.S | 56 +++--- sysdeps/aarch64/dl-trampoline.S | 18 +- sysdeps/aarch64/ilp32/Implies | 6 + sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/aarch64/lp64/Implies | 7 + sysdeps/aarch64/memcmp.S | 3 + sysdeps/aarch64/memcpy.S | 8 + sysdeps/aarch64/memset.S | 3 + sysdeps/aarch64/nptl/bits/semaphore.h | 4 + sysdeps/aarch64/preconfigure | 11 +- sysdeps/aarch64/setjmp.S | 5 +- sysdeps/aarch64/start.S | 20 ++- sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 + sysdeps/aarch64/strcpy.S | 2 + sysdeps/aarch64/strlen.S | 2 + sysdeps/aarch64/strncmp.S | 3 + sysdeps/aarch64/strnlen.S | 3 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 39 +++- sysdeps/generic/ldconfig.h | 1 + sysdeps/generic/stdint.h | 9 +- sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/Makefile | 16 +- sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 ++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 +++++++++ sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 7 + sysdeps/unix/sysv/linux/aarch64/configure | 24 ++- sysdeps/unix/sysv/linux/aarch64/configure.ac | 11 +- sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 +- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 +- sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 + sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++ .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 + sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 ++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 ---- sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 +++ sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 + sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 ++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 ---- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 - sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 +- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +- sysdeps/unix/sysv/linux/fallocate.c | 4 + sysdeps/unix/sysv/linux/fallocate64.c | 4 + sysdeps/unix/sysv/linux/generic/brk.c | 2 +- sysdeps/unix/sysv/linux/posix_fadvise.c | 4 + sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 + 100 files changed, 1649 insertions(+), 250 deletions(-)delete mode 100644 sysdeps/aarch64/Implies
create mode 100644sysdeps/aarch64/bits/wordsize.h
mode change 100644 => 100755 sysdeps/aarch64/configure
create mode 100644 sysdeps/aarch64/ilp32/Implies
create mode 100644 sysdeps/aarch64/lp64/Implies
create mode 100644sysdeps/unix/sysv/linux/aarch64/bits/stat.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/statfs.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/typesizes.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/utmp.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/utmpx.hmode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.cdelete mode 100644sysdeps/unix/sysv/linux/aarch64/ioctl.Screate mode 100644sysdeps/unix/sysv/linux/aarch64/kernel-features.hcreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.Screate mode 100644sysdeps/unix/sysv/linux/aarch64/lp64/mmap.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644sysdeps/unix/sysv/linux/aarch64/mmap.cdelete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions
Hi, Yury
Quoted 9 lines · Yury Norov
Quoted 8 lines · Zhangjian (Bamvor)
Hi, Guys
There was a discussion about bump vdso version of kernel. We need update the vdso version in glibc correspondingly otherwise the application could not make use of the vdso.
Is it make sense to you?
Quoted 7 lines
Quoted 3 lines
Regards
Bamvor
Hi Bamvor,
Is this the source of performance loss you've discovered?
Not yet.
There are mmmapstress03和vma03 failed in our kernel. I plan to investigatet those bugs firstly. Do you encounter those failures?
Regards
Bamvor
Quoted 269 lines
Quoted 269 lines
commit
3ffc1d798fc25ccb02e7cc325fe5fb3890c085e3Author: Bamvor Jian Zhang <[email protected]> Date: Thu Sep 8 12:21:16 2016 +0800[AARCH64] ILP32: bump vdso version consistent with kernel
Signed-off-by Jun Ji <[email protected]>Signed-off-by Bamvor Jian Zhang <[email protected]>sysdeps/unix/sysv/linux/aarch64/init-first.c +8
-4@@ -27,17 +27,21 @@ int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);static inline void _libc_vdso_platform_setup (void ) { -PREPARE_VERSION (linux2639,"LINUX_2.6.39" ,123718537 ); +#ifndef __ILP32__ +PREPARE_VERSION (linux,"LINUX_2.6.39" ,123718537 ); +#else +PREPARE_VERSION (linux,"LINUX_4.8" ,61765624 ); +#endif /* #ifndef __ILP32__ */ -void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux2639); +void *p =_dl_vdso_vsym ("__kernel_gettimeofday" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (gettimeofday) = p; - p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_gettime" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_gettime) = p; - p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux2639); + p =_dl_vdso_vsym ("__kernel_clock_getres" , &linux);PTR_MANGLE (p);VDSO_SYMBOL (clock_getres) = p; }Quoted 225 lines · Yury Norov
This series enables aarch64 port with ilp32 mode.
ABI details:
- types are taken from AARCH32, next types turned to 64-bit, as modern requirement for new APIs tells:ino_t is u64 type off_t is s64 type blkcnt_t is s64 type fsblkcnt_t is u64 type fsfilcnt_t is u64 type- 64-bit arguments are passed in syscall as register pair, as kernel internally clears top halves for all input regs;
- standard syscall table is used;
- 32-bittime_tis used. AARCH64/ILP32 is waiting for general fix of Y2038 problem just like other 32-bit arches;
- stat{64}, statfs{64} structures are of the identical layout with LP64. Corresponding syscalls are taken from 64-bit code
- struct utmp, utmpx layouts are the same.v1: https://sourceware.org/ml/libc-alpha/2016-06/msg00730.html
v2:
- rebased on master;
- dropped unneeded/unrelated patches;
- pread family platform implementation removed;
- addressed v1 comments (I'm really sorry if I missed something, there are a lot of them, and I am really thankfull for detailed review);Tested with LTP. Regressions are like this:
abort01 FAIL 2 kill11 FAIL 2 mmap16 FAIL 6 open12 FAIL 2 rename11 FAIL 2 rmdir02 FAIL 2 umount2_01 FAIL 2 umount2_02 FAIL 2 umount2_03 FAIL 2 utime06 FAIL 2It's better than v1, and there are ~5 additional regressions comparing to aarch64, all are related to filesystem.
Andrew Pinski (17):
[AARCH64] define word size for lp64 and ilp32 [AARCH64] Add header guards tosysdep.hheaders.
Add dynamic ILP32 AARCH64 relocations toelf.h[AARCH64] AddPTR_REG,PTR_LOG_SIZE, andPTR_SIZE. Use it in
LDST_PCRELandLDST_GLOBAL.
[AARCH64] UsePTR_REGincrti.S.
[AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG indl-tlsesc.S[AARCH64] Use PTR_* macros indl-trampoline.S[AARCH64] Use PTR_* instart.S
[AARCH64] UsePTR_REGingetcontext.S.
[AARCH64] Detect ILP32 in configure scripts. [AARCH64] Add ILP32 support toelf_machine_load_address. [AARCH64] Add ILP32 to makefiles
[AARCH64] Add support to ldconfig for ILP32 and libilp32 [AARCH64] Add ILP32 ld.so to the known interpreter names. [AARCH64] Add ldd-rewrite.sed so that ilp32 ld.so can be found [AARCH64] Make lp64 and ilp32 directories.
[AARCH64] Fix ILP32 warningYury Norov (6):
[AARCH64] ILP32: introduce syscalls that passoff_t[AARCH64] ILP32: support stat syscall family [AARCH64] delouse input arguments in system functions [AARCH64] Make__SIZEOF_SEM_T16 for ILP32
off_t: fix register pair calculation for 64-bit case [AARCH64] Take utmp{,x}.h from s390 portelf/cache.c | 3 + sysdeps/aarch64/Implies | 6 - sysdeps/aarch64/__longjmp.S | 6 +- sysdeps/aarch64/bits/wordsize.h | 25 +++ sysdeps/aarch64/configure | 15 +- sysdeps/aarch64/configure.ac | 11 +- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-irel.h | 3 +- sysdeps/aarch64/dl-machine.h | 199 ++++++++++++--------- sysdeps/aarch64/dl-tlsdesc.S | 56 +++--- sysdeps/aarch64/dl-trampoline.S | 18 +- sysdeps/aarch64/ilp32/Implies | 6 + sysdeps/aarch64/jmpbuf-unwind.h | 2 +- sysdeps/aarch64/lp64/Implies | 7 + sysdeps/aarch64/memcmp.S | 3 + sysdeps/aarch64/memcpy.S | 8 + sysdeps/aarch64/memset.S | 3 + sysdeps/aarch64/nptl/bits/semaphore.h | 4 + sysdeps/aarch64/preconfigure | 11 +- sysdeps/aarch64/setjmp.S | 5 +- sysdeps/aarch64/start.S | 20 ++- sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 + sysdeps/aarch64/strcpy.S | 2 + sysdeps/aarch64/strlen.S | 2 + sysdeps/aarch64/strncmp.S | 3 + sysdeps/aarch64/strnlen.S | 3 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 39 +++- sysdeps/generic/ldconfig.h | 1 + sysdeps/generic/stdint.h | 9 +- sysdeps/unix/sysv/linux/aarch64/Implies | 2 - sysdeps/unix/sysv/linux/aarch64/Makefile | 16 +- sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 6 +- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 ++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h | 86 +++++++++ sysdeps/unix/sysv/linux/aarch64/bits/utmp.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 7 + sysdeps/unix/sysv/linux/aarch64/configure | 24 ++- sysdeps/unix/sysv/linux/aarch64/configure.ac | 11 +- sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 +- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 +- sysdeps/unix/sysv/linux/aarch64/ilp32/Implies | 4 + .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.c | 6 + sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.c | 1 + .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c | 77 ++++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.c | 36 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.c | 32 ++++ .../unix/sysv/linux/aarch64/ilp32/posix_fadvise.c | 1 + .../sysv/linux/aarch64/ilp32/posix_fadvise64.c | 2 + sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c | 53 ++++++ .../unix/sysv/linux/aarch64/ilp32/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.c | 32 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ .../unix/sysv/linux/aarch64/ilp32/syscalls.list | 0 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.c | 1 + sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c | 4 + sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ioctl.S | 31 ---- sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 27 +++ sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 + sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed | 1 + sysdeps/unix/sysv/linux/aarch64/lp64/Implies | 4 + sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S | 31 ++++ sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c | 34 ++++ .../unix/sysv/linux/aarch64/lp64/shlib-versions | 7 + sysdeps/unix/sysv/linux/aarch64/mmap.c | 34 ---- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/shlib-versions | 7 - sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 2 +- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 +- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +- sysdeps/unix/sysv/linux/fallocate.c | 4 + sysdeps/unix/sysv/linux/fallocate64.c | 4 + sysdeps/unix/sysv/linux/generic/brk.c | 2 +- sysdeps/unix/sysv/linux/posix_fadvise.c | 4 + sysdeps/unix/sysv/linux/posix_fadvise64.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate.c | 4 + sysdeps/unix/sysv/linux/posix_fallocate64.c | 4 + 100 files changed, 1649 insertions(+), 250 deletions(-)delete mode 100644 sysdeps/aarch64/Implies
create mode 100644sysdeps/aarch64/bits/wordsize.h
mode change 100644 => 100755 sysdeps/aarch64/configure
create mode 100644 sysdeps/aarch64/ilp32/Implies
create mode 100644 sysdeps/aarch64/lp64/Implies
create mode 100644sysdeps/unix/sysv/linux/aarch64/bits/stat.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/statfs.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/typesizes.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/utmp.hcreate mode 100644sysdeps/unix/sysv/linux/aarch64/bits/utmpx.hmode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/dl-xstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lseek.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/mmap.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/msgctl.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/readahead.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/readdir64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/shmctl.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list create mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/truncate.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.ccreate mode 100644sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.cdelete mode 100644sysdeps/unix/sysv/linux/aarch64/ioctl.Screate mode 100644sysdeps/unix/sysv/linux/aarch64/kernel-features.hcreate mode 100644 sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies create mode 100644sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.Screate mode 100644sysdeps/unix/sysv/linux/aarch64/lp64/mmap.ccreate mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions delete mode 100644sysdeps/unix/sysv/linux/aarch64/mmap.cdelete mode 100644 sysdeps/unix/sysv/linux/aarch64/shlib-versions