diff --git a/build-locale-archive.c b/build-locale-archive.c index 474f666..187c7e5 100644 --- a/build-locale-archive.c +++ b/build-locale-archive.c @@ -26,6 +26,12 @@ int verbose = 0; int max_locarchive_open_retry = 10; const char *output_prefix; +/* Endianness should have been taken care of by localedef. We don't need to do + additional swapping. We need this variable exported however, since + locarchive.c uses it to determine if it needs to swap endianness of a value + before writing to or reading from the archive. */ +bool swap_endianness_p = false; + static const char *locnames[] = { #define DEFINE_CATEGORY(category, category_name, items, a) \ @@ -96,7 +102,7 @@ open_tmpl_archive (struct locarhandle *ah) struct stat64 st; int fd; struct locarhead head; - const char *archivefname = tmpl_file; + const char *archivefname = ah->fname == NULL ? tmpl_file : ah->fname; /* Open the archive. We must have exclusive write access. */ fd = open64 (archivefname, O_RDONLY); @@ -250,7 +256,8 @@ compute_data (struct locarhandle *ah, struct nameent *name, size_t sumused, } static int -fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[], +fill_archive (struct locarhandle *tmpl_ah, + const char *fname, size_t nlist, char *list[], const char *primary) { struct locarhandle ah; @@ -304,6 +311,9 @@ fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[], /* Open the archive. This call never returns if we cannot successfully open the archive. */ + ah.fname = NULL; + if (fname != NULL) + ah.fname = fname; open_archive (&ah, false); if (primary != NULL) @@ -532,7 +542,7 @@ fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[], return result; } -int main () +int main (int argc, char *argv[]) { char path[4096]; DIR *dirp; @@ -547,6 +557,11 @@ int main () if (dirp == NULL) error (EXIT_FAILURE, errno, "cannot open directory \"%s\"", loc_path); + /* Use the template file as specified on the command line. */ + tmpl_ah.fname = NULL; + if (argc > 1) + tmpl_ah.fname = argv[1]; + open_tmpl_archive (&tmpl_ah); unlink (locar_file); @@ -623,10 +638,12 @@ int main () cnt++; } closedir (dirp); - fill_archive (&tmpl_ah, cnt, list, primary); + /* Store the archive to the file specified as the second argument on the + command line or the default locale archive. */ + fill_archive (&tmpl_ah, argc > 2 ? argv[2] : NULL, cnt, list, primary); close_archive (&tmpl_ah); truncate (tmpl_file, 0); - char *argv[] = { "/usr/sbin/tzdata-update", NULL }; - execve (argv[0], (char *const *)argv, (char *const *)&argv[1]); + char *tz_argv[] = { "/usr/sbin/tzdata-update", NULL }; + execve (tz_argv[0], (char *const *)tz_argv, (char *const *)&tz_argv[1]); exit (0); } diff --git a/eglibc-2.15-mips-async-unwind.patch b/eglibc-2.15-mips-async-unwind.patch deleted file mode 100644 index e5baba1..0000000 --- a/eglibc-2.15-mips-async-unwind.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- eglibc-2.15/ports/sysdeps/mips/Makefile 2012-01-04 17:35:09.000000000 +0100 -+++ eglibc-2.15-mips-async-unwind/ports/sysdeps/mips/Makefile 2012-02-24 15:19:44.915827395 +0100 -@@ -21,11 +21,11 @@ - endif - - ifeq ($(subdir),csu) --CFLAGS-initfini.s += -fno-unwind-tables -+CFLAGS-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables - endif - - ifeq ($(subdir),nptl) --CFLAGS-pt-initfini.s += -fno-unwind-tables -+CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables - endif - - ASFLAGS-.os += $(pic-ccflag) diff --git a/eglibc-2.15-mips-no-n32-n64.patch b/eglibc-2.15-mips-no-n32-n64.patch deleted file mode 100644 index c8ae7c3..0000000 --- a/eglibc-2.15-mips-no-n32-n64.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- eglibc-2.15/ports/sysdeps/unix/sysv/linux/mips/Makefile 2011-12-22 20:27:39.000000000 +0100 -+++ eglibc-2.15-mips-no-n32-n64/ports/sysdeps/unix/sysv/linux/mips/Makefile 2012-02-24 16:23:23.380420249 +0100 -@@ -7,7 +7,7 @@ - - sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h - --syscall-list-variants := o32 n32 n64 -+syscall-list-variants := o32 - syscall-list-includes := sgidefs.h - syscall-list-o32-options := -mabi=32 - syscall-list-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32 diff --git a/eglibc-2.17-linaro-optimizations.diff b/eglibc-2.17-linaro-optimizations.diff deleted file mode 100644 index b3b5d6e..0000000 --- a/eglibc-2.17-linaro-optimizations.diff +++ /dev/null @@ -1,2716 +0,0 @@ -diff --git a/libc/ChangeLog.linaro b/libc/ChangeLog.linaro -new file mode 100644 -index 0000000..ba62105 ---- /dev/null -+++ b/libc/ChangeLog.linaro -@@ -0,0 +1,39 @@ -+2013-07-25 Will Newton -+ -+ eglibc Linaro 2.17-2013.07-2 released. -+ -+ * version.h: Update version to 2013.07-2. -+ -+2013-07-25 Will Newton -+ -+ * version.h: Bump version. -+ -+2013-07-25 Will Newton -+ -+ eglibc Linaro 2.17-2013.07-1 released. -+ -+ * version.h: Update version to 2013.07-1. -+ -+2013-07-22 Will Newton -+ -+ * version.h: Bump version. -+ -+2013-07-22 Will Newton -+ -+ eglibc Linaro 2.17-2013.07 released. -+ -+ * version.h: Update version to 2013.07. -+ -+2013-06-11 Will Newton -+ -+ * version.h: Bump version. -+ -+2013-06-11 Will Newton -+ -+ eglibc Linaro 2.17-2013.06 released. -+ -+ * version.h: Update version to 2013.06. -+ -+2013-06-10 Will Newton -+ -+ * version.h: Update from linaro branch. -diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro -new file mode 100644 -index 0000000..adb3038 ---- /dev/null -+++ b/libc/ports/ChangeLog.aarch64.linaro -@@ -0,0 +1,51 @@ -+2013-07-25 Will Newton -+ -+ * sysdeps/aarch64/strcmp.S: Move from obsolete ports -+ top-level directory to fix mis-merge. -+ * sysdeps/aarch64/strlen.S: Likewise. -+ * sysdeps/aarch64/bzero.S: Likewise. -+ * sysdeps/aarch64/memmove.S: Likewise. -+ -+2013-01-23 Marcus Shawcroft -+ -+ * sysdeps/aarch64/strncmp.S: New file. -+ -+2013-01-23 Marcus Shawcroft -+ -+ * sysdeps/aarch64/sysdep.h (ENTRY_ALIGN_AND_PAD): New. -+ * sysdeps/aarch64/strnlen.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/strlen.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/strcmp.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/bzero.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/memmove.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/memcpy.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/memset.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/sysdep.h (ENTRY_ALIGN): New. -+ * sysdeps/aarch64/memcmp.S: New file. -+ -+2013-01-17 Marcus Shawcroft -+ -+ * sysdeps/aarch64/sysdep.h (ENTRY, END): Adjust -+ whitespace. -+ -diff --git a/libc/ports/ChangeLog.arm.linaro b/libc/ports/ChangeLog.arm.linaro -new file mode 100644 -index 0000000..82f9c90 ---- /dev/null -+++ b/libc/ports/ChangeLog.arm.linaro -@@ -0,0 +1,20 @@ -+2013-02-28 Richard Henderson -+ -+ * sysdeps/arm/preconfigure: Adjust scan for __ARM_ARCH_* defines. -+ -+2013-06-11 Will Newton -+ -+ * sysdeps/arm/sysdeps.h: Add PC_OFS macro. -+ -+2013-06-10 Will Newton -+ -+ * sysdeps/arm/armv7/multiarch/Makefile: New file. -+ * sysdeps/arm/armv7/multiarch/aeabi_memcpy.c: Likewise. -+ * sysdeps/arm/armv7/multiarch/ifunc-impl-list.c: Likewise. -+ * sysdeps/arm/armv7/multiarch/memcpy.S: Likewise. -+ * sysdeps/arm/armv7/multiarch/memcpy_impl.S: Likewise. -+ * sysdeps/arm/armv7/multiarch/memcpy_neon.S: Likewise. -+ * sysdeps/arm/armv7/multiarch/memcpy_vfp.S: Likewise. -+ * sysdeps/arm/armv7/configure.in: Likewise. -+ * sysdeps/arm/armv7/configure: Generated. -+ -diff --git a/libc/ports/sysdeps/aarch64/bzero.S b/libc/ports/sysdeps/aarch64/bzero.S -new file mode 100644 -index 0000000..228c0a5 ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/bzero.S -@@ -0,0 +1,27 @@ -+/* Copyright (C) 2013 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 -+ . */ -+ -+#include -+ -+ .text -+ENTRY(__bzero) -+ mov x2, x1 -+ mov x1, xzr -+ b __memset -+END(__bzero) -+weak_alias (__bzero, bzero) -diff --git a/libc/ports/sysdeps/aarch64/memcmp.S b/libc/ports/sysdeps/aarch64/memcmp.S -new file mode 100644 -index 0000000..6398ddd ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/memcmp.S -@@ -0,0 +1,151 @@ -+/* memcmp - compare memory -+ -+ Copyright (C) 2013 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 -+ . */ -+ -+#include -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ */ -+ -+/* Parameters and result. */ -+#define src1 x0 -+#define src2 x1 -+#define limit x2 -+#define result x0 -+ -+/* Internal variables. */ -+#define data1 x3 -+#define data1w w3 -+#define data2 x4 -+#define data2w w4 -+#define has_nul x5 -+#define diff x6 -+#define endloop x7 -+#define tmp1 x8 -+#define tmp2 x9 -+#define tmp3 x10 -+#define pos x11 -+#define limit_wd x12 -+#define mask x13 -+ -+ENTRY_ALIGN (memcmp, 6) -+ cbz limit, L(ret0) -+ eor tmp1, src1, src2 -+ tst tmp1, #7 -+ b.ne L(misaligned8) -+ ands tmp1, src1, #7 -+ b.ne L(mutual_align) -+ add limit_wd, limit, #7 -+ lsr limit_wd, limit_wd, #3 -+ /* Start of performance-critical section -- one 64B cache line. */ -+L(loop_aligned): -+ ldr data1, [src1], #8 -+ ldr data2, [src2], #8 -+L(start_realigned): -+ subs limit_wd, limit_wd, #1 -+ eor diff, data1, data2 /* Non-zero if differences found. */ -+ csinv endloop, diff, xzr, ne /* Last Dword or differences. */ -+ cbz endloop, L(loop_aligned) -+ /* End of performance-critical section -- one 64B cache line. */ -+ -+ /* Not reached the limit, must have found a diff. */ -+ cbnz limit_wd, L(not_limit) -+ -+ /* Limit % 8 == 0 => all bytes significant. */ -+ ands limit, limit, #7 -+ b.eq L(not_limit) -+ -+ lsl limit, limit, #3 /* Bits -> bytes. */ -+ mov mask, #~0 -+#ifdef __AARCH64EB__ -+ lsr mask, mask, limit -+#else -+ lsl mask, mask, limit -+#endif -+ bic data1, data1, mask -+ bic data2, data2, mask -+ -+ orr diff, diff, mask -+L(not_limit): -+ -+#ifndef __AARCH64EB__ -+ rev diff, diff -+ rev data1, data1 -+ rev data2, data2 -+#endif -+ /* The MS-non-zero bit of DIFF marks either the first bit -+ that is different, or the end of the significant data. -+ Shifting left now will bring the critical information into the -+ top bits. */ -+ clz pos, diff -+ lsl data1, data1, pos -+ lsl data2, data2, pos -+ /* But we need to zero-extend (char is unsigned) the value and then -+ perform a signed 32-bit subtraction. */ -+ lsr data1, data1, #56 -+ sub result, data1, data2, lsr #56 -+ RET -+ -+L(mutual_align): -+ /* Sources are mutually aligned, but are not currently at an -+ alignment boundary. Round down the addresses and then mask off -+ the bytes that precede the start point. */ -+ bic src1, src1, #7 -+ bic src2, src2, #7 -+ add limit, limit, tmp1 /* Adjust the limit for the extra. */ -+ lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */ -+ ldr data1, [src1], #8 -+ neg tmp1, tmp1 /* Bits to alignment -64. */ -+ ldr data2, [src2], #8 -+ mov tmp2, #~0 -+#ifdef __AARCH64EB__ -+ /* Big-endian. Early bytes are at MSB. */ -+ lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#else -+ /* Little-endian. Early bytes are at LSB. */ -+ lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#endif -+ add limit_wd, limit, #7 -+ orr data1, data1, tmp2 -+ orr data2, data2, tmp2 -+ lsr limit_wd, limit_wd, #3 -+ b L(start_realigned) -+ -+L(ret0): -+ mov result, #0 -+ RET -+ -+ .p2align 6 -+L(misaligned8): -+ sub limit, limit, #1 -+1: -+ /* Perhaps we can do better than this. */ -+ ldrb data1w, [src1], #1 -+ ldrb data2w, [src2], #1 -+ subs limit, limit, #1 -+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ -+ b.eq 1b -+ sub result, data1, data2 -+ RET -+END (memcmp) -+#undef bcmp -+weak_alias (memcmp, bcmp) -+libc_hidden_builtin_def (memcmp) -diff --git a/libc/ports/sysdeps/aarch64/memcpy.S b/libc/ports/sysdeps/aarch64/memcpy.S -new file mode 100644 -index 0000000..4f4e36c ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/memcpy.S -@@ -0,0 +1,176 @@ -+/* Copyright (C) 2012-2013 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 -+ . */ -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ * Unaligned accesses -+ * -+ */ -+ -+#define dstin x0 -+#define src x1 -+#define count x2 -+#define tmp1 x3 -+#define tmp1w w3 -+#define tmp2 x4 -+#define tmp2w w4 -+#define tmp3 x5 -+#define tmp3w w5 -+#define dst x6 -+ -+#define A_l x7 -+#define A_h x8 -+#define B_l x9 -+#define B_h x10 -+#define C_l x11 -+#define C_h x12 -+#define D_l x13 -+#define D_h x14 -+ -+#include -+ -+ENTRY_ALIGN (memcpy, 6) -+ -+ mov dst, dstin -+ cmp count, #64 -+ b.ge L(cpy_not_short) -+ cmp count, #15 -+ b.le L(tail15tiny) -+ -+ /* Deal with small copies quickly by dropping straight into the -+ * exit block. */ -+L(tail63): -+ /* Copy up to 48 bytes of data. At this point we only need the -+ * bottom 6 bits of count to be accurate. */ -+ ands tmp1, count, #0x30 -+ b.eq L(tail15) -+ add dst, dst, tmp1 -+ add src, src, tmp1 -+ cmp tmp1w, #0x20 -+ b.eq 1f -+ b.lt 2f -+ ldp A_l, A_h, [src, #-48] -+ stp A_l, A_h, [dst, #-48] -+1: -+ ldp A_l, A_h, [src, #-32] -+ stp A_l, A_h, [dst, #-32] -+2: -+ ldp A_l, A_h, [src, #-16] -+ stp A_l, A_h, [dst, #-16] -+ -+L(tail15): -+ ands count, count, #15 -+ beq 1f -+ add src, src, count -+ ldp A_l, A_h, [src, #-16] -+ add dst, dst, count -+ stp A_l, A_h, [dst, #-16] -+1: -+ RET -+ -+L(tail15tiny): -+ /* Copy up to 15 bytes of data. Does not assume additional data -+ being copied. */ -+ tbz count, #3, 1f -+ ldr tmp1, [src], #8 -+ str tmp1, [dst], #8 -+1: -+ tbz count, #2, 1f -+ ldr tmp1w, [src], #4 -+ str tmp1w, [dst], #4 -+1: -+ tbz count, #1, 1f -+ ldrh tmp1w, [src], #2 -+ strh tmp1w, [dst], #2 -+1: -+ tbz count, #0, 1f -+ ldrb tmp1w, [src] -+ strb tmp1w, [dst] -+1: -+ RET -+ -+L(cpy_not_short): -+ /* We don't much care about the alignment of DST, but we want SRC -+ * to be 128-bit (16 byte) aligned so that we don't cross cache line -+ * boundaries on both loads and stores. */ -+ neg tmp2, src -+ ands tmp2, tmp2, #15 /* Bytes to reach alignment. */ -+ b.eq 2f -+ sub count, count, tmp2 -+ /* Copy more data than needed; it's faster than jumping -+ * around copying sub-Quadword quantities. We know that -+ * it can't overrun. */ -+ ldp A_l, A_h, [src] -+ add src, src, tmp2 -+ stp A_l, A_h, [dst] -+ add dst, dst, tmp2 -+ /* There may be less than 63 bytes to go now. */ -+ cmp count, #63 -+ b.le L(tail63) -+2: -+ subs count, count, #128 -+ b.ge L(cpy_body_large) -+ /* Less than 128 bytes to copy, so handle 64 here and then jump -+ * to the tail. */ -+ ldp A_l, A_h, [src] -+ ldp B_l, B_h, [src, #16] -+ ldp C_l, C_h, [src, #32] -+ ldp D_l, D_h, [src, #48] -+ stp A_l, A_h, [dst] -+ stp B_l, B_h, [dst, #16] -+ stp C_l, C_h, [dst, #32] -+ stp D_l, D_h, [dst, #48] -+ tst count, #0x3f -+ add src, src, #64 -+ add dst, dst, #64 -+ b.ne L(tail63) -+ RET -+ -+ /* Critical loop. Start at a new cache line boundary. Assuming -+ * 64 bytes per line this ensures the entire loop is in one line. */ -+ .p2align 6 -+L(cpy_body_large): -+ /* There are at least 128 bytes to copy. */ -+ ldp A_l, A_h, [src, #0] -+ sub dst, dst, #16 /* Pre-bias. */ -+ ldp B_l, B_h, [src, #16] -+ ldp C_l, C_h, [src, #32] -+ ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */ -+1: -+ stp A_l, A_h, [dst, #16] -+ ldp A_l, A_h, [src, #16] -+ stp B_l, B_h, [dst, #32] -+ ldp B_l, B_h, [src, #32] -+ stp C_l, C_h, [dst, #48] -+ ldp C_l, C_h, [src, #48] -+ stp D_l, D_h, [dst, #64]! -+ ldp D_l, D_h, [src, #64]! -+ subs count, count, #64 -+ b.ge 1b -+ stp A_l, A_h, [dst, #16] -+ stp B_l, B_h, [dst, #32] -+ stp C_l, C_h, [dst, #48] -+ stp D_l, D_h, [dst, #64] -+ add src, src, #16 -+ add dst, dst, #64 + 16 -+ tst count, #0x3f -+ b.ne L(tail63) -+ RET -+END (memcpy) -+libc_hidden_builtin_def (memcpy) -diff --git a/libc/ports/sysdeps/aarch64/memmove.S b/libc/ports/sysdeps/aarch64/memmove.S -new file mode 100644 -index 0000000..c42eb1c ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/memmove.S -@@ -0,0 +1,312 @@ -+/* Copyright (C) 2012-2013 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 -+ . */ -+ -+#include -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ * Unaligned accesses -+ */ -+ -+/* Parameters and result. */ -+#define dstin x0 -+#define src x1 -+#define count x2 -+#define tmp1 x3 -+#define tmp1w w3 -+#define tmp2 x4 -+#define tmp2w w4 -+#define tmp3 x5 -+#define tmp3w w5 -+#define dst x6 -+ -+#define A_l x7 -+#define A_h x8 -+#define B_l x9 -+#define B_h x10 -+#define C_l x11 -+#define C_h x12 -+#define D_l x13 -+#define D_h x14 -+ -+ENTRY_ALIGN (memmove, 6) -+ -+ cmp dstin, src -+ b.lo L(downwards) -+ add tmp1, src, count -+ cmp dstin, tmp1 -+ b.hs memcpy /* No overlap. */ -+ -+ /* Upwards move with potential overlap. -+ * Need to move from the tail backwards. SRC and DST point one -+ * byte beyond the remaining data to move. */ -+ add dst, dstin, count -+ add src, src, count -+ cmp count, #64 -+ b.ge L(mov_not_short_up) -+ -+ /* Deal with small moves quickly by dropping straight into the -+ * exit block. */ -+L(tail63up): -+ /* Move up to 48 bytes of data. At this point we only need the -+ * bottom 6 bits of count to be accurate. */ -+ ands tmp1, count, #0x30 -+ b.eq L(tail15up) -+ sub dst, dst, tmp1 -+ sub src, src, tmp1 -+ cmp tmp1w, #0x20 -+ b.eq 1f -+ b.lt 2f -+ ldp A_l, A_h, [src, #32] -+ stp A_l, A_h, [dst, #32] -+1: -+ ldp A_l, A_h, [src, #16] -+ stp A_l, A_h, [dst, #16] -+2: -+ ldp A_l, A_h, [src] -+ stp A_l, A_h, [dst] -+L(tail15up): -+ /* Move up to 15 bytes of data. Does not assume additional data -+ * being moved. */ -+ tbz count, #3, 1f -+ ldr tmp1, [src, #-8]! -+ str tmp1, [dst, #-8]! -+1: -+ tbz count, #2, 1f -+ ldr tmp1w, [src, #-4]! -+ str tmp1w, [dst, #-4]! -+1: -+ tbz count, #1, 1f -+ ldrh tmp1w, [src, #-2]! -+ strh tmp1w, [dst, #-2]! -+1: -+ tbz count, #0, 1f -+ ldrb tmp1w, [src, #-1] -+ strb tmp1w, [dst, #-1] -+1: -+ RET -+ -+L(mov_not_short_up): -+ /* We don't much care about the alignment of DST, but we want SRC -+ * to be 128-bit (16 byte) aligned so that we don't cross cache line -+ * boundaries on both loads and stores. */ -+ ands tmp2, src, #15 /* Bytes to reach alignment. */ -+ b.eq 2f -+ sub count, count, tmp2 -+ /* Move enough data to reach alignment; unlike memcpy, we have to -+ * be aware of the overlap, which means we can't move data twice. */ -+ tbz tmp2, #3, 1f -+ ldr tmp1, [src, #-8]! -+ str tmp1, [dst, #-8]! -+1: -+ tbz tmp2, #2, 1f -+ ldr tmp1w, [src, #-4]! -+ str tmp1w, [dst, #-4]! -+1: -+ tbz tmp2, #1, 1f -+ ldrh tmp1w, [src, #-2]! -+ strh tmp1w, [dst, #-2]! -+1: -+ tbz tmp2, #0, 1f -+ ldrb tmp1w, [src, #-1]! -+ strb tmp1w, [dst, #-1]! -+1: -+ -+ /* There may be less than 63 bytes to go now. */ -+ cmp count, #63 -+ b.le L(tail63up) -+2: -+ subs count, count, #128 -+ b.ge L(mov_body_large_up) -+ /* Less than 128 bytes to move, so handle 64 here and then jump -+ * to the tail. */ -+ ldp A_l, A_h, [src, #-64]! -+ ldp B_l, B_h, [src, #16] -+ ldp C_l, C_h, [src, #32] -+ ldp D_l, D_h, [src, #48] -+ stp A_l, A_h, [dst, #-64]! -+ stp B_l, B_h, [dst, #16] -+ stp C_l, C_h, [dst, #32] -+ stp D_l, D_h, [dst, #48] -+ tst count, #0x3f -+ b.ne L(tail63up) -+ RET -+ -+ /* Critical loop. Start at a new Icache line boundary. Assuming -+ * 64 bytes per line this ensures the entire loop is in one line. */ -+ .p2align 6 -+L(mov_body_large_up): -+ /* There are at least 128 bytes to move. */ -+ ldp A_l, A_h, [src, #-16] -+ ldp B_l, B_h, [src, #-32] -+ ldp C_l, C_h, [src, #-48] -+ ldp D_l, D_h, [src, #-64]! -+1: -+ stp A_l, A_h, [dst, #-16] -+ ldp A_l, A_h, [src, #-16] -+ stp B_l, B_h, [dst, #-32] -+ ldp B_l, B_h, [src, #-32] -+ stp C_l, C_h, [dst, #-48] -+ ldp C_l, C_h, [src, #-48] -+ stp D_l, D_h, [dst, #-64]! -+ ldp D_l, D_h, [src, #-64]! -+ subs count, count, #64 -+ b.ge 1b -+ stp A_l, A_h, [dst, #-16] -+ stp B_l, B_h, [dst, #-32] -+ stp C_l, C_h, [dst, #-48] -+ stp D_l, D_h, [dst, #-64]! -+ tst count, #0x3f -+ b.ne L(tail63up) -+ RET -+ -+L(downwards): -+ /* For a downwards move we can safely use memcpy provided that -+ * DST is more than 16 bytes away from SRC. */ -+ sub tmp1, src, #16 -+ cmp dstin, tmp1 -+ b.ls memcpy /* May overlap, but not critically. */ -+ -+ mov dst, dstin /* Preserve DSTIN for return value. */ -+ cmp count, #64 -+ b.ge L(mov_not_short_down) -+ -+ /* Deal with small moves quickly by dropping straight into the -+ * exit block. */ -+L(tail63down): -+ /* Move up to 48 bytes of data. At this point we only need the -+ * bottom 6 bits of count to be accurate. */ -+ ands tmp1, count, #0x30 -+ b.eq L(tail15down) -+ add dst, dst, tmp1 -+ add src, src, tmp1 -+ cmp tmp1w, #0x20 -+ b.eq 1f -+ b.lt 2f -+ ldp A_l, A_h, [src, #-48] -+ stp A_l, A_h, [dst, #-48] -+1: -+ ldp A_l, A_h, [src, #-32] -+ stp A_l, A_h, [dst, #-32] -+2: -+ ldp A_l, A_h, [src, #-16] -+ stp A_l, A_h, [dst, #-16] -+L(tail15down): -+ /* Move up to 15 bytes of data. Does not assume additional data -+ being moved. */ -+ tbz count, #3, 1f -+ ldr tmp1, [src], #8 -+ str tmp1, [dst], #8 -+1: -+ tbz count, #2, 1f -+ ldr tmp1w, [src], #4 -+ str tmp1w, [dst], #4 -+1: -+ tbz count, #1, 1f -+ ldrh tmp1w, [src], #2 -+ strh tmp1w, [dst], #2 -+1: -+ tbz count, #0, 1f -+ ldrb tmp1w, [src] -+ strb tmp1w, [dst] -+1: -+ RET -+ -+L(mov_not_short_down): -+ /* We don't much care about the alignment of DST, but we want SRC -+ * to be 128-bit (16 byte) aligned so that we don't cross cache line -+ * boundaries on both loads and stores. */ -+ neg tmp2, src -+ ands tmp2, tmp2, #15 /* Bytes to reach alignment. */ -+ b.eq 2f -+ sub count, count, tmp2 -+ /* Move enough data to reach alignment; unlike memcpy, we have to -+ * be aware of the overlap, which means we can't move data twice. */ -+ tbz tmp2, #3, 1f -+ ldr tmp1, [src], #8 -+ str tmp1, [dst], #8 -+1: -+ tbz tmp2, #2, 1f -+ ldr tmp1w, [src], #4 -+ str tmp1w, [dst], #4 -+1: -+ tbz tmp2, #1, 1f -+ ldrh tmp1w, [src], #2 -+ strh tmp1w, [dst], #2 -+1: -+ tbz tmp2, #0, 1f -+ ldrb tmp1w, [src], #1 -+ strb tmp1w, [dst], #1 -+1: -+ -+ /* There may be less than 63 bytes to go now. */ -+ cmp count, #63 -+ b.le L(tail63down) -+2: -+ subs count, count, #128 -+ b.ge L(mov_body_large_down) -+ /* Less than 128 bytes to move, so handle 64 here and then jump -+ * to the tail. */ -+ ldp A_l, A_h, [src] -+ ldp B_l, B_h, [src, #16] -+ ldp C_l, C_h, [src, #32] -+ ldp D_l, D_h, [src, #48] -+ stp A_l, A_h, [dst] -+ stp B_l, B_h, [dst, #16] -+ stp C_l, C_h, [dst, #32] -+ stp D_l, D_h, [dst, #48] -+ tst count, #0x3f -+ add src, src, #64 -+ add dst, dst, #64 -+ b.ne L(tail63down) -+ RET -+ -+ /* Critical loop. Start at a new cache line boundary. Assuming -+ * 64 bytes per line this ensures the entire loop is in one line. */ -+ .p2align 6 -+L(mov_body_large_down): -+ /* There are at least 128 bytes to move. */ -+ ldp A_l, A_h, [src, #0] -+ sub dst, dst, #16 /* Pre-bias. */ -+ ldp B_l, B_h, [src, #16] -+ ldp C_l, C_h, [src, #32] -+ ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */ -+1: -+ stp A_l, A_h, [dst, #16] -+ ldp A_l, A_h, [src, #16] -+ stp B_l, B_h, [dst, #32] -+ ldp B_l, B_h, [src, #32] -+ stp C_l, C_h, [dst, #48] -+ ldp C_l, C_h, [src, #48] -+ stp D_l, D_h, [dst, #64]! -+ ldp D_l, D_h, [src, #64]! -+ subs count, count, #64 -+ b.ge 1b -+ stp A_l, A_h, [dst, #16] -+ stp B_l, B_h, [dst, #32] -+ stp C_l, C_h, [dst, #48] -+ stp D_l, D_h, [dst, #64] -+ add src, src, #16 -+ add dst, dst, #64 + 16 -+ tst count, #0x3f -+ b.ne L(tail63down) -+ RET -+END (memmove) -+ -+libc_hidden_builtin_def (memmove) -diff --git a/libc/ports/sysdeps/aarch64/memset.S b/libc/ports/sysdeps/aarch64/memset.S -new file mode 100644 -index 0000000..f96f6a6 ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/memset.S -@@ -0,0 +1,229 @@ -+/* Copyright (C) 2012-2013 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 -+ . */ -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ * Unaligned accesses -+ * -+ */ -+ -+#include -+ -+/* By default we assume that the DC instruction can be used to zero -+ data blocks more efficiently. In some circumstances this might be -+ unsafe, for example in an asymmetric multiprocessor environment with -+ different DC clear lengths (neither the upper nor lower lengths are -+ safe to use). The feature can be disabled by defining DONT_USE_DC. -+ -+ If code may be run in a virtualized environment, then define -+ MAYBE_VIRT. This will cause the code to cache the system register -+ values rather than re-reading them each call. */ -+ -+#define dstin x0 -+#define val w1 -+#define count x2 -+#define tmp1 x3 -+#define tmp1w w3 -+#define tmp2 x4 -+#define tmp2w w4 -+#define zva_len_x x5 -+#define zva_len w5 -+#define zva_bits_x x6 -+ -+#define A_l x7 -+#define A_lw w7 -+#define dst x8 -+#define tmp3w w9 -+ -+ENTRY_ALIGN (__memset, 6) -+ -+ mov dst, dstin /* Preserve return value. */ -+ ands A_lw, val, #255 -+#ifndef DONT_USE_DC -+ b.eq L(zero_mem) -+#endif -+ orr A_lw, A_lw, A_lw, lsl #8 -+ orr A_lw, A_lw, A_lw, lsl #16 -+ orr A_l, A_l, A_l, lsl #32 -+L(tail_maybe_long): -+ cmp count, #64 -+ b.ge L(not_short) -+L(tail_maybe_tiny): -+ cmp count, #15 -+ b.le L(tail15tiny) -+L(tail63): -+ ands tmp1, count, #0x30 -+ b.eq L(tail15) -+ add dst, dst, tmp1 -+ cmp tmp1w, #0x20 -+ b.eq 1f -+ b.lt 2f -+ stp A_l, A_l, [dst, #-48] -+1: -+ stp A_l, A_l, [dst, #-32] -+2: -+ stp A_l, A_l, [dst, #-16] -+ -+L(tail15): -+ and count, count, #15 -+ add dst, dst, count -+ stp A_l, A_l, [dst, #-16] /* Repeat some/all of last store. */ -+ RET -+ -+L(tail15tiny): -+ /* Set up to 15 bytes. Does not assume earlier memory -+ being set. */ -+ tbz count, #3, 1f -+ str A_l, [dst], #8 -+1: -+ tbz count, #2, 1f -+ str A_lw, [dst], #4 -+1: -+ tbz count, #1, 1f -+ strh A_lw, [dst], #2 -+1: -+ tbz count, #0, 1f -+ strb A_lw, [dst] -+1: -+ RET -+ -+ /* Critical loop. Start at a new cache line boundary. Assuming -+ * 64 bytes per line, this ensures the entire loop is in one line. */ -+ .p2align 6 -+L(not_short): -+ neg tmp2, dst -+ ands tmp2, tmp2, #15 -+ b.eq 2f -+ /* Bring DST to 128-bit (16-byte) alignment. We know that there's -+ * more than that to set, so we simply store 16 bytes and advance by -+ * the amount required to reach alignment. */ -+ sub count, count, tmp2 -+ stp A_l, A_l, [dst] -+ add dst, dst, tmp2 -+ /* There may be less than 63 bytes to go now. */ -+ cmp count, #63 -+ b.le L(tail63) -+2: -+ sub dst, dst, #16 /* Pre-bias. */ -+ sub count, count, #64 -+1: -+ stp A_l, A_l, [dst, #16] -+ stp A_l, A_l, [dst, #32] -+ stp A_l, A_l, [dst, #48] -+ stp A_l, A_l, [dst, #64]! -+ subs count, count, #64 -+ b.ge 1b -+ tst count, #0x3f -+ add dst, dst, #16 -+ b.ne L(tail63) -+ RET -+ -+#ifndef DONT_USE_DC -+ /* For zeroing memory, check to see if we can use the ZVA feature to -+ * zero entire 'cache' lines. */ -+L(zero_mem): -+ mov A_l, #0 -+ cmp count, #63 -+ b.le L(tail_maybe_tiny) -+ neg tmp2, dst -+ ands tmp2, tmp2, #15 -+ b.eq 1f -+ sub count, count, tmp2 -+ stp A_l, A_l, [dst] -+ add dst, dst, tmp2 -+ cmp count, #63 -+ b.le L(tail63) -+1: -+ /* For zeroing small amounts of memory, it's not worth setting up -+ * the line-clear code. */ -+ cmp count, #128 -+ b.lt L(not_short) -+#ifdef MAYBE_VIRT -+ /* For efficiency when virtualized, we cache the ZVA capability. */ -+ adrp tmp2, L(cache_clear) -+ ldr zva_len, [tmp2, #:lo12:L(cache_clear)] -+ tbnz zva_len, #31, L(not_short) -+ cbnz zva_len, L(zero_by_line) -+ mrs tmp1, dczid_el0 -+ tbz tmp1, #4, 1f -+ /* ZVA not available. Remember this for next time. */ -+ mov zva_len, #~0 -+ str zva_len, [tmp2, #:lo12:L(cache_clear)] -+ b L(not_short) -+1: -+ mov tmp3w, #4 -+ and zva_len, tmp1w, #15 /* Safety: other bits reserved. */ -+ lsl zva_len, tmp3w, zva_len -+ str zva_len, [tmp2, #:lo12:L(cache_clear)] -+#else -+ mrs tmp1, dczid_el0 -+ tbnz tmp1, #4, L(not_short) -+ mov tmp3w, #4 -+ and zva_len, tmp1w, #15 /* Safety: other bits reserved. */ -+ lsl zva_len, tmp3w, zva_len -+#endif -+ -+L(zero_by_line): -+ /* Compute how far we need to go to become suitably aligned. We're -+ * already at quad-word alignment. */ -+ cmp count, zva_len_x -+ b.lt L(not_short) /* Not enough to reach alignment. */ -+ sub zva_bits_x, zva_len_x, #1 -+ neg tmp2, dst -+ ands tmp2, tmp2, zva_bits_x -+ b.eq 1f /* Already aligned. */ -+ /* Not aligned, check that there's enough to copy after alignment. */ -+ sub tmp1, count, tmp2 -+ cmp tmp1, #64 -+ ccmp tmp1, zva_len_x, #8, ge /* NZCV=0b1000 */ -+ b.lt L(not_short) -+ /* We know that there's at least 64 bytes to zero and that it's safe -+ * to overrun by 64 bytes. */ -+ mov count, tmp1 -+2: -+ stp A_l, A_l, [dst] -+ stp A_l, A_l, [dst, #16] -+ stp A_l, A_l, [dst, #32] -+ subs tmp2, tmp2, #64 -+ stp A_l, A_l, [dst, #48] -+ add dst, dst, #64 -+ b.ge 2b -+ /* We've overrun a bit, so adjust dst downwards. */ -+ add dst, dst, tmp2 -+1: -+ sub count, count, zva_len_x -+3: -+ dc zva, dst -+ add dst, dst, zva_len_x -+ subs count, count, zva_len_x -+ b.ge 3b -+ ands count, count, zva_bits_x -+ b.ne L(tail_maybe_long) -+ RET -+#ifdef MAYBE_VIRT -+ .bss -+ .p2align 2 -+L(cache_clear): -+ .space 4 -+#endif -+#endif /* DONT_USE_DC */ -+ -+END (__memset) -+weak_alias (__memset, memset) -+libc_hidden_builtin_def (memset) -diff --git a/libc/ports/sysdeps/aarch64/strcmp.S b/libc/ports/sysdeps/aarch64/strcmp.S -new file mode 100644 -index 0000000..fa4705c ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/strcmp.S -@@ -0,0 +1,155 @@ -+/* Copyright (C) 2012-2013 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 -+ . */ -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ */ -+ -+#include -+ -+#define REP8_01 0x0101010101010101 -+#define REP8_7f 0x7f7f7f7f7f7f7f7f -+#define REP8_80 0x8080808080808080 -+ -+/* Parameters and result. */ -+#define src1 x0 -+#define src2 x1 -+#define result x0 -+ -+/* Internal variables. */ -+#define data1 x2 -+#define data1w w2 -+#define data2 x3 -+#define data2w w3 -+#define has_nul x4 -+#define diff x5 -+#define syndrome x6 -+#define tmp1 x7 -+#define tmp2 x8 -+#define tmp3 x9 -+#define zeroones x10 -+#define pos x11 -+ -+ /* Start of performance-critical section -- one 64B cache line. */ -+ENTRY_ALIGN(strcmp, 6) -+ -+ eor tmp1, src1, src2 -+ mov zeroones, #REP8_01 -+ tst tmp1, #7 -+ b.ne L(misaligned8) -+ ands tmp1, src1, #7 -+ b.ne L(mutual_align) -+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80 -+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and -+ can be done in parallel across the entire word. */ -+L(loop_aligned): -+ ldr data1, [src1], #8 -+ ldr data2, [src2], #8 -+L(start_realigned): -+ sub tmp1, data1, zeroones -+ orr tmp2, data1, #REP8_7f -+ eor diff, data1, data2 /* Non-zero if differences found. */ -+ bic has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ -+ orr syndrome, diff, has_nul -+ cbz syndrome, L(loop_aligned) -+ /* End of performance-critical section -- one 64B cache line. */ -+ -+#ifndef __AARCH64EB__ -+ rev syndrome, syndrome -+ rev data1, data1 -+ /* The MS-non-zero bit of the syndrome marks either the first bit -+ that is different, or the top bit of the first zero byte. -+ Shifting left now will bring the critical information into the -+ top bits. */ -+ clz pos, syndrome -+ rev data2, data2 -+ lsl data1, data1, pos -+ lsl data2, data2, pos -+ /* But we need to zero-extend (char is unsigned) the value and then -+ perform a signed 32-bit subtraction. */ -+ lsr data1, data1, #56 -+ sub result, data1, data2, lsr #56 -+ RET -+#else -+ /* For big-endian we cannot use the trick with the syndrome value -+ as carry-propagation can corrupt the upper bits if the trailing -+ bytes in the string contain 0x01. */ -+ /* However, if there is no NUL byte in the dword, we can generate -+ the result directly. We can't just subtract the bytes as the -+ MSB might be significant. */ -+ cbnz has_nul, 1f -+ cmp data1, data2 -+ cset result, ne -+ cneg result, result, lo -+ RET -+1: -+ /* Re-compute the NUL-byte detection, using a byte-reversed value. */ -+ rev tmp3, data1 -+ sub tmp1, tmp3, zeroones -+ orr tmp2, tmp3, #REP8_7f -+ bic has_nul, tmp1, tmp2 -+ rev has_nul, has_nul -+ orr syndrome, diff, has_nul -+ clz pos, syndrome -+ /* The MS-non-zero bit of the syndrome marks either the first bit -+ that is different, or the top bit of the first zero byte. -+ Shifting left now will bring the critical information into the -+ top bits. */ -+ lsl data1, data1, pos -+ lsl data2, data2, pos -+ /* But we need to zero-extend (char is unsigned) the value and then -+ perform a signed 32-bit subtraction. */ -+ lsr data1, data1, #56 -+ sub result, data1, data2, lsr #56 -+ RET -+#endif -+ -+L(mutual_align): -+ /* Sources are mutually aligned, but are not currently at an -+ alignment boundary. Round down the addresses and then mask off -+ the bytes that preceed the start point. */ -+ bic src1, src1, #7 -+ bic src2, src2, #7 -+ lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */ -+ ldr data1, [src1], #8 -+ neg tmp1, tmp1 /* Bits to alignment -64. */ -+ ldr data2, [src2], #8 -+ mov tmp2, #~0 -+#ifdef __AARCH64EB__ -+ /* Big-endian. Early bytes are at MSB. */ -+ lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#else -+ /* Little-endian. Early bytes are at LSB. */ -+ lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#endif -+ orr data1, data1, tmp2 -+ orr data2, data2, tmp2 -+ b L(start_realigned) -+ -+L(misaligned8): -+ /* We can do better than this. */ -+ ldrb data1w, [src1], #1 -+ ldrb data2w, [src2], #1 -+ cmp data1w, #1 -+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ -+ b.eq L(misaligned8) -+ sub result, data1, data2 -+ RET -+END(strcmp) -+libc_hidden_builtin_def (strcmp) -diff --git a/libc/ports/sysdeps/aarch64/strlen.S b/libc/ports/sysdeps/aarch64/strlen.S -new file mode 100644 -index 0000000..ba05009 ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/strlen.S -@@ -0,0 +1,117 @@ -+/* Copyright (C) 2012-2013 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 -+ . */ -+ -+#include -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ */ -+ -+/* Arguments and results. */ -+#define srcin x0 -+#define len x0 -+ -+/* Locals and temporaries. */ -+#define src x1 -+#define data1 x2 -+#define data2 x3 -+#define data2a x4 -+#define has_nul1 x5 -+#define has_nul2 x6 -+#define tmp1 x7 -+#define tmp2 x8 -+#define tmp3 x9 -+#define tmp4 x10 -+#define zeroones x11 -+#define pos x12 -+ -+#define REP8_01 0x0101010101010101 -+#define REP8_7f 0x7f7f7f7f7f7f7f7f -+#define REP8_80 0x8080808080808080 -+ -+ /* Start of critial section -- keep to one 64Byte cache line. */ -+ENTRY_ALIGN (strlen, 6) -+ mov zeroones, #REP8_01 -+ bic src, srcin, #15 -+ ands tmp1, srcin, #15 -+ b.ne L(misaligned) -+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80 -+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and -+ can be done in parallel across the entire word. */ -+ /* The inner loop deals with two Dwords at a time. This has a -+ slightly higher start-up cost, but we should win quite quickly, -+ especially on cores with a high number of issue slots per -+ cycle, as we get much better parallelism out of the operations. */ -+L(loop): -+ ldp data1, data2, [src], #16 -+L(realigned): -+ sub tmp1, data1, zeroones -+ orr tmp2, data1, #REP8_7f -+ sub tmp3, data2, zeroones -+ orr tmp4, data2, #REP8_7f -+ bic has_nul1, tmp1, tmp2 -+ bics has_nul2, tmp3, tmp4 -+ ccmp has_nul1, #0, #0, eq /* NZCV = 0000 */ -+ b.eq L(loop) -+ /* End of critical section -- keep to one 64Byte cache line. */ -+ -+ sub len, src, srcin -+ cbz has_nul1, L(nul_in_data2) -+#ifdef __AARCH64EB__ -+ mov data2, data1 -+#endif -+ sub len, len, #8 -+ mov has_nul2, has_nul1 -+L(nul_in_data2): -+#ifdef __AARCH64EB__ -+ /* For big-endian, carry propagation (if the final byte in the -+ string is 0x01) means we cannot use has_nul directly. The -+ easiest way to get the correct byte is to byte-swap the data -+ and calculate the syndrome a second time. */ -+ rev data2, data2 -+ sub tmp1, data2, zeroones -+ orr tmp2, data2, #REP8_7f -+ bic has_nul2, tmp1, tmp2 -+#endif -+ sub len, len, #8 -+ rev has_nul2, has_nul2 -+ clz pos, has_nul2 -+ add len, len, pos, lsr #3 /* Bits to bytes. */ -+ RET -+ -+L(misaligned): -+ cmp tmp1, #8 -+ neg tmp1, tmp1 -+ ldp data1, data2, [src], #16 -+ lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */ -+ mov tmp2, #~0 -+#ifdef __AARCH64EB__ -+ /* Big-endian. Early bytes are at MSB. */ -+ lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#else -+ /* Little-endian. Early bytes are at LSB. */ -+ lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */ -+#endif -+ orr data1, data1, tmp2 -+ orr data2a, data2, tmp2 -+ csinv data1, data1, xzr, le -+ csel data2, data2, data2a, le -+ b L(realigned) -+END (strlen) -+libc_hidden_builtin_def (strlen) -diff --git a/libc/ports/sysdeps/aarch64/strncmp.S b/libc/ports/sysdeps/aarch64/strncmp.S -new file mode 100644 -index 0000000..341d5ce ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/strncmp.S -@@ -0,0 +1,204 @@ -+/* Copyright (C) 2013 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 -+ . */ -+ -+#include -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ */ -+ -+#define REP8_01 0x0101010101010101 -+#define REP8_7f 0x7f7f7f7f7f7f7f7f -+#define REP8_80 0x8080808080808080 -+ -+/* Parameters and result. */ -+#define src1 x0 -+#define src2 x1 -+#define limit x2 -+#define result x0 -+ -+/* Internal variables. */ -+#define data1 x3 -+#define data1w w3 -+#define data2 x4 -+#define data2w w4 -+#define has_nul x5 -+#define diff x6 -+#define syndrome x7 -+#define tmp1 x8 -+#define tmp2 x9 -+#define tmp3 x10 -+#define zeroones x11 -+#define pos x12 -+#define limit_wd x13 -+#define mask x14 -+#define endloop x15 -+ -+ENTRY_ALIGN_AND_PAD (strncmp, 6, 7) -+ cbz limit, L(ret0) -+ eor tmp1, src1, src2 -+ mov zeroones, #REP8_01 -+ tst tmp1, #7 -+ b.ne L(misaligned8) -+ ands tmp1, src1, #7 -+ b.ne L(mutual_align) -+ /* Calculate the number of full and partial words -1. */ -+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */ -+ lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */ -+ -+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80 -+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and -+ can be done in parallel across the entire word. */ -+ /* Start of performance-critical section -- one 64B cache line. */ -+L(loop_aligned): -+ ldr data1, [src1], #8 -+ ldr data2, [src2], #8 -+L(start_realigned): -+ subs limit_wd, limit_wd, #1 -+ sub tmp1, data1, zeroones -+ orr tmp2, data1, #REP8_7f -+ eor diff, data1, data2 /* Non-zero if differences found. */ -+ csinv endloop, diff, xzr, pl /* Last Dword or differences. */ -+ bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ -+ ccmp endloop, #0, #0, eq -+ b.eq L(loop_aligned) -+ /* End of performance-critical section -- one 64B cache line. */ -+ -+ /* Not reached the limit, must have found the end or a diff. */ -+ tbz limit_wd, #63, L(not_limit) -+ -+ /* Limit % 8 == 0 => all bytes significant. */ -+ ands limit, limit, #7 -+ b.eq L(not_limit) -+ -+ lsl limit, limit, #3 /* Bits -> bytes. */ -+ mov mask, #~0 -+#ifdef __AARCH64EB__ -+ lsr mask, mask, limit -+#else -+ lsl mask, mask, limit -+#endif -+ bic data1, data1, mask -+ bic data2, data2, mask -+ -+ /* Make sure that the NUL byte is marked in the syndrome. */ -+ orr has_nul, has_nul, mask -+ -+L(not_limit): -+ orr syndrome, diff, has_nul -+ -+#ifndef __AARCH64EB__ -+ rev syndrome, syndrome -+ rev data1, data1 -+ /* The MS-non-zero bit of the syndrome marks either the first bit -+ that is different, or the top bit of the first zero byte. -+ Shifting left now will bring the critical information into the -+ top bits. */ -+ clz pos, syndrome -+ rev data2, data2 -+ lsl data1, data1, pos -+ lsl data2, data2, pos -+ /* But we need to zero-extend (char is unsigned) the value and then -+ perform a signed 32-bit subtraction. */ -+ lsr data1, data1, #56 -+ sub result, data1, data2, lsr #56 -+ RET -+#else -+ /* For big-endian we cannot use the trick with the syndrome value -+ as carry-propagation can corrupt the upper bits if the trailing -+ bytes in the string contain 0x01. */ -+ /* However, if there is no NUL byte in the dword, we can generate -+ the result directly. We can't just subtract the bytes as the -+ MSB might be significant. */ -+ cbnz has_nul, 1f -+ cmp data1, data2 -+ cset result, ne -+ cneg result, result, lo -+ RET -+1: -+ /* Re-compute the NUL-byte detection, using a byte-reversed value. */ -+ rev tmp3, data1 -+ sub tmp1, tmp3, zeroones -+ orr tmp2, tmp3, #REP8_7f -+ bic has_nul, tmp1, tmp2 -+ rev has_nul, has_nul -+ orr syndrome, diff, has_nul -+ clz pos, syndrome -+ /* The MS-non-zero bit of the syndrome marks either the first bit -+ that is different, or the top bit of the first zero byte. -+ Shifting left now will bring the critical information into the -+ top bits. */ -+ lsl data1, data1, pos -+ lsl data2, data2, pos -+ /* But we need to zero-extend (char is unsigned) the value and then -+ perform a signed 32-bit subtraction. */ -+ lsr data1, data1, #56 -+ sub result, data1, data2, lsr #56 -+ RET -+#endif -+ -+L(mutual_align): -+ /* Sources are mutually aligned, but are not currently at an -+ alignment boundary. Round down the addresses and then mask off -+ the bytes that precede the start point. -+ We also need to adjust the limit calculations, but without -+ overflowing if the limit is near ULONG_MAX. */ -+ bic src1, src1, #7 -+ bic src2, src2, #7 -+ ldr data1, [src1], #8 -+ neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */ -+ ldr data2, [src2], #8 -+ mov tmp2, #~0 -+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */ -+#ifdef __AARCH64EB__ -+ /* Big-endian. Early bytes are at MSB. */ -+ lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */ -+#else -+ /* Little-endian. Early bytes are at LSB. */ -+ lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */ -+#endif -+ and tmp3, limit_wd, #7 -+ lsr limit_wd, limit_wd, #3 -+ /* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */ -+ add limit, limit, tmp1 -+ add tmp3, tmp3, tmp1 -+ orr data1, data1, tmp2 -+ orr data2, data2, tmp2 -+ add limit_wd, limit_wd, tmp3, lsr #3 -+ b L(start_realigned) -+ -+L(ret0): -+ mov result, #0 -+ RET -+ -+ .p2align 6 -+L(misaligned8): -+ sub limit, limit, #1 -+1: -+ /* Perhaps we can do better than this. */ -+ ldrb data1w, [src1], #1 -+ ldrb data2w, [src2], #1 -+ subs limit, limit, #1 -+ ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */ -+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ -+ b.eq 1b -+ sub result, data1, data2 -+ RET -+END (strncmp) -+libc_hidden_builtin_def (strncmp) -diff --git a/libc/ports/sysdeps/aarch64/strnlen.S b/libc/ports/sysdeps/aarch64/strnlen.S -new file mode 100644 -index 0000000..e582e8a ---- /dev/null -+++ b/libc/ports/sysdeps/aarch64/strnlen.S -@@ -0,0 +1,161 @@ -+/* strnlen - calculate the length of a string with limit. -+ -+ Copyright (C) 2013 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 -+ . */ -+ -+#include -+ -+/* Assumptions: -+ * -+ * ARMv8-a, AArch64 -+ */ -+ -+/* Arguments and results. */ -+#define srcin x0 -+#define len x0 -+#define limit x1 -+ -+/* Locals and temporaries. */ -+#define src x2 -+#define data1 x3 -+#define data2 x4 -+#define data2a x5 -+#define has_nul1 x6 -+#define has_nul2 x7 -+#define tmp1 x8 -+#define tmp2 x9 -+#define tmp3 x10 -+#define tmp4 x11 -+#define zeroones x12 -+#define pos x13 -+#define limit_wd x14 -+ -+#define REP8_01 0x0101010101010101 -+#define REP8_7f 0x7f7f7f7f7f7f7f7f -+#define REP8_80 0x8080808080808080 -+ -+ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9) -+ cbz limit, L(hit_limit) -+ mov zeroones, #REP8_01 -+ bic src, srcin, #15 -+ ands tmp1, srcin, #15 -+ b.ne L(misaligned) -+ /* Calculate the number of full and partial words -1. */ -+ sub limit_wd, limit, #1 /* Limit != 0, so no underflow. */ -+ lsr limit_wd, limit_wd, #4 /* Convert to Qwords. */ -+ -+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80 -+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and -+ can be done in parallel across the entire word. */ -+ /* The inner loop deals with two Dwords at a time. This has a -+ slightly higher start-up cost, but we should win quite quickly, -+ especially on cores with a high number of issue slots per -+ cycle, as we get much better parallelism out of the operations. */ -+ -+ /* Start of critial section -- keep to one 64Byte cache line. */ -+L(loop): -+ ldp data1, data2, [src], #16 -+L(realigned): -+ sub tmp1, data1, zeroones -+ orr tmp2, data1, #REP8_7f -+ sub tmp3, data2, zeroones -+ orr tmp4, data2, #REP8_7f -+ bic has_nul1, tmp1, tmp2 -+ bic has_nul2, tmp3, tmp4 -+ subs limit_wd, limit_wd, #1 -+ orr tmp1, has_nul1, has_nul2 -+ ccmp tmp1, #0, #0, pl /* NZCV = 0000 */ -+ b.eq L(loop) -+ /* End of critical section -- keep to one 64Byte cache line. */ -+ -+ orr tmp1, has_nul1, has_nul2 -+ cbz tmp1, L(hit_limit) /* No null in final Qword. */ -+ -+ /* We know there's a null in the final Qword. The easiest thing -+ to do now is work out the length of the string and return -+ MIN (len, limit). */ -+ -+ sub len, src, srcin -+ cbz has_nul1, L(nul_in_data2) -+#ifdef __AARCH64EB__ -+ mov data2, data1 -+#endif -+ sub len, len, #8 -+ mov has_nul2, has_nul1 -+L(nul_in_data2): -+#ifdef __AARCH64EB__ -+ /* For big-endian, carry propagation (if the final byte in the -+ string is 0x01) means we cannot use has_nul directly. The -+ easiest way to get the correct byte is to byte-swap the data -+ and calculate the syndrome a second time. */ -+ rev data2, data2 -+ sub tmp1, data2, zeroones -+ orr tmp2, data2, #REP8_7f -+ bic has_nul2, tmp1, tmp2 -+#endif -+ sub len, len, #8 -+ rev has_nul2, has_nul2 -+ clz pos, has_nul2 -+ add len, len, pos, lsr #3 /* Bits to bytes. */ -+ cmp len, limit -+ csel len, len, limit, ls /* Return the lower value. */ -+ RET -+ -+L(misaligned): -+ /* Deal with a partial first word. -+ We're doing two things in parallel here; -+ 1) Calculate the number of words (but avoiding overflow if -+ limit is near ULONG_MAX) - to do this we need to work out -+ limit + tmp1 - 1 as a 65-bit value before shifting it; -+ 2) Load and mask the initial data words - we force the bytes -+ before the ones we are interested in to 0xff - this ensures -+ early bytes will not hit any zero detection. */ -+ sub limit_wd, limit, #1 -+ neg tmp4, tmp1 -+ cmp tmp1, #8 -+ -+ and tmp3, limit_wd, #15 -+ lsr limit_wd, limit_wd, #4 -+ mov tmp2, #~0 -+ -+ ldp data1, data2, [src], #16 -+ lsl tmp4, tmp4, #3 /* Bytes beyond alignment -> bits. */ -+ add tmp3, tmp3, tmp1 -+ -+#ifdef __AARCH64EB__ -+ /* Big-endian. Early bytes are at MSB. */ -+ lsl tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */ -+#else -+ /* Little-endian. Early bytes are at LSB. */ -+ lsr tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */ -+#endif -+ add limit_wd, limit_wd, tmp3, lsr #4 -+ -+ orr data1, data1, tmp2 -+ orr data2a, data2, tmp2 -+ -+ csinv data1, data1, xzr, le -+ csel data2, data2, data2a, le -+ b L(realigned) -+ -+L(hit_limit): -+ mov len, limit -+ RET -+END (__strnlen) -+weak_alias (__strnlen, strnlen) -+libc_hidden_def (strnlen) -diff --git a/libc/ports/sysdeps/aarch64/sysdep.h b/libc/ports/sysdeps/aarch64/sysdep.h -index ed0a354..7af05bf 100644 ---- a/libc/ports/sysdeps/aarch64/sysdep.h -+++ b/libc/ports/sysdeps/aarch64/sysdep.h -@@ -25,24 +25,49 @@ - #define ASM_SIZE_DIRECTIVE(name) .size name,.-name - - /* Define an entry point visible from C. */ --#define ENTRY(name) \ -- .globl C_SYMBOL_NAME(name); \ -- .type C_SYMBOL_NAME(name),%function; \ -- .align 4; \ -- C_LABEL(name) \ -- cfi_startproc; \ -+#define ENTRY(name) \ -+ .globl C_SYMBOL_NAME(name); \ -+ .type C_SYMBOL_NAME(name),%function; \ -+ .align 4; \ -+ C_LABEL(name) \ -+ cfi_startproc; \ -+ CALL_MCOUNT -+ -+/* Define an entry point visible from C. */ -+#define ENTRY_ALIGN(name, align) \ -+ .globl C_SYMBOL_NAME(name); \ -+ .type C_SYMBOL_NAME(name),%function; \ -+ .p2align align; \ -+ C_LABEL(name) \ -+ cfi_startproc; \ -+ CALL_MCOUNT -+ -+/* Define an entry point visible from C with a specified alignment and -+ pre-padding with NOPs. This can be used to ensure that a critical -+ loop within a function is cache line aligned. Note this version -+ does not adjust the padding if CALL_MCOUNT is defined. */ -+ -+#define ENTRY_ALIGN_AND_PAD(name, align, padding) \ -+ .globl C_SYMBOL_NAME(name); \ -+ .type C_SYMBOL_NAME(name),%function; \ -+ .p2align align; \ -+ .rep padding; \ -+ nop; \ -+ .endr; \ -+ C_LABEL(name) \ -+ cfi_startproc; \ - CALL_MCOUNT - - #undef END --#define END(name) \ -- cfi_endproc; \ -+#define END(name) \ -+ cfi_endproc; \ - ASM_SIZE_DIRECTIVE(name) - - /* If compiled for profiling, call `mcount' at the start of each function. */ - #ifdef PROF --# define CALL_MCOUNT \ -- str x30, [sp, #-16]!; \ -- bl mcount; \ -+# define CALL_MCOUNT \ -+ str x30, [sp, #-16]!; \ -+ bl mcount; \ - ldr x30, [sp], #16 ; - #else - # define CALL_MCOUNT /* Do nothing. */ -diff --git a/libc/ports/sysdeps/arm/armv7/configure b/libc/ports/sysdeps/arm/armv7/configure -new file mode 100644 -index 0000000..a879ffb ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/configure -@@ -0,0 +1,72 @@ -+# This file is generated from configure.in by Autoconf. DO NOT EDIT! -+ # Local configure fragment for sysdeps/arm/armv7. -+ -+# We need binutils 2.21 to ensure that NEON alignments are assembled correctly. -+libc_cv_arm_as_version_ok=yes -+for ac_prog in $AS -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_AS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$AS"; then -+ ac_cv_prog_AS="$AS" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_AS="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+AS=$ac_cv_prog_AS -+if test -n "$AS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -+$as_echo "$AS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$AS" && break -+done -+ -+if test -z "$AS"; then -+ ac_verc_fail=yes -+else -+ # Found it, now check the version. -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $AS" >&5 -+$as_echo_n "checking version of $AS... " >&6; } -+ ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ case $ac_prog_version in -+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; -+ 2.1[0-9][0-9]*|2.2[1-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*) -+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; -+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; -+ -+ esac -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 -+$as_echo "$ac_prog_version" >&6; } -+fi -+if test $ac_verc_fail = yes; then -+ libc_cv_arm_as_version_ok=no -+fi -+ -+ -+if test $libc_cv_arm_as_version_ok != yes; then -+ as_fn_error $? "as version too old, at least 2.21 is required" "$LINENO" 5 -+fi -diff --git a/libc/ports/sysdeps/arm/armv7/configure.in b/libc/ports/sysdeps/arm/armv7/configure.in -new file mode 100644 -index 0000000..01e93ec ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/configure.in -@@ -0,0 +1,12 @@ -+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -+# Local configure fragment for sysdeps/arm/armv7. -+ -+# We need binutils 2.21 to ensure that NEON alignments are assembled correctly. -+libc_cv_arm_as_version_ok=yes -+AC_CHECK_PROG_VER(AS, $AS, --version, -+ [GNU assembler.* \([0-9]*\.[0-9.]*\)], -+ [2.1[0-9][0-9]*|2.2[1-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], libc_cv_arm_as_version_ok=no) -+ -+if test $libc_cv_arm_as_version_ok != yes; then -+ AC_MSG_ERROR([as version too old, at least 2.21 is required]) -+fi -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/Makefile b/libc/ports/sysdeps/arm/armv7/multiarch/Makefile -new file mode 100644 -index 0000000..e834cc9 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/Makefile -@@ -0,0 +1,3 @@ -+ifeq ($(subdir),string) -+sysdep_routines += memcpy_neon memcpy_vfp -+endif -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/aeabi_memcpy.c b/libc/ports/sysdeps/arm/armv7/multiarch/aeabi_memcpy.c -new file mode 100644 -index 0000000..c6a2a98 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/aeabi_memcpy.c -@@ -0,0 +1,2 @@ -+/* Empty file to override sysdeps/arm version. See memcpy.S for definitions -+ of these functions. */ -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c b/libc/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c -new file mode 100644 -index 0000000..0dcdcd6 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c -@@ -0,0 +1,44 @@ -+/* Enumerate available IFUNC implementations of a function. ARM version. -+ Copyright (C) 2013 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 -+ . */ -+ -+#include -+#include -+#include -+#include -+ -+/* Fill ARRAY of MAX elements with IFUNC implementations for function -+ NAME and return the number of valid entries. */ -+ -+size_t -+__libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, -+ size_t max) -+{ -+ size_t i = 0; -+ int hwcap; -+ -+ hwcap = GLRO(dl_hwcap); -+ -+ IFUNC_IMPL (i, name, memcpy, -+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_NEON, -+ __memcpy_neon) -+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_VFP, -+ __memcpy_vfp) -+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_arm)); -+ -+ return i; -+} -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/memcpy.S b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy.S -new file mode 100644 -index 0000000..1b12465 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy.S -@@ -0,0 +1,73 @@ -+/* Multiple versions of memcpy -+ All versions must be listed in ifunc-impl-list.c. -+ Copyright (C) 2013 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 -+ . */ -+ -+/* Thumb requires excess IT instructions here. */ -+#define NO_THUMB -+#include -+#include -+ -+#if !defined NOT_IN_libc -+ .text -+ENTRY(memcpy) -+ .type memcpy, %gnu_indirect_function -+#ifdef __SOFTFP__ -+ ldr r1, .Lmemcpy_arm -+ tst r0, #HWCAP_ARM_VFP -+ ldrne r1, .Lmemcpy_vfp -+#else -+ ldr r1, .Lmemcpy_vfp -+#endif -+ tst r0, #HWCAP_ARM_NEON -+ ldrne r1, .Lmemcpy_neon -+1: -+ add r0, r1, pc -+ DO_RET(lr) -+ -+#ifdef __SOFTFP__ -+.Lmemcpy_arm: -+ .long C_SYMBOL_NAME(__memcpy_arm) - 1b - PC_OFS -+#endif -+.Lmemcpy_neon: -+ .long C_SYMBOL_NAME(__memcpy_neon) - 1b - PC_OFS -+.Lmemcpy_vfp: -+ .long C_SYMBOL_NAME(__memcpy_vfp) - 1b - PC_OFS -+ -+END(memcpy) -+ -+libc_hidden_builtin_def (memcpy) -+ -+/* These versions of memcpy are defined not to clobber any VFP or NEON -+ registers so they must always call the ARM variant of the memcpy code. */ -+strong_alias (__memcpy_arm, __aeabi_memcpy) -+strong_alias (__memcpy_arm, __aeabi_memcpy4) -+strong_alias (__memcpy_arm, __aeabi_memcpy8) -+libc_hidden_def (__memcpy_arm) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+#undef weak_alias -+#define weak_alias(x, y) -+#undef libc_hidden_def -+#define libc_hidden_def(name) -+ -+#define memcpy __memcpy_arm -+ -+#endif -+ -+#include "memcpy_impl.S" -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S -new file mode 100644 -index 0000000..f83276a ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S -@@ -0,0 +1,642 @@ -+/* NEON/VFP/ARM version of memcpy optimized for Cortex-A15. -+ Copyright (C) 2013 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 -+ . -+ -+ This memcpy routine is optimised for Cortex-A15 cores and takes advantage -+ of VFP or NEON when built with the appropriate flags. -+ -+ Assumptions: -+ -+ ARMv6 (ARMv7-a if using Neon) -+ ARM state -+ Unaligned accesses -+ LDRD/STRD support unaligned word accesses -+ -+ */ -+ -+/* Thumb cannot encode negative immediate offsets in memory operations. */ -+#ifndef NO_THUMB -+#define NO_THUMB -+#endif -+#include -+ -+ .syntax unified -+ /* This implementation requires ARM state. */ -+ .arm -+ -+#ifdef MEMCPY_NEON -+ -+ .fpu neon -+ .arch armv7-a -+# define FRAME_SIZE 4 -+# define USE_VFP -+# define USE_NEON -+ -+#elif defined (MEMCPY_VFP) -+ -+ .arch armv6 -+ .fpu vfpv2 -+# define FRAME_SIZE 32 -+# define USE_VFP -+ -+#else -+ .arch armv6 -+# define FRAME_SIZE 32 -+ -+#endif -+ -+#define ALIGN(addr, align) addr:align -+ -+#define INSN_SIZE 4 -+ -+/* Call parameters. */ -+#define dstin r0 -+#define src r1 -+#define count r2 -+ -+/* Locals. */ -+#define tmp1 r3 -+#define dst ip -+#define tmp2 r10 -+ -+#ifndef USE_NEON -+/* For bulk copies using GP registers. */ -+#define A_l r2 /* Call-clobbered. */ -+#define A_h r3 /* Call-clobbered. */ -+#define B_l r4 -+#define B_h r5 -+#define C_l r6 -+#define C_h r7 -+#define D_l r8 -+#define D_h r9 -+#endif -+ -+/* Number of lines ahead to pre-fetch data. If you change this the code -+ below will need adjustment to compensate. */ -+ -+#define prefetch_lines 5 -+ -+#ifdef USE_VFP -+ .macro cpy_line_vfp vreg, base -+ vstr \vreg, [dst, #\base] -+ vldr \vreg, [src, #\base] -+ vstr d0, [dst, #\base + 8] -+ vldr d0, [src, #\base + 8] -+ vstr d1, [dst, #\base + 16] -+ vldr d1, [src, #\base + 16] -+ vstr d2, [dst, #\base + 24] -+ vldr d2, [src, #\base + 24] -+ vstr \vreg, [dst, #\base + 32] -+ vldr \vreg, [src, #\base + prefetch_lines * 64 - 32] -+ vstr d0, [dst, #\base + 40] -+ vldr d0, [src, #\base + 40] -+ vstr d1, [dst, #\base + 48] -+ vldr d1, [src, #\base + 48] -+ vstr d2, [dst, #\base + 56] -+ vldr d2, [src, #\base + 56] -+ .endm -+ -+ .macro cpy_tail_vfp vreg, base -+ vstr \vreg, [dst, #\base] -+ vldr \vreg, [src, #\base] -+ vstr d0, [dst, #\base + 8] -+ vldr d0, [src, #\base + 8] -+ vstr d1, [dst, #\base + 16] -+ vldr d1, [src, #\base + 16] -+ vstr d2, [dst, #\base + 24] -+ vldr d2, [src, #\base + 24] -+ vstr \vreg, [dst, #\base + 32] -+ vstr d0, [dst, #\base + 40] -+ vldr d0, [src, #\base + 40] -+ vstr d1, [dst, #\base + 48] -+ vldr d1, [src, #\base + 48] -+ vstr d2, [dst, #\base + 56] -+ vldr d2, [src, #\base + 56] -+ .endm -+#endif -+ -+ .p2align 6 -+ENTRY(memcpy) -+ -+ mov dst, dstin /* Preserve dstin, we need to return it. */ -+ cmp count, #64 -+ bge .Lcpy_not_short -+ /* Deal with small copies quickly by dropping straight into the -+ exit block. */ -+ -+.Ltail63unaligned: -+#ifdef USE_NEON -+ and tmp1, count, #0x38 -+ rsb tmp1, tmp1, #(56 - PC_OFS + INSN_SIZE) -+ add pc, pc, tmp1 -+ vld1.8 {d0}, [src]! /* 14 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 12 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 10 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 8 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 6 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 4 words to go. */ -+ vst1.8 {d0}, [dst]! -+ vld1.8 {d0}, [src]! /* 2 words to go. */ -+ vst1.8 {d0}, [dst]! -+ -+ tst count, #4 -+ ldrne tmp1, [src], #4 -+ strne tmp1, [dst], #4 -+#else -+ /* Copy up to 15 full words of data. May not be aligned. */ -+ /* Cannot use VFP for unaligned data. */ -+ and tmp1, count, #0x3c -+ add dst, dst, tmp1 -+ add src, src, tmp1 -+ rsb tmp1, tmp1, #(60 - PC_OFS/2 + INSN_SIZE/2) -+ /* Jump directly into the sequence below at the correct offset. */ -+ add pc, pc, tmp1, lsl #1 -+ -+ ldr tmp1, [src, #-60] /* 15 words to go. */ -+ str tmp1, [dst, #-60] -+ -+ ldr tmp1, [src, #-56] /* 14 words to go. */ -+ str tmp1, [dst, #-56] -+ ldr tmp1, [src, #-52] -+ str tmp1, [dst, #-52] -+ -+ ldr tmp1, [src, #-48] /* 12 words to go. */ -+ str tmp1, [dst, #-48] -+ ldr tmp1, [src, #-44] -+ str tmp1, [dst, #-44] -+ -+ ldr tmp1, [src, #-40] /* 10 words to go. */ -+ str tmp1, [dst, #-40] -+ ldr tmp1, [src, #-36] -+ str tmp1, [dst, #-36] -+ -+ ldr tmp1, [src, #-32] /* 8 words to go. */ -+ str tmp1, [dst, #-32] -+ ldr tmp1, [src, #-28] -+ str tmp1, [dst, #-28] -+ -+ ldr tmp1, [src, #-24] /* 6 words to go. */ -+ str tmp1, [dst, #-24] -+ ldr tmp1, [src, #-20] -+ str tmp1, [dst, #-20] -+ -+ ldr tmp1, [src, #-16] /* 4 words to go. */ -+ str tmp1, [dst, #-16] -+ ldr tmp1, [src, #-12] -+ str tmp1, [dst, #-12] -+ -+ ldr tmp1, [src, #-8] /* 2 words to go. */ -+ str tmp1, [dst, #-8] -+ ldr tmp1, [src, #-4] -+ str tmp1, [dst, #-4] -+#endif -+ -+ lsls count, count, #31 -+ ldrhcs tmp1, [src], #2 -+ ldrbne src, [src] /* Src is dead, use as a scratch. */ -+ strhcs tmp1, [dst], #2 -+ strbne src, [dst] -+ bx lr -+ -+.Lcpy_not_short: -+ /* At least 64 bytes to copy, but don't know the alignment yet. */ -+ str tmp2, [sp, #-FRAME_SIZE]! -+ cfi_adjust_cfa_offset (FRAME_SIZE) -+ cfi_rel_offset (tmp2, 0) -+ cfi_remember_state -+ and tmp2, src, #3 -+ and tmp1, dst, #3 -+ cmp tmp1, tmp2 -+ bne .Lcpy_notaligned -+ -+#ifdef USE_VFP -+ /* Magic dust alert! Force VFP on Cortex-A9. Experiments show -+ that the FP pipeline is much better at streaming loads and -+ stores. This is outside the critical loop. */ -+ vmov.f32 s0, s0 -+#endif -+ -+ /* SRC and DST have the same mutual 32-bit alignment, but we may -+ still need to pre-copy some bytes to get to natural alignment. -+ We bring DST into full 64-bit alignment. */ -+ lsls tmp2, dst, #29 -+ beq 1f -+ rsbs tmp2, tmp2, #0 -+ sub count, count, tmp2, lsr #29 -+ ldrmi tmp1, [src], #4 -+ strmi tmp1, [dst], #4 -+ lsls tmp2, tmp2, #2 -+ ldrhcs tmp1, [src], #2 -+ ldrbne tmp2, [src], #1 -+ strhcs tmp1, [dst], #2 -+ strbne tmp2, [dst], #1 -+ -+1: -+ subs tmp2, count, #64 /* Use tmp2 for count. */ -+ blt .Ltail63aligned -+ -+ cmp tmp2, #512 -+ bge .Lcpy_body_long -+ -+.Lcpy_body_medium: /* Count in tmp2. */ -+#ifdef USE_VFP -+1: -+ vldr d0, [src, #0] -+ subs tmp2, tmp2, #64 -+ vldr d1, [src, #8] -+ vstr d0, [dst, #0] -+ vldr d0, [src, #16] -+ vstr d1, [dst, #8] -+ vldr d1, [src, #24] -+ vstr d0, [dst, #16] -+ vldr d0, [src, #32] -+ vstr d1, [dst, #24] -+ vldr d1, [src, #40] -+ vstr d0, [dst, #32] -+ vldr d0, [src, #48] -+ vstr d1, [dst, #40] -+ vldr d1, [src, #56] -+ vstr d0, [dst, #48] -+ add src, src, #64 -+ vstr d1, [dst, #56] -+ add dst, dst, #64 -+ bge 1b -+ tst tmp2, #0x3f -+ beq .Ldone -+ -+.Ltail63aligned: /* Count in tmp2. */ -+ and tmp1, tmp2, #0x38 -+ add dst, dst, tmp1 -+ add src, src, tmp1 -+ rsb tmp1, tmp1, #(56 - PC_OFS + INSN_SIZE) -+ add pc, pc, tmp1 -+ -+ vldr d0, [src, #-56] /* 14 words to go. */ -+ vstr d0, [dst, #-56] -+ vldr d0, [src, #-48] /* 12 words to go. */ -+ vstr d0, [dst, #-48] -+ vldr d0, [src, #-40] /* 10 words to go. */ -+ vstr d0, [dst, #-40] -+ vldr d0, [src, #-32] /* 8 words to go. */ -+ vstr d0, [dst, #-32] -+ vldr d0, [src, #-24] /* 6 words to go. */ -+ vstr d0, [dst, #-24] -+ vldr d0, [src, #-16] /* 4 words to go. */ -+ vstr d0, [dst, #-16] -+ vldr d0, [src, #-8] /* 2 words to go. */ -+ vstr d0, [dst, #-8] -+#else -+ sub src, src, #8 -+ sub dst, dst, #8 -+1: -+ ldrd A_l, A_h, [src, #8] -+ strd A_l, A_h, [dst, #8] -+ ldrd A_l, A_h, [src, #16] -+ strd A_l, A_h, [dst, #16] -+ ldrd A_l, A_h, [src, #24] -+ strd A_l, A_h, [dst, #24] -+ ldrd A_l, A_h, [src, #32] -+ strd A_l, A_h, [dst, #32] -+ ldrd A_l, A_h, [src, #40] -+ strd A_l, A_h, [dst, #40] -+ ldrd A_l, A_h, [src, #48] -+ strd A_l, A_h, [dst, #48] -+ ldrd A_l, A_h, [src, #56] -+ strd A_l, A_h, [dst, #56] -+ ldrd A_l, A_h, [src, #64]! -+ strd A_l, A_h, [dst, #64]! -+ subs tmp2, tmp2, #64 -+ bge 1b -+ tst tmp2, #0x3f -+ bne 1f -+ ldr tmp2,[sp], #FRAME_SIZE -+ cfi_adjust_cfa_offset (-FRAME_SIZE) -+ cfi_restore (tmp2) -+ bx lr -+ -+ cfi_restore_state -+ cfi_remember_state -+1: -+ add src, src, #8 -+ add dst, dst, #8 -+ -+.Ltail63aligned: /* Count in tmp2. */ -+ /* Copy up to 7 d-words of data. Similar to Ltail63unaligned, but -+ we know that the src and dest are 32-bit aligned so we can use -+ LDRD/STRD to improve efficiency. */ -+ /* TMP2 is now negative, but we don't care about that. The bottom -+ six bits still tell us how many bytes are left to copy. */ -+ -+ and tmp1, tmp2, #0x38 -+ add dst, dst, tmp1 -+ add src, src, tmp1 -+ rsb tmp1, tmp1, #(56 - PC_OFS + INSN_SIZE) -+ add pc, pc, tmp1 -+ ldrd A_l, A_h, [src, #-56] /* 14 words to go. */ -+ strd A_l, A_h, [dst, #-56] -+ ldrd A_l, A_h, [src, #-48] /* 12 words to go. */ -+ strd A_l, A_h, [dst, #-48] -+ ldrd A_l, A_h, [src, #-40] /* 10 words to go. */ -+ strd A_l, A_h, [dst, #-40] -+ ldrd A_l, A_h, [src, #-32] /* 8 words to go. */ -+ strd A_l, A_h, [dst, #-32] -+ ldrd A_l, A_h, [src, #-24] /* 6 words to go. */ -+ strd A_l, A_h, [dst, #-24] -+ ldrd A_l, A_h, [src, #-16] /* 4 words to go. */ -+ strd A_l, A_h, [dst, #-16] -+ ldrd A_l, A_h, [src, #-8] /* 2 words to go. */ -+ strd A_l, A_h, [dst, #-8] -+ -+#endif -+ tst tmp2, #4 -+ ldrne tmp1, [src], #4 -+ strne tmp1, [dst], #4 -+ lsls tmp2, tmp2, #31 /* Count (tmp2) now dead. */ -+ ldrhcs tmp1, [src], #2 -+ ldrbne tmp2, [src] -+ strhcs tmp1, [dst], #2 -+ strbne tmp2, [dst] -+ -+.Ldone: -+ ldr tmp2, [sp], #FRAME_SIZE -+ cfi_adjust_cfa_offset (-FRAME_SIZE) -+ cfi_restore (tmp2) -+ bx lr -+ -+ cfi_restore_state -+ cfi_remember_state -+ -+.Lcpy_body_long: /* Count in tmp2. */ -+ -+ /* Long copy. We know that there's at least (prefetch_lines * 64) -+ bytes to go. */ -+#ifdef USE_VFP -+ /* Don't use PLD. Instead, read some data in advance of the current -+ copy position into a register. This should act like a PLD -+ operation but we won't have to repeat the transfer. */ -+ -+ vldr d3, [src, #0] -+ vldr d4, [src, #64] -+ vldr d5, [src, #128] -+ vldr d6, [src, #192] -+ vldr d7, [src, #256] -+ -+ vldr d0, [src, #8] -+ vldr d1, [src, #16] -+ vldr d2, [src, #24] -+ add src, src, #32 -+ -+ subs tmp2, tmp2, #prefetch_lines * 64 * 2 -+ blt 2f -+1: -+ cpy_line_vfp d3, 0 -+ cpy_line_vfp d4, 64 -+ cpy_line_vfp d5, 128 -+ add dst, dst, #3 * 64 -+ add src, src, #3 * 64 -+ cpy_line_vfp d6, 0 -+ cpy_line_vfp d7, 64 -+ add dst, dst, #2 * 64 -+ add src, src, #2 * 64 -+ subs tmp2, tmp2, #prefetch_lines * 64 -+ bge 1b -+ -+2: -+ cpy_tail_vfp d3, 0 -+ cpy_tail_vfp d4, 64 -+ cpy_tail_vfp d5, 128 -+ add src, src, #3 * 64 -+ add dst, dst, #3 * 64 -+ cpy_tail_vfp d6, 0 -+ vstr d7, [dst, #64] -+ vldr d7, [src, #64] -+ vstr d0, [dst, #64 + 8] -+ vldr d0, [src, #64 + 8] -+ vstr d1, [dst, #64 + 16] -+ vldr d1, [src, #64 + 16] -+ vstr d2, [dst, #64 + 24] -+ vldr d2, [src, #64 + 24] -+ vstr d7, [dst, #64 + 32] -+ add src, src, #96 -+ vstr d0, [dst, #64 + 40] -+ vstr d1, [dst, #64 + 48] -+ vstr d2, [dst, #64 + 56] -+ add dst, dst, #128 -+ add tmp2, tmp2, #prefetch_lines * 64 -+ b .Lcpy_body_medium -+#else -+ /* Long copy. Use an SMS style loop to maximize the I/O -+ bandwidth of the core. We don't have enough spare registers -+ to synthesise prefetching, so use PLD operations. */ -+ /* Pre-bias src and dst. */ -+ sub src, src, #8 -+ sub dst, dst, #8 -+ pld [src, #8] -+ pld [src, #72] -+ subs tmp2, tmp2, #64 -+ pld [src, #136] -+ ldrd A_l, A_h, [src, #8] -+ strd B_l, B_h, [sp, #8] -+ cfi_rel_offset (B_l, 8) -+ cfi_rel_offset (B_h, 12) -+ ldrd B_l, B_h, [src, #16] -+ strd C_l, C_h, [sp, #16] -+ cfi_rel_offset (C_l, 16) -+ cfi_rel_offset (C_h, 20) -+ ldrd C_l, C_h, [src, #24] -+ strd D_l, D_h, [sp, #24] -+ cfi_rel_offset (D_l, 24) -+ cfi_rel_offset (D_h, 28) -+ pld [src, #200] -+ ldrd D_l, D_h, [src, #32]! -+ b 1f -+ .p2align 6 -+2: -+ pld [src, #232] -+ strd A_l, A_h, [dst, #40] -+ ldrd A_l, A_h, [src, #40] -+ strd B_l, B_h, [dst, #48] -+ ldrd B_l, B_h, [src, #48] -+ strd C_l, C_h, [dst, #56] -+ ldrd C_l, C_h, [src, #56] -+ strd D_l, D_h, [dst, #64]! -+ ldrd D_l, D_h, [src, #64]! -+ subs tmp2, tmp2, #64 -+1: -+ strd A_l, A_h, [dst, #8] -+ ldrd A_l, A_h, [src, #8] -+ strd B_l, B_h, [dst, #16] -+ ldrd B_l, B_h, [src, #16] -+ strd C_l, C_h, [dst, #24] -+ ldrd C_l, C_h, [src, #24] -+ strd D_l, D_h, [dst, #32] -+ ldrd D_l, D_h, [src, #32] -+ bcs 2b -+ /* Save the remaining bytes and restore the callee-saved regs. */ -+ strd A_l, A_h, [dst, #40] -+ add src, src, #40 -+ strd B_l, B_h, [dst, #48] -+ ldrd B_l, B_h, [sp, #8] -+ cfi_restore (B_l) -+ cfi_restore (B_h) -+ strd C_l, C_h, [dst, #56] -+ ldrd C_l, C_h, [sp, #16] -+ cfi_restore (C_l) -+ cfi_restore (C_h) -+ strd D_l, D_h, [dst, #64] -+ ldrd D_l, D_h, [sp, #24] -+ cfi_restore (D_l) -+ cfi_restore (D_h) -+ add dst, dst, #72 -+ tst tmp2, #0x3f -+ bne .Ltail63aligned -+ ldr tmp2, [sp], #FRAME_SIZE -+ cfi_adjust_cfa_offset (-FRAME_SIZE) -+ cfi_restore (tmp2) -+ bx lr -+#endif -+ -+ cfi_restore_state -+ cfi_remember_state -+ -+.Lcpy_notaligned: -+ pld [src] -+ pld [src, #64] -+ /* There's at least 64 bytes to copy, but there is no mutual -+ alignment. */ -+ /* Bring DST to 64-bit alignment. */ -+ lsls tmp2, dst, #29 -+ pld [src, #(2 * 64)] -+ beq 1f -+ rsbs tmp2, tmp2, #0 -+ sub count, count, tmp2, lsr #29 -+ ldrmi tmp1, [src], #4 -+ strmi tmp1, [dst], #4 -+ lsls tmp2, tmp2, #2 -+ ldrbne tmp1, [src], #1 -+ ldrhcs tmp2, [src], #2 -+ strbne tmp1, [dst], #1 -+ strhcs tmp2, [dst], #2 -+1: -+ pld [src, #(3 * 64)] -+ subs count, count, #64 -+ ldrmi tmp2, [sp], #FRAME_SIZE -+ bmi .Ltail63unaligned -+ pld [src, #(4 * 64)] -+ -+#ifdef USE_NEON -+ vld1.8 {d0-d3}, [src]! -+ vld1.8 {d4-d7}, [src]! -+ subs count, count, #64 -+ bmi 2f -+1: -+ pld [src, #(4 * 64)] -+ vst1.8 {d0-d3}, [ALIGN (dst, 64)]! -+ vld1.8 {d0-d3}, [src]! -+ vst1.8 {d4-d7}, [ALIGN (dst, 64)]! -+ vld1.8 {d4-d7}, [src]! -+ subs count, count, #64 -+ bpl 1b -+2: -+ vst1.8 {d0-d3}, [ALIGN (dst, 64)]! -+ vst1.8 {d4-d7}, [ALIGN (dst, 64)]! -+ ands count, count, #0x3f -+#else -+ /* Use an SMS style loop to maximize the I/O bandwidth. */ -+ sub src, src, #4 -+ sub dst, dst, #8 -+ subs tmp2, count, #64 /* Use tmp2 for count. */ -+ ldr A_l, [src, #4] -+ ldr A_h, [src, #8] -+ strd B_l, B_h, [sp, #8] -+ cfi_rel_offset (B_l, 8) -+ cfi_rel_offset (B_h, 12) -+ ldr B_l, [src, #12] -+ ldr B_h, [src, #16] -+ strd C_l, C_h, [sp, #16] -+ cfi_rel_offset (C_l, 16) -+ cfi_rel_offset (C_h, 20) -+ ldr C_l, [src, #20] -+ ldr C_h, [src, #24] -+ strd D_l, D_h, [sp, #24] -+ cfi_rel_offset (D_l, 24) -+ cfi_rel_offset (D_h, 28) -+ ldr D_l, [src, #28] -+ ldr D_h, [src, #32]! -+ b 1f -+ .p2align 6 -+2: -+ pld [src, #(5 * 64) - (32 - 4)] -+ strd A_l, A_h, [dst, #40] -+ ldr A_l, [src, #36] -+ ldr A_h, [src, #40] -+ strd B_l, B_h, [dst, #48] -+ ldr B_l, [src, #44] -+ ldr B_h, [src, #48] -+ strd C_l, C_h, [dst, #56] -+ ldr C_l, [src, #52] -+ ldr C_h, [src, #56] -+ strd D_l, D_h, [dst, #64]! -+ ldr D_l, [src, #60] -+ ldr D_h, [src, #64]! -+ subs tmp2, tmp2, #64 -+1: -+ strd A_l, A_h, [dst, #8] -+ ldr A_l, [src, #4] -+ ldr A_h, [src, #8] -+ strd B_l, B_h, [dst, #16] -+ ldr B_l, [src, #12] -+ ldr B_h, [src, #16] -+ strd C_l, C_h, [dst, #24] -+ ldr C_l, [src, #20] -+ ldr C_h, [src, #24] -+ strd D_l, D_h, [dst, #32] -+ ldr D_l, [src, #28] -+ ldr D_h, [src, #32] -+ bcs 2b -+ -+ /* Save the remaining bytes and restore the callee-saved regs. */ -+ strd A_l, A_h, [dst, #40] -+ add src, src, #36 -+ strd B_l, B_h, [dst, #48] -+ ldrd B_l, B_h, [sp, #8] -+ cfi_restore (B_l) -+ cfi_restore (B_h) -+ strd C_l, C_h, [dst, #56] -+ ldrd C_l, C_h, [sp, #16] -+ cfi_restore (C_l) -+ cfi_restore (C_h) -+ strd D_l, D_h, [dst, #64] -+ ldrd D_l, D_h, [sp, #24] -+ cfi_restore (D_l) -+ cfi_restore (D_h) -+ add dst, dst, #72 -+ ands count, tmp2, #0x3f -+#endif -+ ldr tmp2, [sp], #FRAME_SIZE -+ cfi_adjust_cfa_offset (-FRAME_SIZE) -+ cfi_restore (tmp2) -+ bne .Ltail63unaligned -+ bx lr -+ -+END(memcpy) -+libc_hidden_builtin_def (memcpy) -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_neon.S b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_neon.S -new file mode 100644 -index 0000000..c0ef1f8 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_neon.S -@@ -0,0 +1,3 @@ -+#define MEMCPY_NEON -+#define memcpy __memcpy_neon -+#include "memcpy_impl.S" -diff --git a/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_vfp.S b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_vfp.S -new file mode 100644 -index 0000000..d21b702 ---- /dev/null -+++ b/libc/ports/sysdeps/arm/armv7/multiarch/memcpy_vfp.S -@@ -0,0 +1,3 @@ -+#define MEMCPY_VFP -+#define memcpy __memcpy_vfp -+#include "memcpy_impl.S" -diff --git a/libc/ports/sysdeps/arm/preconfigure b/libc/ports/sysdeps/arm/preconfigure -index 20f6d91..e3762af 100644 ---- a/libc/ports/sysdeps/arm/preconfigure -+++ b/libc/ports/sysdeps/arm/preconfigure -@@ -10,7 +10,7 @@ arm*) - # an appropriate directory exists in sysdeps/arm - archcppflag=`echo "" | - $CC $CFLAGS $CPPFLAGS -E -dM - | -- grep __ARM_ARCH | -+ grep '__ARM_ARCH_[0-9].*__' | - sed -e 's/^#define //' -e 's/ .*//'` - - case x$archcppflag in -diff --git a/libc/ports/sysdeps/arm/sysdep.h b/libc/ports/sysdeps/arm/sysdep.h -index 6ec2bd6..f42c898 100644 ---- a/libc/ports/sysdeps/arm/sysdep.h -+++ b/libc/ports/sysdeps/arm/sysdep.h -@@ -116,3 +116,10 @@ - .eabi_attribute 24, 1 - - #endif /* __ASSEMBLER__ */ -+ -+/* This number is the offset from the pc at the current location. */ -+#if defined(__thumb__) && !defined(__ASSEMBLER__) -+# define PC_OFS 4 -+#else -+# define PC_OFS 8 -+#endif - diff --git a/eglibc-2.18-sb2-workaround.patch b/eglibc-2.18-sb2-workaround.patch deleted file mode 100644 index 08066c1..0000000 --- a/eglibc-2.18-sb2-workaround.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -ru eglibc-2.18/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c ---- eglibc-2.18/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000 -+++ eglibc-2.18-sb2-workaround/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c 2013-12-27 08:56:08.000000000 +0000 -@@ -21,4 +21,4 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -diff -ru eglibc-2.18/ports/sysdeps/arm/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/arm/nptl/pthread_spin_lock.c ---- eglibc-2.18/ports/sysdeps/arm/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000 -+++ eglibc-2.18-sb2-workaround/ports/sysdeps/arm/nptl/pthread_spin_lock.c 2013-12-27 08:55:03.000000000 +0000 -@@ -20,4 +20,4 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -diff -ru eglibc-2.18/ports/sysdeps/mips/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/mips/nptl/pthread_spin_lock.c ---- eglibc-2.18/ports/sysdeps/mips/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000 -+++ eglibc-2.18-sb2-workaround/ports/sysdeps/mips/nptl/pthread_spin_lock.c 2013-12-27 08:56:28.000000000 +0000 -@@ -20,4 +20,5 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -+ diff --git a/eglibc-2.19-sb2-workaround.patch b/eglibc-2.19-sb2-workaround.patch new file mode 100644 index 0000000..3a628ad --- /dev/null +++ b/eglibc-2.19-sb2-workaround.patch @@ -0,0 +1,31 @@ +diff --git a/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c b/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c +index 490bd43..7f2505f 100644 +--- a/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c ++++ b/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c +@@ -21,4 +21,4 @@ + /* We can't use the normal "#include " because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +-#include ++#include +diff --git a/ports/sysdeps/arm/nptl/pthread_spin_lock.c b/ports/sysdeps/arm/nptl/pthread_spin_lock.c +index 7105c73..795db52 100644 +--- a/ports/sysdeps/arm/nptl/pthread_spin_lock.c ++++ b/ports/sysdeps/arm/nptl/pthread_spin_lock.c +@@ -20,4 +20,4 @@ + /* We can't use the normal "#include " because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +-#include ++#include +diff --git a/ports/sysdeps/mips/nptl/pthread_spin_lock.c b/ports/sysdeps/mips/nptl/pthread_spin_lock.c +index f3e718c..a6c4ca3 100644 +--- a/ports/sysdeps/mips/nptl/pthread_spin_lock.c ++++ b/ports/sysdeps/mips/nptl/pthread_spin_lock.c +@@ -20,4 +20,5 @@ + /* We can't use the normal "#include " because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +-#include ++#include ++ diff --git a/eglibc-2.15-shlib-make.patch b/eglibc-2.19-shlib-make.patch similarity index 81% rename from eglibc-2.15-shlib-make.patch rename to eglibc-2.19-shlib-make.patch index 42f21a4..11a57f2 100644 --- a/eglibc-2.15-shlib-make.patch +++ b/eglibc-2.19-shlib-make.patch @@ -1,15 +1,15 @@ -Index: eglibc-2.15/Makerules -=================================================================== ---- eglibc-2.15.orig/Makerules 2011-10-25 03:37:10.000000000 +0300 -+++ eglibc-2.15/Makerules 2013-07-16 14:35:52.581191695 +0300 -@@ -509,25 +509,19 @@ +diff --git a/Makerules b/Makerules +index b46b09b..297e605 100644 +--- a/Makerules ++++ b/Makerules +@@ -454,25 +454,19 @@ shlib-lds-flags = else # binutils only position loadable notes into the first page for binaries, # not for shared objects -$(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules - $(LINK.o) -shared -Wl,-O1 \ - -nostdlib -nostartfiles \ -- $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \ +- $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ - -Wl,--verbose 2>&1 | \ - sed > $@T \ - -e '/^=========/,/^=========/!d;/^=========/d' \ @@ -33,14 +33,14 @@ Index: eglibc-2.15/Makerules PROVIDE(__start___libc_subfreeres = .);\ __libc_subfreeres : { *(__libc_subfreeres) }\ PROVIDE(__stop___libc_subfreeres = .);\ -@@ -538,6 +532,13 @@ +@@ -483,6 +477,13 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\ PROVIDE(__stop___libc_thread_subfreeres = .);\ /DISCARD/ : { *(.gnu.glibc-stub.*) }@' +$(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules + $(LINK.o) -shared -Wl,-O1 \ + -nostdlib -nostartfiles \ -+ $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \ ++ $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ + -Wl,--verbose 2>&1 | \ + sed > $@T \ + $(shlib-lds-hash) $(shlib-lds-dynbss) $(shlib-lds-jcr) diff --git a/eglibc_2.18-0ubuntu2.debian.tar.xz b/eglibc_2.18-0ubuntu2.debian.tar.xz deleted file mode 100644 index 5827863..0000000 Binary files a/eglibc_2.18-0ubuntu2.debian.tar.xz and /dev/null differ diff --git a/eglibc_2.19-0ubuntu2.debian.tar.xz b/eglibc_2.19-0ubuntu2.debian.tar.xz new file mode 100644 index 0000000..8156157 Binary files /dev/null and b/eglibc_2.19-0ubuntu2.debian.tar.xz differ diff --git a/eglibc_2.18.orig.tar.xz b/eglibc_2.19.orig.tar.xz similarity index 57% rename from eglibc_2.18.orig.tar.xz rename to eglibc_2.19.orig.tar.xz index 33a9be1..411cf5d 100644 Binary files a/eglibc_2.18.orig.tar.xz and b/eglibc_2.19.orig.tar.xz differ diff --git a/glibc-2.14.1-ldso-nodefaultdirs-option.5.diff b/glibc-2.14.1-ldso-nodefaultdirs-option.5.diff deleted file mode 100644 index 9b3e56d..0000000 --- a/glibc-2.14.1-ldso-nodefaultdirs-option.5.diff +++ /dev/null @@ -1,243 +0,0 @@ -diff -ru eglibc-2.18/elf/dl-load.c eglibc-2.18-nodefaultdirs/elf/dl-load.c ---- eglibc-2.18/elf/dl-load.c 2014-01-01 10:24:04.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/dl-load.c 2014-01-01 10:25:39.000000000 +0000 -@@ -2280,7 +2280,9 @@ - /* 'l' is always != NULL for dynamically linked objects. */ - l != NULL && - # endif -- __builtin_expect (l->l_flags_1 & DF_1_NODEFLIB, 0)) -+ __builtin_expect (((l->l_flags_1 & DF_1_NODEFLIB) || -+ GLRO(dl_no_default_dirs)), 0)) -+ - { - const char *dirp = system_dirs; - unsigned int cnt = 0; -@@ -2322,7 +2324,8 @@ - /* Finally, try the default path. */ - if (fd == -1 - && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL -- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) -+ || __builtin_expect (!((l->l_flags_1 & DF_1_NODEFLIB) || -+ GLRO(dl_no_default_dirs)), 1)) - && rtld_search_dirs.dirs != (void *) -1) - fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, - &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); -@@ -2488,7 +2491,7 @@ - a way to indicate that in the results for Dl_serinfo. */ - - /* Finally, try the default path. */ -- if (!(loader->l_flags_1 & DF_1_NODEFLIB)) -+ if (!((loader->l_flags_1 & DF_1_NODEFLIB) || GLRO(dl_no_default_dirs))) - add_path (&rtld_search_dirs, XXX_default); - - if (counting) -diff -ru eglibc-2.18/elf/dl-load.c.orig eglibc-2.18-nodefaultdirs/elf/dl-load.c.orig ---- eglibc-2.18/elf/dl-load.c.orig 2013-07-02 00:11:45.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/dl-load.c.orig 2014-01-01 10:24:04.000000000 +0000 -@@ -481,7 +481,8 @@ - - static struct r_search_path_elem ** - fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, -- int check_trusted, const char *what, const char *where) -+ int check_trusted, const char *what, const char *where, -+ const char *rpath_prefix) - { - char *cp; - size_t nelems = 0; -@@ -512,9 +513,23 @@ - continue; - - /* See if this directory is already known. */ -- for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) -- if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0) -- break; -+ if (__builtin_expect (rpath_prefix != NULL, 0)) -+ { -+ /* has rpath_prefix */ -+ size_t rpath_prefix_len = strlen (rpath_prefix); -+ -+ for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) -+ if (dirp->dirnamelen == (rpath_prefix_len+len) && -+ (memcmp (cp, rpath_prefix, rpath_prefix_len) == 0) && -+ (memcmp (cp+rpath_prefix_len, dirp->dirname, len) == 0)) -+ break; -+ } -+ else -+ { -+ for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) -+ if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0) -+ break; -+ } - - if (dirp != NULL) - { -@@ -532,22 +547,43 @@ - size_t cnt; - enum r_dir_status init_val; - size_t where_len = where ? strlen (where) + 1 : 0; -+ size_t rpath_prefix_len = 0; -+ -+ if (__builtin_expect (rpath_prefix != NULL, 0) -+ && !INTUSE(__libc_enable_secure)) -+ { -+ rpath_prefix_len = strlen (rpath_prefix); -+ if (*cp != '/') rpath_prefix_len++; /* need to add a '/' */ -+ } - - /* It's a new directory. Create an entry and add it. */ - dirp = (struct r_search_path_elem *) - malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status) -- + where_len + len + 1); -+ + where_len + rpath_prefix_len + len + 1); - if (dirp == NULL) - _dl_signal_error (ENOMEM, NULL, NULL, - N_("cannot create cache for search path")); - - dirp->dirname = ((char *) dirp + sizeof (*dirp) - + ncapstr * sizeof (enum r_dir_status)); -- *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0'; -- dirp->dirnamelen = len; -+ if (rpath_prefix_len == 0) -+ { -+ *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0'; -+ } -+ else -+ { -+ char *prefixend; -+ -+ prefixend = (char *) __mempcpy ((char *) dirp->dirname, -+ rpath_prefix, rpath_prefix_len); -+ if (*cp != '/') -+ prefixend[-1] = '/'; /* replace \0 */ -+ *((char *) __mempcpy (prefixend, cp, len)) = '\0'; -+ } -+ dirp->dirnamelen = len + rpath_prefix_len; - -- if (len > max_dirnamelen) -- max_dirnamelen = len; -+ if ((len + rpath_prefix_len) > max_dirnamelen) -+ max_dirnamelen = len + rpath_prefix_len; - - /* We have to make sure all the relative directories are - never ignored. The current directory might change and -@@ -558,7 +594,8 @@ - - dirp->what = what; - if (__builtin_expect (where != NULL, 1)) -- dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + len + 1 -+ dirp->where = memcpy ((char *) dirp + sizeof (*dirp) -+ + rpath_prefix_len + len + 1 - + (ncapstr * sizeof (enum r_dir_status)), - where, where_len); - else -@@ -660,7 +697,7 @@ - _dl_signal_error (ENOMEM, NULL, NULL, errstring); - } - -- fillin_rpath (copy, result, ":", 0, what, where); -+ fillin_rpath (copy, result, ":", 0, what, where, GLRO(dl_rpath_prefix)); - - /* Free the copied RPATH string. `fillin_rpath' make own copies if - necessary. */ -@@ -865,7 +902,7 @@ - - (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;", - INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH", -- NULL); -+ NULL, NULL/*no prefix*/); - - if (env_path_list.dirs[0] == NULL) - { -diff -ru eglibc-2.18/elf/dl-support.c eglibc-2.18-nodefaultdirs/elf/dl-support.c ---- eglibc-2.18/elf/dl-support.c 2014-01-01 10:24:04.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/dl-support.c 2014-01-01 10:25:39.000000000 +0000 -@@ -64,6 +64,9 @@ - /* prefix to be added to all RUNPATHs and RPATHs */ - const char *_dl_rpath_prefix = NULL; - -+/* flag: don't search default directories if set. */ -+int _dl_no_default_dirs = 0; -+ - /* The map for the object we will profile. */ - struct link_map *_dl_profile_map; - -diff -ru eglibc-2.18/elf/dl-support.c.orig eglibc-2.18-nodefaultdirs/elf/dl-support.c.orig ---- eglibc-2.18/elf/dl-support.c.orig 2013-07-02 00:11:45.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/dl-support.c.orig 2014-01-01 10:24:04.000000000 +0000 -@@ -61,6 +61,9 @@ - ignored. */ - const char *_dl_inhibit_rpath; - -+/* prefix to be added to all RUNPATHs and RPATHs */ -+const char *_dl_rpath_prefix = NULL; -+ - /* The map for the object we will profile. */ - struct link_map *_dl_profile_map; - -diff -ru eglibc-2.18/elf/rtld.c eglibc-2.18-nodefaultdirs/elf/rtld.c ---- eglibc-2.18/elf/rtld.c 2014-01-01 10:24:04.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/rtld.c 2014-01-01 10:26:13.000000000 +0000 -@@ -978,6 +978,15 @@ - --_dl_argc; - ++INTUSE(_dl_argv); - } -+ else if (! strcmp (INTUSE(_dl_argv)[1], "--nodefaultdirs") -+ && _dl_argc > 2) -+ { -+ GLRO(dl_no_default_dirs) = 1; -+ -+ ++_dl_skip_args; -+ --_dl_argc; -+ ++INTUSE(_dl_argv); -+ } - else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path") - && _dl_argc > 2) - { -@@ -1051,6 +1060,7 @@ - --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ - in LIST\n\ - --argv0 STRING use STRING as argv[0]\n\ -+ --nodefaultdirs Do not search from default directories or cache\n\ - --audit LIST use objects named in LIST as auditors\n"); - - ++_dl_skip_args; -diff -ru eglibc-2.18/elf/rtld.c.orig eglibc-2.18-nodefaultdirs/elf/rtld.c.orig ---- eglibc-2.18/elf/rtld.c.orig 2014-01-01 10:23:45.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/elf/rtld.c.orig 2014-01-01 10:24:04.000000000 +0000 -@@ -996,6 +996,15 @@ - _dl_argc -= 2; - INTUSE(_dl_argv) += 2; - } -+ else if (! strcmp (INTUSE(_dl_argv)[1], "--rpath-prefix") -+ && _dl_argc > 2) -+ { -+ GLRO(dl_rpath_prefix) = INTUSE(_dl_argv)[2]; -+ -+ _dl_skip_args += 2; -+ _dl_argc -= 2; -+ INTUSE(_dl_argv) += 2; -+ } - else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2) - { - process_dl_audit (INTUSE(_dl_argv)[2]); -@@ -1038,6 +1047,7 @@ - --inhibit-cache Do not use " LD_SO_CACHE "\n\ - --library-path PATH use given PATH instead of content of the environment\n\ - variable LD_LIBRARY_PATH\n\ -+ --rpath-prefix PREFIX add PREFIX to every RUNPATH and RPATH component\n\ - --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ - in LIST\n\ - --argv0 STRING use STRING as argv[0]\n\ -Only in eglibc-2.18-nodefaultdirs/elf: rtld.c.rej -diff -ru eglibc-2.18/sysdeps/generic/ldsodefs.h eglibc-2.18-nodefaultdirs/sysdeps/generic/ldsodefs.h ---- eglibc-2.18/sysdeps/generic/ldsodefs.h 2014-01-01 10:24:04.000000000 +0000 -+++ eglibc-2.18-nodefaultdirs/sysdeps/generic/ldsodefs.h 2014-01-01 10:25:39.000000000 +0000 -@@ -566,6 +566,8 @@ - platforms. */ - EXTERN uint64_t _dl_hwcap2; - -+ EXTERN int _dl_no_default_dirs; -+ - #ifdef SHARED - /* We add a function table to _rtld_global which is then used to - call the function instead of going through the PLT. The result diff --git a/glibc-2.19-ldso-nodefaultdirs-option.5.diff b/glibc-2.19-ldso-nodefaultdirs-option.5.diff new file mode 100644 index 0000000..51e7229 --- /dev/null +++ b/glibc-2.19-ldso-nodefaultdirs-option.5.diff @@ -0,0 +1,88 @@ +diff --git a/elf/dl-load.c b/elf/dl-load.c +index 49f070f..621b5a3 100644 +--- a/elf/dl-load.c ++++ b/elf/dl-load.c +@@ -2279,7 +2279,8 @@ _dl_map_object (struct link_map *loader, const char *name, + + /* If the loader has the DF_1_NODEFLIB flag set we must not + use a cache entry from any of these directories. */ +- if (__builtin_expect (l->l_flags_1 & DF_1_NODEFLIB, 0)) ++ if (__builtin_expect (((l->l_flags_1 & DF_1_NODEFLIB) || ++ GLRO(dl_no_default_dirs)), 0)) + { + const char *dirp = system_dirs; + unsigned int cnt = 0; +@@ -2321,7 +2322,8 @@ _dl_map_object (struct link_map *loader, const char *name, + /* Finally, try the default path. */ + if (fd == -1 + && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL +- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) ++ || __builtin_expect (!((l->l_flags_1 & DF_1_NODEFLIB) || ++ GLRO(dl_no_default_dirs)), 1)) + && rtld_search_dirs.dirs != (void *) -1) + fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, + &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); +@@ -2487,7 +2489,7 @@ _dl_rtld_di_serinfo (struct link_map *loader, Dl_serinfo *si, bool counting) + a way to indicate that in the results for Dl_serinfo. */ + + /* Finally, try the default path. */ +- if (!(loader->l_flags_1 & DF_1_NODEFLIB)) ++ if (!((loader->l_flags_1 & DF_1_NODEFLIB) || GLRO(dl_no_default_dirs))) + add_path (&rtld_search_dirs, XXX_default); + + if (counting) +diff --git a/elf/dl-support.c b/elf/dl-support.c +index 723814a..fccc1d4 100644 +--- a/elf/dl-support.c ++++ b/elf/dl-support.c +@@ -61,6 +61,9 @@ const char *_dl_inhibit_rpath; + /* prefix to be added to all RUNPATHs and RPATHs */ + const char *_dl_rpath_prefix = NULL; + ++/* flag: don't search default directories if set. */ ++int _dl_no_default_dirs = 0; ++ + /* The map for the object we will profile. */ + struct link_map *_dl_profile_map; + +diff --git a/elf/rtld.c b/elf/rtld.c +index ea3af55..75a2415 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -976,6 +976,15 @@ dl_main (const ElfW(Phdr) *phdr, + --_dl_argc; + ++INTUSE(_dl_argv); + } ++ else if (! strcmp (INTUSE(_dl_argv)[1], "--nodefaultdirs") ++ && _dl_argc > 2) ++ { ++ GLRO(dl_no_default_dirs) = 1; ++ ++ ++_dl_skip_args; ++ --_dl_argc; ++ ++INTUSE(_dl_argv); ++ } + else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path") + && _dl_argc > 2) + { +@@ -1034,6 +1043,7 @@ of this helper program; chances are you did not intend to run this program.\n\ + --list list all dependencies and how they are resolved\n\ + --verify verify that given object really is a dynamically linked\n\ + object we can handle\n\ ++ --nodefaultdirs Do not search from default directories or cache\n\ + --inhibit-cache Do not use " LD_SO_CACHE "\n\ + --library-path PATH use given PATH instead of content of the environment\n\ + variable LD_LIBRARY_PATH\n\ +diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h +index 3116188..0759694 100644 +--- a/sysdeps/generic/ldsodefs.h ++++ b/sysdeps/generic/ldsodefs.h +@@ -559,6 +559,8 @@ struct rtld_global_ro + platforms. */ + EXTERN uint64_t _dl_hwcap2; + ++ EXTERN int _dl_no_default_dirs; ++ + #ifdef SHARED + /* We add a function table to _rtld_global which is then used to + call the function instead of going through the PLT. The result diff --git a/glibc-2.14.1-ldso-rpath-prefix-option.2.diff b/glibc-2.19-ldso-rpath-prefix-option.2.diff similarity index 72% rename from glibc-2.14.1-ldso-rpath-prefix-option.2.diff rename to glibc-2.19-ldso-rpath-prefix-option.2.diff index 89b4bc8..6963f03 100644 --- a/glibc-2.14.1-ldso-rpath-prefix-option.2.diff +++ b/glibc-2.19-ldso-rpath-prefix-option.2.diff @@ -1,18 +1,18 @@ -diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c ---- glibc-2.14.1+p1/elf/dl-load.c 2011-10-07 12:48:55.000000000 +0300 -+++ glibc-2.14.1/elf/dl-load.c 2011-11-16 17:07:07.000000000 +0200 -@@ -487,7 +487,8 @@ - +diff --git a/elf/dl-load.c b/elf/dl-load.c +index 1be7a3c..49f070f 100644 +--- a/elf/dl-load.c ++++ b/elf/dl-load.c +@@ -482,7 +482,7 @@ static size_t max_dirnamelen; static struct r_search_path_elem ** fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, -- int check_trusted, const char *what, const char *where) -+ int check_trusted, const char *what, const char *where, -+ const char *rpath_prefix) + int check_trusted, const char *what, const char *where, +- struct link_map *l) ++ struct link_map *l, const char *rpath_prefix) { char *cp; size_t nelems = 0; -@@ -518,9 +519,23 @@ - continue; +@@ -520,9 +520,23 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, + } /* See if this directory is already known. */ - for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) @@ -38,7 +38,7 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c if (dirp != NULL) { -@@ -538,22 +553,43 @@ +@@ -540,22 +554,43 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, size_t cnt; enum r_dir_status init_val; size_t where_len = where ? strlen (where) + 1 : 0; @@ -87,7 +87,7 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c /* We have to make sure all the relative directories are never ignored. The current directory might change and -@@ -564,7 +600,8 @@ +@@ -566,7 +601,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep, dirp->what = what; if (__builtin_expect (where != NULL, 1)) @@ -97,28 +97,29 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c + (ncapstr * sizeof (enum r_dir_status)), where, where_len); else -@@ -666,7 +703,7 @@ +@@ -668,7 +704,7 @@ decompose_rpath (struct r_search_path_struct *sps, _dl_signal_error (ENOMEM, NULL, NULL, errstring); } -- fillin_rpath (copy, result, ":", 0, what, where); -+ fillin_rpath (copy, result, ":", 0, what, where, GLRO(dl_rpath_prefix)); +- fillin_rpath (copy, result, ":", 0, what, where, l); ++ fillin_rpath (copy, result, ":", 0, what, where, l, GLRO(dl_rpath_prefix)); /* Free the copied RPATH string. `fillin_rpath' make own copies if necessary. */ -@@ -865,7 +902,7 @@ +@@ -871,7 +907,7 @@ _dl_init_paths (const char *llp) (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;", INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH", -- NULL); -+ NULL, NULL/*no prefix*/); +- NULL, l); ++ NULL, l, NULL/*no prefix*/); if (env_path_list.dirs[0] == NULL) { -diff -ur glibc-2.14.1+p1/elf/dl-support.c glibc-2.14.1/elf/dl-support.c ---- glibc-2.14.1+p1/elf/dl-support.c 2011-10-07 12:48:55.000000000 +0300 -+++ glibc-2.14.1/elf/dl-support.c 2011-11-16 17:07:07.000000000 +0200 -@@ -57,6 +57,9 @@ +diff --git a/elf/dl-support.c b/elf/dl-support.c +index e435436..723814a 100644 +--- a/elf/dl-support.c ++++ b/elf/dl-support.c +@@ -58,6 +58,9 @@ const char *_dl_profile_output; ignored. */ const char *_dl_inhibit_rpath; @@ -128,10 +129,11 @@ diff -ur glibc-2.14.1+p1/elf/dl-support.c glibc-2.14.1/elf/dl-support.c /* The map for the object we will profile. */ struct link_map *_dl_profile_map; -diff -ur glibc-2.14.1+p1/elf/rtld.c glibc-2.14.1/elf/rtld.c ---- glibc-2.14.1+p1/elf/rtld.c 2011-11-16 17:00:19.000000000 +0200 -+++ glibc-2.14.1/elf/rtld.c 2011-11-16 17:08:18.000000000 +0200 -@@ -987,6 +987,15 @@ +diff --git a/elf/rtld.c b/elf/rtld.c +index 6dcbabc..ea3af55 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -994,6 +994,15 @@ dl_main (const ElfW(Phdr) *phdr, _dl_argc -= 2; INTUSE(_dl_argv) += 2; } @@ -147,18 +149,19 @@ diff -ur glibc-2.14.1+p1/elf/rtld.c glibc-2.14.1/elf/rtld.c else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2) { process_dl_audit (INTUSE(_dl_argv)[2]); -@@ -1028,6 +1037,7 @@ - object we can handle\n\ +@@ -1028,6 +1037,7 @@ of this helper program; chances are you did not intend to run this program.\n\ + --inhibit-cache Do not use " LD_SO_CACHE "\n\ --library-path PATH use given PATH instead of content of the environment\n\ variable LD_LIBRARY_PATH\n\ + --rpath-prefix PREFIX add PREFIX to every RUNPATH and RPATH component\n\ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ in LIST\n\ - --argv0 STRING use STRING as argv[0]\n\ -diff -ur glibc-2.14.1+p1/sysdeps/generic/ldsodefs.h glibc-2.14.1/sysdeps/generic/ldsodefs.h ---- glibc-2.14.1+p1/sysdeps/generic/ldsodefs.h 2011-10-07 12:48:55.000000000 +0300 -+++ glibc-2.14.1/sysdeps/generic/ldsodefs.h 2011-11-16 17:07:07.000000000 +0200 -@@ -687,6 +687,12 @@ + --audit LIST use objects named in LIST as auditors\n"); +diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h +index ffeb093..3116188 100644 +--- a/sysdeps/generic/ldsodefs.h ++++ b/sysdeps/generic/ldsodefs.h +@@ -593,6 +593,12 @@ struct rtld_global_ro /* 0 if internal pointer values should not be guarded, 1 if they should. */ EXTERN int _dl_pointer_guard; diff --git a/glibc.changes b/glibc.changes index 4d8f6b6..4782f09 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,6 @@ +* Thu Mar 20 2014 Davide Bettio - 2.19 +- Upgrade to 2.19 + * Sat Mar 08 2014 Davide Bettio - 2.18 - Do not build glibc for mipsel with -O3 enabled diff --git a/glibc.spec b/glibc.spec index 6cb15fa..3e2daa2 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ # temporary needed for debuginfo change in rpm package %define _unpackaged_files_terminate_build 0 -%define glibcsrcdir eglibc-2.18 +%define glibcsrcdir eglibc-2.19 ### glibc.spec.in follows: %define run_glibc_tests 0 %define multiarcharches %{ix86} x86_64 @@ -8,7 +8,7 @@ Summary: Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) Name: glibc -Version: 2.18 +Version: 2.19 Release: 1 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. @@ -19,26 +19,34 @@ Release: 1 License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ Group: System/Libraries URL: http://www.eglibc.org/ -Source0: https://launchpad.net/ubuntu/+archive/primary/+files/eglibc_2.18.orig.tar.xz -Source1: eglibc_2.18-0ubuntu2.debian.tar.xz +Source0: https://launchpad.net/ubuntu/+archive/primary/+files/eglibc_2.19.orig.tar.xz +Source1: eglibc_2.19-0ubuntu2.debian.tar.xz Source11: build-locale-archive.c + +# glibc-arm-alignment-fix.patch: safe but probably not needed anymore Patch1: glibc-arm-alignment-fix.patch +# glibc-arm-runfast.patch: performance improvement patch Patch2: glibc-arm-runfast.patch +# glibc-2.19-ldso-rpath-prefix-option.2.diff: required for OBS Patch3: glibc-2.13-no-timestamping.patch Patch4: glibc-2.14.1-elf-rtld.c.1.diff -Patch5: glibc-2.14.1-ldso-rpath-prefix-option.2.diff +# glibc-2.19-ldso-rpath-prefix-option.2.diff: required from scratchbox2 +Patch5: glibc-2.19-ldso-rpath-prefix-option.2.diff +# eglibc-2.15-nsswitchconf-location.3.diff: TODO review required Patch6: eglibc-2.15-nsswitchconf-location.3.diff +# glibc-2.14.1-nscd-socket-location.4.diff: TODO review required Patch7: glibc-2.14.1-nscd-socket-location.4.diff -Patch8: glibc-2.14.1-ldso-nodefaultdirs-option.5.diff -#Patch9: eglibc-2.15-mips-async-unwind.patch -#Patch10: eglibc-2.15-mips-no-n32-n64.patch -Patch11: glibc-2.14-locarchive-fedora.patch -#Patch12: eglibc-2.15-disable-multilib.patch -Patch13: eglibc-2.15-use-usrbin-localedef.patch -Patch14: eglibc-2.15-fix-neon-libdl.patch -#Patch15: eglibc-2.15-shlib-make.patch -#Patch16: eglibc-2.17-linaro-optimizations.diff -Patch17: eglibc-2.18-sb2-workaround.patch +# glibc-2.19-ldso-nodefaultdirs-option.5.diff: required from scratchbox2 +Patch8: glibc-2.19-ldso-nodefaultdirs-option.5.diff +Patch9: glibc-2.14-locarchive-fedora.patch +# eglibc-2.15-use-usrbin-localedef.patch: TODO review required +Patch10: eglibc-2.15-use-usrbin-localedef.patch +# eglibc-2.15-fix-neon-libdl.patch: fix crash +Patch11: eglibc-2.15-fix-neon-libdl.patch +# eglibc-2.19-shlib-make.patch: fix build fail +Patch12: eglibc-2.19-shlib-make.patch +# eglibc-2.19-sb2-workaround.patch: fix build fail +Patch13: eglibc-2.19-sb2-workaround.patch Provides: ldconfig # The dynamic linker supports DT_GNU_HASH @@ -185,28 +193,37 @@ If unsure if you need this, don't install this package. %prep %setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} xz -dc %SOURCE1 | tar xf - -#%patch0 -p1 + +# glibc-arm-alignment-fix.patch %patch1 -p1 %ifarch %{arm} +# glibc-arm-runfast.patch %patch2 -p1 %endif +# glibc-2.13-no-timestamping.patch %patch3 -p1 +# glibc-2.14.1-elf-rtld.c.1.diff %patch4 -p1 +# glibc-2.19-ldso-rpath-prefix-option.2.diff %patch5 -p1 +# eglibc-2.15-nsswitchconf-location.3.diff %patch6 -p1 +# glibc-2.14.1-nscd-socket-location.4.diff %patch7 -p1 +# glibc-2.19-ldso-nodefaultdirs-option.5.diff %patch8 -p1 -#%patch9 -p1 -#%patch10 -p1 -%patch11 -p1 -#%patch12 -p1 +# glibc-2.14-locarchive-fedora.patch +%patch9 -p1 %if 0%{?qemu_user_space_build} -%patch13 -p1 -%patch14 -p1 +# eglibc-2.15-use-usrbin-localedef.patch +%patch10 -p1 +# eglibc-2.15-fix-neon-libdl.patch +%patch11 -p1 %endif -#%patch15 -p1 -#%patch16 -p2 -%patch17 -p1 +# eglibc-2.19-shlib-make.patch +%patch12 -p1 +# eglibc-2.19-sb2-workaround.patch +%patch13 -p1 # Not well formatted locales --cvm sed -i "s|^localedata/locale-eo_EO.diff$||g" debian/patches/series @@ -246,17 +263,13 @@ BuildFlags="$BuildFlags -fasynchronous-unwind-tables" EnableKernel="--enable-kernel=%{enablekernel}" echo "$GCC" > Gcc -AddOns=`echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'` %ifarch %{arm} mipsel aarch64 -AddOns=,ports$AddOns +EnablePorts="ports," +%else +EnablePorts="" %endif -#%ifarch armv7tnhl -# workaround for a potential compiler bug using -mfpu=neon (gcc 4.6 2013.01) -#BuildFlags="$BuildFlags -mfpu=vfpv3-d16" -#%endif - build_nptl() { builddir=build-%{nptl_target_cpu}-$1 @@ -274,7 +287,7 @@ build_CFLAGS="$BuildFlags -g -O3 $*" export MAKEINFO=: ../configure CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" \ --prefix=%{_prefix} \ - --enable-pt_chown "--enable-add-ons=libidn,ports,nptl" --without-cvs $EnableKernel \ + --enable-pt_chown "--enable-add-ons=libidn,"$EnablePorts"nptl" --without-cvs $EnableKernel \ --enable-bind-now --with-tls --with-__thread \ --with-headers=%{_prefix}/include \ %ifnarch %{arm} @@ -292,7 +305,7 @@ export MAKEINFO=: %ifarch %{multiarcharches} --enable-multi-arch \ %endif - --disable-profile --enable-experimental-malloc --enable-obsolete-rpc + --disable-profile --enable-obsolete-rpc make %{?_smp_mflags} -r CFLAGS="$build_CFLAGS" @@ -332,8 +345,6 @@ if [ -d $RPM_BUILD_ROOT%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; rm -rf $RPM_BUILD_ROOT%{_prefix}/info fi -#gzip -9nvf $RPM_BUILD_ROOT%{_infodir}/libc* - ln -sf libbsd-compat.a $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libbsd.a install -p -m 644 nss/nsswitch.conf $RPM_BUILD_ROOT/etc/nsswitch.conf