public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v1] String: Add support for __memcmpeq() ABI on all targets
@ 2021-09-27 20:38 Noah Goldstein
  2021-09-27 20:43 ` Joseph Myers
                   ` (19 more replies)
  0 siblings, 20 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-27 20:38 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
Note: I did not test with build-many-glibcs.py. So far I have not been
able to get it working. The only ABI I tested was x86_64-linux-gnu.
    
Essentially what I did was go through all reference to bcmp() and add
the corresponding logic for __memcmpeq(). If bcmp() was missing for
any arch then this patch will have missed an alias.

There are two places I did not mirror the existing logic for bcmp()
I didn't include anything in 'conform/data/strings.h-data'. I also
defined __memcmpeq() in 'string/string.h' as opposed to
'string/strings.h'.

One thing I am concerned about is some arch having an optimized
version of memcmp() but no alias for __memcmpeq(). If this happens
replacing the optimized memcmp() will the fallback __memcmpeq() will
likely be an anti-optimization.

This is a list of all memcmp implementations:

'$' means it contains an alias to __memcmpeq()
'*' means it includes a file with an alias
'^' means its just making declarations
'%' means its an implementation without an alias

$ sysdeps/sparc/sparc64/memcmp.S
$ sysdeps/sparc/sparc32/sparcv9/memcmp.S
$ sysdeps/s390/memcmp-z900.S
$ sysdeps/s390/memcmp.c
$ sysdeps/powerpc/powerpc32/405/memcmp.S
$ sysdeps/powerpc/powerpc32/power4/memcmp.S
* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
^ sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
* sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S
$ sysdeps/powerpc/powerpc32/power7/memcmp.S
$ sysdeps/powerpc/powerpc64/power8/memcmp.S
$ sysdeps/powerpc/powerpc64/power4/memcmp.S
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S 
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
^ sysdeps/powerpc/powerpc64/multiarch/memcmp.c
^ sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
$ sysdeps/powerpc/powerpc64/le/power10/memcmp.S
$ sysdeps/powerpc/powerpc64/power7/memcmp.S
$ sysdeps/aarch64/memcmp.S
$ sysdeps/ia64/memcmp.S
$ sysdeps/i386/i686/memcmp.S
% sysdeps/i386/i686/multiarch/memcmp-sse4.S
% sysdeps/i386/i686/multiarch/memcmp-ssse3.S
% sysdeps/i386/i686/multiarch/memcmp-ia32.S
$ sysdeps/i386/i686/multiarch/memcmp.c
$ sysdeps/i386/memcmp.S
$ sysdeps/x86_64/memcmp.S
% sysdeps/x86_64/multiarch/memcmp-sse4.S
% sysdeps/x86_64/multiarch/memcmp-ssse3.S
% sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
% sysdeps/x86_64/multiarch/memcmp-sse2.S
% sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
% sysdeps/x86_64/multiarch/memcmp-evex-movbe.S
$ sysdeps/x86_64/multiarch/memcmp.c
$ sysdeps/csky/abiv2/memcmp.S
$ string/memcmp.c

As far as I can tell everything is covered. I tested on x86_64 that
the '%' implements will redirect bcmp() to the correct ifunc
selection.

 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..e953599525 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equals. Return
+   some non-zero value otherwise.
+
+   Essentially the exact same semantics as memcmp() except the return
+   value is less constrained. memcmp() is always a correct
+   implementation of __memcmpeq(). As well !!memcmp(), -memcmp(), or
+   bcmp() are correct implementations.
+
+   Used by compilers when memcmp() return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..7d8e1b7c1e 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check(__memcmpeq("a", "a", 1) == 0, 1);	/* Identity. */
+  check(__memcmpeq("abc", "abc", 3) == 0, 2);	/* Multicharacter. */
+  check(__memcmpeq("abcd", "abce", 4) != 0, 3);	/* Honestly unequal. */
+  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
+  check(__memcmpeq("alph", "beta", 4) != 0, 5);
+  check(__memcmpeq("abce", "abcd", 3) == 0, 6);	/* Count limited. */
+  check(__memcmpeq("abc", "def", 0) == 0, 8);	/* Zero count. */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..dcd1fadd88 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
 HURD_CTHREADS_0.3 __cthread_setspecific F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..8f49b255dd 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..b655fab937 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3037,3 +3037,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..9090fec640 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..3e532f3a6e 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2736,3 +2736,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..2376520077 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2733,3 +2733,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..70cd0ff05e 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..7056d3e4d6 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..8ffd4c2832 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..f8c405a3c1 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2706,3 +2706,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..c8b7557d26 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2715,3 +2715,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..94f983248b 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2882,3 +2882,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..87f62551fe 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..a30ddf68ef 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..e54c14ccd1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2843,3 +2843,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..38aba84dc5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2841,3 +2841,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..a3605989e3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e6ffe45977 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2753,3 +2753,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..16776a5d25 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..8dd99682a9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..306c194aca 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3125,3 +3125,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..a8e24f6aae 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2836,3 +2836,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..f47d906947 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..87b8554999 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..65147c4596 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..d71ddcb6a5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3092,3 +3092,4 @@ GLIBC_2.9 pututline F
 GLIBC_2.9 pututxline F
 GLIBC_2.9 updwtmp F
 GLIBC_2.9 updwtmpx F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..88ae19acae 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2871,3 +2871,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..5609329d85 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2762,3 +2762,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..f3ce30fcc5 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2759,3 +2759,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..8d67b75244 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3097,3 +3097,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..999e7c1f05 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2729,3 +2729,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..c5be6ef43e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2680,3 +2680,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..cc16ae6335 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_3.5 __memcmpeq F
\ No newline at end of file
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v1] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-09-27 20:43 ` Joseph Myers
  2021-09-27 21:06   ` Noah Goldstein
  2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 106+ messages in thread
From: Joseph Myers @ 2021-09-27 20:43 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha

On Mon, 27 Sep 2021, Noah Goldstein via Libc-alpha wrote:

> +/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equals. Return
> +   some non-zero value otherwise.
> +
> +   Essentially the exact same semantics as memcmp() except the return
> +   value is less constrained. memcmp() is always a correct
> +   implementation of __memcmpeq(). As well !!memcmp(), -memcmp(), or
> +   bcmp() are correct implementations.
> +
> +   Used by compilers when memcmp() return is only used for its bolean
> +   value.  */

GNU standards say not to use () after a function name to indicate that 
it's a function, only when you actually want a function call with no 
arguments.  Also, two spaces after '.' at end of sentence.

> +GLIBC_3.5 __memcmpeq F

That's the wrong version.

> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file

Likewise, and these files should all end with a newline.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v1] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:43 ` Joseph Myers
@ 2021-09-27 21:06   ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-27 21:06 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library

On Mon, Sep 27, 2021 at 3:43 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 27 Sep 2021, Noah Goldstein via Libc-alpha wrote:
>
> > +/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equals. Return
> > +   some non-zero value otherwise.
> > +
> > +   Essentially the exact same semantics as memcmp() except the return
> > +   value is less constrained. memcmp() is always a correct
> > +   implementation of __memcmpeq(). As well !!memcmp(), -memcmp(), or
> > +   bcmp() are correct implementations.
> > +
> > +   Used by compilers when memcmp() return is only used for its bolean
> > +   value.  */
>
> GNU standards say not to use () after a function name to indicate that
> it's a function, only when you actually want a function call with no
> arguments.  Also, two spaces after '.' at end of sentence.

Fixed.

>
> > +GLIBC_3.5 __memcmpeq F
>
> That's the wrong version.
>
> > +GLIBC_3.5 __memcmpeq F
> > \ No newline at end of file
>
> Likewise, and these files should all end with a newline.

Fixed.

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v2] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-09-27 20:43 ` Joseph Myers
@ 2021-09-27 21:06 ` Noah Goldstein
  2021-09-27 21:52   ` Joseph Myers
  2021-09-28  1:24 ` [PATCH v3] " Noah Goldstein
                   ` (17 subsequent siblings)
  19 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-09-27 21:06 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d965ca0eeb 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   Used by compilers when memcmp return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..7d8e1b7c1e 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check(__memcmpeq("a", "a", 1) == 0, 1);	/* Identity. */
+  check(__memcmpeq("abc", "abc", 3) == 0, 2);	/* Multicharacter. */
+  check(__memcmpeq("abcd", "abce", 4) != 0, 3);	/* Honestly unequal. */
+  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
+  check(__memcmpeq("alph", "beta", 4) != 0, 5);
+  check(__memcmpeq("abce", "abcd", 3) == 0, 6);	/* Count limited. */
+  check(__memcmpeq("abc", "def", 0) == 0, 8);	/* Zero count. */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..51cf4ab216 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
 HURD_CTHREADS_0.3 __cthread_setspecific F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..eb86ac77a1 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3037,3 +3037,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..accb893165 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2736,3 +2736,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..b699df0a10 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2733,3 +2733,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..0fde110731 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..73507b3a1e 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..003aa08281 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2706,3 +2706,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..1d2546d8d9 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2715,3 +2715,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..e505a9fe15 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2882,3 +2882,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..b7a832f430 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2843,3 +2843,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..153a128ab4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2841,3 +2841,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..b33cae050f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..7729535954 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2753,3 +2753,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..9978c18019 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..4b0945e30c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3125,3 +3125,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..eba9c641e9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2836,3 +2836,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..29eeba351d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3092,3 +3092,4 @@ GLIBC_2.9 pututline F
 GLIBC_2.9 pututxline F
 GLIBC_2.9 updwtmp F
 GLIBC_2.9 updwtmpx F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..ed24ea1e1a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2871,3 +2871,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..fdaa24a946 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2762,3 +2762,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..993590b09a 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2759,3 +2759,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..bb54de8e30 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3097,3 +3097,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..b4cb71c497 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2729,3 +2729,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..ee99d62fb5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2680,3 +2680,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v2] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
@ 2021-09-27 21:52   ` Joseph Myers
  2021-09-28  1:24     ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph Myers @ 2021-09-27 21:52 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha

On Mon, 27 Sep 2021, Noah Goldstein via Libc-alpha wrote:

> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..51cf4ab216 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_2.35 __memcmpeq F

These files are sorted with LC_COLLATE=C, so GLIBC_2.35 comes after 
GLIBC_2.34 and before GLIBC_2.4.  (See "make update-all-abi" for updating 
all ABI baselines after making a glibc change, in the simple case where 
the same symbols are being added at the same version for all glibc 
configurations.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-09-27 20:43 ` Joseph Myers
  2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
@ 2021-09-28  1:24 ` Noah Goldstein
  2021-09-28  8:15   ` Andreas Schwab
  2021-09-28  8:40   ` Florian Weimer
  2021-09-28 16:46 ` [PATCH v4] " Noah Goldstein
                   ` (16 subsequent siblings)
  19 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28  1:24 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d965ca0eeb 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   Used by compilers when memcmp return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..7d8e1b7c1e 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check(__memcmpeq("a", "a", 1) == 0, 1);	/* Identity. */
+  check(__memcmpeq("abc", "abc", 3) == 0, 2);	/* Multicharacter. */
+  check(__memcmpeq("abcd", "abce", 4) != 0, 3);	/* Honestly unequal. */
+  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
+  check(__memcmpeq("alph", "beta", 4) != 0, 5);
+  check(__memcmpeq("abce", "abcd", 3) == 0, 6);	/* Count limited. */
+  check(__memcmpeq("abc", "def", 0) == 0, 8);	/* Zero count. */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..eb86ac77a1 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3037,3 +3037,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..accb893165 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2736,3 +2736,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..b699df0a10 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2733,3 +2733,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..0fde110731 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..73507b3a1e 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..003aa08281 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2706,3 +2706,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..1d2546d8d9 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2715,3 +2715,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..e505a9fe15 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2882,3 +2882,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..b7a832f430 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2843,3 +2843,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..153a128ab4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2841,3 +2841,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..b33cae050f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..7729535954 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2753,3 +2753,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..9978c18019 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..4b0945e30c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3125,3 +3125,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..eba9c641e9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2836,3 +2836,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..29eeba351d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3092,3 +3092,4 @@ GLIBC_2.9 pututline F
 GLIBC_2.9 pututxline F
 GLIBC_2.9 updwtmp F
 GLIBC_2.9 updwtmpx F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..ed24ea1e1a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2871,3 +2871,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..fdaa24a946 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2762,3 +2762,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..993590b09a 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2759,3 +2759,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..bb54de8e30 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3097,3 +3097,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..b4cb71c497 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2729,3 +2729,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..ee99d62fb5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2680,3 +2680,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v2] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 21:52   ` Joseph Myers
@ 2021-09-28  1:24     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28  1:24 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library

On Mon, Sep 27, 2021 at 4:52 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 27 Sep 2021, Noah Goldstein via Libc-alpha wrote:
>
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..51cf4ab216 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F
> >  GLIBC_2.9 ns_name_uncompress F
> >  GLIBC_2.9 ns_name_unpack F
> >  GLIBC_2.9 pipe2 F
> > +GLIBC_2.35 __memcmpeq F
>
> These files are sorted with LC_COLLATE=C, so GLIBC_2.35 comes after
> GLIBC_2.34 and before GLIBC_2.4.  (See "make update-all-abi" for updating
> all ABI baselines after making a glibc change, in the simple case where
> the same symbols are being added at the same version for all glibc
> configurations.)

Fixed. But I'm not sure what I should do with "make update-all-abi". The build
doesn't have an errors irrelevant of the order in:
sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist



>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28  1:24 ` [PATCH v3] " Noah Goldstein
@ 2021-09-28  8:15   ` Andreas Schwab
  2021-09-28 16:47     ` Noah Goldstein
  2021-09-28  8:40   ` Florian Weimer
  1 sibling, 1 reply; 106+ messages in thread
From: Andreas Schwab @ 2021-09-28  8:15 UTC (permalink / raw)
  To: Noah Goldstein via Libc-alpha

On Sep 27 2021, Noah Goldstein via Libc-alpha wrote:

> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..7d8e1b7c1e 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
>  }
>  
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check(__memcmpeq("a", "a", 1) == 0, 1);	/* Identity. */
> +  check(__memcmpeq("abc", "abc", 3) == 0, 2);	/* Multicharacter. */
> +  check(__memcmpeq("abcd", "abce", 4) != 0, 3);	/* Honestly unequal. */
> +  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
> +  check(__memcmpeq("alph", "beta", 4) != 0, 5);
> +  check(__memcmpeq("abce", "abcd", 3) == 0, 6);	/* Count limited. */
> +  check(__memcmpeq("abc", "def", 0) == 0, 8);	/* Zero count. */

Style: space before paren.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28  1:24 ` [PATCH v3] " Noah Goldstein
  2021-09-28  8:15   ` Andreas Schwab
@ 2021-09-28  8:40   ` Florian Weimer
  2021-09-28 16:47     ` Noah Goldstein
  1 sibling, 1 reply; 106+ messages in thread
From: Florian Weimer @ 2021-09-28  8:40 UTC (permalink / raw)
  To: Noah Goldstein via Libc-alpha

* Noah Goldstein via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..0fde110731 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..73507b3a1e 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_2.35 __memcmpeq F

These files still aren't sorted correctly.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (2 preceding siblings ...)
  2021-09-28  1:24 ` [PATCH v3] " Noah Goldstein
@ 2021-09-28 16:46 ` Noah Goldstein
  2021-09-28 16:50 ` [PATCH v5] " Noah Goldstein
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:46 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d965ca0eeb 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   Used by compilers when memcmp return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..b33cae050f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..9978c18019 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28  8:40   ` Florian Weimer
@ 2021-09-28 16:47     ` Noah Goldstein
  2021-09-28 16:51       ` Florian Weimer
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:47 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Noah Goldstein via Libc-alpha

On Tue, Sep 28, 2021 at 3:40 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Noah Goldstein via Libc-alpha:
>
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..0fde110731 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
> >  GLIBC_2.9 ns_name_uncompress F
> >  GLIBC_2.9 ns_name_unpack F
> >  GLIBC_2.9 pipe2 F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..73507b3a1e 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
> >  GLIBC_2.9 ns_name_uncompress F
> >  GLIBC_2.9 ns_name_unpack F
> >  GLIBC_2.9 pipe2 F
> > +GLIBC_2.35 __memcmpeq F
>
> These files still aren't sorted correctly.

Fixed. Think I got all of them.

Out of curiosity what dictates which files are sorted which ways?

>
> Thanks,
> Florian
>

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28  8:15   ` Andreas Schwab
@ 2021-09-28 16:47     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:47 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Noah Goldstein via Libc-alpha

On Tue, Sep 28, 2021 at 3:15 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Sep 27 2021, Noah Goldstein via Libc-alpha wrote:
>
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..7d8e1b7c1e 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);      /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check(__memcmpeq("a", "a", 1) == 0, 1);    /* Identity. */
> > +  check(__memcmpeq("abc", "abc", 3) == 0, 2);        /* Multicharacter. */
> > +  check(__memcmpeq("abcd", "abce", 4) != 0, 3);      /* Honestly unequal. */
> > +  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
> > +  check(__memcmpeq("alph", "beta", 4) != 0, 5);
> > +  check(__memcmpeq("abce", "abcd", 3) == 0, 6);      /* Count limited. */
> > +  check(__memcmpeq("abc", "def", 0) == 0, 8);        /* Zero count. */
>
> Style: space before paren.
Fixed.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v5] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (3 preceding siblings ...)
  2021-09-28 16:46 ` [PATCH v4] " Noah Goldstein
@ 2021-09-28 16:50 ` Noah Goldstein
  2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:50 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d965ca0eeb 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   Used by compilers when memcmp return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..9978c18019 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28 16:47     ` Noah Goldstein
@ 2021-09-28 16:51       ` Florian Weimer
  0 siblings, 0 replies; 106+ messages in thread
From: Florian Weimer @ 2021-09-28 16:51 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: Noah Goldstein via Libc-alpha

* Noah Goldstein:

> On Tue, Sep 28, 2021 at 3:40 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * Noah Goldstein via Libc-alpha:
>>
>> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
>> > index f6965c9d95..0fde110731 100644
>> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
>> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
>> > @@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
>> >  GLIBC_2.9 ns_name_uncompress F
>> >  GLIBC_2.9 ns_name_unpack F
>> >  GLIBC_2.9 pipe2 F
>> > +GLIBC_2.35 __memcmpeq F
>> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
>> > index 2e7603d9ed..73507b3a1e 100644
>> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
>> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
>> > @@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
>> >  GLIBC_2.9 ns_name_uncompress F
>> >  GLIBC_2.9 ns_name_unpack F
>> >  GLIBC_2.9 pipe2 F
>> > +GLIBC_2.35 __memcmpeq F
>>
>> These files still aren't sorted correctly.
>
> Fixed. Think I got all of them.
>
> Out of curiosity what dictates which files are sorted which ways?

All abilist files are sorted according to “LC_ALL=C sort”.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (4 preceding siblings ...)
  2021-09-28 16:50 ` [PATCH v5] " Noah Goldstein
@ 2021-09-28 16:53 ` Noah Goldstein
  2021-09-29  8:36   ` Florian Weimer
  2021-09-29  8:52   ` Andreas Schwab
  2021-09-28 16:57 ` [PATCH v1] " Noah Goldstein
                   ` (13 subsequent siblings)
  19 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:53 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 13 +++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 91 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..550b7bb69b 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d965ca0eeb 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   Used by compilers when memcmp return is only used for its bolean
+   value.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..9cc4750bbc 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v1] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (5 preceding siblings ...)
  2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
@ 2021-09-28 16:57 ` Noah Goldstein
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-28 16:57 UTC (permalink / raw)
  To: GNU C Library

On Mon, Sep 27, 2021 at 3:38 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
> Note: I did not test with build-many-glibcs.py. So far I have not been
> able to get it working. The only ABI I tested was x86_64-linux-gnu.

Started build-many-glibcs.py tests. Last night all builds passed
From:
compilers-aarch64-linux-gnu check-host-libraries
To:
compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft build

As well as x86_64 and x86_32.

>
> Essentially what I did was go through all reference to bcmp() and add
> the corresponding logic for __memcmpeq(). If bcmp() was missing for
> any arch then this patch will have missed an alias.
>
> There are two places I did not mirror the existing logic for bcmp()
> I didn't include anything in 'conform/data/strings.h-data'. I also
> defined __memcmpeq() in 'string/string.h' as opposed to
> 'string/strings.h'.
>
> One thing I am concerned about is some arch having an optimized
> version of memcmp() but no alias for __memcmpeq(). If this happens
> replacing the optimized memcmp() will the fallback __memcmpeq() will
> likely be an anti-optimization.
>
> This is a list of all memcmp implementations:
>
> '$' means it contains an alias to __memcmpeq()
> '*' means it includes a file with an alias
> '^' means its just making declarations
> '%' means its an implementation without an alias
>
> $ sysdeps/sparc/sparc64/memcmp.S
> $ sysdeps/sparc/sparc32/sparcv9/memcmp.S
> $ sysdeps/s390/memcmp-z900.S
> $ sysdeps/s390/memcmp.c
> $ sysdeps/powerpc/powerpc32/405/memcmp.S
> $ sysdeps/powerpc/powerpc32/power4/memcmp.S
> * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> ^ sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
> * sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S
> $ sysdeps/powerpc/powerpc32/power7/memcmp.S
> $ sysdeps/powerpc/powerpc64/power8/memcmp.S
> $ sysdeps/powerpc/powerpc64/power4/memcmp.S
> * sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> * sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> * sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> * sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> ^ sysdeps/powerpc/powerpc64/multiarch/memcmp.c
> ^ sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> $ sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> $ sysdeps/powerpc/powerpc64/power7/memcmp.S
> $ sysdeps/aarch64/memcmp.S
> $ sysdeps/ia64/memcmp.S
> $ sysdeps/i386/i686/memcmp.S
> % sysdeps/i386/i686/multiarch/memcmp-sse4.S
> % sysdeps/i386/i686/multiarch/memcmp-ssse3.S
> % sysdeps/i386/i686/multiarch/memcmp-ia32.S
> $ sysdeps/i386/i686/multiarch/memcmp.c
> $ sysdeps/i386/memcmp.S
> $ sysdeps/x86_64/memcmp.S
> % sysdeps/x86_64/multiarch/memcmp-sse4.S
> % sysdeps/x86_64/multiarch/memcmp-ssse3.S
> % sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
> % sysdeps/x86_64/multiarch/memcmp-sse2.S
> % sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
> % sysdeps/x86_64/multiarch/memcmp-evex-movbe.S
> $ sysdeps/x86_64/multiarch/memcmp.c
> $ sysdeps/csky/abiv2/memcmp.S
> $ string/memcmp.c
>
> As far as I can tell everything is covered. I tested on x86_64 that
> the '%' implements will redirect bcmp() to the correct ifunc
> selection.
>
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 13 +++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 91 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..550b7bb69b 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index 04e1b7067d..e953599525 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equals. Return
> +   some non-zero value otherwise.
> +
> +   Essentially the exact same semantics as memcmp() except the return
> +   value is less constrained. memcmp() is always a correct
> +   implementation of __memcmpeq(). As well !!memcmp(), -memcmp(), or
> +   bcmp() are correct implementations.
> +
> +   Used by compilers when memcmp() return is only used for its bolean
> +   value.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..7d8e1b7c1e 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check(__memcmpeq("a", "a", 1) == 0, 1);      /* Identity. */
> +  check(__memcmpeq("abc", "abc", 3) == 0, 2);  /* Multicharacter. */
> +  check(__memcmpeq("abcd", "abce", 4) != 0, 3);        /* Honestly unequal. */
> +  check(__memcmpeq("abce", "abcd", 4) != 0, 4);
> +  check(__memcmpeq("alph", "beta", 4) != 0, 5);
> +  check(__memcmpeq("abce", "abcd", 3) == 0, 6);        /* Count limited. */
> +  check(__memcmpeq("abc", "def", 0) == 0, 8);  /* Zero count. */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..bc932eff2a 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..d61fca0f29 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..0194f8deab 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..956fc8e601 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..18e225f963 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..4488e0eba4 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..dcd1fadd88 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
>  HURD_CTHREADS_0.3 __cthread_getspecific F
>  HURD_CTHREADS_0.3 __cthread_keycreate F
>  HURD_CTHREADS_0.3 __cthread_setspecific F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..e8b1b6c9bd 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..e4dde875bb 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..e60a62fc86 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..c7fe8047ca 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..4ab4a90496 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..b541978b5f 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..d4f84a5b6f 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..0942d32814 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..475fc45d3a 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..edcc19915a 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..8f49b255dd 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..b655fab937 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -3037,3 +3037,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..9090fec640 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..3e532f3a6e 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -2736,3 +2736,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..2376520077 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -2733,3 +2733,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..70cd0ff05e 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..7056d3e4d6 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..8ffd4c2832 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..f8c405a3c1 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2706,3 +2706,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..c8b7557d26 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -2715,3 +2715,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..94f983248b 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2882,3 +2882,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..87f62551fe 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..a30ddf68ef 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..e54c14ccd1 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2843,3 +2843,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..38aba84dc5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2841,3 +2841,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..a3605989e3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e6ffe45977 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2753,3 +2753,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..16776a5d25 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..8dd99682a9 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..306c194aca 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -3125,3 +3125,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..a8e24f6aae 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2836,3 +2836,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..f47d906947 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..87b8554999 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..65147c4596 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..d71ddcb6a5 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -3092,3 +3092,4 @@ GLIBC_2.9 pututline F
>  GLIBC_2.9 pututxline F
>  GLIBC_2.9 updwtmp F
>  GLIBC_2.9 updwtmpx F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..88ae19acae 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2871,3 +2871,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..5609329d85 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2762,3 +2762,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..f3ce30fcc5 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2759,3 +2759,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..8d67b75244 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -3097,3 +3097,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..999e7c1f05 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2729,3 +2729,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..c5be6ef43e 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2680,3 +2680,4 @@ GLIBC_2.9 ns_name_skip F
>  GLIBC_2.9 ns_name_uncompress F
>  GLIBC_2.9 ns_name_unpack F
>  GLIBC_2.9 pipe2 F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..cc16ae6335 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_3.5 __memcmpeq F
> \ No newline at end of file
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f41ae48006 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..9cc4750bbc 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
@ 2021-09-29  8:36   ` Florian Weimer
  2021-09-29 15:17     ` Noah Goldstein
  2021-09-29  8:52   ` Andreas Schwab
  1 sibling, 1 reply; 106+ messages in thread
From: Florian Weimer @ 2021-09-29  8:36 UTC (permalink / raw)
  To: Noah Goldstein via Libc-alpha

* Noah Goldstein via Libc-alpha:

> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..550b7bb69b 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif

Missing space after #.

> diff --git a/string/string.h b/string/string.h
> index 04e1b7067d..d965ca0eeb 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>  
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.

typo: “are equal[].”

> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   Used by compilers when memcmp return is only used for its bolean
> +   value.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));

I think we should be more explicitly say that __memcmpeq is declared for
use by compilers, programmers should use memcmp.

> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..9cc4750bbc 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)

Missing # indentation.

Rest looks okay.  I have verified that this builds on all architectures.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
  2021-09-29  8:36   ` Florian Weimer
@ 2021-09-29  8:52   ` Andreas Schwab
  2021-09-29  9:18     ` Florian Weimer
  1 sibling, 1 reply; 106+ messages in thread
From: Andreas Schwab @ 2021-09-29  8:52 UTC (permalink / raw)
  To: Noah Goldstein via Libc-alpha

How about calling the function __memequal?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29  8:52   ` Andreas Schwab
@ 2021-09-29  9:18     ` Florian Weimer
  2021-09-29  9:31       ` Andreas Schwab
  0 siblings, 1 reply; 106+ messages in thread
From: Florian Weimer @ 2021-09-29  9:18 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Noah Goldstein via Libc-alpha

* Andreas Schwab:

> How about calling the function __memequal?

Programmers tend to use memequal for functions which return 0 for
different inputs:

| The consttime_memequal() function compares len bytes of memory at b1
| and b2 for equality, returning 0 if they are distinct and 1 if they
| are identical.

<https://man.netbsd.org/consttime_memequal.3>

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29  9:18     ` Florian Weimer
@ 2021-09-29  9:31       ` Andreas Schwab
  2021-09-29  9:44         ` Florian Weimer
  0 siblings, 1 reply; 106+ messages in thread
From: Andreas Schwab @ 2021-09-29  9:31 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Noah Goldstein via Libc-alpha

On Sep 29 2021, Florian Weimer wrote:

> * Andreas Schwab:
>
>> How about calling the function __memequal?
>
> Programmers tend to use memequal for functions which return 0 for
> different inputs:

__memcmpeq has the same problem.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29  9:31       ` Andreas Schwab
@ 2021-09-29  9:44         ` Florian Weimer
  0 siblings, 0 replies; 106+ messages in thread
From: Florian Weimer @ 2021-09-29  9:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Noah Goldstein via Libc-alpha

* Andreas Schwab:

> On Sep 29 2021, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> How about calling the function __memequal?
>>
>> Programmers tend to use memequal for functions which return 0 for
>> different inputs:
>
> __memcmpeq has the same problem.

I don't see it.  The examples in

  <https://codesearch.debian.net/search?q=memcmpeq&literal=1>

all use the inverted sense of memcmp/bcmp.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v6] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29  8:36   ` Florian Weimer
@ 2021-09-29 15:17     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-29 15:17 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Noah Goldstein via Libc-alpha

On Wed, Sep 29, 2021 at 3:36 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Noah Goldstein via Libc-alpha:
>
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..550b7bb69b 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
>
> Missing space after #.
Fixed.
>
> > diff --git a/string/string.h b/string/string.h
> > index 04e1b7067d..d965ca0eeb 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equals.
>
> typo: “are equal[].”
Fixed.
>
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   Used by compilers when memcmp return is only used for its bolean
> > +   value.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
>
> I think we should be more explicitly say that __memcmpeq is declared for
> use by compilers, programmers should use memcmp.

Added 2 sentences expressing the point.

>
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..9cc4750bbc 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
>
> Missing # indentation.

Fixed.

>
> Rest looks okay.  I have verified that this builds on all architectures.
Thanks. Was able to do the same.
>
> Thanks,
> Florian
>

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (6 preceding siblings ...)
  2021-09-28 16:57 ` [PATCH v1] " Noah Goldstein
@ 2021-09-29 15:17 ` Noah Goldstein
  2021-09-30 19:31   ` Noah Goldstein
                     ` (3 more replies)
  2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
                   ` (11 subsequent siblings)
  19 siblings, 4 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-29 15:17 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 94 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..5020be00e0 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index 04e1b7067d..d0b714f836 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..fe125e0904 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
@ 2021-09-30 19:31   ` Noah Goldstein
  2021-10-11  2:33   ` Noah Goldstein
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-09-30 19:31 UTC (permalink / raw)
  To: GNU C Library

On Wed, Sep 29, 2021 at 10:17 AM Noah Goldstein <goldstein.w.n@gmail.com>
wrote:

> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 94 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..5020be00e0 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index 04e1b7067d..d0b714f836 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n)
> __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..bc932eff2a 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..d61fca0f29 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..0194f8deab 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c
> b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..956fc8e601 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..18e225f963 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..4488e0eba4 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist
> b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S
> b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..e8b1b6c9bd 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..e4dde875bb 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..e60a62fc86 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..c7fe8047ca 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..4ab4a90496 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..b541978b5f 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..d4f84a5b6f 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..0942d32814 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..475fc45d3a 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S
> b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..edcc19915a 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist
> b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist
> b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist
> b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f41ae48006 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c
> b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..fe125e0904 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>
>
Is this good to push?

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
  2021-09-30 19:31   ` Noah Goldstein
@ 2021-10-11  2:33   ` Noah Goldstein
  2021-10-18 14:47     ` Noah Goldstein
  2021-10-21 19:28   ` H.J. Lu
  2021-10-21 19:33   ` Adhemerval Zanella
  3 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-11  2:33 UTC (permalink / raw)
  To: GNU C Library; +Cc: Carlos O'Donell, Florian Weimer, Joseph Myers

On Wed, Sep 29, 2021 at 10:17 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 94 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..5020be00e0 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index 04e1b7067d..d0b714f836 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..bc932eff2a 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..d61fca0f29 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..0194f8deab 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..956fc8e601 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..18e225f963 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..4488e0eba4 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..e8b1b6c9bd 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..e4dde875bb 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..e60a62fc86 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..c7fe8047ca 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..4ab4a90496 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..b541978b5f 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..d4f84a5b6f 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..0942d32814 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..475fc45d3a 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..edcc19915a 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f41ae48006 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..fe125e0904 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

Ping.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-11  2:33   ` Noah Goldstein
@ 2021-10-18 14:47     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-18 14:47 UTC (permalink / raw)
  To: GNU C Library; +Cc: Carlos O'Donell, Florian Weimer, Joseph Myers

On Sun, Oct 10, 2021 at 10:33 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Wed, Sep 29, 2021 at 10:17 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  2 ++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 94 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..5020be00e0 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index 04e1b7067d..d0b714f836 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..bc932eff2a 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..d61fca0f29 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..0194f8deab 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..956fc8e601 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..18e225f963 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..4488e0eba4 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..e8b1b6c9bd 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..e4dde875bb 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..e60a62fc86 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..c7fe8047ca 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..4ab4a90496 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..b541978b5f 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..d4f84a5b6f 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..0942d32814 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..475fc45d3a 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..edcc19915a 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..f41ae48006 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..fe125e0904 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
> Ping.
Ping2.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
  2021-09-30 19:31   ` Noah Goldstein
  2021-10-11  2:33   ` Noah Goldstein
@ 2021-10-21 19:28   ` H.J. Lu
  2021-10-21 19:58     ` Noah Goldstein
  2021-10-21 19:33   ` Adhemerval Zanella
  3 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 19:28 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha

On Wed, Sep 29, 2021 at 10:17:43AM -0500, GNU C Library wrote:
> No bug.
> 
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
> 
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
> 
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
> 
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 94 insertions(+)
> 
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..5020be00e0 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index 04e1b7067d..d0b714f836 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>  
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));

Please add an internal one in include/string.h so that it can be called 
within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
can be used and use it.

Thanks.

> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
>  }
>  
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>  
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>  
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..bc932eff2a 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..d61fca0f29 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>  	br	.L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..0194f8deab 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..956fc8e601 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..18e225f963 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..4488e0eba4 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>  
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..e8b1b6c9bd 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..e4dde875bb 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>  
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..e60a62fc86 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>  
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..c7fe8047ca 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..4ab4a90496 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..b541978b5f 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..d4f84a5b6f 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..0942d32814 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
>  
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..475fc45d3a 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>  		      })
>  		      )
>  weak_alias (memcmp, bcmp);
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..edcc19915a 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f41ae48006 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..fe125e0904 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
                     ` (2 preceding siblings ...)
  2021-10-21 19:28   ` H.J. Lu
@ 2021-10-21 19:33   ` Adhemerval Zanella
  2021-10-21 20:01     ` Noah Goldstein
  3 siblings, 1 reply; 106+ messages in thread
From: Adhemerval Zanella @ 2021-10-21 19:33 UTC (permalink / raw)
  To: Noah Goldstein, libc-alpha



On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
> No bug.
> 
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
> 
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
> 
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
> 

Should we export memcmpeq() as a GNU extension as well?

> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.

This patch requires a NEWS entry for the new symbol and most likely
a manual entry to describe its semantic. 

I also think we should model a new testing based on test-memcmp.c
to check for multiple alignments and random inputs.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 19:28   ` H.J. Lu
@ 2021-10-21 19:58     ` Noah Goldstein
  2021-10-21 20:00       ` H.J. Lu
  2021-10-21 20:02       ` Adhemerval Zanella
  0 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 19:58 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

On Thu, Oct 21, 2021 at 2:28 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Sep 29, 2021 at 10:17:43AM -0500, GNU C Library wrote:
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  2 ++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 94 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..5020be00e0 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index 04e1b7067d..d0b714f836 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
>
> Please add an internal one in include/string.h so that it can be called
> within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
> can be used and use it.

Usage outside of a test? It is currently used directly in string/tester.c

>
> Thanks.
>
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);      /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..bc932eff2a 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..d61fca0f29 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >       br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..0194f8deab 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..956fc8e601 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..18e225f963 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..4488e0eba4 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..e8b1b6c9bd 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..e4dde875bb 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..e60a62fc86 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..c7fe8047ca 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..4ab4a90496 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..b541978b5f 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..d4f84a5b6f 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..0942d32814 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..475fc45d3a 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                     })
> >                     )
> >  weak_alias (memcmp, bcmp);
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..edcc19915a 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..f41ae48006 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..fe125e0904 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 19:58     ` Noah Goldstein
@ 2021-10-21 20:00       ` H.J. Lu
  2021-10-21 21:04         ` Noah Goldstein
  2021-10-21 20:02       ` Adhemerval Zanella
  1 sibling, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 20:00 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library

On Thu, Oct 21, 2021 at 12:58 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 2:28 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Wed, Sep 29, 2021 at 10:17:43AM -0500, GNU C Library wrote:
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> > > ---
> > >  string/Versions                                  |  3 +++
> > >  string/memcmp.c                                  |  2 ++
> > >  string/string.h                                  | 16 ++++++++++++++++
> > >  string/tester.c                                  | 16 ++++++++++++++++
> > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > >  sysdeps/i386/memcmp.S                            |  2 ++
> > >  sysdeps/ia64/memcmp.S                            |  1 +
> > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > >  sysdeps/s390/memcmp.c                            |  1 +
> > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > >  sysdeps/x86_64/memcmp.S                          |  2 ++
> > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > >  55 files changed, 94 insertions(+)
> > >
> > > diff --git a/string/Versions b/string/Versions
> > > index 298ecd401a..864c4cf7a4 100644
> > > --- a/string/Versions
> > > +++ b/string/Versions
> > > @@ -89,4 +89,7 @@ libc {
> > >      sigdescr_np; sigabbrev_np;
> > >      strerrordesc_np; strerrorname_np;
> > >    }
> > > +  GLIBC_2.35 {
> > > +    __memcmpeq;
> > > +  }
> > >  }
> > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > index 9b46d7a905..5020be00e0 100644
> > > --- a/string/memcmp.c
> > > +++ b/string/memcmp.c
> > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > >  #ifdef weak_alias
> > >  # undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +# undef __memcmpeq
> > > +weak_alias (memcmp, __memcmpeq)
> > >  #endif
> > > diff --git a/string/string.h b/string/string.h
> > > index 04e1b7067d..d0b714f836 100644
> > > --- a/string/string.h
> > > +++ b/string/string.h
> > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > >
> > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > +   Return some non-zero value otherwise.
> > > +
> > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > +   except the return value is less constrained.  memcmp is always a
> > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > +   or bcmp are correct implementations.
> > > +
> > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > +   only used for its bolean value.
> > > +
> > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > +   continue to use memcmp.  */
> > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > Please add an internal one in include/string.h so that it can be called
> > within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
> > can be used and use it.
>
> Usage outside of a test? It is currently used directly in string/tester.c
>

A standalone test, which can test all IFUNC implementations, is needed.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 19:33   ` Adhemerval Zanella
@ 2021-10-21 20:01     ` Noah Goldstein
  2021-10-21 20:06       ` Adhemerval Zanella
  2021-10-21 20:07       ` H.J. Lu
  0 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 20:01 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: GNU C Library

On Thu, Oct 21, 2021 at 2:33 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
>
> Should we export memcmpeq() as a GNU extension as well?
>
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
>
> This patch requires a NEWS entry for the new symbol and most likely
> a manual entry to describe its semantic.

My understanding is that since we are only exporting this symbol for
compiler use (to optimize boolean use of 'memcmp()') we weren't
planning to add a manual entry.

>
> I also think we should model a new testing based on test-memcmp.c
> to check for multiple alignments and random inputs.

In this patch __memcmpeq is always just memcmp which is tested.

In my followup patch (once this one gets through) to add separate
implementations for x86_64 I add tests. Would it be better to include
those tests in this patchset?

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 19:58     ` Noah Goldstein
  2021-10-21 20:00       ` H.J. Lu
@ 2021-10-21 20:02       ` Adhemerval Zanella
  2021-10-21 20:23         ` Noah Goldstein
  1 sibling, 1 reply; 106+ messages in thread
From: Adhemerval Zanella @ 2021-10-21 20:02 UTC (permalink / raw)
  To: Noah Goldstein, H.J. Lu; +Cc: GNU C Library

>>> diff --git a/string/string.h b/string/string.h
>>> index 04e1b7067d..d0b714f836 100644
>>> --- a/string/string.h
>>> +++ b/string/string.h
>>> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>>>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>>>       __THROW __attribute_pure__ __nonnull ((1, 2));
>>>
>>> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
>>> +   Return some non-zero value otherwise.
>>> +
>>> +   Essentially __memcmpeq has the exact same semantics as memcmp
>>> +   except the return value is less constrained.  memcmp is always a
>>> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
>>> +   or bcmp are correct implementations.
>>> +
>>> +   __memcmpeq is meant to be used by compilers when memcmp return is
>>> +   only used for its bolean value.
>>> +
>>> +   __memcmpeq is declared only for use by compilers.  Programs should
>>> +   continue to use memcmp.  */
>>> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
>>> +     __THROW __attribute_pure__ __nonnull ((1, 2));
>>
>> Please add an internal one in include/string.h so that it can be called
>> within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
>> can be used and use it.
> 
> Usage outside of a test? It is currently used directly in string/tester.c


Add a libc_hidden_proto on include/string.h and a libc_hidden_def on
each implementation to create a local alias that bypass PLT if we
eventually need to call it from within glibc.


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:01     ` Noah Goldstein
@ 2021-10-21 20:06       ` Adhemerval Zanella
  2021-10-21 21:18         ` Florian Weimer
  2021-10-21 20:07       ` H.J. Lu
  1 sibling, 1 reply; 106+ messages in thread
From: Adhemerval Zanella @ 2021-10-21 20:06 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library



On 21/10/2021 17:01, Noah Goldstein wrote:
> On Thu, Oct 21, 2021 at 2:33 PM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>>
>>
>> On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
>>> No bug.
>>>
>>> This commit adds support for __memcmpeq() as a new ABI for all
>>> targets. In this commit __memcmpeq() is implemented only as an alias
>>> to the corresponding targets memcmp() implementation. __memcmpeq() is
>>> added as a new symbol starting with GLIBC_2.35 and defined in string.h
>>> with comments explaining its behavior. Basic tests that it is callable
>>> and works where added in string/tester.c
>>>
>>> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
>>> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
>>> is shares the same specifications as memcmp() except the return value
>>> for non-equal byte sequences is any non-zero value. This is less
>>> strict than memcmp()'s return value specification and can be better
>>> optimized when a boolean return is all that is needed.
>>>
>>> __memcmpeq() is meant to only be called by compilers if they can prove
>>> that the return value of a memcmp() call is only used for its boolean
>>> value.
>>>
>>
>> Should we export memcmpeq() as a GNU extension as well?
>>
>>> All tests in string/tester.c passed. As well build succeeds on
>>> x86_64-linux-gnu target.
>>
>> This patch requires a NEWS entry for the new symbol and most likely
>> a manual entry to describe its semantic.
> 
> My understanding is that since we are only exporting this symbol for
> compiler use (to optimize boolean use of 'memcmp()') we weren't
> planning to add a manual entry.

But you are exporting the double underscore symbol on an installed
header, so it would be visible to users as well.

I wonder if it would be better to only export 'memcmpeq' as a
GNU extension on string.h and '__memcmpeq' as a global symbol
without a prototype (so only compiler generated objects will have
bindings to '__memcmpeq').

> 
>>
>> I also think we should model a new testing based on test-memcmp.c
>> to check for multiple alignments and random inputs.
> 
> In this patch __memcmpeq is always just memcmp which is tested.
> 
> In my followup patch (once this one gets through) to add separate
> implementations for x86_64 I add tests. Would it be better to include
> those tests in this patchset?
> 

Right, in this patch or in subsequent patch is fine. 

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:01     ` Noah Goldstein
  2021-10-21 20:06       ` Adhemerval Zanella
@ 2021-10-21 20:07       ` H.J. Lu
  2021-10-21 20:11         ` Noah Goldstein
  1 sibling, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 20:07 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: Adhemerval Zanella, GNU C Library

On Thu, Oct 21, 2021 at 1:02 PM Noah Goldstein via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Thu, Oct 21, 2021 at 2:33 PM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
> >
> >
> >
> > On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> >
> > Should we export memcmpeq() as a GNU extension as well?
> >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> >
> > This patch requires a NEWS entry for the new symbol and most likely
> > a manual entry to describe its semantic.
>
> My understanding is that since we are only exporting this symbol for
> compiler use (to optimize boolean use of 'memcmp()') we weren't
> planning to add a manual entry.
>
> >
> > I also think we should model a new testing based on test-memcmp.c
> > to check for multiple alignments and random inputs.
>
> In this patch __memcmpeq is always just memcmp which is tested.
>
> In my followup patch (once this one gets through) to add separate
> implementations for x86_64 I add tests. Would it be better to include
> those tests in this patchset?

I think we should add it now since someone can add IFUNC for
a non x86-64 target before x86-64 one is landed.

With __memcmpeq, bcmp should be an alias of __memcmpeq,
not memcmp.

--
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:07       ` H.J. Lu
@ 2021-10-21 20:11         ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 20:11 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Adhemerval Zanella, GNU C Library

On Thu, Oct 21, 2021 at 3:07 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 1:02 PM Noah Goldstein via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
> >
> > On Thu, Oct 21, 2021 at 2:33 PM Adhemerval Zanella
> > <adhemerval.zanella@linaro.org> wrote:
> > >
> > >
> > >
> > > On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
> > > > No bug.
> > > >
> > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > with comments explaining its behavior. Basic tests that it is callable
> > > > and works where added in string/tester.c
> > > >
> > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > is shares the same specifications as memcmp() except the return value
> > > > for non-equal byte sequences is any non-zero value. This is less
> > > > strict than memcmp()'s return value specification and can be better
> > > > optimized when a boolean return is all that is needed.
> > > >
> > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > that the return value of a memcmp() call is only used for its boolean
> > > > value.
> > > >
> > >
> > > Should we export memcmpeq() as a GNU extension as well?
> > >
> > > > All tests in string/tester.c passed. As well build succeeds on
> > > > x86_64-linux-gnu target.
> > >
> > > This patch requires a NEWS entry for the new symbol and most likely
> > > a manual entry to describe its semantic.
> >
> > My understanding is that since we are only exporting this symbol for
> > compiler use (to optimize boolean use of 'memcmp()') we weren't
> > planning to add a manual entry.
> >
> > >
> > > I also think we should model a new testing based on test-memcmp.c
> > > to check for multiple alignments and random inputs.
> >
> > In this patch __memcmpeq is always just memcmp which is tested.
> >
> > In my followup patch (once this one gets through) to add separate
> > implementations for x86_64 I add tests. Would it be better to include
> > those tests in this patchset?
>
> I think we should add it now since someone can add IFUNC for
> a non x86-64 target before x86-64 one is landed.

Got it.

>
> With __memcmpeq, bcmp should be an alias of __memcmpeq,
> not memcmp.

I think we had some concerns that since 'bcmp' had aliased 'memcmp'
for so long users may have started relying on the -/+/= behavior.

>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:02       ` Adhemerval Zanella
@ 2021-10-21 20:23         ` Noah Goldstein
  2021-10-21 20:26           ` Adhemerval Zanella
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 20:23 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: H.J. Lu, GNU C Library

On Thu, Oct 21, 2021 at 3:02 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> >>> diff --git a/string/string.h b/string/string.h
> >>> index 04e1b7067d..d0b714f836 100644
> >>> --- a/string/string.h
> >>> +++ b/string/string.h
> >>> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >>>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >>>       __THROW __attribute_pure__ __nonnull ((1, 2));
> >>>
> >>> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> >>> +   Return some non-zero value otherwise.
> >>> +
> >>> +   Essentially __memcmpeq has the exact same semantics as memcmp
> >>> +   except the return value is less constrained.  memcmp is always a
> >>> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> >>> +   or bcmp are correct implementations.
> >>> +
> >>> +   __memcmpeq is meant to be used by compilers when memcmp return is
> >>> +   only used for its bolean value.
> >>> +
> >>> +   __memcmpeq is declared only for use by compilers.  Programs should
> >>> +   continue to use memcmp.  */
> >>> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> >>> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> >>
> >> Please add an internal one in include/string.h so that it can be called
> >> within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
> >> can be used and use it.
> >
> > Usage outside of a test? It is currently used directly in string/tester.c
>
>
> Add a libc_hidden_proto on include/string.h and a libc_hidden_def on
> each implementation to create a local alias that bypass PLT if we
> eventually need to call it from within glibc.

Does each place this patch does 'weak_alias(memcmp, __memcmpeq)`
need a 'libc_hidden_def' for '__memcmpeq'?
>

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:23         ` Noah Goldstein
@ 2021-10-21 20:26           ` Adhemerval Zanella
  0 siblings, 0 replies; 106+ messages in thread
From: Adhemerval Zanella @ 2021-10-21 20:26 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: H.J. Lu, GNU C Library



On 21/10/2021 17:23, Noah Goldstein wrote:
> On Thu, Oct 21, 2021 at 3:02 PM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>>>>> diff --git a/string/string.h b/string/string.h
>>>>> index 04e1b7067d..d0b714f836 100644
>>>>> --- a/string/string.h
>>>>> +++ b/string/string.h
>>>>> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>>>>>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>>>>>       __THROW __attribute_pure__ __nonnull ((1, 2));
>>>>>
>>>>> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
>>>>> +   Return some non-zero value otherwise.
>>>>> +
>>>>> +   Essentially __memcmpeq has the exact same semantics as memcmp
>>>>> +   except the return value is less constrained.  memcmp is always a
>>>>> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
>>>>> +   or bcmp are correct implementations.
>>>>> +
>>>>> +   __memcmpeq is meant to be used by compilers when memcmp return is
>>>>> +   only used for its bolean value.
>>>>> +
>>>>> +   __memcmpeq is declared only for use by compilers.  Programs should
>>>>> +   continue to use memcmp.  */
>>>>> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
>>>>> +     __THROW __attribute_pure__ __nonnull ((1, 2));
>>>>
>>>> Please add an internal one in include/string.h so that it can be called
>>>> within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
>>>> can be used and use it.
>>>
>>> Usage outside of a test? It is currently used directly in string/tester.c
>>
>>
>> Add a libc_hidden_proto on include/string.h and a libc_hidden_def on
>> each implementation to create a local alias that bypass PLT if we
>> eventually need to call it from within glibc.
> 
> Does each place this patch does 'weak_alias(memcmp, __memcmpeq)`
> need a 'libc_hidden_def' for '__memcmpeq'?

Yes, it might not generate regression, but it will once we start to call
__memcmpeq internally (which compiler might generate eventually).

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:00       ` H.J. Lu
@ 2021-10-21 21:04         ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 21:04 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

On Thu, Oct 21, 2021 at 3:01 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 12:58 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Thu, Oct 21, 2021 at 2:28 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Wed, Sep 29, 2021 at 10:17:43AM -0500, GNU C Library wrote:
> > > > No bug.
> > > >
> > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > with comments explaining its behavior. Basic tests that it is callable
> > > > and works where added in string/tester.c
> > > >
> > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > is shares the same specifications as memcmp() except the return value
> > > > for non-equal byte sequences is any non-zero value. This is less
> > > > strict than memcmp()'s return value specification and can be better
> > > > optimized when a boolean return is all that is needed.
> > > >
> > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > that the return value of a memcmp() call is only used for its boolean
> > > > value.
> > > >
> > > > All tests in string/tester.c passed. As well build succeeds on
> > > > x86_64-linux-gnu target.
> > > > ---
> > > >  string/Versions                                  |  3 +++
> > > >  string/memcmp.c                                  |  2 ++
> > > >  string/string.h                                  | 16 ++++++++++++++++
> > > >  string/tester.c                                  | 16 ++++++++++++++++
> > > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > > >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> > > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > > >  sysdeps/i386/memcmp.S                            |  2 ++
> > > >  sysdeps/ia64/memcmp.S                            |  1 +
> > > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > > >  sysdeps/s390/memcmp.c                            |  1 +
> > > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > > >  sysdeps/x86_64/memcmp.S                          |  2 ++
> > > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > > >  55 files changed, 94 insertions(+)
> > > >
> > > > diff --git a/string/Versions b/string/Versions
> > > > index 298ecd401a..864c4cf7a4 100644
> > > > --- a/string/Versions
> > > > +++ b/string/Versions
> > > > @@ -89,4 +89,7 @@ libc {
> > > >      sigdescr_np; sigabbrev_np;
> > > >      strerrordesc_np; strerrorname_np;
> > > >    }
> > > > +  GLIBC_2.35 {
> > > > +    __memcmpeq;
> > > > +  }
> > > >  }
> > > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > > index 9b46d7a905..5020be00e0 100644
> > > > --- a/string/memcmp.c
> > > > +++ b/string/memcmp.c
> > > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > > >  #ifdef weak_alias
> > > >  # undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +# undef __memcmpeq
> > > > +weak_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > > diff --git a/string/string.h b/string/string.h
> > > > index 04e1b7067d..d0b714f836 100644
> > > > --- a/string/string.h
> > > > +++ b/string/string.h
> > > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > > >
> > > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > > +   Return some non-zero value otherwise.
> > > > +
> > > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > > +   except the return value is less constrained.  memcmp is always a
> > > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > > +   or bcmp are correct implementations.
> > > > +
> > > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > > +   only used for its bolean value.
> > > > +
> > > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > > +   continue to use memcmp.  */
> > > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > >
> > > Please add an internal one in include/string.h so that it can be called
> > > within libc.so bypassing PLT.  Find one place in glibc where __memcmpeq
> > > can be used and use it.
> >
> > Usage outside of a test? It is currently used directly in string/tester.c
> >
>
> A standalone test, which can test all IFUNC implementations, is needed.

I added a test-memcmpeq.c file but it doesn't go through all the ifunc versions
available. I.e on x86_64 the output of test-memcmpeq.out is:

```
                        __memcmpeq simple_memcmp
```

whereas test-memcmp.out is:

```
                        simple_memcmp __memcmp_avx2_movbe
__memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
```

Is there something else I need to be adding in addition to the
weak_alias / hidden def to run all of the ifunc variations?

>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 20:06       ` Adhemerval Zanella
@ 2021-10-21 21:18         ` Florian Weimer
  0 siblings, 0 replies; 106+ messages in thread
From: Florian Weimer @ 2021-10-21 21:18 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> On 21/10/2021 17:01, Noah Goldstein wrote:
>> My understanding is that since we are only exporting this symbol for
>> compiler use (to optimize boolean use of 'memcmp()') we weren't
>> planning to add a manual entry.
>
> But you are exporting the double underscore symbol on an installed
> header, so it would be visible to users as well.

The advantage of exporting it is that GCC can perform the memcmp →
__memcmpeq if and only if a suitable declaration of __memcmpeq is in
scope.

Maybe we could add #pragma GCC poison for __memcmpeq.  Or add a new
pragma to enable the transformation.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (7 preceding siblings ...)
  2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
@ 2021-10-21 22:38 ` Noah Goldstein
  2021-10-21 22:38   ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                     ` (2 more replies)
  2021-10-22  5:49 ` [PATCH v9 " Noah Goldstein
                   ` (10 subsequent siblings)
  19 siblings, 3 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 22:38 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 94 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..5020be00e0 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..bc932eff2a 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..d61fca0f29 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..0194f8deab 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..956fc8e601 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..18e225f963 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..4488e0eba4 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..e8b1b6c9bd 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..e4dde875bb 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..e60a62fc86 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..c7fe8047ca 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..4ab4a90496 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..b541978b5f 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..d4f84a5b6f 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..0942d32814 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+weak_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..475fc45d3a 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+weak_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..edcc19915a 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f41ae48006 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..fe125e0904 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+weak_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
@ 2021-10-21 22:38   ` Noah Goldstein
  2021-10-21 22:52     ` H.J. Lu
  2021-10-21 22:38   ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
  2021-10-21 22:50   ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  2 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 22:38 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 5020be00e0..ecffc1d34a 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index bc932eff2a..318124a4fd 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index d61fca0f29..f4179769d2 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)    
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 0194f8deab..b61fba2be1 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 956fc8e601..575471f1ec 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 18e225f963..2802da7833 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 4488e0eba4..ae4be49a64 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index e8b1b6c9bd..61949db62f 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index e4dde875bb..e7e2ab13b5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index e60a62fc86..2047f70e82 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index c7fe8047ca..ed682a6303 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index 4ab4a90496..01cbed80df 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index b541978b5f..aaf1a36263 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index d4f84a5b6f..520c31a6b1 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 0942d32814..c10fdb27fa 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 475fc45d3a..c381e038e2 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index edcc19915a..7ecee3281f 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index f41ae48006..5f4a09d5a4 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe125e0904..427a1a9ede 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 weak_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v8 3/3] String: Add tests for __memcmpeq
  2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
  2021-10-21 22:38   ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-21 22:38   ` Noah Goldstein
  2021-10-21 22:57     ` H.J. Lu
  2021-10-21 22:50   ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  2 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 22:38 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
Note at the momement for test-memcmpeq.c the
tests only appear to do the generic versions.

For example on x86_64 the output of test-memcmpeq.out is:


```
                        __memcmpeq simple_memcmp
```

whereas test-memcmp.out is:

```
                        simple_memcmp __memcmp_avx2_movbe
__memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
```

So the test is not going through all available ifuncs. I'm not
sure if this is expected or indicates a bug in the previous
patches adding support for __memcmpeq.

 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 27 ++++++++++++++++++---------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 41 insertions(+), 11 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..e1f07cab58 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,6 +38,7 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
 simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
@@ -48,8 +52,11 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+# else
+#  define MEMCMP memcmp
+# endif
 # define MEMCPY memcpy
 # define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
@@ -69,6 +76,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +92,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +197,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
  2021-10-21 22:38   ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
  2021-10-21 22:38   ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-21 22:50   ` H.J. Lu
  2021-10-21 23:42     ` Noah Goldstein
  2 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 22:50 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 3:38 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 94 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..5020be00e0 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..bc932eff2a 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)

Can we use strong_alias for __memcmpeq?

>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..d61fca0f29 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..0194f8deab 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..956fc8e601 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..18e225f963 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..4488e0eba4 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..e8b1b6c9bd 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..e4dde875bb 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..e60a62fc86 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..c7fe8047ca 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..4ab4a90496 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..b541978b5f 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..d4f84a5b6f 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..0942d32814 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +weak_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..475fc45d3a 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +weak_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..edcc19915a 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f41ae48006 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..fe125e0904 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +weak_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 22:38   ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-21 22:52     ` H.J. Lu
  2021-10-21 23:08       ` Joseph Myers
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 22:52 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 3:39 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds hidden defs for all declarations of __memcmpeq. This
> enables usage of __memcmpeq without the PLT for usage internal to
> GLIBC.
> ---
>  include/string.h                              | 1 +
>  string/memcmp.c                               | 1 +
>  sysdeps/aarch64/memcmp.S                      | 1 +
>  sysdeps/csky/abiv2/memcmp.S                   | 1 +
>  sysdeps/i386/i686/memcmp.S                    | 1 +
>  sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
>  sysdeps/i386/memcmp.S                         | 1 +
>  sysdeps/ia64/memcmp.S                         | 1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
>  sysdeps/s390/memcmp-z900.S                    | 1 +
>  sysdeps/s390/memcmp.c                         | 1 +
>  sysdeps/sparc/sparc64/memcmp.S                | 1 +
>  sysdeps/x86_64/memcmp.S                       | 1 +
>  sysdeps/x86_64/multiarch/memcmp.c             | 1 +
>  20 files changed, 20 insertions(+)
>
> diff --git a/include/string.h b/include/string.h
> index 81dab39891..21f641a413 100644
> --- a/include/string.h
> +++ b/include/string.h
> @@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
>  libc_hidden_proto (__strsep_g)
>  libc_hidden_proto (strnlen)
>  libc_hidden_proto (__strnlen)
> +libc_hidden_proto (__memcmpeq)
>  libc_hidden_proto (memmem)
>  extern __typeof (memmem) __memmem;
>  libc_hidden_proto (__memmem)

There are many memcmp calls in ld.so.   I think most, if not all, of them
can be changed to __memcmpeq.   Can you make another patch to do
that?

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 3/3] String: Add tests for __memcmpeq
  2021-10-21 22:38   ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-21 22:57     ` H.J. Lu
  2021-10-21 23:47       ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 22:57 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 3:40 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds tests for the new function __memcmpeq. The new tests
> use the existing tests in 'test-memcmp.c' but relax the result
> requirement to only check for zero or non-zero returns.
>
> All string tests include test-memcmpeq are passing.
> ---
> Note at the momement for test-memcmpeq.c the
> tests only appear to do the generic versions.
>
> For example on x86_64 the output of test-memcmpeq.out is:
>
>
> ```
>                         __memcmpeq simple_memcmp
> ```
>
> whereas test-memcmp.out is:
>
> ```
>                         simple_memcmp __memcmp_avx2_movbe
> __memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
> ```
>
> So the test is not going through all available ifuncs. I'm not
> sure if this is expected or indicates a bug in the previous
> patches adding support for __memcmpeq.
>

This doesn't look right.  If __memcmpeq is a true alias of memcmp, you
should only have simple_memcmpeq and __memcmpeq.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 22:52     ` H.J. Lu
@ 2021-10-21 23:08       ` Joseph Myers
  2021-10-21 23:10         ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph Myers @ 2021-10-21 23:08 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Noah Goldstein, GNU C Library

On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:

> There are many memcmp calls in ld.so.   I think most, if not all, of them
> can be changed to __memcmpeq.   Can you make another patch to do
> that?

Rather than doing that micro-optimization in the glibc sources, I think 
it's better to add the relevant feature to GCC and let glibc get optimized 
when built with a new-enough compiler.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:08       ` Joseph Myers
@ 2021-10-21 23:10         ` H.J. Lu
  2021-10-21 23:14           ` Joseph Myers
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-21 23:10 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Noah Goldstein, GNU C Library

On Thu, Oct 21, 2021 at 4:08 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
>
> > There are many memcmp calls in ld.so.   I think most, if not all, of them
> > can be changed to __memcmpeq.   Can you make another patch to do
> > that?
>
> Rather than doing that micro-optimization in the glibc sources, I think
> it's better to add the relevant feature to GCC and let glibc get optimized
> when built with a new-enough compiler.
>

Why not? We don't know when __memcmpeq will be supported by GCC
used by glibc developers.   If we don't even use it in glibc, why bother?


--
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:10         ` H.J. Lu
@ 2021-10-21 23:14           ` Joseph Myers
  2021-10-21 23:39             ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph Myers @ 2021-10-21 23:14 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:

> On Thu, Oct 21, 2021 at 4:08 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
> >
> > > There are many memcmp calls in ld.so.   I think most, if not all, of them
> > > can be changed to __memcmpeq.   Can you make another patch to do
> > > that?
> >
> > Rather than doing that micro-optimization in the glibc sources, I think
> > it's better to add the relevant feature to GCC and let glibc get optimized
> > when built with a new-enough compiler.
> 
> Why not? We don't know when __memcmpeq will be supported by GCC
> used by glibc developers.   If we don't even use it in glibc, why bother?

The point of this function is entirely for compilers to generate for calls 
from memcmp, not for humans to write direct calls to.

The compiler knows other semantics of memcmp (it might sometimes expand a 
memcmp with a small fixed size inline, for example).  So changing to a 
direct call to __memcmpeq by hand isn't even always an optimization; it 
seems better to leave the semantics visible to the compiler.  Note that in 
other cases we've generally moved *towards* relying on built-in functions 
rather than having our own local inline expansions of those or calls to 
internal names for those functions (we've done that for calls to various 
functions in libm, for example).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:14           ` Joseph Myers
@ 2021-10-21 23:39             ` Noah Goldstein
  2021-10-21 23:45               ` Noah Goldstein
  2021-10-22  0:18               ` Joseph Myers
  0 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 23:39 UTC (permalink / raw)
  To: Joseph Myers; +Cc: H.J. Lu, GNU C Library

On Thu, Oct 21, 2021 at 6:15 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
>
> > On Thu, Oct 21, 2021 at 4:08 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > >
> > > On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
> > >
> > > > There are many memcmp calls in ld.so.   I think most, if not all, of them
> > > > can be changed to __memcmpeq.   Can you make another patch to do
> > > > that?
> > >
> > > Rather than doing that micro-optimization in the glibc sources, I think
> > > it's better to add the relevant feature to GCC and let glibc get optimized
> > > when built with a new-enough compiler.
> >
> > Why not? We don't know when __memcmpeq will be supported by GCC
> > used by glibc developers.   If we don't even use it in glibc, why bother?
>
> The point of this function is entirely for compilers to generate for calls
> from memcmp, not for humans to write direct calls to.
>
> The compiler knows other semantics of memcmp (it might sometimes expand a
> memcmp with a small fixed size inline, for example).  So changing to a
> direct call to __memcmpeq by hand isn't even always an optimization; it
> seems better to leave the semantics visible to the compiler.  Note that in
> other cases we've generally moved *towards* relying on built-in functions
> rather than having our own local inline expansions of those or calls to
> internal names for those functions (we've done that for calls to various
> functions in libm, for example).

I have gone through all non-test .c files in GLIBC and replaced memcmp
with __memcmpeq where it makes sense. I can post that as a separate
patchset and we can decide whether it's a good idea there.

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 22:50   ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
@ 2021-10-21 23:42     ` Noah Goldstein
  2021-10-22  2:38       ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 23:42 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 3:38 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  2 ++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 94 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..5020be00e0 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..bc932eff2a 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
>
> Can we use strong_alias for __memcmpeq?

Think we can but not sure if its needed or we should.
>
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..d61fca0f29 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..0194f8deab 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..956fc8e601 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..18e225f963 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..4488e0eba4 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..e8b1b6c9bd 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..e4dde875bb 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..e60a62fc86 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..c7fe8047ca 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..4ab4a90496 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..b541978b5f 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..d4f84a5b6f 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..0942d32814 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..475fc45d3a 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +weak_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..edcc19915a 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..f41ae48006 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..fe125e0904 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +weak_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:39             ` Noah Goldstein
@ 2021-10-21 23:45               ` Noah Goldstein
  2021-10-22  0:19                 ` Joseph Myers
  2021-10-22  0:18               ` Joseph Myers
  1 sibling, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 23:45 UTC (permalink / raw)
  To: Joseph Myers; +Cc: H.J. Lu, GNU C Library

On Thu, Oct 21, 2021 at 6:39 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 6:15 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
> >
> > > On Thu, Oct 21, 2021 at 4:08 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > >
> > > > On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:
> > > >
> > > > > There are many memcmp calls in ld.so.   I think most, if not all, of them
> > > > > can be changed to __memcmpeq.   Can you make another patch to do
> > > > > that?
> > > >
> > > > Rather than doing that micro-optimization in the glibc sources, I think
> > > > it's better to add the relevant feature to GCC and let glibc get optimized
> > > > when built with a new-enough compiler.
> > >
> > > Why not? We don't know when __memcmpeq will be supported by GCC
> > > used by glibc developers.   If we don't even use it in glibc, why bother?
> >
> > The point of this function is entirely for compilers to generate for calls
> > from memcmp, not for humans to write direct calls to.
> >
> > The compiler knows other semantics of memcmp (it might sometimes expand a
> > memcmp with a small fixed size inline, for example).  So changing to a
> > direct call to __memcmpeq by hand isn't even always an optimization;
Will compilers not implement the same optimization for __memcmpeq?
> it
> > seems better to leave the semantics visible to the compiler.  Note that in
> > other cases we've generally moved *towards* relying on built-in functions
> > rather than having our own local inline expansions of those or calls to
> > internal names for those functions (we've done that for calls to various
> > functions in libm, for example).
>
> I have gone through all non-test .c files in GLIBC and replaced memcmp
> with __memcmpeq where it makes sense. I can post that as a separate
> patchset and we can decide whether it's a good idea there.
>
> >
> > --
> > Joseph S. Myers
> > joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 3/3] String: Add tests for __memcmpeq
  2021-10-21 22:57     ` H.J. Lu
@ 2021-10-21 23:47       ` Noah Goldstein
  2021-10-22  0:41         ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-21 23:47 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 5:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 3:40 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds tests for the new function __memcmpeq. The new tests
> > use the existing tests in 'test-memcmp.c' but relax the result
> > requirement to only check for zero or non-zero returns.
> >
> > All string tests include test-memcmpeq are passing.
> > ---
> > Note at the momement for test-memcmpeq.c the
> > tests only appear to do the generic versions.
> >
> > For example on x86_64 the output of test-memcmpeq.out is:
> >
> >
> > ```
> >                         __memcmpeq simple_memcmp
> > ```
> >
> > whereas test-memcmp.out is:
> >
> > ```
> >                         simple_memcmp __memcmp_avx2_movbe
> > __memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
> > ```
> >
> > So the test is not going through all available ifuncs. I'm not
> > sure if this is expected or indicates a bug in the previous
> > patches adding support for __memcmpeq.
> >
>
> This doesn't look right.  If __memcmpeq is a true alias of memcmp, you
> should only have simple_memcmpeq and __memcmpeq.

Figured. Any idea what the issue might be?

>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:39             ` Noah Goldstein
  2021-10-21 23:45               ` Noah Goldstein
@ 2021-10-22  0:18               ` Joseph Myers
  1 sibling, 0 replies; 106+ messages in thread
From: Joseph Myers @ 2021-10-22  0:18 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library

On Thu, 21 Oct 2021, Noah Goldstein via Libc-alpha wrote:

> I have gone through all non-test .c files in GLIBC and replaced memcmp
> with __memcmpeq where it makes sense. I can post that as a separate
> patchset and we can decide whether it's a good idea there.

I think it's a bad idea - it obfuscates the source code and it's better 
just to call the standard function, leave the code more readable and let 
the compiler optimize it as appropriate.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-21 23:45               ` Noah Goldstein
@ 2021-10-22  0:19                 ` Joseph Myers
  2021-10-22  0:40                   ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph Myers @ 2021-10-22  0:19 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library

On Thu, 21 Oct 2021, Noah Goldstein via Libc-alpha wrote:

> > > The compiler knows other semantics of memcmp (it might sometimes expand a
> > > memcmp with a small fixed size inline, for example).  So changing to a
> > > direct call to __memcmpeq by hand isn't even always an optimization;
> Will compilers not implement the same optimization for __memcmpeq?

Why should they?  It's intended as an ABI, not an API - that is, an 
alternative assembler name the compiler name generate calls to, not a 
function for which it should find calls in its input.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22  0:19                 ` Joseph Myers
@ 2021-10-22  0:40                   ` H.J. Lu
  2021-10-25 16:41                     ` Joseph Myers
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22  0:40 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Noah Goldstein, GNU C Library

On Thu, Oct 21, 2021 at 5:19 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 21 Oct 2021, Noah Goldstein via Libc-alpha wrote:
>
> > > > The compiler knows other semantics of memcmp (it might sometimes expand a
> > > > memcmp with a small fixed size inline, for example).  So changing to a
> > > > direct call to __memcmpeq by hand isn't even always an optimization;
> > Will compilers not implement the same optimization for __memcmpeq?
>
> Why should they?  It's intended as an ABI, not an API - that is, an
> alternative assembler name the compiler name generate calls to, not a
> function for which it should find calls in its input.
>

Compiler builtin optimization doesn't work well for glibc:

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


-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 3/3] String: Add tests for __memcmpeq
  2021-10-21 23:47       ` Noah Goldstein
@ 2021-10-22  0:41         ` H.J. Lu
  2021-10-22  1:01           ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22  0:41 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 4:47 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 5:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Thu, Oct 21, 2021 at 3:40 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > No bug.
> > >
> > > This commit adds tests for the new function __memcmpeq. The new tests
> > > use the existing tests in 'test-memcmp.c' but relax the result
> > > requirement to only check for zero or non-zero returns.
> > >
> > > All string tests include test-memcmpeq are passing.
> > > ---
> > > Note at the momement for test-memcmpeq.c the
> > > tests only appear to do the generic versions.
> > >
> > > For example on x86_64 the output of test-memcmpeq.out is:
> > >
> > >
> > > ```
> > >                         __memcmpeq simple_memcmp
> > > ```
> > >
> > > whereas test-memcmp.out is:
> > >
> > > ```
> > >                         simple_memcmp __memcmp_avx2_movbe
> > > __memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
> > > ```
> > >
> > > So the test is not going through all available ifuncs. I'm not
> > > sure if this is expected or indicates a bug in the previous
> > > patches adding support for __memcmpeq.
> > >
> >
> > This doesn't look right.  If __memcmpeq is a true alias of memcmp, you
> > should only have simple_memcmpeq and __memcmpeq.
>
> Figured. Any idea what the issue might be?

Where is your branch?  I can take a look.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 3/3] String: Add tests for __memcmpeq
  2021-10-22  0:41         ` H.J. Lu
@ 2021-10-22  1:01           ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22  1:01 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 7:42 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 4:47 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Thu, Oct 21, 2021 at 5:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Thu, Oct 21, 2021 at 3:40 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > > >
> > > > No bug.
> > > >
> > > > This commit adds tests for the new function __memcmpeq. The new tests
> > > > use the existing tests in 'test-memcmp.c' but relax the result
> > > > requirement to only check for zero or non-zero returns.
> > > >
> > > > All string tests include test-memcmpeq are passing.
> > > > ---
> > > > Note at the momement for test-memcmpeq.c the
> > > > tests only appear to do the generic versions.
> > > >
> > > > For example on x86_64 the output of test-memcmpeq.out is:
> > > >
> > > >
> > > > ```
> > > >                         __memcmpeq simple_memcmp
> > > > ```
> > > >
> > > > whereas test-memcmp.out is:
> > > >
> > > > ```
> > > >                         simple_memcmp __memcmp_avx2_movbe
> > > > __memcmp_evex_movbe __memcmp_sse4_1 __memcmp_ssse3 __memcmp_sse2
> > > > ```
> > > >
> > > > So the test is not going through all available ifuncs. I'm not
> > > > sure if this is expected or indicates a bug in the previous
> > > > patches adding support for __memcmpeq.
> > > >
> > >
> > > This doesn't look right.  If __memcmpeq is a true alias of memcmp, you
> > > should only have simple_memcmpeq and __memcmpeq.
> >
> > Figured. Any idea what the issue might be?
>
> Where is your branch?  I can take a look.

Made a new branch on your gitlab here:

https://gitlab.com/x86-glibc/glibc/-/tree/users/goldsteinn/memcmpeq-abi

>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-21 23:42     ` Noah Goldstein
@ 2021-10-22  2:38       ` H.J. Lu
  2021-10-22  4:04         ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22  2:38 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 4:42 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Thu, Oct 21, 2021 at 3:38 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> > > ---
> > >  string/Versions                                  |  3 +++
> > >  string/memcmp.c                                  |  2 ++
> > >  string/string.h                                  | 16 ++++++++++++++++
> > >  string/tester.c                                  | 16 ++++++++++++++++
> > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > >  sysdeps/i386/memcmp.S                            |  2 ++
> > >  sysdeps/ia64/memcmp.S                            |  1 +
> > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > >  sysdeps/s390/memcmp.c                            |  1 +
> > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > >  sysdeps/x86_64/memcmp.S                          |  2 ++
> > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > >  55 files changed, 94 insertions(+)
> > >
> > > diff --git a/string/Versions b/string/Versions
> > > index 298ecd401a..864c4cf7a4 100644
> > > --- a/string/Versions
> > > +++ b/string/Versions
> > > @@ -89,4 +89,7 @@ libc {
> > >      sigdescr_np; sigabbrev_np;
> > >      strerrordesc_np; strerrorname_np;
> > >    }
> > > +  GLIBC_2.35 {
> > > +    __memcmpeq;
> > > +  }
> > >  }
> > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > index 9b46d7a905..5020be00e0 100644
> > > --- a/string/memcmp.c
> > > +++ b/string/memcmp.c
> > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > >  #ifdef weak_alias
> > >  # undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +# undef __memcmpeq
> > > +weak_alias (memcmp, __memcmpeq)
> > >  #endif
> > > diff --git a/string/string.h b/string/string.h
> > > index b1b083edce..e70feeaeea 100644
> > > --- a/string/string.h
> > > +++ b/string/string.h
> > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > >
> > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > +   Return some non-zero value otherwise.
> > > +
> > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > +   except the return value is less constrained.  memcmp is always a
> > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > +   or bcmp are correct implementations.
> > > +
> > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > +   only used for its bolean value.
> > > +
> > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > +   continue to use memcmp.  */
> > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > > +
> > >  /* Search N bytes of S for C.  */
> > >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> > >  extern "C++"
> > > diff --git a/string/tester.c b/string/tester.c
> > > index 778160ae6e..605b3f00f9 100644
> > > --- a/string/tester.c
> > > +++ b/string/tester.c
> > > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> > >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> > >  }
> > >
> > > +static void
> > > +test_memcmpeq (void)
> > > +{
> > > +  it = "__memcmpeq";
> > > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > > +}
> > > +
> > >  static void
> > >  test_strerror (void)
> > >  {
> > > @@ -1611,6 +1624,9 @@ main (void)
> > >    /* bcmp - somewhat like memcmp.  */
> > >    test_bcmp ();
> > >
> > > +  /* __memcmpeq - somewhat like memcmp.  */
> > > +  test_memcmpeq ();
> > > +
> > >    /* strndup.  */
> > >    test_strndup ();
> > >
> > > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > > index c1937f6f5c..bc932eff2a 100644
> > > --- a/sysdeps/aarch64/memcmp.S
> > > +++ b/sysdeps/aarch64/memcmp.S
> > > @@ -177,4 +177,6 @@ L(ret_0):
> > >  END (memcmp)
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#undef __memcmpeq
> > > +weak_alias (memcmp, __memcmpeq)
> >
> > Can we use strong_alias for __memcmpeq?
>
> Think we can but not sure if its needed or we should.

__memcmpeq shouldn't have STB_WEAK binding since it
shouldn't be preempted.


-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22  2:38       ` H.J. Lu
@ 2021-10-22  4:04         ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22  4:04 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 9:38 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 4:42 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Thu, Oct 21, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Thu, Oct 21, 2021 at 3:38 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > > >
> > > > No bug.
> > > >
> > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > with comments explaining its behavior. Basic tests that it is callable
> > > > and works where added in string/tester.c
> > > >
> > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > is shares the same specifications as memcmp() except the return value
> > > > for non-equal byte sequences is any non-zero value. This is less
> > > > strict than memcmp()'s return value specification and can be better
> > > > optimized when a boolean return is all that is needed.
> > > >
> > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > that the return value of a memcmp() call is only used for its boolean
> > > > value.
> > > >
> > > > All tests in string/tester.c passed. As well build succeeds on
> > > > x86_64-linux-gnu target.
> > > > ---
> > > >  string/Versions                                  |  3 +++
> > > >  string/memcmp.c                                  |  2 ++
> > > >  string/string.h                                  | 16 ++++++++++++++++
> > > >  string/tester.c                                  | 16 ++++++++++++++++
> > > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > > >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> > > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > > >  sysdeps/i386/memcmp.S                            |  2 ++
> > > >  sysdeps/ia64/memcmp.S                            |  1 +
> > > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > > >  sysdeps/s390/memcmp.c                            |  1 +
> > > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > > >  sysdeps/x86_64/memcmp.S                          |  2 ++
> > > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > > >  55 files changed, 94 insertions(+)
> > > >
> > > > diff --git a/string/Versions b/string/Versions
> > > > index 298ecd401a..864c4cf7a4 100644
> > > > --- a/string/Versions
> > > > +++ b/string/Versions
> > > > @@ -89,4 +89,7 @@ libc {
> > > >      sigdescr_np; sigabbrev_np;
> > > >      strerrordesc_np; strerrorname_np;
> > > >    }
> > > > +  GLIBC_2.35 {
> > > > +    __memcmpeq;
> > > > +  }
> > > >  }
> > > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > > index 9b46d7a905..5020be00e0 100644
> > > > --- a/string/memcmp.c
> > > > +++ b/string/memcmp.c
> > > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > > >  #ifdef weak_alias
> > > >  # undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +# undef __memcmpeq
> > > > +weak_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > > diff --git a/string/string.h b/string/string.h
> > > > index b1b083edce..e70feeaeea 100644
> > > > --- a/string/string.h
> > > > +++ b/string/string.h
> > > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > > >
> > > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > > +   Return some non-zero value otherwise.
> > > > +
> > > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > > +   except the return value is less constrained.  memcmp is always a
> > > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > > +   or bcmp are correct implementations.
> > > > +
> > > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > > +   only used for its bolean value.
> > > > +
> > > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > > +   continue to use memcmp.  */
> > > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > > > +
> > > >  /* Search N bytes of S for C.  */
> > > >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> > > >  extern "C++"
> > > > diff --git a/string/tester.c b/string/tester.c
> > > > index 778160ae6e..605b3f00f9 100644
> > > > --- a/string/tester.c
> > > > +++ b/string/tester.c
> > > > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> > > >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> > > >  }
> > > >
> > > > +static void
> > > > +test_memcmpeq (void)
> > > > +{
> > > > +  it = "__memcmpeq";
> > > > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > > > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > > > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > > > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > > > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > > > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > > > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > > > +}
> > > > +
> > > >  static void
> > > >  test_strerror (void)
> > > >  {
> > > > @@ -1611,6 +1624,9 @@ main (void)
> > > >    /* bcmp - somewhat like memcmp.  */
> > > >    test_bcmp ();
> > > >
> > > > +  /* __memcmpeq - somewhat like memcmp.  */
> > > > +  test_memcmpeq ();
> > > > +
> > > >    /* strndup.  */
> > > >    test_strndup ();
> > > >
> > > > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > > > index c1937f6f5c..bc932eff2a 100644
> > > > --- a/sysdeps/aarch64/memcmp.S
> > > > +++ b/sysdeps/aarch64/memcmp.S
> > > > @@ -177,4 +177,6 @@ L(ret_0):
> > > >  END (memcmp)
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#undef __memcmpeq
> > > > +weak_alias (memcmp, __memcmpeq)
> > >
> > > Can we use strong_alias for __memcmpeq?
> >
> > Think we can but not sure if its needed or we should.
>
> __memcmpeq shouldn't have STB_WEAK binding since it
> shouldn't be preempted.

Got it. Note for x86_64 the patch defined an alias from
memcmp -> memcmpeq in two places.

Onces in sysdeps/x86_64/memcmp.S and once
in sysdeps/x86_64/multiarch/memcmp.c. The one in
memcmp.c is the one that will get the IFUNC selection
so I think that's the one we want to keep but will there
be an issue with ld.so usage of __memcmpeq if there
is no alias in memcmp.S? Should the one in memcmp.S
stay weak maybe?
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (8 preceding siblings ...)
  2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
@ 2021-10-22  5:49 ` Noah Goldstein
  2021-10-22 12:38   ` H.J. Lu
  2021-10-22 17:19   ` Noah Goldstein
  2021-10-22  5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                   ` (9 subsequent siblings)
  19 siblings, 2 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22  5:49 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
Kept one weak alias in in:
sysdeps/x86_64/memcmp.S

This will be preempted by the strong_alias in:
sysdeps/x86_64/multiarch/memcmp.c

 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  3 +++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 95 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..6e93a3128f 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..90266d904b 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..f60ddb2ed1 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,7 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (9 preceding siblings ...)
  2021-10-22  5:49 ` [PATCH v9 " Noah Goldstein
@ 2021-10-22  5:49 ` Noah Goldstein
  2021-10-22 12:44   ` H.J. Lu
  2021-10-22  5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
                   ` (8 subsequent siblings)
  19 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22  5:49 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 90266d904b..cc3329bef4 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index f60ddb2ed1..7b7a9dc8e7 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp)
    definition coming from IFUNC in multiarch/memcmp.c. */
 weak_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_builtin_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v9 3/3] String: Add tests for __memcmpeq
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (10 preceding siblings ...)
  2021-10-22  5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22  5:49 ` Noah Goldstein
  2021-10-22 12:42   ` H.J. Lu
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (7 subsequent siblings)
  19 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22  5:49 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 32 +++++++++++++++++++++-----------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..70529137ae 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,6 +38,7 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
 simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22  5:49 ` [PATCH v9 " Noah Goldstein
@ 2021-10-22 12:38   ` H.J. Lu
  2021-10-22 16:07     ` Noah Goldstein
  2021-10-22 17:19   ` Noah Goldstein
  1 sibling, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 12:38 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 10:51 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
> Kept one weak alias in in:
> sysdeps/x86_64/memcmp.S

Please change it to strong_alias for --disable-multi-arch.

I think we need a NEWS entry for it.

> This will be preempted by the strong_alias in:
> sysdeps/x86_64/multiarch/memcmp.c
>
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 95 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..6e93a3128f 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f60ddb2ed1 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,7 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +/* Weak alias for __memcmpeq here as it will be preempted by
> +   definition coming from IFUNC in multiarch/memcmp.c. */
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 3/3] String: Add tests for __memcmpeq
  2021-10-22  5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 12:42   ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 12:42 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 10:51 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds tests for the new function __memcmpeq. The new tests
> use the existing tests in 'test-memcmp.c' but relax the result
> requirement to only check for zero or non-zero returns.
>
> All string tests include test-memcmpeq are passing.
> ---
>  string/Makefile        |  4 ++--
>  string/test-memcmp.c   | 32 +++++++++++++++++++++-----------
>  string/test-memcmpeq.c | 21 +++++++++++++++++++++
>  3 files changed, 44 insertions(+), 13 deletions(-)
>  create mode 100644 string/test-memcmpeq.c
>
> diff --git a/string/Makefile b/string/Makefile
> index f0fce2a0b8..40d6fac133 100644
> --- a/string/Makefile
> +++ b/string/Makefile
> @@ -48,8 +48,8 @@ routines      := strcat strchr strcmp strcoll strcpy strcspn          \
>                    sigdescr_np sigabbrev_np strerrorname_np             \
>                    strerrordesc_np
>
> -strop-tests    := memchr memcmp memcpy memmove mempcpy memset memccpy  \
> -                  stpcpy stpncpy strcat strchr strcmp strcpy strcspn   \
> +strop-tests    := memchr memcmp memcpy memcmpeq memmove mempcpy memset \
> +                  memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn   \
>                    strlen strncmp strncpy strpbrk strrchr strspn memmem \
>                    strstr strcasestr strnlen strcasecmp strncasecmp     \
>                    strncat rawmemchr strchrnul bcopy bzero memrchr      \
> diff --git a/string/test-memcmp.c b/string/test-memcmp.c
> index 6ddbc05d2f..70529137ae 100644
> --- a/string/test-memcmp.c
> +++ b/string/test-memcmp.c
> @@ -17,11 +17,14 @@
>     <https://www.gnu.org/licenses/>.  */
>
>  #define TEST_MAIN
> -#ifdef WIDE
> +#ifdef TEST_MEMCMPEQ
> +# define TEST_NAME "__memcmpeq"
> +#elif defined WIDE
>  # define TEST_NAME "wmemcmp"
>  #else
>  # define TEST_NAME "memcmp"
>  #endif
> +
>  #include "test-string.h"
>  #ifdef WIDE
>  # include <inttypes.h>
> @@ -35,6 +38,7 @@
>  # define CHARBYTES 4
>  # define CHAR__MIN WCHAR_MIN
>  # define CHAR__MAX WCHAR_MAX
> +
>  int
>  simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
>  {
> @@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
>  }
>  #else
>  # include <limits.h>
> -
> -# define MEMCMP memcmp
> +# ifdef TEST_MEMCMPEQ
> +#  define MEMCMP __memcmpeq
> +#  define SIMPLE_MEMCMP simple_memcmpeq
> +# else
> +#  define MEMCMP memcmp
> +#  define SIMPLE_MEMCMP simple_memcmp
> +# endif
>  # define MEMCPY memcpy
> -# define SIMPLE_MEMCMP simple_memcmp
>  # define CHAR char
>  # define MAX_CHAR 255
>  # define UCHAR unsigned char
> @@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
>  # define CHAR__MAX CHAR_MAX
>
>  int
> -simple_memcmp (const char *s1, const char *s2, size_t n)
> +SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
>  {
>    int ret = 0;
>
> @@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
>  }
>  #endif
>
> +#ifndef BAD_RESULT
> +# define BAD_RESULT(result, expec)                                      \
> +    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
> +     ((result) > 0 && (expec) <= 0))
> +# endif
> +
>  typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
>
>  IMPL (SIMPLE_MEMCMP, 0)
> @@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
>               int exp_result)
>  {
>    int result = CALL (impl, s1, s2, len);
> -  if ((exp_result == 0 && result != 0)
> -      || (exp_result < 0 && result >= 0)
> -      || (exp_result > 0 && result <= 0))
> +  if (BAD_RESULT(result, exp_result))
>      {
>        error (0, 0, "Wrong result in function %s %d %d", impl->name,
>              result, exp_result);
> @@ -186,9 +198,7 @@ do_random_tests (void)
>         {
>           r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
>                     len);
> -         if ((r == 0 && result)
> -             || (r < 0 && result >= 0)
> -             || (r > 0 && result <= 0))
> +         if (BAD_RESULT(r, result))
>             {
>               error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
>                      n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
> diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
> new file mode 100644
> index 0000000000..8889117868
> --- /dev/null
> +++ b/string/test-memcmpeq.c
> @@ -0,0 +1,21 @@
> +/* Test and measure __memcmpeq functions.
> +   Copyright (C) 2012-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
> +#define TEST_MEMCMPEQ 1
> +#include "test-memcmp.c"
> --
> 2.25.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22  5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22 12:44   ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 12:44 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Thu, Oct 21, 2021 at 10:51 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds hidden defs for all declarations of __memcmpeq. This
> enables usage of __memcmpeq without the PLT for usage internal to
> GLIBC.
> ---
>  include/string.h                              | 1 +
>  string/memcmp.c                               | 1 +
>  sysdeps/aarch64/memcmp.S                      | 1 +
>  sysdeps/csky/abiv2/memcmp.S                   | 1 +
>  sysdeps/i386/i686/memcmp.S                    | 1 +
>  sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
>  sysdeps/i386/memcmp.S                         | 1 +
>  sysdeps/ia64/memcmp.S                         | 1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
>  sysdeps/s390/memcmp-z900.S                    | 1 +
>  sysdeps/s390/memcmp.c                         | 1 +
>  sysdeps/sparc/sparc64/memcmp.S                | 1 +
>  sysdeps/x86_64/memcmp.S                       | 1 +
>  sysdeps/x86_64/multiarch/memcmp.c             | 1 +
>  20 files changed, 20 insertions(+)
>
> diff --git a/include/string.h b/include/string.h
> index 81dab39891..21f641a413 100644
> --- a/include/string.h
> +++ b/include/string.h
> @@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
>  libc_hidden_proto (__strsep_g)
>  libc_hidden_proto (strnlen)
>  libc_hidden_proto (__strnlen)
> +libc_hidden_proto (__memcmpeq)
>  libc_hidden_proto (memmem)
>  extern __typeof (memmem) __memmem;
>  libc_hidden_proto (__memmem)
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 6e93a3128f..dc1a94e6ea 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
>  weak_alias (memcmp, bcmp)
>  # undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index 37f37b9191..5dc4ee5f0b 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 2a4ae577b0..9aacfd4cab 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -140,4 +140,5 @@ END (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
> +libc_hidden_def (__memcmpeq)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index 90266d904b..cc3329bef4 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 3b2815edbc..eb7cb9f2e2 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 02473c2c0c..f224db4681 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 7722908751..3ab04d4f8a 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -162,3 +162,4 @@ END(memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index c2836040a7..339091be0d 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -127,3 +127,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index f58e34aba5..0df97dbf49 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index f8deb4e32c..25be9a7f51 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1374,3 +1374,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index f81c73a29c..b0cd3ddde7 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -178,3 +178,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index cc82be115f..3731bb0a73 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1375,3 +1375,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index 3044f7ede9..29ae19d843 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1060,3 +1060,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index 0c6a154502..897a5713ce 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1443,3 +1443,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index d625bf90dd..5808f9365d 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -165,6 +165,7 @@ END(MEMCMP_Z196)
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 52c20af772..cc58279389 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       )
>  weak_alias (memcmp, bcmp);
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index fefeee5f5d..d237945554 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index f60ddb2ed1..7b7a9dc8e7 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp)
>     definition coming from IFUNC in multiarch/memcmp.c. */
>  weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_builtin_def (__memcmpeq)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index 4a3aad2c9c..7b3409b1dd 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  weak_alias (memcmp, bcmp)
>  # undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (11 preceding siblings ...)
  2021-10-22  5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 16:06 ` Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                     ` (3 more replies)
  2021-10-22 18:37 ` [PATCH v11 " Noah Goldstein
                   ` (6 subsequent siblings)
  19 siblings, 4 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:06 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  7 +++++++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 99 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..6e93a3128f 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..90266d904b 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..2fa79edd47 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,11 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#ifdef USE_MULTIARCH
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
+#else
+strong_alias (memcmp, __memcmpeq)
+#endif
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-10-22 16:06   ` Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 3/4] String: Add tests for __memcmpeq Noah Goldstein
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:06 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 90266d904b..cc3329bef4 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 2fa79edd47..7e77c4e5a1 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -366,3 +366,4 @@ weak_alias (memcmp, __memcmpeq)
 strong_alias (memcmp, __memcmpeq)
 #endif
 libc_hidden_builtin_def (memcmp)
+libc_hidden_builtin_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v10 3/4] String: Add tests for __memcmpeq
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22 16:06   ` Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
  2021-10-22 16:12   ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:06 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 32 +++++++++++++++++++++-----------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..70529137ae 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,6 +38,7 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
 simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v10 4/4] NEWS: Add item for __memcmpeq
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
  2021-10-22 16:06   ` [PATCH v10 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 16:06   ` Noah Goldstein
  2021-10-22 16:12     ` H.J. Lu
  2021-10-22 16:12   ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  3 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:06 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index b39b1e5e33..82b7016aef 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   DSO sorting algorithms.  The default setting of '1' uses the current existing
   algorithm, while a value of '2' selects the new DFS-based algorithm.
 
+* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
+  to be used by compilers for optimizing usage of 'memcmp' when its
+  return value is only used for its boolean status.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The r_version update in the debugger interface makes the glibc binary
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 12:38   ` H.J. Lu
@ 2021-10-22 16:07     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:07 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 7:39 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Oct 21, 2021 at 10:51 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> > Kept one weak alias in in:
> > sysdeps/x86_64/memcmp.S
>
> Please change it to strong_alias for --disable-multi-arch.

Done.

>
> I think we need a NEWS entry for it.

Added in a new patch.

>
> > This will be preempted by the strong_alias in:
> > sysdeps/x86_64/multiarch/memcmp.c
> >
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  3 +++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 95 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..6e93a3128f 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..37f37b9191 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..2a4ae577b0 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..90266d904b 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..3b2815edbc 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..02473c2c0c 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..7722908751 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..c2836040a7 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..f58e34aba5 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..f8deb4e32c 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..f81c73a29c 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..cc82be115f 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..3044f7ede9 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..0c6a154502 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..d625bf90dd 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..52c20af772 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..fefeee5f5d 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..f60ddb2ed1 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,7 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +/* Weak alias for __memcmpeq here as it will be preempted by
> > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..4a3aad2c9c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                     ` (2 preceding siblings ...)
  2021-10-22 16:06   ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-22 16:12   ` H.J. Lu
  2021-10-22 16:18     ` Noah Goldstein
  3 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 16:12 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 9:07 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  7 +++++++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 99 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..6e93a3128f 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..2fa79edd47 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,11 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#ifdef USE_MULTIARCH
> +/* Weak alias for __memcmpeq here as it will be preempted by
> +   definition coming from IFUNC in multiarch/memcmp.c. */
> +weak_alias (memcmp, __memcmpeq)
> +#else
> +strong_alias (memcmp, __memcmpeq)
> +#endif
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Please run build-many-glibcs.py and wait for a few days before pushing
upstream.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v10 4/4] NEWS: Add item for __memcmpeq
  2021-10-22 16:06   ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-22 16:12     ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 16:12 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 9:07 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> ---
>  NEWS | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index b39b1e5e33..82b7016aef 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -60,6 +60,10 @@ Major new features:
>    DSO sorting algorithms.  The default setting of '1' uses the current existing
>    algorithm, while a value of '2' selects the new DFS-based algorithm.
>
> +* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
> +  to be used by compilers for optimizing usage of 'memcmp' when its
> +  return value is only used for its boolean status.
> +
>  Deprecated and removed features, and other changes affecting compatibility:
>
>  * The r_version update in the debugger interface makes the glibc binary
> --
> 2.25.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 16:12   ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
@ 2021-10-22 16:18     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 16:18 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 11:12 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 9:07 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  7 +++++++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 99 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..6e93a3128f 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..37f37b9191 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..2a4ae577b0 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..90266d904b 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..3b2815edbc 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..02473c2c0c 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..7722908751 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..c2836040a7 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..f58e34aba5 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..f8deb4e32c 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..f81c73a29c 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..cc82be115f 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..3044f7ede9 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..0c6a154502 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..d625bf90dd 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..52c20af772 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..fefeee5f5d 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..2fa79edd47 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,11 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#ifdef USE_MULTIARCH
> > +/* Weak alias for __memcmpeq here as it will be preempted by
> > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > +weak_alias (memcmp, __memcmpeq)
> > +#else
> > +strong_alias (memcmp, __memcmpeq)
> > +#endif
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..4a3aad2c9c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
>
> Please run build-many-glibcs.py and wait for a few days before pushing
> upstream.
>

Got it. Thank you for the review!

> Thanks.
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22  5:49 ` [PATCH v9 " Noah Goldstein
  2021-10-22 12:38   ` H.J. Lu
@ 2021-10-22 17:19   ` Noah Goldstein
  2021-10-22 17:40     ` Noah Goldstein
  1 sibling, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 17:19 UTC (permalink / raw)
  To: GNU C Library

On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
> Kept one weak alias in in:
> sysdeps/x86_64/memcmp.S
>
> This will be preempted by the strong_alias in:
> sysdeps/x86_64/multiarch/memcmp.c

This issue is present on some other builds. Fixing.

>
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 95 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..6e93a3128f 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..f60ddb2ed1 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,7 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +/* Weak alias for __memcmpeq here as it will be preempted by
> +   definition coming from IFUNC in multiarch/memcmp.c. */
> +weak_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 17:19   ` Noah Goldstein
@ 2021-10-22 17:40     ` Noah Goldstein
  2021-10-22 17:44       ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 17:40 UTC (permalink / raw)
  To: GNU C Library

On Fri, Oct 22, 2021 at 12:19 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> > Kept one weak alias in in:
> > sysdeps/x86_64/memcmp.S
> >
> > This will be preempted by the strong_alias in:
> > sysdeps/x86_64/multiarch/memcmp.c
>
> This issue is present on some other builds. Fixing.

Should the check on --disable-multi-arch also include
IS_IN (LIBC)?
>
> >
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  3 +++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 95 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..6e93a3128f 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..37f37b9191 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..2a4ae577b0 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..90266d904b 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..3b2815edbc 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..02473c2c0c 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..7722908751 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..c2836040a7 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..f58e34aba5 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..f8deb4e32c 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..f81c73a29c 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..cc82be115f 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..3044f7ede9 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..0c6a154502 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..d625bf90dd 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..52c20af772 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..fefeee5f5d 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..f60ddb2ed1 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,7 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +/* Weak alias for __memcmpeq here as it will be preempted by
> > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > +weak_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..4a3aad2c9c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 17:40     ` Noah Goldstein
@ 2021-10-22 17:44       ` H.J. Lu
  2021-10-22 18:09         ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 17:44 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 10:41 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 12:19 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> > > ---
> > > Kept one weak alias in in:
> > > sysdeps/x86_64/memcmp.S
> > >
> > > This will be preempted by the strong_alias in:
> > > sysdeps/x86_64/multiarch/memcmp.c
> >
> > This issue is present on some other builds. Fixing.
>
> Should the check on --disable-multi-arch also include
> IS_IN (LIBC)?

Why? It can be used in ld.so.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 17:44       ` H.J. Lu
@ 2021-10-22 18:09         ` Noah Goldstein
  2021-10-22 18:33           ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 18:09 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 12:45 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 10:41 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Fri, Oct 22, 2021 at 12:19 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > > >
> > > > No bug.
> > > >
> > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > with comments explaining its behavior. Basic tests that it is callable
> > > > and works where added in string/tester.c
> > > >
> > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > is shares the same specifications as memcmp() except the return value
> > > > for non-equal byte sequences is any non-zero value. This is less
> > > > strict than memcmp()'s return value specification and can be better
> > > > optimized when a boolean return is all that is needed.
> > > >
> > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > that the return value of a memcmp() call is only used for its boolean
> > > > value.
> > > >
> > > > All tests in string/tester.c passed. As well build succeeds on
> > > > x86_64-linux-gnu target.
> > > > ---
> > > > Kept one weak alias in in:
> > > > sysdeps/x86_64/memcmp.S
> > > >
> > > > This will be preempted by the strong_alias in:
> > > > sysdeps/x86_64/multiarch/memcmp.c
> > >
> > > This issue is present on some other builds. Fixing.
> >
> > Should the check on --disable-multi-arch also include
> > IS_IN (LIBC)?
>
> Why? It can be used in ld.so.

Just looking at:
'#if ! HAVE_MEMCMP_IFUNC'
in memcmp-z900.S which requires
both.

>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 18:09         ` Noah Goldstein
@ 2021-10-22 18:33           ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 18:33 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 11:09 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 12:45 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Oct 22, 2021 at 10:41 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > On Fri, Oct 22, 2021 at 12:19 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > > >
> > > > On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > > > >
> > > > > No bug.
> > > > >
> > > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > > with comments explaining its behavior. Basic tests that it is callable
> > > > > and works where added in string/tester.c
> > > > >
> > > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > > is shares the same specifications as memcmp() except the return value
> > > > > for non-equal byte sequences is any non-zero value. This is less
> > > > > strict than memcmp()'s return value specification and can be better
> > > > > optimized when a boolean return is all that is needed.
> > > > >
> > > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > > that the return value of a memcmp() call is only used for its boolean
> > > > > value.
> > > > >
> > > > > All tests in string/tester.c passed. As well build succeeds on
> > > > > x86_64-linux-gnu target.
> > > > > ---
> > > > > Kept one weak alias in in:
> > > > > sysdeps/x86_64/memcmp.S
> > > > >
> > > > > This will be preempted by the strong_alias in:
> > > > > sysdeps/x86_64/multiarch/memcmp.c
> > > >
> > > > This issue is present on some other builds. Fixing.
> > >
> > > Should the check on --disable-multi-arch also include
> > > IS_IN (LIBC)?
> >
> > Why? It can be used in ld.so.
>
> Just looking at:
> '#if ! HAVE_MEMCMP_IFUNC'
> in memcmp-z900.S which requires
> both.

Different targets have different requirements.   For x86, it is
safe to use IFUNC for memcmp in ld.so, except when initializing
tunables.

-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v11 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (12 preceding siblings ...)
  2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-10-22 18:37 ` Noah Goldstein
  2021-10-22 18:37 ` [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 18:37 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
Only other place the issue appears to be is for i686. Fixed there
using a weak_alias if multiarch is enabled.

 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  7 +++++++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 105 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..6e93a3128f 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..acc702bd34 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,12 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+#ifdef USE_MULTIARCH
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
+#else
+strong_alias (memcmp, __memcmpeq)
+#endif
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..2fa79edd47 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,11 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#ifdef USE_MULTIARCH
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
+#else
+strong_alias (memcmp, __memcmpeq)
+#endif
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (13 preceding siblings ...)
  2021-10-22 18:37 ` [PATCH v11 " Noah Goldstein
@ 2021-10-22 18:37 ` Noah Goldstein
  2021-10-22 18:37 ` [PATCH v11 3/4] String: Add tests for __memcmpeq Noah Goldstein
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 18:37 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index acc702bd34..c5e4453898 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -414,3 +414,4 @@ weak_alias (memcmp, __memcmpeq)
 strong_alias (memcmp, __memcmpeq)
 #endif
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 2fa79edd47..7e77c4e5a1 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -366,3 +366,4 @@ weak_alias (memcmp, __memcmpeq)
 strong_alias (memcmp, __memcmpeq)
 #endif
 libc_hidden_builtin_def (memcmp)
+libc_hidden_builtin_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v11 3/4] String: Add tests for __memcmpeq
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (14 preceding siblings ...)
  2021-10-22 18:37 ` [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22 18:37 ` Noah Goldstein
  2021-10-22 18:37 ` [PATCH v11 4/4] NEWS: Add item " Noah Goldstein
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 18:37 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 32 +++++++++++++++++++++-----------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..70529137ae 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,6 +38,7 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
 simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v11 4/4] NEWS: Add item for __memcmpeq
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (15 preceding siblings ...)
  2021-10-22 18:37 ` [PATCH v11 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 18:37 ` Noah Goldstein
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 18:37 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index b39b1e5e33..82b7016aef 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   DSO sorting algorithms.  The default setting of '1' uses the current existing
   algorithm, while a value of '2' selects the new DFS-based algorithm.
 
+* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
+  to be used by compilers for optimizing usage of 'memcmp' when its
+  return value is only used for its boolean status.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The r_version update in the debugger interface makes the glibc binary
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (16 preceding siblings ...)
  2021-10-22 18:37 ` [PATCH v11 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-22 19:46 ` Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                     ` (3 more replies)
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
  19 siblings, 4 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 19:46 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  7 +++++++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 55 files changed, 105 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..6e93a3128f 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..acc702bd34 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,12 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+#ifdef USE_MULTIARCH
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
+#else
+strong_alias (memcmp, __memcmpeq)
+#endif
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..2fa79edd47 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,11 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#ifdef USE_MULTIARCH
+/* Weak alias for __memcmpeq here as it will be preempted by
+   definition coming from IFUNC in multiarch/memcmp.c. */
+weak_alias (memcmp, __memcmpeq)
+#else
+strong_alias (memcmp, __memcmpeq)
+#endif
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-10-22 19:46   ` Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 3/4] String: Add tests for __memcmpeq Noah Goldstein
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 19:46 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index acc702bd34..c5e4453898 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -414,3 +414,4 @@ weak_alias (memcmp, __memcmpeq)
 strong_alias (memcmp, __memcmpeq)
 #endif
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 2fa79edd47..7e77c4e5a1 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -366,3 +366,4 @@ weak_alias (memcmp, __memcmpeq)
 strong_alias (memcmp, __memcmpeq)
 #endif
 libc_hidden_builtin_def (memcmp)
+libc_hidden_builtin_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v12 3/4] String: Add tests for __memcmpeq
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22 19:46   ` Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 4/4] NEWS: Add item " Noah Goldstein
  2021-10-22 20:28   ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 19:46 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 34 ++++++++++++++++++++++------------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..fdf148102c 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,8 +38,9 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
-simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
   int ret = 0;
   /* Warning!
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v12 4/4] NEWS: Add item for __memcmpeq
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
  2021-10-22 19:46   ` [PATCH v12 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 19:46   ` Noah Goldstein
  2021-10-22 20:28   ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 19:46 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index b39b1e5e33..82b7016aef 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   DSO sorting algorithms.  The default setting of '1' uses the current existing
   algorithm, while a value of '2' selects the new DFS-based algorithm.
 
+* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
+  to be used by compilers for optimizing usage of 'memcmp' when its
+  return value is only used for its boolean status.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The r_version update in the debugger interface makes the glibc binary
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                     ` (2 preceding siblings ...)
  2021-10-22 19:46   ` [PATCH v12 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-22 20:28   ` H.J. Lu
  2021-10-22 20:33     ` Noah Goldstein
  3 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 20:28 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

..On Fri, Oct 22, 2021 at 12:47 PM Noah Goldstein
<goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  7 +++++++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  55 files changed, 105 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..6e93a3128f 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..acc702bd34 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,12 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +#ifdef USE_MULTIARCH
> +/* Weak alias for __memcmpeq here as it will be preempted by
> +   definition coming from IFUNC in multiarch/memcmp.c. */
> +weak_alias (memcmp, __memcmpeq)
> +#else
> +strong_alias (memcmp, __memcmpeq)
> +#endif
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..2fa79edd47 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,11 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#ifdef USE_MULTIARCH
> +/* Weak alias for __memcmpeq here as it will be preempted by
> +   definition coming from IFUNC in multiarch/memcmp.c. */
> +weak_alias (memcmp, __memcmpeq)
> +#else
> +strong_alias (memcmp, __memcmpeq)
> +#endif

No need to do that.  Just always use strong_alias.

>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 20:28   ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
@ 2021-10-22 20:33     ` Noah Goldstein
  2021-10-22 20:45       ` H.J. Lu
  0 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 20:33 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 3:29 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> ..On Fri, Oct 22, 2021 at 12:47 PM Noah Goldstein
> <goldstein.w.n@gmail.com> wrote:
> >
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  2 ++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  7 +++++++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  55 files changed, 105 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..6e93a3128f 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> >  #ifdef weak_alias
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..37f37b9191 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..2a4ae577b0 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >         br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..acc702bd34 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,12 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +#ifdef USE_MULTIARCH
> > +/* Weak alias for __memcmpeq here as it will be preempted by
> > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > +weak_alias (memcmp, __memcmpeq)
> > +#else
> > +strong_alias (memcmp, __memcmpeq)
> > +#endif
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..3b2815edbc 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..02473c2c0c 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..7722908751 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..c2836040a7 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..f58e34aba5 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..f8deb4e32c 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..f81c73a29c 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..cc82be115f 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..3044f7ede9 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..0c6a154502 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..d625bf90dd 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..52c20af772 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                       })
> >                       )
> >  weak_alias (memcmp, bcmp);
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..fefeee5f5d 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..2fa79edd47 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,11 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#ifdef USE_MULTIARCH
> > +/* Weak alias for __memcmpeq here as it will be preempted by
> > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > +weak_alias (memcmp, __memcmpeq)
> > +#else
> > +strong_alias (memcmp, __memcmpeq)
> > +#endif
>
> No need to do that.  Just always use strong_alias.

Build fails if I use strong_alias in the multiarch build.

Do you mean remove the aliasing in memcmp.S entirely
in the multiarch build?
>
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..4a3aad2c9c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 20:33     ` Noah Goldstein
@ 2021-10-22 20:45       ` H.J. Lu
  2021-10-22 21:24         ` Noah Goldstein
  0 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-22 20:45 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: GNU C Library, Carlos O'Donell

.On Fri, Oct 22, 2021 at 1:33 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 3:29 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > ..On Fri, Oct 22, 2021 at 12:47 PM Noah Goldstein
> > <goldstein.w.n@gmail.com> wrote:
> > >
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> > > ---
> > >  string/Versions                                  |  3 +++
> > >  string/memcmp.c                                  |  2 ++
> > >  string/string.h                                  | 16 ++++++++++++++++
> > >  string/tester.c                                  | 16 ++++++++++++++++
> > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > >  sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
> > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > >  sysdeps/i386/memcmp.S                            |  2 ++
> > >  sysdeps/ia64/memcmp.S                            |  1 +
> > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > >  sysdeps/s390/memcmp.c                            |  1 +
> > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > >  sysdeps/x86_64/memcmp.S                          |  7 +++++++
> > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > >  55 files changed, 105 insertions(+)
> > >
> > > diff --git a/string/Versions b/string/Versions
> > > index 298ecd401a..864c4cf7a4 100644
> > > --- a/string/Versions
> > > +++ b/string/Versions
> > > @@ -89,4 +89,7 @@ libc {
> > >      sigdescr_np; sigabbrev_np;
> > >      strerrordesc_np; strerrorname_np;
> > >    }
> > > +  GLIBC_2.35 {
> > > +    __memcmpeq;
> > > +  }
> > >  }
> > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > index 9b46d7a905..6e93a3128f 100644
> > > --- a/string/memcmp.c
> > > +++ b/string/memcmp.c
> > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > >  #ifdef weak_alias
> > >  # undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +# undef __memcmpeq
> > > +strong_alias (memcmp, __memcmpeq)
> > >  #endif
> > > diff --git a/string/string.h b/string/string.h
> > > index b1b083edce..e70feeaeea 100644
> > > --- a/string/string.h
> > > +++ b/string/string.h
> > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > >
> > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > +   Return some non-zero value otherwise.
> > > +
> > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > +   except the return value is less constrained.  memcmp is always a
> > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > +   or bcmp are correct implementations.
> > > +
> > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > +   only used for its bolean value.
> > > +
> > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > +   continue to use memcmp.  */
> > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > > +
> > >  /* Search N bytes of S for C.  */
> > >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> > >  extern "C++"
> > > diff --git a/string/tester.c b/string/tester.c
> > > index 778160ae6e..605b3f00f9 100644
> > > --- a/string/tester.c
> > > +++ b/string/tester.c
> > > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> > >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> > >  }
> > >
> > > +static void
> > > +test_memcmpeq (void)
> > > +{
> > > +  it = "__memcmpeq";
> > > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > > +}
> > > +
> > >  static void
> > >  test_strerror (void)
> > >  {
> > > @@ -1611,6 +1624,9 @@ main (void)
> > >    /* bcmp - somewhat like memcmp.  */
> > >    test_bcmp ();
> > >
> > > +  /* __memcmpeq - somewhat like memcmp.  */
> > > +  test_memcmpeq ();
> > > +
> > >    /* strndup.  */
> > >    test_strndup ();
> > >
> > > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > > index c1937f6f5c..37f37b9191 100644
> > > --- a/sysdeps/aarch64/memcmp.S
> > > +++ b/sysdeps/aarch64/memcmp.S
> > > @@ -177,4 +177,6 @@ L(ret_0):
> > >  END (memcmp)
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#undef __memcmpeq
> > > +strong_alias (memcmp, __memcmpeq)
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > > index 1560387618..2a4ae577b0 100644
> > > --- a/sysdeps/csky/abiv2/memcmp.S
> > > +++ b/sysdeps/csky/abiv2/memcmp.S
> > > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> > >         br      .L_s1_aligned
> > >  END (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > >  libc_hidden_def (memcmp)
> > >  .weak memcmp
> > > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > > index b26b124fad..acc702bd34 100644
> > > --- a/sysdeps/i386/i686/memcmp.S
> > > +++ b/sysdeps/i386/i686/memcmp.S
> > > @@ -405,4 +405,12 @@ L(table_32bytes) :
> > >
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#undef __memcmpeq
> > > +#ifdef USE_MULTIARCH
> > > +/* Weak alias for __memcmpeq here as it will be preempted by
> > > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > > +weak_alias (memcmp, __memcmpeq)
> > > +#else
> > > +strong_alias (memcmp, __memcmpeq)
> > > +#endif
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > > index 6e058a8857..3b2815edbc 100644
> > > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > > @@ -29,4 +29,5 @@
> > >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> > >
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > >  #endif
> > > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > > index 1f212b0f6d..02473c2c0c 100644
> > > --- a/sysdeps/i386/memcmp.S
> > > +++ b/sysdeps/i386/memcmp.S
> > > @@ -70,4 +70,6 @@ END (memcmp)
> > >
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#undef __memcmpeq
> > > +strong_alias (memcmp, __memcmpeq)
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > > index 97539c23fd..7722908751 100644
> > > --- a/sysdeps/ia64/memcmp.S
> > > +++ b/sysdeps/ia64/memcmp.S
> > > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> > >  END(memcmp)
> > >
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > > index c5da10a0cd..e849d6fa35 100644
> > > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> > >  GLIBC_2.34 shm_open F
> > >  GLIBC_2.34 shm_unlink F
> > >  GLIBC_2.34 timespec_getres F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > index 6a6a54d90f..c2836040a7 100644
> > > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > @@ -126,3 +126,4 @@ L(st2):
> > >  END (memcmp)
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp,bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > index 814d2f211d..f58e34aba5 100644
> > > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > @@ -1373,3 +1373,4 @@ END (memcmp)
> > >
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > index 8a19953e2d..f8deb4e32c 100644
> > > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > @@ -1373,3 +1373,4 @@ END (memcmp)
> > >
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > index 52f244e7e7..f81c73a29c 100644
> > > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > @@ -177,3 +177,4 @@ L(tail8):
> > >  END (MEMCMP)
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > index dc1be3a0d8..cc82be115f 100644
> > > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> > >  END (MEMCMP)
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > index bc034a55bc..3044f7ede9 100644
> > > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> > >  END (MEMCMP)
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > index b676b09a9b..0c6a154502 100644
> > > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> > >  END (MEMCMP)
> > >  libc_hidden_builtin_def (memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > > index 995d52e47d..d625bf90dd 100644
> > > --- a/sysdeps/s390/memcmp-z900.S
> > > +++ b/sysdeps/s390/memcmp-z900.S
> > > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> > >     Otherwise see sysdeps/s390/memcmp.c.  */
> > >  strong_alias (MEMCMP_DEFAULT, memcmp)
> > >  weak_alias (memcmp, bcmp)
> > > +strong_alias (memcmp, __memcmpeq)
> > >  #endif
> > >
> > >  #if defined SHARED && IS_IN (libc)
> > > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > > index 0b4e9da717..52c20af772 100644
> > > --- a/sysdeps/s390/memcmp.c
> > > +++ b/sysdeps/s390/memcmp.c
> > > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> > >                       })
> > >                       )
> > >  weak_alias (memcmp, bcmp);
> > > +strong_alias (memcmp, __memcmpeq)
> > >  #endif
> > > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > > index d8d9ff9b24..fefeee5f5d 100644
> > > --- a/sysdeps/sparc/sparc64/memcmp.S
> > > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > > @@ -137,4 +137,6 @@ END(memcmp)
> > >
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#undef __memcmpeq
> > > +strong_alias (memcmp, __memcmpeq)
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > index 21a2e50a88..f227ae6cee 100644
> > > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > index a201fd69ba..0ccc3fc73e 100644
> > > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > index 2611436937..fd80704787 100644
> > > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > index a426241965..2ae6c58b8a 100644
> > > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _Exit F
> > >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> > >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > index 02f80418cc..fcfd1e8594 100644
> > > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _Exit F
> > >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> > >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > index b7676eb372..ba034b8541 100644
> > > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > index f6965c9d95..b7460bec8a 100644
> > > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > index 2e7603d9ed..a4dc341ded 100644
> > > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > index dd3a56d3fe..94b222dbc7 100644
> > > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > index c1e0ea9c10..12fd3b6310 100644
> > > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _Exit F
> > >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> > >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > index 93161048ca..4d2296007a 100644
> > > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > index 0aaeec8a27..a223278a3d 100644
> > > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > index bec5f456c9..780a4f5b0b 100644
> > > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > index 97d2127f78..cd65136062 100644
> > > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > index acb0756c11..b5b9902db5 100644
> > > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > index ebc21dde1e..57593d5f94 100644
> > > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > index c68f7e3c6c..e944d76bed 100644
> > > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > index e5b6834f14..8af5a3a90d 100644
> > > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > index 132707c8ad..3a0213b39f 100644
> > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > index 0af2be31a0..f57df0234b 100644
> > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > index cf864632d0..259a0cfc51 100644
> > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > index d566d675d0..126541daf1 100644
> > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > index c9a7eacb32..05df4d13d2 100644
> > > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > index 8299131cb2..8e349cbff8 100644
> > > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > index c3fe78f77f..e9de402766 100644
> > > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > index 83e542aa8c..1a010c745d 100644
> > > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > index dc502f6833..22ce530975 100644
> > > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > index cba1abb556..960df07b83 100644
> > > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > index d4a516fb47..eedb376f3d 100644
> > > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 _IO_fprintf F
> > >  GLIBC_2.4 _IO_printf F
> > >  GLIBC_2.4 _IO_sprintf F
> > > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > index 6268875ba3..86e0c92bef 100644
> > > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > index 095e914b73..5e59d90623 100644
> > > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > >  GLIBC_2.4 __confstr_chk F
> > >  GLIBC_2.4 __fgets_chk F
> > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > index dd910f7fe9..94412dc134 100644
> > > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> > >  GLIBC_2.34 tss_delete F
> > >  GLIBC_2.34 tss_get F
> > >  GLIBC_2.34 tss_set F
> > > +GLIBC_2.35 __memcmpeq F
> > > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > > index 870e15c5a0..2fa79edd47 100644
> > > --- a/sysdeps/x86_64/memcmp.S
> > > +++ b/sysdeps/x86_64/memcmp.S
> > > @@ -358,4 +358,11 @@ END(memcmp)
> > >
> > >  #undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +#ifdef USE_MULTIARCH
> > > +/* Weak alias for __memcmpeq here as it will be preempted by
> > > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > > +weak_alias (memcmp, __memcmpeq)
> > > +#else
> > > +strong_alias (memcmp, __memcmpeq)
> > > +#endif
> >
> > No need to do that.  Just always use strong_alias.
>
> Build fails if I use strong_alias in the multiarch build.
>
> Do you mean remove the aliasing in memcmp.S entirely
> in the multiarch build?

Add

# undef strong_alias
# define strong_alias(ignored1, ignored2)

to memcmp-sse2.S.

> >
> > >  libc_hidden_builtin_def (memcmp)
> > > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > > index fe725f3563..4a3aad2c9c 100644
> > > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > > @@ -29,6 +29,8 @@
> > >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> > >  # undef bcmp
> > >  weak_alias (memcmp, bcmp)
> > > +# undef __memcmpeq
> > > +strong_alias (memcmp, __memcmpeq)
> > >
> > >  # ifdef SHARED
> > >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > > --
> > > 2.25.1
> > >
> >
> >
> > --
> > H.J.



-- 
H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (17 preceding siblings ...)
  2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-10-22 21:23 ` Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                     ` (3 more replies)
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
  19 siblings, 4 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 21:23 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  2 ++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 57 files changed, 100 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..6e93a3128f 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
 #ifdef weak_alias
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..90266d904b 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
index 5f6658b89a..a5b5c3d349 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -30,6 +30,9 @@
 
 # undef weak_alias
 # define weak_alias(original, alias)
+
+# undef strong_alias
+# define strong_alias(original, alias)
 #endif
 
 #include <sysdeps/i386/i686/memcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..1b351ee092 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
index b135fa2d40..af737c5e6c 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -26,6 +26,9 @@
 
 # undef weak_alias
 # define weak_alias(ignored1, ignored2)
+
+# undef strong_alias
+# define strong_alias(ignored1, ignored2)
 #endif
 
 #include <sysdeps/x86_64/memcmp.S>
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
@ 2021-10-22 21:23   ` Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 3/4] String: Add tests for __memcmpeq Noah Goldstein
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 21:23 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                              | 1 +
 string/memcmp.c                               | 1 +
 sysdeps/aarch64/memcmp.S                      | 1 +
 sysdeps/csky/abiv2/memcmp.S                   | 1 +
 sysdeps/i386/i686/memcmp.S                    | 1 +
 sysdeps/i386/i686/multiarch/memcmp-ia32.S     | 4 ++++
 sysdeps/i386/i686/multiarch/memcmp.c          | 1 +
 sysdeps/i386/memcmp.S                         | 1 +
 sysdeps/ia64/memcmp.S                         | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S        | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc32/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
 sysdeps/powerpc/powerpc64/power4/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S     | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S     | 1 +
 sysdeps/s390/memcmp-z900.S                    | 1 +
 sysdeps/s390/memcmp.c                         | 1 +
 sysdeps/sparc/sparc64/memcmp.S                | 1 +
 sysdeps/x86_64/memcmp.S                       | 1 +
 sysdeps/x86_64/multiarch/memcmp-sse2.S        | 3 +++
 sysdeps/x86_64/multiarch/memcmp.c             | 1 +
 22 files changed, 27 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 90266d904b..cc3329bef4 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
index a5b5c3d349..74188f74ab 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -26,6 +26,10 @@
    used by IFUNC.  */
 #  define libc_hidden_builtin_def(name) \
 	.globl __GI_memcmp; __GI_memcmp = memcmp
+
+#  undef libc_hidden_def
+#  define libc_hidden_def(name) \
+	.globl __GI___memcmpeq; __GI___memcmpeq = __memcmpeq
 # endif
 
 # undef weak_alias
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 1b351ee092..8a03e572e8 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
index af737c5e6c..7b30b7ca2e 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -22,6 +22,9 @@
 # ifdef SHARED
 #  undef libc_hidden_builtin_def
 #  define libc_hidden_builtin_def(name)
+
+#  undef libc_hidden_def
+#  define libc_hidden_def(ignored)
 # endif
 
 # undef weak_alias
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v13 3/4] String: Add tests for __memcmpeq
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-22 21:23   ` Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 4/4] NEWS: Add item " Noah Goldstein
  2021-10-23 23:23   ` [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 21:23 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 34 ++++++++++++++++++++++------------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..fdf148102c 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,8 +38,9 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
-simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
   int ret = 0;
   /* Warning!
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v13 4/4] NEWS: Add item for __memcmpeq
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
  2021-10-22 21:23   ` [PATCH v13 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-22 21:23   ` Noah Goldstein
  2021-10-23 23:23   ` [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 21:23 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index b39b1e5e33..82b7016aef 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   DSO sorting algorithms.  The default setting of '1' uses the current existing
   algorithm, while a value of '2' selects the new DFS-based algorithm.
 
+* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
+  to be used by compilers for optimizing usage of 'memcmp' when its
+  return value is only used for its boolean status.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The r_version update in the debugger interface makes the glibc binary
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 20:45       ` H.J. Lu
@ 2021-10-22 21:24         ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-22 21:24 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Fri, Oct 22, 2021 at 3:45 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> .On Fri, Oct 22, 2021 at 1:33 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Fri, Oct 22, 2021 at 3:29 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > ..On Fri, Oct 22, 2021 at 12:47 PM Noah Goldstein
> > > <goldstein.w.n@gmail.com> wrote:
> > > >
> > > > No bug.
> > > >
> > > > This commit adds support for __memcmpeq() as a new ABI for all
> > > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > > with comments explaining its behavior. Basic tests that it is callable
> > > > and works where added in string/tester.c
> > > >
> > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > > is shares the same specifications as memcmp() except the return value
> > > > for non-equal byte sequences is any non-zero value. This is less
> > > > strict than memcmp()'s return value specification and can be better
> > > > optimized when a boolean return is all that is needed.
> > > >
> > > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > > that the return value of a memcmp() call is only used for its boolean
> > > > value.
> > > >
> > > > All tests in string/tester.c passed. As well build succeeds on
> > > > x86_64-linux-gnu target.
> > > > ---
> > > >  string/Versions                                  |  3 +++
> > > >  string/memcmp.c                                  |  2 ++
> > > >  string/string.h                                  | 16 ++++++++++++++++
> > > >  string/tester.c                                  | 16 ++++++++++++++++
> > > >  sysdeps/aarch64/memcmp.S                         |  2 ++
> > > >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> > > >  sysdeps/i386/i686/memcmp.S                       |  8 ++++++++
> > > >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> > > >  sysdeps/i386/memcmp.S                            |  2 ++
> > > >  sysdeps/ia64/memcmp.S                            |  1 +
> > > >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> > > >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> > > >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> > > >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> > > >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> > > >  sysdeps/s390/memcmp-z900.S                       |  1 +
> > > >  sysdeps/s390/memcmp.c                            |  1 +
> > > >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> > > >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> > > >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> > > >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> > > >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> > > >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> > > >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> > > >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> > > >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> > > >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> > > >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> > > >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> > > >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> > > >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> > > >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> > > >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> > > >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> > > >  sysdeps/x86_64/memcmp.S                          |  7 +++++++
> > > >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> > > >  55 files changed, 105 insertions(+)
> > > >
> > > > diff --git a/string/Versions b/string/Versions
> > > > index 298ecd401a..864c4cf7a4 100644
> > > > --- a/string/Versions
> > > > +++ b/string/Versions
> > > > @@ -89,4 +89,7 @@ libc {
> > > >      sigdescr_np; sigabbrev_np;
> > > >      strerrordesc_np; strerrorname_np;
> > > >    }
> > > > +  GLIBC_2.35 {
> > > > +    __memcmpeq;
> > > > +  }
> > > >  }
> > > > diff --git a/string/memcmp.c b/string/memcmp.c
> > > > index 9b46d7a905..6e93a3128f 100644
> > > > --- a/string/memcmp.c
> > > > +++ b/string/memcmp.c
> > > > @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
> > > >  #ifdef weak_alias
> > > >  # undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +# undef __memcmpeq
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > > diff --git a/string/string.h b/string/string.h
> > > > index b1b083edce..e70feeaeea 100644
> > > > --- a/string/string.h
> > > > +++ b/string/string.h
> > > > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> > > >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> > > >       __THROW __attribute_pure__ __nonnull ((1, 2));
> > > >
> > > > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > > > +   Return some non-zero value otherwise.
> > > > +
> > > > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > > > +   except the return value is less constrained.  memcmp is always a
> > > > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > > > +   or bcmp are correct implementations.
> > > > +
> > > > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > > > +   only used for its bolean value.
> > > > +
> > > > +   __memcmpeq is declared only for use by compilers.  Programs should
> > > > +   continue to use memcmp.  */
> > > > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > > > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > > > +
> > > >  /* Search N bytes of S for C.  */
> > > >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> > > >  extern "C++"
> > > > diff --git a/string/tester.c b/string/tester.c
> > > > index 778160ae6e..605b3f00f9 100644
> > > > --- a/string/tester.c
> > > > +++ b/string/tester.c
> > > > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> > > >    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
> > > >  }
> > > >
> > > > +static void
> > > > +test_memcmpeq (void)
> > > > +{
> > > > +  it = "__memcmpeq";
> > > > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > > > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > > > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > > > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > > > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > > > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > > > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > > > +}
> > > > +
> > > >  static void
> > > >  test_strerror (void)
> > > >  {
> > > > @@ -1611,6 +1624,9 @@ main (void)
> > > >    /* bcmp - somewhat like memcmp.  */
> > > >    test_bcmp ();
> > > >
> > > > +  /* __memcmpeq - somewhat like memcmp.  */
> > > > +  test_memcmpeq ();
> > > > +
> > > >    /* strndup.  */
> > > >    test_strndup ();
> > > >
> > > > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > > > index c1937f6f5c..37f37b9191 100644
> > > > --- a/sysdeps/aarch64/memcmp.S
> > > > +++ b/sysdeps/aarch64/memcmp.S
> > > > @@ -177,4 +177,6 @@ L(ret_0):
> > > >  END (memcmp)
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#undef __memcmpeq
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > > > index 1560387618..2a4ae577b0 100644
> > > > --- a/sysdeps/csky/abiv2/memcmp.S
> > > > +++ b/sysdeps/csky/abiv2/memcmp.S
> > > > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> > > >         br      .L_s1_aligned
> > > >  END (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  libc_hidden_def (memcmp)
> > > >  .weak memcmp
> > > > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > > > index b26b124fad..acc702bd34 100644
> > > > --- a/sysdeps/i386/i686/memcmp.S
> > > > +++ b/sysdeps/i386/i686/memcmp.S
> > > > @@ -405,4 +405,12 @@ L(table_32bytes) :
> > > >
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#undef __memcmpeq
> > > > +#ifdef USE_MULTIARCH
> > > > +/* Weak alias for __memcmpeq here as it will be preempted by
> > > > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > > > +weak_alias (memcmp, __memcmpeq)
> > > > +#else
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > +#endif
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > > > index 6e058a8857..3b2815edbc 100644
> > > > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > > > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > > > @@ -29,4 +29,5 @@
> > > >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> > > >
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > > > index 1f212b0f6d..02473c2c0c 100644
> > > > --- a/sysdeps/i386/memcmp.S
> > > > +++ b/sysdeps/i386/memcmp.S
> > > > @@ -70,4 +70,6 @@ END (memcmp)
> > > >
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#undef __memcmpeq
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > > > index 97539c23fd..7722908751 100644
> > > > --- a/sysdeps/ia64/memcmp.S
> > > > +++ b/sysdeps/ia64/memcmp.S
> > > > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> > > >  END(memcmp)
> > > >
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > > > index c5da10a0cd..e849d6fa35 100644
> > > > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > > > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > > > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> > > >  GLIBC_2.34 shm_open F
> > > >  GLIBC_2.34 shm_unlink F
> > > >  GLIBC_2.34 timespec_getres F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > > index 6a6a54d90f..c2836040a7 100644
> > > > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > > > @@ -126,3 +126,4 @@ L(st2):
> > > >  END (memcmp)
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp,bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > > index 814d2f211d..f58e34aba5 100644
> > > > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > > > @@ -1373,3 +1373,4 @@ END (memcmp)
> > > >
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > > index 8a19953e2d..f8deb4e32c 100644
> > > > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > > > @@ -1373,3 +1373,4 @@ END (memcmp)
> > > >
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > > index 52f244e7e7..f81c73a29c 100644
> > > > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > > > @@ -177,3 +177,4 @@ L(tail8):
> > > >  END (MEMCMP)
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > > index dc1be3a0d8..cc82be115f 100644
> > > > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > > > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> > > >  END (MEMCMP)
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > > index bc034a55bc..3044f7ede9 100644
> > > > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > > > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> > > >  END (MEMCMP)
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > > index b676b09a9b..0c6a154502 100644
> > > > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > > > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> > > >  END (MEMCMP)
> > > >  libc_hidden_builtin_def (memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > > > index 995d52e47d..d625bf90dd 100644
> > > > --- a/sysdeps/s390/memcmp-z900.S
> > > > +++ b/sysdeps/s390/memcmp-z900.S
> > > > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> > > >     Otherwise see sysdeps/s390/memcmp.c.  */
> > > >  strong_alias (MEMCMP_DEFAULT, memcmp)
> > > >  weak_alias (memcmp, bcmp)
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > >
> > > >  #if defined SHARED && IS_IN (libc)
> > > > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > > > index 0b4e9da717..52c20af772 100644
> > > > --- a/sysdeps/s390/memcmp.c
> > > > +++ b/sysdeps/s390/memcmp.c
> > > > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> > > >                       })
> > > >                       )
> > > >  weak_alias (memcmp, bcmp);
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  #endif
> > > > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > > > index d8d9ff9b24..fefeee5f5d 100644
> > > > --- a/sysdeps/sparc/sparc64/memcmp.S
> > > > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > > > @@ -137,4 +137,6 @@ END(memcmp)
> > > >
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#undef __memcmpeq
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > > index 21a2e50a88..f227ae6cee 100644
> > > > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > > > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > > index a201fd69ba..0ccc3fc73e 100644
> > > > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > > > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > > index 2611436937..fd80704787 100644
> > > > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > > > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > > index a426241965..2ae6c58b8a 100644
> > > > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > > > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _Exit F
> > > >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> > > >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > > > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > > index 02f80418cc..fcfd1e8594 100644
> > > > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > > > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _Exit F
> > > >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> > > >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > > > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > > index b7676eb372..ba034b8541 100644
> > > > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > > > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > > index f6965c9d95..b7460bec8a 100644
> > > > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > > > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > > index 2e7603d9ed..a4dc341ded 100644
> > > > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > > > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > > index dd3a56d3fe..94b222dbc7 100644
> > > > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > > > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > > index c1e0ea9c10..12fd3b6310 100644
> > > > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > > > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _Exit F
> > > >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> > > >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > > > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > > index 93161048ca..4d2296007a 100644
> > > > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > > > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > > index 0aaeec8a27..a223278a3d 100644
> > > > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > > > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > > index bec5f456c9..780a4f5b0b 100644
> > > > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > > > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > > index 97d2127f78..cd65136062 100644
> > > > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > > > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > > index acb0756c11..b5b9902db5 100644
> > > > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > > > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > > index ebc21dde1e..57593d5f94 100644
> > > > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > > > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > > index c68f7e3c6c..e944d76bed 100644
> > > > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > > > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > > index e5b6834f14..8af5a3a90d 100644
> > > > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > > > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > > index 132707c8ad..3a0213b39f 100644
> > > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > > > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > > index 0af2be31a0..f57df0234b 100644
> > > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > > > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > > index cf864632d0..259a0cfc51 100644
> > > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > > > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > > index d566d675d0..126541daf1 100644
> > > > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > > > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > > index c9a7eacb32..05df4d13d2 100644
> > > > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > > > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > > index 8299131cb2..8e349cbff8 100644
> > > > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > > > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > > index c3fe78f77f..e9de402766 100644
> > > > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > > > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > > index 83e542aa8c..1a010c745d 100644
> > > > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > > > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > > index dc502f6833..22ce530975 100644
> > > > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > > > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > > index cba1abb556..960df07b83 100644
> > > > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > > > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > > index d4a516fb47..eedb376f3d 100644
> > > > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > > > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 _IO_fprintf F
> > > >  GLIBC_2.4 _IO_printf F
> > > >  GLIBC_2.4 _IO_sprintf F
> > > > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > > index 6268875ba3..86e0c92bef 100644
> > > > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > > > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > > index 095e914b73..5e59d90623 100644
> > > > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > > > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > >  GLIBC_2.4 __confstr_chk F
> > > >  GLIBC_2.4 __fgets_chk F
> > > >  GLIBC_2.4 __fgets_unlocked_chk F
> > > > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > > index dd910f7fe9..94412dc134 100644
> > > > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > > > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> > > >  GLIBC_2.34 tss_delete F
> > > >  GLIBC_2.34 tss_get F
> > > >  GLIBC_2.34 tss_set F
> > > > +GLIBC_2.35 __memcmpeq F
> > > > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > > > index 870e15c5a0..2fa79edd47 100644
> > > > --- a/sysdeps/x86_64/memcmp.S
> > > > +++ b/sysdeps/x86_64/memcmp.S
> > > > @@ -358,4 +358,11 @@ END(memcmp)
> > > >
> > > >  #undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +#ifdef USE_MULTIARCH
> > > > +/* Weak alias for __memcmpeq here as it will be preempted by
> > > > +   definition coming from IFUNC in multiarch/memcmp.c. */
> > > > +weak_alias (memcmp, __memcmpeq)
> > > > +#else
> > > > +strong_alias (memcmp, __memcmpeq)
> > > > +#endif
> > >
> > > No need to do that.  Just always use strong_alias.
> >
> > Build fails if I use strong_alias in the multiarch build.
> >
> > Do you mean remove the aliasing in memcmp.S entirely
> > in the multiarch build?
>
> Add
>
> # undef strong_alias
> # define strong_alias(ignored1, ignored2)
>
> to memcmp-sse2.S.

Got it. Did the same for i686 for memcmp.S and multiarch/memcmp-ia32.S

>
> > >
> > > >  libc_hidden_builtin_def (memcmp)
> > > > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > > > index fe725f3563..4a3aad2c9c 100644
> > > > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > > > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > > > @@ -29,6 +29,8 @@
> > > >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> > > >  # undef bcmp
> > > >  weak_alias (memcmp, bcmp)
> > > > +# undef __memcmpeq
> > > > +strong_alias (memcmp, __memcmpeq)
> > > >
> > > >  # ifdef SHARED
> > > >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > > > --
> > > > 2.25.1
> > > >
> > >
> > >
> > > --
> > > H.J.
>
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
                     ` (2 preceding siblings ...)
  2021-10-22 21:23   ` [PATCH v13 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-23 23:23   ` Noah Goldstein
  3 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-23 23:23 UTC (permalink / raw)
  To: GNU C Library

On Fri, Oct 22, 2021 at 4:24 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  2 ++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  57 files changed, 100 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..6e93a3128f 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp)
>  #ifdef weak_alias
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> index 5f6658b89a..a5b5c3d349 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> @@ -30,6 +30,9 @@
>
>  # undef weak_alias
>  # define weak_alias(original, alias)
> +
> +# undef strong_alias
> +# define strong_alias(original, alias)
>  #endif
>
>  #include <sysdeps/i386/i686/memcmp.S>
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..1b351ee092 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> index b135fa2d40..af737c5e6c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
> +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> @@ -26,6 +26,9 @@
>
>  # undef weak_alias
>  # define weak_alias(ignored1, ignored2)
> +
> +# undef strong_alias
> +# define strong_alias(ignored1, ignored2)
>  #endif
>
>  #include <sysdeps/x86_64/memcmp.S>
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

This patch has some failures on powerpc. Fixed in v14. Rerunning all
of build-many.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
                   ` (18 preceding siblings ...)
  2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
@ 2021-10-23 23:24 ` Noah Goldstein
  2021-10-23 23:24   ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
                     ` (4 more replies)
  19 siblings, 5 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-23 23:24 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds support for __memcmpeq() as a new ABI for all
targets. In this commit __memcmpeq() is implemented only as an alias
to the corresponding targets memcmp() implementation. __memcmpeq() is
added as a new symbol starting with GLIBC_2.35 and defined in string.h
with comments explaining its behavior. Basic tests that it is callable
and works where added in string/tester.c

As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
__memcmpeq() is essentially a reserved namespace for bcmp(). The means
is shares the same specifications as memcmp() except the return value
for non-equal byte sequences is any non-zero value. This is less
strict than memcmp()'s return value specification and can be better
optimized when a boolean return is all that is needed.

__memcmpeq() is meant to only be called by compilers if they can prove
that the return value of a memcmp() call is only used for its boolean
value.

All tests in string/tester.c passed. As well build succeeds on
x86_64-linux-gnu target.
---
 string/Versions                                  |  3 +++
 string/memcmp.c                                  |  3 +++
 string/string.h                                  | 16 ++++++++++++++++
 string/tester.c                                  | 16 ++++++++++++++++
 sysdeps/aarch64/memcmp.S                         |  2 ++
 sysdeps/csky/abiv2/memcmp.S                      |  1 +
 sysdeps/i386/i686/memcmp.S                       |  2 ++
 sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
 sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
 sysdeps/i386/memcmp.S                            |  2 ++
 sysdeps/ia64/memcmp.S                            |  1 +
 sysdeps/mach/hurd/i386/libc.abilist              |  1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
 .../powerpc32/power4/multiarch/memcmp-power7.S   |  3 +++
 .../powerpc32/power4/multiarch/memcmp-ppc32.S    |  4 ++++
 sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
 .../powerpc/powerpc64/multiarch/memcmp-power10.S |  2 ++
 .../powerpc/powerpc64/multiarch/memcmp-power4.S  |  2 ++
 .../powerpc/powerpc64/multiarch/memcmp-power7.S  |  2 ++
 .../powerpc/powerpc64/multiarch/memcmp-power8.S  |  2 ++
 .../powerpc/powerpc64/multiarch/memcmp-ppc64.c   |  4 ++++
 sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
 sysdeps/s390/memcmp-z900.S                       |  1 +
 sysdeps/s390/memcmp.c                            |  1 +
 sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
 .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
 .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
 .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
 .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
 .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
 sysdeps/x86_64/memcmp.S                          |  2 ++
 sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
 sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
 64 files changed, 120 insertions(+)

diff --git a/string/Versions b/string/Versions
index 298ecd401a..864c4cf7a4 100644
--- a/string/Versions
+++ b/string/Versions
@@ -89,4 +89,7 @@ libc {
     sigdescr_np; sigabbrev_np;
     strerrordesc_np; strerrorname_np;
   }
+  GLIBC_2.35 {
+    __memcmpeq;
+  }
 }
diff --git a/string/memcmp.c b/string/memcmp.c
index 9b46d7a905..eac4112530 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -359,3 +359,6 @@ libc_hidden_builtin_def(memcmp)
 # undef bcmp
 weak_alias (memcmp, bcmp)
 #endif
+
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
diff --git a/string/string.h b/string/string.h
index b1b083edce..e70feeaeea 100644
--- a/string/string.h
+++ b/string/string.h
@@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
+/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
+   Return some non-zero value otherwise.
+
+   Essentially __memcmpeq has the exact same semantics as memcmp
+   except the return value is less constrained.  memcmp is always a
+   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
+   or bcmp are correct implementations.
+
+   __memcmpeq is meant to be used by compilers when memcmp return is
+   only used for its bolean value.
+
+   __memcmpeq is declared only for use by compilers.  Programs should
+   continue to use memcmp.  */
+extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Search N bytes of S for C.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
diff --git a/string/tester.c b/string/tester.c
index 778160ae6e..605b3f00f9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1449,6 +1449,19 @@ test_bcmp (void)
   check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
 }
 
+static void
+test_memcmpeq (void)
+{
+  it = "__memcmpeq";
+  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
+  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
+  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
+  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
+  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
+  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
+  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
+}
+
 static void
 test_strerror (void)
 {
@@ -1611,6 +1624,9 @@ main (void)
   /* bcmp - somewhat like memcmp.  */
   test_bcmp ();
 
+  /* __memcmpeq - somewhat like memcmp.  */
+  test_memcmpeq ();
+
   /* strndup.  */
   test_strndup ();
 
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index c1937f6f5c..37f37b9191 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -177,4 +177,6 @@ L(ret_0):
 END (memcmp)
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 1560387618..2a4ae577b0 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -138,5 +138,6 @@ ENTRY (memcmp)
 	br	.L_s1_aligned
 END (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index b26b124fad..90266d904b 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -405,4 +405,6 @@ L(table_32bytes) :
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
index 5f6658b89a..a5b5c3d349 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -30,6 +30,9 @@
 
 # undef weak_alias
 # define weak_alias(original, alias)
+
+# undef strong_alias
+# define strong_alias(original, alias)
 #endif
 
 #include <sysdeps/i386/i686/memcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 6e058a8857..3b2815edbc 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -29,4 +29,5 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 1f212b0f6d..02473c2c0c 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -70,4 +70,6 @@ END (memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 97539c23fd..7722908751 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -160,4 +160,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index c5da10a0cd..e849d6fa35 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
 GLIBC_2.34 shm_open F
 GLIBC_2.34 shm_unlink F
 GLIBC_2.34 timespec_getres F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6a54d90f..c2836040a7 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -126,3 +126,4 @@ L(st2):
 END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 814d2f211d..f58e34aba5 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
index 8a929b2b44..b17d0e43b7 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
@@ -38,4 +38,7 @@
 #undef weak_alias
 #define weak_alias(a, b)
 
+#undef strong_alias
+#define strong_alias(a, b)
+
 #include <sysdeps/powerpc/powerpc32/power7/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
index 317523b743..893b6cac9c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
@@ -40,6 +40,10 @@
 # undef weak_alias
 # define weak_alias(a, b)					\
   .weak b ; b = __memcmp_ppc
+
+# undef strong_alias
+# define strong_alias(a, b)					\
+  .globl b ; b = __memcmp_ppc
 #endif
 
 #include <sysdeps/powerpc/powerpc32/power4/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 8a19953e2d..f8deb4e32c 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1373,3 +1373,4 @@ END (memcmp)
 
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index 52f244e7e7..f81c73a29c 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -177,3 +177,4 @@ L(tail8):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
index 73a0debd4a..22399f143d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
@@ -22,5 +22,7 @@
 #define libc_hidden_builtin_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
+#undef strong_alias
+#define strong_alias(name,alias)
 
 #include <sysdeps/powerpc/powerpc64/le/power10/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
index d2b6c2f934..fe68912a3b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
@@ -22,5 +22,7 @@
 #define libc_hidden_builtin_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
+#undef strong_alias
+#define strong_alias(name,alias)
 
 #include <sysdeps/powerpc/powerpc64/power4/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
index 8671e930f0..5739471a7d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
@@ -22,5 +22,7 @@
 #define libc_hidden_builtin_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
+#undef strong_alias
+#define strong_alias(name,alias)
 
 #include <sysdeps/powerpc/powerpc64/power7/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
index eb2273d468..e6a93e88c6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
@@ -22,5 +22,7 @@
 #define libc_hidden_builtin_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
+#undef strong_alias
+#define strong_alias(name,alias)
 
 #include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
index 1f9f219971..2bc5fa50d7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
@@ -22,6 +22,10 @@
 #define weak_alias(name, aliasname) \
   extern __typeof (__memcmp_ppc) aliasname \
     __attribute__ ((weak, alias ("__memcmp_ppc")));
+#undef strong_alias
+#define strong_alias(name, aliasname) \
+  extern __typeof (__memcmp_ppc) aliasname \
+    __attribute__ ((alias ("__memcmp_ppc")));
 #if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index dc1be3a0d8..cc82be115f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1374,3 +1374,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index bc034a55bc..3044f7ede9 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1059,3 +1059,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index b676b09a9b..0c6a154502 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1442,3 +1442,4 @@ L(duzeroLength):
 END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index 995d52e47d..d625bf90dd 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -164,6 +164,7 @@ END(MEMCMP_Z196)
    Otherwise see sysdeps/s390/memcmp.c.  */
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
+strong_alias (memcmp, __memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 0b4e9da717..52c20af772 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      })
 		      )
 weak_alias (memcmp, bcmp);
+strong_alias (memcmp, __memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index d8d9ff9b24..fefeee5f5d 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -137,4 +137,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 21a2e50a88..f227ae6cee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index a201fd69ba..0ccc3fc73e 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2611436937..fd80704787 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index a426241965..2ae6c58b8a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 02f80418cc..fcfd1e8594 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index b7676eb372..ba034b8541 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f6965c9d95..b7460bec8a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 2e7603d9ed..a4dc341ded 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index dd3a56d3fe..94b222dbc7 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c1e0ea9c10..12fd3b6310 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 93161048ca..4d2296007a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 0aaeec8a27..a223278a3d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index bec5f456c9..780a4f5b0b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 97d2127f78..cd65136062 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index acb0756c11..b5b9902db5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ebc21dde1e..57593d5f94 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c68f7e3c6c..e944d76bed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e5b6834f14..8af5a3a90d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 132707c8ad..3a0213b39f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 0af2be31a0..f57df0234b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index cf864632d0..259a0cfc51 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index d566d675d0..126541daf1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index c9a7eacb32..05df4d13d2 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 8299131cb2..8e349cbff8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c3fe78f77f..e9de402766 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 83e542aa8c..1a010c745d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dc502f6833..22ce530975 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index cba1abb556..960df07b83 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d4a516fb47..eedb376f3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 6268875ba3..86e0c92bef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 095e914b73..5e59d90623 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index dd910f7fe9..94412dc134 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
 GLIBC_2.34 tss_delete F
 GLIBC_2.34 tss_get F
 GLIBC_2.34 tss_set F
+GLIBC_2.35 __memcmpeq F
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 870e15c5a0..1b351ee092 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -358,4 +358,6 @@ END(memcmp)
 
 #undef bcmp
 weak_alias (memcmp, bcmp)
+#undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
index b135fa2d40..af737c5e6c 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -26,6 +26,9 @@
 
 # undef weak_alias
 # define weak_alias(ignored1, ignored2)
+
+# undef strong_alias
+# define strong_alias(ignored1, ignored2)
 #endif
 
 #include <sysdeps/x86_64/memcmp.S>
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index fe725f3563..4a3aad2c9c 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -29,6 +29,8 @@
 libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 # undef bcmp
 weak_alias (memcmp, bcmp)
+# undef __memcmpeq
+strong_alias (memcmp, __memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
@ 2021-10-23 23:24   ` Noah Goldstein
  2021-10-26 18:56     ` H.J. Lu
  2021-10-23 23:24   ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-23 23:24 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
 include/string.h                                           | 1 +
 string/memcmp.c                                            | 1 +
 sysdeps/aarch64/memcmp.S                                   | 1 +
 sysdeps/csky/abiv2/memcmp.S                                | 1 +
 sysdeps/i386/i686/memcmp.S                                 | 1 +
 sysdeps/i386/i686/multiarch/memcmp-ia32.S                  | 4 ++++
 sysdeps/i386/i686/multiarch/memcmp.c                       | 1 +
 sysdeps/i386/memcmp.S                                      | 1 +
 sysdeps/ia64/memcmp.S                                      | 1 +
 sysdeps/powerpc/powerpc32/405/memcmp.S                     | 1 +
 sysdeps/powerpc/powerpc32/power4/memcmp.S                  | 1 +
 sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S | 3 +++
 sysdeps/powerpc/powerpc32/power7/memcmp.S                  | 1 +
 sysdeps/powerpc/powerpc64/le/power10/memcmp.S              | 1 +
 sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S       | 2 ++
 sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S        | 2 ++
 sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S        | 2 ++
 sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S        | 2 ++
 sysdeps/powerpc/powerpc64/power4/memcmp.S                  | 1 +
 sysdeps/powerpc/powerpc64/power7/memcmp.S                  | 1 +
 sysdeps/powerpc/powerpc64/power8/memcmp.S                  | 1 +
 sysdeps/s390/memcmp-z900.S                                 | 1 +
 sysdeps/s390/memcmp.c                                      | 1 +
 sysdeps/sparc/sparc64/memcmp.S                             | 1 +
 sysdeps/x86_64/memcmp.S                                    | 1 +
 sysdeps/x86_64/multiarch/memcmp-sse2.S                     | 3 +++
 sysdeps/x86_64/multiarch/memcmp.c                          | 1 +
 27 files changed, 38 insertions(+)

diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
 libc_hidden_proto (__strsep_g)
 libc_hidden_proto (strnlen)
 libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
 libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index eac4112530..4620e79f29 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp)
 
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def(__memcmpeq)
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
 .weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 90266d904b..cc3329bef4 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
index a5b5c3d349..74188f74ab 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -26,6 +26,10 @@
    used by IFUNC.  */
 #  define libc_hidden_builtin_def(name) \
 	.globl __GI_memcmp; __GI_memcmp = memcmp
+
+#  undef libc_hidden_def
+#  define libc_hidden_def(name) \
+	.globl __GI___memcmpeq; __GI___memcmpeq = __memcmpeq
 # endif
 
 # undef weak_alias
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp,bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
index b17d0e43b7..cb1338c650 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
@@ -35,6 +35,9 @@
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
 
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+
 #undef weak_alias
 #define weak_alias(a, b)
 
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
index 22399f143d..07a83b07b9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
@@ -20,6 +20,8 @@
 
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
 #undef strong_alias
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
index fe68912a3b..3308222a4b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
@@ -20,6 +20,8 @@
 
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
 #undef strong_alias
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
index 5739471a7d..b02174b328 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
@@ -20,6 +20,8 @@
 
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
 #undef strong_alias
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
index e6a93e88c6..5eb4b58691 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
@@ -20,6 +20,8 @@
 
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
 #undef weak_alias
 #define weak_alias(name,alias)
 #undef strong_alias
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
 libc_hidden_builtin_def (memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
 strong_alias (MEMCMP_DEFAULT, memcmp)
 weak_alias (memcmp, bcmp)
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
 
 #if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
 		      )
 weak_alias (memcmp, bcmp);
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 #endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 1b351ee092..8a03e572e8 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp)
 #undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
 libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
index af737c5e6c..7b30b7ca2e 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -22,6 +22,9 @@
 # ifdef SHARED
 #  undef libc_hidden_builtin_def
 #  define libc_hidden_builtin_def(name)
+
+#  undef libc_hidden_def
+#  define libc_hidden_def(ignored)
 # endif
 
 # undef weak_alias
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 weak_alias (memcmp, bcmp)
 # undef __memcmpeq
 strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
 
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v14 3/4] String: Add tests for __memcmpeq
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
  2021-10-23 23:24   ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-23 23:24   ` Noah Goldstein
  2021-10-26 18:57     ` H.J. Lu
  2021-10-23 23:24   ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-23 23:24 UTC (permalink / raw)
  To: libc-alpha

No bug.

This commit adds tests for the new function __memcmpeq. The new tests
use the existing tests in 'test-memcmp.c' but relax the result
requirement to only check for zero or non-zero returns.

All string tests include test-memcmpeq are passing.
---
 string/Makefile        |  4 ++--
 string/test-memcmp.c   | 34 ++++++++++++++++++++++------------
 string/test-memcmpeq.c | 21 +++++++++++++++++++++
 3 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 string/test-memcmpeq.c

diff --git a/string/Makefile b/string/Makefile
index f0fce2a0b8..40d6fac133 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   sigdescr_np sigabbrev_np strerrorname_np		\
 		   strerrordesc_np
 
-strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
-		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
+		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
 		   strstr strcasestr strnlen strcasecmp strncasecmp	\
 		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6ddbc05d2f..fdf148102c 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -17,11 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef WIDE
+#ifdef TEST_MEMCMPEQ
+# define TEST_NAME "__memcmpeq"
+#elif defined WIDE
 # define TEST_NAME "wmemcmp"
 #else
 # define TEST_NAME "memcmp"
 #endif
+
 #include "test-string.h"
 #ifdef WIDE
 # include <inttypes.h>
@@ -35,8 +38,9 @@
 # define CHARBYTES 4
 # define CHAR__MIN WCHAR_MIN
 # define CHAR__MAX WCHAR_MAX
+
 int
-simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
 {
   int ret = 0;
   /* Warning!
@@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 }
 #else
 # include <limits.h>
-
-# define MEMCMP memcmp
+# ifdef TEST_MEMCMPEQ
+#  define MEMCMP __memcmpeq
+#  define SIMPLE_MEMCMP simple_memcmpeq
+# else
+#  define MEMCMP memcmp
+#  define SIMPLE_MEMCMP simple_memcmp
+# endif
 # define MEMCPY memcpy
-# define SIMPLE_MEMCMP simple_memcmp
 # define CHAR char
 # define MAX_CHAR 255
 # define UCHAR unsigned char
@@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
 # define CHAR__MAX CHAR_MAX
 
 int
-simple_memcmp (const char *s1, const char *s2, size_t n)
+SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
 {
   int ret = 0;
 
@@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
 }
 #endif
 
+#ifndef BAD_RESULT
+# define BAD_RESULT(result, expec)                                      \
+    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
+     ((result) > 0 && (expec) <= 0))
+# endif
+
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
 IMPL (SIMPLE_MEMCMP, 0)
@@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
 	      int exp_result)
 {
   int result = CALL (impl, s1, s2, len);
-  if ((exp_result == 0 && result != 0)
-      || (exp_result < 0 && result >= 0)
-      || (exp_result > 0 && result <= 0))
+  if (BAD_RESULT(result, exp_result))
     {
       error (0, 0, "Wrong result in function %s %d %d", impl->name,
 	     result, exp_result);
@@ -186,9 +198,7 @@ do_random_tests (void)
 	{
 	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
 		    len);
-	  if ((r == 0 && result)
-	      || (r < 0 && result >= 0)
-	      || (r > 0 && result <= 0))
+	  if (BAD_RESULT(r, result))
 	    {
 	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
 		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
new file mode 100644
index 0000000000..8889117868
--- /dev/null
+++ b/string/test-memcmpeq.c
@@ -0,0 +1,21 @@
+/* Test and measure __memcmpeq functions.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
+#define TEST_MEMCMPEQ 1
+#include "test-memcmp.c"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* [PATCH v14 4/4] NEWS: Add item for __memcmpeq
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
  2021-10-23 23:24   ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
  2021-10-23 23:24   ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-23 23:24   ` Noah Goldstein
  2021-10-26 18:58     ` H.J. Lu
  2021-10-25  2:45   ` [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
  2021-10-26 18:55   ` H.J. Lu
  4 siblings, 1 reply; 106+ messages in thread
From: Noah Goldstein @ 2021-10-23 23:24 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index b39b1e5e33..82b7016aef 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   DSO sorting algorithms.  The default setting of '1' uses the current existing
   algorithm, while a value of '2' selects the new DFS-based algorithm.
 
+* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
+  to be used by compilers for optimizing usage of 'memcmp' when its
+  return value is only used for its boolean status.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The r_version update in the debugger interface makes the glibc binary
-- 
2.25.1


^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
                     ` (2 preceding siblings ...)
  2021-10-23 23:24   ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-25  2:45   ` Noah Goldstein
  2021-10-26 18:55   ` H.J. Lu
  4 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-25  2:45 UTC (permalink / raw)
  To: GNU C Library

On Sat, Oct 23, 2021 at 7:24 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> No bug.
>
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
>
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
>
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
>
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  3 +++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  .../powerpc32/power4/multiarch/memcmp-power7.S   |  3 +++
>  .../powerpc32/power4/multiarch/memcmp-ppc32.S    |  4 ++++
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  .../powerpc/powerpc64/multiarch/memcmp-power10.S |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power4.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power7.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power8.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-ppc64.c   |  4 ++++
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  64 files changed, 120 insertions(+)
>
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..eac4112530 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -359,3 +359,6 @@ libc_hidden_builtin_def(memcmp)
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
>  #endif
> +
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);        /* Zero count. */
>  }
>
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>         br      .L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> index 5f6658b89a..a5b5c3d349 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> @@ -30,6 +30,9 @@
>
>  # undef weak_alias
>  # define weak_alias(original, alias)
> +
> +# undef strong_alias
> +# define strong_alias(original, alias)
>  #endif
>
>  #include <sysdeps/i386/i686/memcmp.S>
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> index 8a929b2b44..b17d0e43b7 100644
> --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> @@ -38,4 +38,7 @@
>  #undef weak_alias
>  #define weak_alias(a, b)
>
> +#undef strong_alias
> +#define strong_alias(a, b)
> +
>  #include <sysdeps/powerpc/powerpc32/power7/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> index 317523b743..893b6cac9c 100644
> --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> @@ -40,6 +40,10 @@
>  # undef weak_alias
>  # define weak_alias(a, b)                                      \
>    .weak b ; b = __memcmp_ppc
> +
> +# undef strong_alias
> +# define strong_alias(a, b)                                    \
> +  .globl b ; b = __memcmp_ppc
>  #endif
>
>  #include <sysdeps/powerpc/powerpc32/power4/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> index 73a0debd4a..22399f143d 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>
>  #include <sysdeps/powerpc/powerpc64/le/power10/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> index d2b6c2f934..fe68912a3b 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>
>  #include <sysdeps/powerpc/powerpc64/power4/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> index 8671e930f0..5739471a7d 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>
>  #include <sysdeps/powerpc/powerpc64/power7/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> index eb2273d468..e6a93e88c6 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>
>  #include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> index 1f9f219971..2bc5fa50d7 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> @@ -22,6 +22,10 @@
>  #define weak_alias(name, aliasname) \
>    extern __typeof (__memcmp_ppc) aliasname \
>      __attribute__ ((weak, alias ("__memcmp_ppc")));
> +#undef strong_alias
> +#define strong_alias(name, aliasname) \
> +  extern __typeof (__memcmp_ppc) aliasname \
> +    __attribute__ ((alias ("__memcmp_ppc")));
>  #if IS_IN (libc) && defined(SHARED)
>  # undef libc_hidden_builtin_def
>  # define libc_hidden_builtin_def(name) \
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>                       })
>                       )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..1b351ee092 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> index b135fa2d40..af737c5e6c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
> +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> @@ -26,6 +26,9 @@
>
>  # undef weak_alias
>  # define weak_alias(ignored1, ignored2)
> +
> +# undef strong_alias
> +# define strong_alias(ignored1, ignored2)
>  #endif
>
>  #include <sysdeps/x86_64/memcmp.S>
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> --
> 2.25.1
>

build-many passes for everything:

```
noah[07:16:44]:~/programs/opensource/glibc-dev$ rm -rf build-many;
python3 src/glibc/scripts/build-many-glibcs.py build-many/ checkout
gcc-vcs-11; (cd build-many/src/glibc; git am
/home/noah/programs/opensource/glibc-dev/*.patch;); python3
src/glibc/scripts/build-many-glibcs.py build-many host-libraries
--keep=failed; echo "BUILD-COMPILERS"; python3
src/glibc/scripts/build-many-glibcs.py build-many compilers
--keep=all; echo "BUILD-GLIBC"; python3
src/glibc/scripts/build-many-glibcs.py build-many glibcs --keep=failed
configure.ac:83: installing 'build-aux/compile'
configure.ac:46: installing 'build-aux/config.guess'
configure.ac:46: installing 'build-aux/config.sub'
configure.ac:26: installing 'build-aux/install-sh'
configure.ac:26: installing 'build-aux/missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing 'build-aux/depcomp'
Makefile.am:32: installing 'build-aux/mdate-sh'
doc/Makefrag.am:106: warning: user target '$(srcdir)/doc/version.texi'
defined here ...
Makefile.am:155:   'doc/Makefrag.am' included from here
/usr/share/automake-1.16/am/texi-vers.am: ... overrides Automake
target '$(srcdir)/doc/version.texi' defined here
Makefile.am:32: installing 'build-aux/texinfo.tex'
parallel-tests: installing 'build-aux/test-driver'
configure.ac:25: installing 'build-aux/compile'
configure.ac:9: installing 'build-aux/config.guess'
configure.ac:9: installing 'build-aux/config.sub'
configure.ac:14: installing 'build-aux/install-sh'
configure.ac:14: installing 'build-aux/missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing 'build-aux/depcomp'
configure.ac: installing 'build-aux/ylwrap'
parallel-tests: installing 'build-aux/test-driver'
Applying: String: Add support for __memcmpeq() ABI on all targets
Applying: String: Add hidden defs for __memcmpeq() to enable internal usage
Applying: String: Add tests for __memcmpeq
Applying: NEWS: Add item for __memcmpeq
PASS: host-libraries gmp rm
PASS: host-libraries gmp mkdir
PASS: host-libraries gmp configure
PASS: host-libraries gmp build
PASS: host-libraries gmp check
PASS: host-libraries gmp install
PASS: host-libraries gmp cleanup
PASS: host-libraries mpfr rm
PASS: host-libraries mpfr mkdir
PASS: host-libraries mpfr configure
PASS: host-libraries mpfr build
PASS: host-libraries mpfr check
PASS: host-libraries mpfr install
PASS: host-libraries mpfr cleanup
PASS: host-libraries mpc rm
PASS: host-libraries mpc mkdir
PASS: host-libraries mpc configure
PASS: host-libraries mpc build
PASS: host-libraries mpc check
PASS: host-libraries mpc install
PASS: host-libraries mpc cleanup
PASS: host-libraries done
BUILD-COMPILERS
PASS: compilers-arm-linux-gnueabihf check-host-libraries
PASS: compilers-arm-linux-gnueabihf binutils rm
PASS: compilers-arm-linux-gnueabihf binutils mkdir
PASS: compilers-arm-linux-gnueabihf binutils configure
PASS: compilers-aarch64_be-linux-gnu check-host-libraries
PASS: compilers-aarch64_be-linux-gnu binutils rm
PASS: compilers-aarch64_be-linux-gnu binutils mkdir
PASS: compilers-aarch64_be-linux-gnu binutils configure
PASS: compilers-aarch64-linux-gnu check-host-libraries
PASS: compilers-aarch64-linux-gnu binutils rm
PASS: compilers-aarch64-linux-gnu binutils mkdir
PASS: compilers-aarch64-linux-gnu binutils configure
PASS: compilers-arc-linux-gnu check-host-libraries
PASS: compilers-arc-linux-gnu binutils rm
PASS: compilers-arc-linux-gnu binutils mkdir
PASS: compilers-arc-linux-gnu binutils configure
PASS: compilers-arm-linux-gnueabi check-host-libraries
PASS: compilers-arm-linux-gnueabi binutils rm
PASS: compilers-arm-linux-gnueabi binutils mkdir
PASS: compilers-arm-linux-gnueabi binutils configure
PASS: compilers-arceb-linux-gnu check-host-libraries
PASS: compilers-arceb-linux-gnu binutils rm
PASS: compilers-arceb-linux-gnu binutils mkdir
PASS: compilers-arceb-linux-gnu binutils configure
PASS: compilers-arc-linux-gnuhf check-host-libraries
PASS: compilers-arc-linux-gnuhf binutils rm
PASS: compilers-arc-linux-gnuhf binutils mkdir
PASS: compilers-arc-linux-gnuhf binutils configure
PASS: compilers-alpha-linux-gnu check-host-libraries
PASS: compilers-alpha-linux-gnu binutils rm
PASS: compilers-alpha-linux-gnu binutils mkdir
PASS: compilers-alpha-linux-gnu binutils configure
PASS: compilers-arc-linux-gnuhf binutils build
PASS: compilers-arc-linux-gnu binutils build
PASS: compilers-arceb-linux-gnu binutils build
PASS: compilers-alpha-linux-gnu binutils build
PASS: compilers-arc-linux-gnu binutils install
PASS: compilers-arc-linux-gnu linux rm
PASS: compilers-arc-linux-gnu linux mkdir
PASS: compilers-arc-linux-gnuhf binutils install
PASS: compilers-arc-linux-gnuhf linux rm
PASS: compilers-arc-linux-gnuhf linux mkdir
PASS: compilers-arceb-linux-gnu binutils install
PASS: compilers-arceb-linux-gnu linux rm
PASS: compilers-arceb-linux-gnu linux mkdir
PASS: compilers-alpha-linux-gnu binutils install
PASS: compilers-alpha-linux-gnu linux rm
PASS: compilers-alpha-linux-gnu linux mkdir
PASS: compilers-arm-linux-gnueabihf binutils build
PASS: compilers-arm-linux-gnueabi binutils build
PASS: compilers-arc-linux-gnu linux install-headers
PASS: compilers-arc-linux-gnuhf linux install-headers
PASS: compilers-arceb-linux-gnu linux install-headers
PASS: compilers-arm-linux-gnueabi binutils install
PASS: compilers-arm-linux-gnueabi linux rm
PASS: compilers-arm-linux-gnueabi linux mkdir
PASS: compilers-arm-linux-gnueabihf binutils install
PASS: compilers-arm-linux-gnueabihf linux rm
PASS: compilers-arm-linux-gnueabihf linux mkdir
PASS: compilers-alpha-linux-gnu linux install-headers
PASS: compilers-arc-linux-gnu gcc-first rm
PASS: compilers-arc-linux-gnu gcc-first mkdir
PASS: compilers-arc-linux-gnu gcc-first configure
PASS: compilers-arc-linux-gnuhf gcc-first rm
PASS: compilers-arc-linux-gnuhf gcc-first mkdir
PASS: compilers-arc-linux-gnuhf gcc-first configure
PASS: compilers-arceb-linux-gnu gcc-first rm
PASS: compilers-arceb-linux-gnu gcc-first mkdir
PASS: compilers-arceb-linux-gnu gcc-first configure
PASS: compilers-alpha-linux-gnu gcc-first rm
PASS: compilers-alpha-linux-gnu gcc-first mkdir
PASS: compilers-alpha-linux-gnu gcc-first configure
PASS: compilers-arm-linux-gnueabihf linux install-headers
PASS: compilers-arm-linux-gnueabi linux install-headers
PASS: compilers-aarch64_be-linux-gnu binutils build
PASS: compilers-aarch64-linux-gnu binutils build
PASS: compilers-arm-linux-gnueabihf gcc-first rm
PASS: compilers-arm-linux-gnueabihf gcc-first mkdir
PASS: compilers-arm-linux-gnueabihf gcc-first configure
PASS: compilers-arm-linux-gnueabi gcc-first rm
PASS: compilers-arm-linux-gnueabi gcc-first mkdir
PASS: compilers-arm-linux-gnueabi gcc-first configure
PASS: compilers-aarch64_be-linux-gnu binutils install
PASS: compilers-aarch64_be-linux-gnu linux rm
PASS: compilers-aarch64_be-linux-gnu linux mkdir
PASS: compilers-aarch64-linux-gnu binutils install
PASS: compilers-aarch64-linux-gnu linux rm
PASS: compilers-aarch64-linux-gnu linux mkdir
PASS: compilers-aarch64_be-linux-gnu linux install-headers
PASS: compilers-aarch64-linux-gnu linux install-headers
PASS: compilers-aarch64_be-linux-gnu gcc-first rm
PASS: compilers-aarch64_be-linux-gnu gcc-first mkdir
PASS: compilers-aarch64_be-linux-gnu gcc-first configure
PASS: compilers-aarch64-linux-gnu gcc-first rm
PASS: compilers-aarch64-linux-gnu gcc-first mkdir
PASS: compilers-aarch64-linux-gnu gcc-first configure
PASS: compilers-alpha-linux-gnu gcc-first build
PASS: compilers-alpha-linux-gnu gcc-first install
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu rm
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu mkdir
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu configure
PASS: compilers-arceb-linux-gnu gcc-first build
PASS: compilers-arc-linux-gnu gcc-first build
PASS: compilers-arc-linux-gnuhf gcc-first build
PASS: compilers-arceb-linux-gnu gcc-first install
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu rm
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu mkdir
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu configure
PASS: compilers-arc-linux-gnu gcc-first install
PASS: compilers-arc-linux-gnuhf gcc-first install
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu rm
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu mkdir
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu configure
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf rm
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf mkdir
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf configure
PASS: compilers-arm-linux-gnueabi gcc-first build
PASS: compilers-arm-linux-gnueabihf gcc-first build
PASS: compilers-arm-linux-gnueabi gcc-first install
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi rm
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi mkdir
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi configure
PASS: compilers-arm-linux-gnueabihf gcc-first install
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf rm
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf mkdir
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf configure
PASS: compilers-aarch64_be-linux-gnu gcc-first build
PASS: compilers-aarch64-linux-gnu gcc-first build
PASS: compilers-aarch64_be-linux-gnu gcc-first install
PASS: compilers-aarch64-linux-gnu gcc-first install
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu rm
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu mkdir
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu configure
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu rm
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu mkdir
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu configure
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf build
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu build
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu build
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf install
PASS: compilers-arc-linux-gnuhf glibc arc-linux-gnuhf mkdir-lib
PASS: compilers-arc-linux-gnuhf gcc rm
PASS: compilers-arc-linux-gnuhf gcc mkdir
PASS: compilers-arc-linux-gnuhf gcc configure
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu install
PASS: compilers-arceb-linux-gnu glibc arceb-linux-gnu mkdir-lib
PASS: compilers-arceb-linux-gnu gcc rm
PASS: compilers-arceb-linux-gnu gcc mkdir
PASS: compilers-arceb-linux-gnu gcc configure
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu install
PASS: compilers-arc-linux-gnu glibc arc-linux-gnu mkdir-lib
PASS: compilers-arc-linux-gnu gcc rm
PASS: compilers-arc-linux-gnu gcc mkdir
PASS: compilers-arc-linux-gnu gcc configure
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu build
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu install
PASS: compilers-alpha-linux-gnu glibc alpha-linux-gnu mkdir-lib
PASS: compilers-alpha-linux-gnu gcc rm
PASS: compilers-alpha-linux-gnu gcc mkdir
PASS: compilers-alpha-linux-gnu gcc configure
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi build
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf build
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi install
PASS: compilers-arm-linux-gnueabi glibc arm-linux-gnueabi mkdir-lib
PASS: compilers-arm-linux-gnueabi gcc rm
PASS: compilers-arm-linux-gnueabi gcc mkdir
PASS: compilers-arm-linux-gnueabi gcc configure
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf install
PASS: compilers-arm-linux-gnueabihf glibc arm-linux-gnueabihf mkdir-lib
PASS: compilers-arm-linux-gnueabihf gcc rm
PASS: compilers-arm-linux-gnueabihf gcc mkdir
PASS: compilers-arm-linux-gnueabihf gcc configure
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu build
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu build
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu install
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu install
PASS: compilers-aarch64-linux-gnu glibc aarch64-linux-gnu mkdir-lib
PASS: compilers-aarch64-linux-gnu gcc rm
PASS: compilers-aarch64-linux-gnu gcc mkdir
PASS: compilers-aarch64-linux-gnu gcc configure
PASS: compilers-aarch64_be-linux-gnu glibc aarch64_be-linux-gnu mkdir-lib
PASS: compilers-aarch64_be-linux-gnu gcc rm
PASS: compilers-aarch64_be-linux-gnu gcc mkdir
PASS: compilers-aarch64_be-linux-gnu gcc configure
PASS: compilers-arc-linux-gnuhf gcc build
PASS: compilers-arceb-linux-gnu gcc build
PASS: compilers-arc-linux-gnuhf gcc install
PASS: compilers-arc-linux-gnuhf done
PASS: compilers-arceb-linux-gnu gcc install
PASS: compilers-arceb-linux-gnu done
PASS: compilers-arc-linux-gnu gcc build
PASS: compilers-arc-linux-gnu gcc install
PASS: compilers-arc-linux-gnu done
PASS: compilers-alpha-linux-gnu gcc build
PASS: compilers-alpha-linux-gnu gcc install
PASS: compilers-alpha-linux-gnu done
PASS: compilers-armeb-linux-gnueabi check-host-libraries
PASS: compilers-armeb-linux-gnueabi binutils rm
PASS: compilers-armeb-linux-gnueabi binutils mkdir
PASS: compilers-armeb-linux-gnueabi binutils configure
PASS: compilers-armeb-linux-gnueabi-be8 check-host-libraries
PASS: compilers-armeb-linux-gnueabi-be8 binutils rm
PASS: compilers-armeb-linux-gnueabi-be8 binutils mkdir
PASS: compilers-armeb-linux-gnueabi-be8 binutils configure
PASS: compilers-armeb-linux-gnueabihf check-host-libraries
PASS: compilers-armeb-linux-gnueabihf binutils rm
PASS: compilers-armeb-linux-gnueabihf binutils mkdir
PASS: compilers-armeb-linux-gnueabihf binutils configure
PASS: compilers-armeb-linux-gnueabi binutils build
PASS: compilers-armeb-linux-gnueabihf-be8 check-host-libraries
PASS: compilers-armeb-linux-gnueabihf-be8 binutils rm
PASS: compilers-armeb-linux-gnueabihf-be8 binutils mkdir
PASS: compilers-armeb-linux-gnueabihf-be8 binutils configure
PASS: compilers-armeb-linux-gnueabi binutils install
PASS: compilers-armeb-linux-gnueabi linux rm
PASS: compilers-armeb-linux-gnueabi linux mkdir
PASS: compilers-armeb-linux-gnueabi linux install-headers
PASS: compilers-armeb-linux-gnueabi gcc-first rm
PASS: compilers-armeb-linux-gnueabi gcc-first mkdir
PASS: compilers-armeb-linux-gnueabi gcc-first configure
PASS: compilers-armeb-linux-gnueabi-be8 binutils build
PASS: compilers-armeb-linux-gnueabi-be8 binutils install
PASS: compilers-armeb-linux-gnueabi-be8 linux rm
PASS: compilers-armeb-linux-gnueabi-be8 linux mkdir
PASS: compilers-armeb-linux-gnueabi-be8 linux install-headers
PASS: compilers-armeb-linux-gnueabi-be8 gcc-first rm
PASS: compilers-armeb-linux-gnueabi-be8 gcc-first mkdir
PASS: compilers-armeb-linux-gnueabi-be8 gcc-first configure
PASS: compilers-armeb-linux-gnueabihf binutils build
PASS: compilers-armeb-linux-gnueabihf binutils install
PASS: compilers-armeb-linux-gnueabihf linux rm
PASS: compilers-armeb-linux-gnueabihf linux mkdir
PASS: compilers-armeb-linux-gnueabihf linux install-headers
PASS: compilers-armeb-linux-gnueabihf gcc-first rm
PASS: compilers-armeb-linux-gnueabihf gcc-first mkdir
PASS: compilers-armeb-linux-gnueabihf gcc-first configure
PASS: compilers-aarch64-linux-gnu gcc build
PASS: compilers-aarch64-linux-gnu gcc install
PASS: compilers-aarch64-linux-gnu done
PASS: compilers-csky-linux-gnuabiv2 check-host-libraries
PASS: compilers-csky-linux-gnuabiv2 binutils rm
PASS: compilers-csky-linux-gnuabiv2 binutils mkdir
PASS: compilers-csky-linux-gnuabiv2 binutils configure
PASS: compilers-armeb-linux-gnueabihf-be8 binutils build
PASS: compilers-armeb-linux-gnueabihf-be8 binutils install
PASS: compilers-armeb-linux-gnueabihf-be8 linux rm
PASS: compilers-armeb-linux-gnueabihf-be8 linux mkdir
PASS: compilers-armeb-linux-gnueabihf-be8 linux install-headers
PASS: compilers-armeb-linux-gnueabihf-be8 gcc-first rm
PASS: compilers-armeb-linux-gnueabihf-be8 gcc-first mkdir
PASS: compilers-armeb-linux-gnueabihf-be8 gcc-first configure
PASS: compilers-csky-linux-gnuabiv2 binutils build
PASS: compilers-csky-linux-gnuabiv2 binutils install
PASS: compilers-csky-linux-gnuabiv2 linux rm
PASS: compilers-csky-linux-gnuabiv2 linux mkdir
PASS: compilers-csky-linux-gnuabiv2 linux install-headers
PASS: compilers-csky-linux-gnuabiv2 gcc-first rm
PASS: compilers-csky-linux-gnuabiv2 gcc-first mkdir
PASS: compilers-csky-linux-gnuabiv2 gcc-first configure
PASS: compilers-arm-linux-gnueabi gcc build
PASS: compilers-arm-linux-gnueabi gcc install
PASS: compilers-arm-linux-gnueabi done
PASS: compilers-arm-linux-gnueabihf gcc build
PASS: compilers-csky-linux-gnuabiv2-soft check-host-libraries
PASS: compilers-csky-linux-gnuabiv2-soft binutils rm
PASS: compilers-csky-linux-gnuabiv2-soft binutils mkdir
PASS: compilers-csky-linux-gnuabiv2-soft binutils configure
PASS: compilers-arm-linux-gnueabihf gcc install
PASS: compilers-arm-linux-gnueabihf done
PASS: compilers-aarch64_be-linux-gnu gcc build
PASS: compilers-aarch64_be-linux-gnu gcc install
PASS: compilers-aarch64_be-linux-gnu done
PASS: compilers-csky-linux-gnuabiv2-soft binutils build
PASS: compilers-csky-linux-gnuabiv2-soft binutils install
PASS: compilers-csky-linux-gnuabiv2-soft linux rm
PASS: compilers-csky-linux-gnuabiv2-soft linux mkdir
PASS: compilers-hppa-linux-gnu check-host-libraries
PASS: compilers-hppa-linux-gnu binutils rm
PASS: compilers-hppa-linux-gnu binutils mkdir
PASS: compilers-hppa-linux-gnu binutils configure
PASS: compilers-csky-linux-gnuabiv2-soft linux install-headers
PASS: compilers-csky-linux-gnuabiv2-soft gcc-first rm
PASS: compilers-csky-linux-gnuabiv2-soft gcc-first mkdir
PASS: compilers-csky-linux-gnuabiv2-soft gcc-first configure
PASS: compilers-i686-gnu check-host-libraries
PASS: compilers-i686-gnu binutils rm
PASS: compilers-i686-gnu binutils mkdir
PASS: compilers-i686-gnu binutils configure
PASS: compilers-hppa-linux-gnu binutils build
PASS: compilers-hppa-linux-gnu binutils install
PASS: compilers-hppa-linux-gnu linux rm
PASS: compilers-hppa-linux-gnu linux mkdir
PASS: compilers-hppa-linux-gnu linux install-headers
PASS: compilers-hppa-linux-gnu gcc-first rm
PASS: compilers-hppa-linux-gnu gcc-first mkdir
PASS: compilers-hppa-linux-gnu gcc-first configure
PASS: compilers-i686-gnu binutils build
PASS: compilers-i686-gnu binutils install
PASS: compilers-i686-gnu gcc-first rm
PASS: compilers-i686-gnu gcc-first mkdir
PASS: compilers-i686-gnu gcc-first configure
PASS: compilers-armeb-linux-gnueabihf gcc-first build
PASS: compilers-armeb-linux-gnueabihf gcc-first install
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf rm
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf mkdir
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf configure
PASS: compilers-armeb-linux-gnueabi gcc-first build
PASS: compilers-csky-linux-gnuabiv2 gcc-first build
PASS: compilers-armeb-linux-gnueabi gcc-first install
PASS: compilers-csky-linux-gnuabiv2 gcc-first install
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 rm
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 mkdir
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 configure
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi rm
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi mkdir
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi configure
PASS: compilers-armeb-linux-gnueabi-be8 gcc-first build
PASS: compilers-armeb-linux-gnueabi-be8 gcc-first install
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 rm
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 mkdir
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 configure
PASS: compilers-armeb-linux-gnueabihf-be8 gcc-first build
PASS: compilers-armeb-linux-gnueabihf-be8 gcc-first install
PASS: compilers-armeb-linux-gnueabihf-be8 glibc armeb-linux-gnueabihf-be8 rm
PASS: compilers-armeb-linux-gnueabihf-be8 glibc armeb-linux-gnueabihf-be8 mkdir
PASS: compilers-armeb-linux-gnueabihf-be8 glibc
armeb-linux-gnueabihf-be8 configure
PASS: compilers-csky-linux-gnuabiv2-soft gcc-first build
PASS: compilers-csky-linux-gnuabiv2-soft gcc-first install
PASS: compilers-csky-linux-gnuabiv2-soft glibc csky-linux-gnuabiv2-soft rm
PASS: compilers-csky-linux-gnuabiv2-soft glibc csky-linux-gnuabiv2-soft mkdir
PASS: compilers-csky-linux-gnuabiv2-soft glibc
csky-linux-gnuabiv2-soft configure
PASS: compilers-hppa-linux-gnu gcc-first build
PASS: compilers-hppa-linux-gnu gcc-first install
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu rm
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu mkdir
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu configure
PASS: compilers-i686-gnu gcc-first build
PASS: compilers-i686-gnu gcc-first install
PASS: compilers-i686-gnu gnumach rm
PASS: compilers-i686-gnu gnumach mkdir
PASS: compilers-i686-gnu gnumach configure
PASS: compilers-i686-gnu gnumach install
PASS: compilers-i686-gnu mig rm
PASS: compilers-i686-gnu mig mkdir
PASS: compilers-i686-gnu mig configure
PASS: compilers-i686-gnu mig build
PASS: compilers-i686-gnu mig install
PASS: compilers-i686-gnu hurd rm
PASS: compilers-i686-gnu hurd mkdir
PASS: compilers-i686-gnu hurd configure
PASS: compilers-i686-gnu hurd install
PASS: compilers-i686-gnu glibc i686-gnu rm
PASS: compilers-i686-gnu glibc i686-gnu mkdir
PASS: compilers-i686-gnu glibc i686-gnu configure
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 build
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 install
PASS: compilers-csky-linux-gnuabiv2 glibc csky-linux-gnuabiv2 mkdir-lib
PASS: compilers-csky-linux-gnuabiv2 gcc rm
PASS: compilers-csky-linux-gnuabiv2 gcc mkdir
PASS: compilers-csky-linux-gnuabiv2 gcc configure
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf build
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi build
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf install
PASS: compilers-armeb-linux-gnueabihf glibc armeb-linux-gnueabihf mkdir-lib
PASS: compilers-armeb-linux-gnueabihf gcc rm
PASS: compilers-armeb-linux-gnueabihf gcc mkdir
PASS: compilers-armeb-linux-gnueabihf gcc configure
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi install
PASS: compilers-armeb-linux-gnueabi glibc armeb-linux-gnueabi mkdir-lib
PASS: compilers-armeb-linux-gnueabi gcc rm
PASS: compilers-armeb-linux-gnueabi gcc mkdir
PASS: compilers-armeb-linux-gnueabi gcc configure
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 build
PASS: compilers-armeb-linux-gnueabihf-be8 glibc armeb-linux-gnueabihf-be8 build
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 install
PASS: compilers-armeb-linux-gnueabi-be8 glibc armeb-linux-gnueabi-be8 mkdir-lib
PASS: compilers-armeb-linux-gnueabi-be8 gcc rm
PASS: compilers-armeb-linux-gnueabi-be8 gcc mkdir
PASS: compilers-armeb-linux-gnueabi-be8 gcc configure
PASS: compilers-csky-linux-gnuabiv2-soft glibc csky-linux-gnuabiv2-soft build
PASS: compilers-armeb-linux-gnueabihf-be8 glibc
armeb-linux-gnueabihf-be8 install
PASS: compilers-armeb-linux-gnueabihf-be8 glibc
armeb-linux-gnueabihf-be8 mkdir-lib
PASS: compilers-armeb-linux-gnueabihf-be8 gcc rm
PASS: compilers-armeb-linux-gnueabihf-be8 gcc mkdir
PASS: compilers-armeb-linux-gnueabihf-be8 gcc configure
PASS: compilers-csky-linux-gnuabiv2-soft glibc csky-linux-gnuabiv2-soft install
PASS: compilers-csky-linux-gnuabiv2-soft glibc
csky-linux-gnuabiv2-soft mkdir-lib
PASS: compilers-csky-linux-gnuabiv2-soft gcc rm
PASS: compilers-csky-linux-gnuabiv2-soft gcc mkdir
PASS: compilers-csky-linux-gnuabiv2-soft gcc configure
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu build
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu install
PASS: compilers-hppa-linux-gnu glibc hppa-linux-gnu mkdir-lib
PASS: compilers-hppa-linux-gnu gcc rm
PASS: compilers-hppa-linux-gnu gcc mkdir
PASS: compilers-hppa-linux-gnu gcc configure
PASS: compilers-i686-gnu glibc i686-gnu build
PASS: compilers-i686-gnu glibc i686-gnu install
PASS: compilers-i686-gnu glibc i686-gnu mkdir-lib
PASS: compilers-i686-gnu gcc rm
PASS: compilers-i686-gnu gcc mkdir
PASS: compilers-i686-gnu gcc configure
PASS: compilers-csky-linux-gnuabiv2 gcc build
PASS: compilers-csky-linux-gnuabiv2 gcc install
PASS: compilers-csky-linux-gnuabiv2 done
PASS: compilers-ia64-linux-gnu check-host-libraries
PASS: compilers-ia64-linux-gnu binutils rm
PASS: compilers-ia64-linux-gnu binutils mkdir
PASS: compilers-ia64-linux-gnu binutils configure
PASS: compilers-ia64-linux-gnu binutils build
PASS: compilers-ia64-linux-gnu binutils install
PASS: compilers-ia64-linux-gnu linux rm
PASS: compilers-ia64-linux-gnu linux mkdir
PASS: compilers-ia64-linux-gnu linux install-headers
PASS: compilers-ia64-linux-gnu gcc-first rm
PASS: compilers-ia64-linux-gnu gcc-first mkdir
PASS: compilers-ia64-linux-gnu gcc-first configure
PASS: compilers-csky-linux-gnuabiv2-soft gcc build
PASS: compilers-csky-linux-gnuabiv2-soft gcc install
PASS: compilers-csky-linux-gnuabiv2-soft done
PASS: compilers-m68k-linux-gnu check-host-libraries
PASS: compilers-m68k-linux-gnu binutils rm
PASS: compilers-m68k-linux-gnu binutils mkdir
PASS: compilers-m68k-linux-gnu binutils configure
PASS: compilers-hppa-linux-gnu gcc build
PASS: compilers-hppa-linux-gnu gcc install
PASS: compilers-hppa-linux-gnu done
PASS: compilers-m68k-linux-gnu-coldfire check-host-libraries
PASS: compilers-m68k-linux-gnu-coldfire binutils rm
PASS: compilers-m68k-linux-gnu-coldfire binutils mkdir
PASS: compilers-m68k-linux-gnu-coldfire binutils configure
PASS: compilers-m68k-linux-gnu binutils build
PASS: compilers-m68k-linux-gnu binutils install
PASS: compilers-m68k-linux-gnu linux rm
PASS: compilers-m68k-linux-gnu linux mkdir
PASS: compilers-m68k-linux-gnu linux install-headers
PASS: compilers-m68k-linux-gnu gcc-first rm
PASS: compilers-m68k-linux-gnu gcc-first mkdir
PASS: compilers-m68k-linux-gnu gcc-first configure
PASS: compilers-armeb-linux-gnueabihf gcc build
PASS: compilers-armeb-linux-gnueabi gcc build
PASS: compilers-m68k-linux-gnu-coldfire binutils build
PASS: compilers-armeb-linux-gnueabihf gcc install
PASS: compilers-armeb-linux-gnueabihf done
PASS: compilers-m68k-linux-gnu-coldfire binutils install
PASS: compilers-m68k-linux-gnu-coldfire linux rm
PASS: compilers-m68k-linux-gnu-coldfire linux mkdir
PASS: compilers-m68k-linux-gnu-coldfire linux install-headers
PASS: compilers-m68k-linux-gnu-coldfire-soft check-host-libraries
PASS: compilers-m68k-linux-gnu-coldfire-soft binutils rm
PASS: compilers-m68k-linux-gnu-coldfire-soft binutils mkdir
PASS: compilers-m68k-linux-gnu-coldfire-soft binutils configure
PASS: compilers-m68k-linux-gnu-coldfire gcc-first rm
PASS: compilers-m68k-linux-gnu-coldfire gcc-first mkdir
PASS: compilers-m68k-linux-gnu-coldfire gcc-first configure
PASS: compilers-armeb-linux-gnueabi gcc install
PASS: compilers-armeb-linux-gnueabi done
PASS: compilers-armeb-linux-gnueabi-be8 gcc build
PASS: compilers-armeb-linux-gnueabi-be8 gcc install
PASS: compilers-armeb-linux-gnueabi-be8 done
PASS: compilers-armeb-linux-gnueabihf-be8 gcc build
PASS: compilers-microblaze-linux-gnu check-host-libraries
PASS: compilers-microblaze-linux-gnu binutils rm
PASS: compilers-microblaze-linux-gnu binutils mkdir
PASS: compilers-microblaze-linux-gnu binutils configure
PASS: compilers-armeb-linux-gnueabihf-be8 gcc install
PASS: compilers-armeb-linux-gnueabihf-be8 done
PASS: compilers-m68k-linux-gnu-coldfire-soft binutils build
PASS: compilers-m68k-linux-gnu-coldfire-soft binutils install
PASS: compilers-m68k-linux-gnu-coldfire-soft linux rm
PASS: compilers-m68k-linux-gnu-coldfire-soft linux mkdir
PASS: compilers-microblazeel-linux-gnu check-host-libraries
PASS: compilers-microblazeel-linux-gnu binutils rm
PASS: compilers-microblazeel-linux-gnu binutils mkdir
PASS: compilers-microblazeel-linux-gnu binutils configure
PASS: compilers-mips64-linux-gnu check-host-libraries
PASS: compilers-mips64-linux-gnu binutils rm
PASS: compilers-mips64-linux-gnu binutils mkdir
PASS: compilers-mips64-linux-gnu binutils configure
PASS: compilers-m68k-linux-gnu-coldfire-soft linux install-headers
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc-first rm
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc-first mkdir
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc-first configure
PASS: compilers-microblaze-linux-gnu binutils build
PASS: compilers-microblaze-linux-gnu binutils install
PASS: compilers-microblaze-linux-gnu linux rm
PASS: compilers-microblaze-linux-gnu linux mkdir
PASS: compilers-microblaze-linux-gnu linux install-headers
PASS: compilers-microblaze-linux-gnu gcc-first rm
PASS: compilers-microblaze-linux-gnu gcc-first mkdir
PASS: compilers-microblaze-linux-gnu gcc-first configure
PASS: compilers-microblazeel-linux-gnu binutils build
PASS: compilers-microblazeel-linux-gnu binutils install
PASS: compilers-microblazeel-linux-gnu linux rm
PASS: compilers-microblazeel-linux-gnu linux mkdir
PASS: compilers-microblazeel-linux-gnu linux install-headers
PASS: compilers-microblazeel-linux-gnu gcc-first rm
PASS: compilers-microblazeel-linux-gnu gcc-first mkdir
PASS: compilers-microblazeel-linux-gnu gcc-first configure
PASS: compilers-mips64-linux-gnu binutils build
PASS: compilers-mips64-linux-gnu binutils install
PASS: compilers-mips64-linux-gnu linux rm
PASS: compilers-mips64-linux-gnu linux mkdir
PASS: compilers-mips64-linux-gnu linux install-headers
PASS: compilers-mips64-linux-gnu gcc-first rm
PASS: compilers-mips64-linux-gnu gcc-first mkdir
PASS: compilers-mips64-linux-gnu gcc-first configure
PASS: compilers-ia64-linux-gnu gcc-first build
PASS: compilers-ia64-linux-gnu gcc-first install
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu rm
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu mkdir
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu configure
PASS: compilers-i686-gnu gcc build
PASS: compilers-i686-gnu gcc install
PASS: compilers-i686-gnu done
PASS: compilers-mips64-linux-gnu-nan2008 check-host-libraries
PASS: compilers-mips64-linux-gnu-nan2008 binutils rm
PASS: compilers-mips64-linux-gnu-nan2008 binutils mkdir
PASS: compilers-mips64-linux-gnu-nan2008 binutils configure
PASS: compilers-m68k-linux-gnu gcc-first build
PASS: compilers-m68k-linux-gnu gcc-first install
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu rm
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu mkdir
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu configure
PASS: compilers-mips64-linux-gnu-nan2008 binutils build
PASS: compilers-mips64-linux-gnu-nan2008 binutils install
PASS: compilers-mips64-linux-gnu-nan2008 linux rm
PASS: compilers-mips64-linux-gnu-nan2008 linux mkdir
PASS: compilers-mips64-linux-gnu-nan2008 linux install-headers
PASS: compilers-mips64-linux-gnu-nan2008 gcc-first rm
PASS: compilers-mips64-linux-gnu-nan2008 gcc-first mkdir
PASS: compilers-mips64-linux-gnu-nan2008 gcc-first configure
PASS: compilers-m68k-linux-gnu-coldfire gcc-first build
PASS: compilers-m68k-linux-gnu-coldfire gcc-first install
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire rm
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire mkdir
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire configure
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc-first build
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc-first install
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft rm
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft mkdir
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft configure
PASS: compilers-microblaze-linux-gnu gcc-first build
PASS: compilers-microblaze-linux-gnu gcc-first install
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu rm
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu mkdir
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu configure
PASS: compilers-microblazeel-linux-gnu gcc-first build
PASS: compilers-microblazeel-linux-gnu gcc-first install
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu rm
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu mkdir
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu configure
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu build
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu build
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu install
PASS: compilers-m68k-linux-gnu glibc m68k-linux-gnu mkdir-lib
PASS: compilers-m68k-linux-gnu gcc rm
PASS: compilers-m68k-linux-gnu gcc mkdir
PASS: compilers-m68k-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu gcc-first build
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu install
PASS: compilers-ia64-linux-gnu glibc ia64-linux-gnu mkdir-lib
PASS: compilers-ia64-linux-gnu gcc rm
PASS: compilers-ia64-linux-gnu gcc mkdir
PASS: compilers-ia64-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu gcc-first install
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 rm
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 mkdir
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 configure
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire build
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire install
PASS: compilers-m68k-linux-gnu-coldfire glibc m68k-linux-gnu-coldfire mkdir-lib
PASS: compilers-m68k-linux-gnu-coldfire gcc rm
PASS: compilers-m68k-linux-gnu-coldfire gcc mkdir
PASS: compilers-m68k-linux-gnu-coldfire gcc configure
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft build
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu build
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft install
PASS: compilers-m68k-linux-gnu-coldfire-soft glibc
m68k-linux-gnu-coldfire-soft mkdir-lib
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc rm
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc mkdir
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc configure
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu install
PASS: compilers-microblaze-linux-gnu glibc microblaze-linux-gnu mkdir-lib
PASS: compilers-microblaze-linux-gnu gcc rm
PASS: compilers-microblaze-linux-gnu gcc mkdir
PASS: compilers-microblaze-linux-gnu gcc configure
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu build
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu install
PASS: compilers-microblazeel-linux-gnu glibc microblazeel-linux-gnu mkdir-lib
PASS: compilers-microblazeel-linux-gnu gcc rm
PASS: compilers-microblazeel-linux-gnu gcc mkdir
PASS: compilers-microblazeel-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu-nan2008 gcc-first build
PASS: compilers-mips64-linux-gnu-nan2008 gcc-first install
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips64-linux-gnu-n32-nan2008 rm
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n32-nan2008 mkdir
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n32-nan2008 configure
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 build
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 install
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n32 mkdir-lib
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu rm
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu mkdir
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu configure
PASS: compilers-m68k-linux-gnu gcc build
PASS: compilers-ia64-linux-gnu gcc build
PASS: compilers-m68k-linux-gnu gcc install
PASS: compilers-m68k-linux-gnu done
PASS: compilers-ia64-linux-gnu gcc install
PASS: compilers-ia64-linux-gnu done
PASS: compilers-mips64-linux-gnu-nan2008-soft check-host-libraries
PASS: compilers-mips64-linux-gnu-nan2008-soft binutils rm
PASS: compilers-mips64-linux-gnu-nan2008-soft binutils mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft binutils configure
PASS: compilers-mips64-linux-gnu-soft check-host-libraries
PASS: compilers-mips64-linux-gnu-soft binutils rm
PASS: compilers-mips64-linux-gnu-soft binutils mkdir
PASS: compilers-mips64-linux-gnu-soft binutils configure
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n32-nan2008 build
PASS: compilers-mips64-linux-gnu-nan2008-soft binutils build
PASS: compilers-mips64-linux-gnu-nan2008-soft binutils install
PASS: compilers-mips64-linux-gnu-nan2008-soft linux rm
PASS: compilers-mips64-linux-gnu-nan2008-soft linux mkdir
PASS: compilers-m68k-linux-gnu-coldfire gcc build
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n32-nan2008 install
PASS: compilers-mips64-linux-gnu-nan2008-soft linux install-headers
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc-first rm
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc-first mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc-first configure
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n32-nan2008 mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 rm
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 mkdir
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 configure
PASS: compilers-m68k-linux-gnu-coldfire gcc install
PASS: compilers-m68k-linux-gnu-coldfire done
PASS: compilers-mips64el-linux-gnu check-host-libraries
PASS: compilers-mips64el-linux-gnu binutils rm
PASS: compilers-mips64el-linux-gnu binutils mkdir
PASS: compilers-mips64el-linux-gnu binutils configure
PASS: compilers-microblaze-linux-gnu gcc build
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu build
PASS: compilers-microblaze-linux-gnu gcc install
PASS: compilers-microblaze-linux-gnu done
PASS: compilers-mips64el-linux-gnu-nan2008 check-host-libraries
PASS: compilers-mips64el-linux-gnu-nan2008 binutils rm
PASS: compilers-mips64el-linux-gnu-nan2008 binutils mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 binutils configure
PASS: compilers-mips64-linux-gnu-soft binutils build
PASS: compilers-mips64-linux-gnu-soft binutils install
PASS: compilers-mips64-linux-gnu-soft linux rm
PASS: compilers-mips64-linux-gnu-soft linux mkdir
PASS: compilers-mips64-linux-gnu-soft linux install-headers
PASS: compilers-mips64-linux-gnu-soft gcc-first rm
PASS: compilers-mips64-linux-gnu-soft gcc-first mkdir
PASS: compilers-mips64-linux-gnu-soft gcc-first configure
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu install
PASS: compilers-mips64-linux-gnu glibc mips-linux-gnu mkdir-lib
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 rm
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 mkdir
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 configure
PASS: compilers-microblazeel-linux-gnu gcc build
PASS: compilers-microblazeel-linux-gnu gcc install
PASS: compilers-microblazeel-linux-gnu done
PASS: compilers-mips64el-linux-gnu-nan2008-soft check-host-libraries
PASS: compilers-mips64el-linux-gnu-nan2008-soft binutils rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft binutils mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft binutils configure
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc build
PASS: compilers-mips64el-linux-gnu binutils build
PASS: compilers-mips64el-linux-gnu binutils install
PASS: compilers-mips64el-linux-gnu linux rm
PASS: compilers-mips64el-linux-gnu linux mkdir
PASS: compilers-m68k-linux-gnu-coldfire-soft gcc install
PASS: compilers-m68k-linux-gnu-coldfire-soft done
PASS: compilers-mips64el-linux-gnu linux install-headers
PASS: compilers-mips64el-linux-gnu gcc-first rm
PASS: compilers-mips64el-linux-gnu gcc-first mkdir
PASS: compilers-mips64el-linux-gnu gcc-first configure
PASS: compilers-mips64el-linux-gnu-soft check-host-libraries
PASS: compilers-mips64el-linux-gnu-soft binutils rm
PASS: compilers-mips64el-linux-gnu-soft binutils mkdir
PASS: compilers-mips64el-linux-gnu-soft binutils configure
PASS: compilers-mips64el-linux-gnu-nan2008 binutils build
PASS: compilers-mips64el-linux-gnu-nan2008 binutils install
PASS: compilers-mips64el-linux-gnu-nan2008 linux rm
PASS: compilers-mips64el-linux-gnu-nan2008 linux mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 linux install-headers
PASS: compilers-mips64el-linux-gnu-nan2008 gcc-first rm
PASS: compilers-mips64el-linux-gnu-nan2008 gcc-first mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 gcc-first configure
PASS: compilers-mips64el-linux-gnu-nan2008-soft binutils build
PASS: compilers-mips64el-linux-gnu-nan2008-soft binutils install
PASS: compilers-mips64el-linux-gnu-nan2008-soft linux rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft linux mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft linux install-headers
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc-first rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc-first mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc-first configure
PASS: compilers-mips64el-linux-gnu-soft binutils build
PASS: compilers-mips64el-linux-gnu-soft binutils install
PASS: compilers-mips64el-linux-gnu-soft linux rm
PASS: compilers-mips64el-linux-gnu-soft linux mkdir
PASS: compilers-mips64el-linux-gnu-soft linux install-headers
PASS: compilers-mips64el-linux-gnu-soft gcc-first rm
PASS: compilers-mips64el-linux-gnu-soft gcc-first mkdir
PASS: compilers-mips64el-linux-gnu-soft gcc-first configure
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 build
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 install
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips-linux-gnu-nan2008 mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008 glibc mips64-linux-gnu-n64-nan2008 rm
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n64-nan2008 mkdir
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n64-nan2008 configure
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 build
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 install
PASS: compilers-mips64-linux-gnu glibc mips64-linux-gnu-n64 mkdir-lib
PASS: compilers-mips64-linux-gnu gcc rm
PASS: compilers-mips64-linux-gnu gcc mkdir
PASS: compilers-mips64-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc-first build
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc-first install
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft rm
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft configure
PASS: compilers-mips64-linux-gnu-soft gcc-first build
PASS: compilers-mips64-linux-gnu-soft gcc-first install
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft rm
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft mkdir
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft configure
PASS: compilers-mips64el-linux-gnu gcc-first build
PASS: compilers-mips64el-linux-gnu gcc-first install
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 rm
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 mkdir
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 configure
PASS: compilers-mips64el-linux-gnu-nan2008 gcc-first build
PASS: compilers-mips64el-linux-gnu-nan2008 gcc-first install
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 rm
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 configure
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n64-nan2008 build
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc-first build
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc-first install
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft configure
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n64-nan2008 install
PASS: compilers-mips64-linux-gnu-nan2008 glibc
mips64-linux-gnu-n64-nan2008 mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008 gcc rm
PASS: compilers-mips64-linux-gnu-nan2008 gcc mkdir
PASS: compilers-mips64-linux-gnu-nan2008 gcc configure
PASS: compilers-mips64el-linux-gnu-soft gcc-first build
PASS: compilers-mips64el-linux-gnu-soft gcc-first install
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n32-soft rm
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n32-soft mkdir
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n32-soft configure
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft build
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft install
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n32-nan2008-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft rm
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft configure
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft build
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft install
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n32-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft rm
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft mkdir
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft configure
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 build
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 build
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 install
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n32 mkdir-lib
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu rm
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu mkdir
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu configure
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 install
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n32-nan2008 mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008 glibc mipsel-linux-gnu-nan2008 rm
PASS: compilers-mips64el-linux-gnu-nan2008 glibc mipsel-linux-gnu-nan2008 mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mipsel-linux-gnu-nan2008 configure
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft build
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft install
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n32-soft build
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n32-nan2008-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft configure
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n32-soft install
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n32-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft rm
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft mkdir
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft configure
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft build
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft install
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips-linux-gnu-nan2008-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft rm
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft configure
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft build
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft install
PASS: compilers-mips64-linux-gnu-soft glibc mips-linux-gnu-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft rm
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft mkdir
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft configure
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu build
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu install
PASS: compilers-mips64el-linux-gnu glibc mipsel-linux-gnu mkdir-lib
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 rm
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 mkdir
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 configure
PASS: compilers-mips64el-linux-gnu-nan2008 glibc mipsel-linux-gnu-nan2008 build
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mipsel-linux-gnu-nan2008 install
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mipsel-linux-gnu-nan2008 mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 rm
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 configure
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft build
PASS: compilers-mips64-linux-gnu gcc build
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft install
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mipsel-linux-gnu-nan2008-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft configure
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft build
PASS: compilers-mips64-linux-gnu gcc install
PASS: compilers-mips64-linux-gnu done
PASS: compilers-mipsisa64r6el-linux-gnu check-host-libraries
PASS: compilers-mipsisa64r6el-linux-gnu binutils rm
PASS: compilers-mipsisa64r6el-linux-gnu binutils mkdir
PASS: compilers-mipsisa64r6el-linux-gnu binutils configure
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft install
PASS: compilers-mips64el-linux-gnu-soft glibc mipsel-linux-gnu-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n64-soft rm
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n64-soft mkdir
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n64-soft configure
PASS: compilers-mipsisa64r6el-linux-gnu binutils build
PASS: compilers-mipsisa64r6el-linux-gnu binutils install
PASS: compilers-mipsisa64r6el-linux-gnu linux rm
PASS: compilers-mipsisa64r6el-linux-gnu linux mkdir
PASS: compilers-mipsisa64r6el-linux-gnu linux install-headers
PASS: compilers-mipsisa64r6el-linux-gnu gcc-first rm
PASS: compilers-mipsisa64r6el-linux-gnu gcc-first mkdir
PASS: compilers-mipsisa64r6el-linux-gnu gcc-first configure
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft build
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft install
PASS: compilers-mips64-linux-gnu-nan2008-soft glibc
mips64-linux-gnu-n64-nan2008-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc rm
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc mkdir
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc configure
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft build
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft install
PASS: compilers-mips64-linux-gnu-soft glibc mips64-linux-gnu-n64-soft mkdir-lib
PASS: compilers-mips64-linux-gnu-soft gcc rm
PASS: compilers-mips64-linux-gnu-soft gcc mkdir
PASS: compilers-mips64-linux-gnu-soft gcc configure
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 build
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 build
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 install
PASS: compilers-mips64-linux-gnu-nan2008 gcc build
PASS: compilers-mips64el-linux-gnu glibc mips64el-linux-gnu-n64 mkdir-lib
PASS: compilers-mips64el-linux-gnu gcc rm
PASS: compilers-mips64el-linux-gnu gcc mkdir
PASS: compilers-mips64el-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu-nan2008 gcc install
PASS: compilers-mips64-linux-gnu-nan2008 done
PASS: compilers-nios2-linux-gnu check-host-libraries
PASS: compilers-nios2-linux-gnu binutils rm
PASS: compilers-nios2-linux-gnu binutils mkdir
PASS: compilers-nios2-linux-gnu binutils configure
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 install
PASS: compilers-mips64el-linux-gnu-nan2008 glibc
mips64el-linux-gnu-n64-nan2008 mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008 gcc rm
PASS: compilers-mips64el-linux-gnu-nan2008 gcc mkdir
PASS: compilers-mips64el-linux-gnu-nan2008 gcc configure
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft build
PASS: compilers-nios2-linux-gnu binutils build
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft install
PASS: compilers-nios2-linux-gnu binutils install
PASS: compilers-nios2-linux-gnu linux rm
PASS: compilers-nios2-linux-gnu linux mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft glibc
mips64el-linux-gnu-n64-nan2008-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc rm
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc configure
PASS: compilers-mips64el-linux-gnu-soft glibc mips64el-linux-gnu-n64-soft build
PASS: compilers-nios2-linux-gnu linux install-headers
PASS: compilers-nios2-linux-gnu gcc-first rm
PASS: compilers-nios2-linux-gnu gcc-first mkdir
PASS: compilers-nios2-linux-gnu gcc-first configure
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n64-soft install
PASS: compilers-mips64el-linux-gnu-soft glibc
mips64el-linux-gnu-n64-soft mkdir-lib
PASS: compilers-mips64el-linux-gnu-soft gcc rm
PASS: compilers-mips64el-linux-gnu-soft gcc mkdir
PASS: compilers-mips64el-linux-gnu-soft gcc configure
PASS: compilers-mipsisa64r6el-linux-gnu gcc-first build
PASS: compilers-mipsisa64r6el-linux-gnu gcc-first install
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n32 rm
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n32 mkdir
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n32 configure
PASS: compilers-nios2-linux-gnu gcc-first build
PASS: compilers-nios2-linux-gnu gcc-first install
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu rm
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu mkdir
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu configure
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n32 build
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n32 install
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n32 mkdir-lib
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu rm
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu mkdir
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu configure
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu build
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu install
PASS: compilers-nios2-linux-gnu glibc nios2-linux-gnu mkdir-lib
PASS: compilers-nios2-linux-gnu gcc rm
PASS: compilers-nios2-linux-gnu gcc mkdir
PASS: compilers-nios2-linux-gnu gcc configure
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc build
PASS: compilers-mips64-linux-gnu-nan2008-soft gcc install
PASS: compilers-mips64-linux-gnu-nan2008-soft done
PASS: compilers-powerpc-linux-gnu check-host-libraries
PASS: compilers-powerpc-linux-gnu binutils rm
PASS: compilers-powerpc-linux-gnu binutils mkdir
PASS: compilers-powerpc-linux-gnu binutils configure
PASS: compilers-mips64-linux-gnu-soft gcc build
PASS: compilers-mips64-linux-gnu-soft gcc install
PASS: compilers-mips64-linux-gnu-soft done
PASS: compilers-mips64el-linux-gnu gcc build
PASS: compilers-mips64el-linux-gnu gcc install
PASS: compilers-mips64el-linux-gnu done
PASS: compilers-powerpc-linux-gnu-soft check-host-libraries
PASS: compilers-powerpc-linux-gnu-soft binutils rm
PASS: compilers-powerpc-linux-gnu-soft binutils mkdir
PASS: compilers-powerpc-linux-gnu-soft binutils configure
PASS: compilers-powerpc-linux-gnu binutils build
PASS: compilers-powerpc-linux-gnu binutils install
PASS: compilers-powerpc-linux-gnu linux rm
PASS: compilers-powerpc-linux-gnu linux mkdir
PASS: compilers-powerpc-linux-gnu linux install-headers
PASS: compilers-mips64el-linux-gnu-nan2008 gcc build
PASS: compilers-powerpc-linux-gnu gcc-first rm
PASS: compilers-powerpc-linux-gnu gcc-first mkdir
PASS: compilers-powerpc-linux-gnu gcc-first configure
PASS: compilers-mips64el-linux-gnu-nan2008 gcc install
PASS: compilers-mips64el-linux-gnu-nan2008 done
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu build
PASS: compilers-powerpc64-linux-gnu check-host-libraries
PASS: compilers-powerpc64-linux-gnu binutils rm
PASS: compilers-powerpc64-linux-gnu binutils mkdir
PASS: compilers-powerpc64-linux-gnu binutils configure
PASS: compilers-powerpc64le-linux-gnu check-host-libraries
PASS: compilers-powerpc64le-linux-gnu binutils rm
PASS: compilers-powerpc64le-linux-gnu binutils mkdir
PASS: compilers-powerpc64le-linux-gnu binutils configure
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu install
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa32r6el-linux-gnu mkdir-lib
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n64 rm
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n64 mkdir
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n64 configure
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc build
PASS: compilers-powerpc-linux-gnu-soft binutils build
PASS: compilers-powerpc-linux-gnu-soft binutils install
PASS: compilers-powerpc-linux-gnu-soft linux rm
PASS: compilers-powerpc-linux-gnu-soft linux mkdir
PASS: compilers-mips64el-linux-gnu-nan2008-soft gcc install
PASS: compilers-mips64el-linux-gnu-nan2008-soft done
PASS: compilers-powerpc-linux-gnu-soft linux install-headers
PASS: compilers-powerpc-linux-gnu-soft gcc-first rm
PASS: compilers-powerpc-linux-gnu-soft gcc-first mkdir
PASS: compilers-powerpc-linux-gnu-soft gcc-first configure
PASS: compilers-mips64el-linux-gnu-soft gcc build
PASS: compilers-powerpc64le-linux-gnu binutils build
PASS: compilers-powerpc64-linux-gnu binutils build
PASS: compilers-powerpc64-linux-gnu binutils install
PASS: compilers-powerpc64le-linux-gnu binutils install
PASS: compilers-powerpc64-linux-gnu linux rm
PASS: compilers-powerpc64-linux-gnu linux mkdir
PASS: compilers-powerpc64le-linux-gnu linux rm
PASS: compilers-powerpc64le-linux-gnu linux mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 check-host-libraries
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 binutils rm
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 binutils mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 binutils configure
PASS: compilers-mips64el-linux-gnu-soft gcc install
PASS: compilers-mips64el-linux-gnu-soft done
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 check-host-libraries
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 binutils rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 binutils mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 binutils configure
PASS: compilers-powerpc64le-linux-gnu linux install-headers
PASS: compilers-powerpc64-linux-gnu linux install-headers
PASS: compilers-powerpc64le-linux-gnu gcc-first rm
PASS: compilers-powerpc64le-linux-gnu gcc-first mkdir
PASS: compilers-powerpc64le-linux-gnu gcc-first configure
PASS: compilers-powerpc64-linux-gnu gcc-first rm
PASS: compilers-powerpc64-linux-gnu gcc-first mkdir
PASS: compilers-powerpc64-linux-gnu gcc-first configure
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 binutils build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 binutils build
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 binutils install
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 linux rm
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 linux mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 binutils install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 linux rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 linux mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 linux install-headers
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 linux install-headers
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc-first rm
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc-first mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc-first configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc-first rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc-first mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc-first configure
PASS: compilers-nios2-linux-gnu gcc build
PASS: compilers-nios2-linux-gnu gcc install
PASS: compilers-nios2-linux-gnu done
PASS: compilers-mipsisa64r6el-linux-gnu glibc mipsisa64r6el-linux-gnu-n64 build
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n64 install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d check-host-libraries
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d binutils rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d binutils mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d binutils configure
PASS: compilers-mipsisa64r6el-linux-gnu glibc
mipsisa64r6el-linux-gnu-n64 mkdir-lib
PASS: compilers-mipsisa64r6el-linux-gnu gcc rm
PASS: compilers-mipsisa64r6el-linux-gnu gcc mkdir
PASS: compilers-mipsisa64r6el-linux-gnu gcc configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d binutils build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d binutils install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d linux rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d linux mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d linux install-headers
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc-first rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc-first mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc-first configure
PASS: compilers-powerpc-linux-gnu gcc-first build
PASS: compilers-powerpc-linux-gnu gcc-first install
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu rm
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu mkdir
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu configure
PASS: compilers-powerpc-linux-gnu-soft gcc-first build
PASS: compilers-powerpc-linux-gnu-soft gcc-first install
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft rm
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft mkdir
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft configure
PASS: compilers-powerpc64le-linux-gnu gcc-first build
PASS: compilers-powerpc64-linux-gnu gcc-first build
PASS: compilers-powerpc64le-linux-gnu gcc-first install
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu rm
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu mkdir
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu configure
PASS: compilers-powerpc64-linux-gnu gcc-first install
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu rm
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu mkdir
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc-first build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc-first install
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc-first build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 configure
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc-first install
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 rm
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 configure
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu build
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 build
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu install
PASS: compilers-powerpc-linux-gnu glibc powerpc-linux-gnu mkdir-lib
PASS: compilers-powerpc-linux-gnu gcc rm
PASS: compilers-powerpc-linux-gnu gcc mkdir
PASS: compilers-powerpc-linux-gnu gcc configure
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 build
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc-first build
PASS: compilers-powerpc-linux-gnu-soft glibc powerpc-linux-gnu-soft mkdir-lib
PASS: compilers-powerpc-linux-gnu-soft gcc rm
PASS: compilers-powerpc-linux-gnu-soft gcc mkdir
PASS: compilers-powerpc-linux-gnu-soft gcc configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc-first install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 glibc
riscv32-linux-gnu-rv32imafdc-ilp32 mkdir-lib
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc configure
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 install
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 glibc
riscv32-linux-gnu-rv32imac-ilp32 mkdir-lib
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc rm
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc mkdir
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc configure
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu build
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu install
PASS: compilers-powerpc64-linux-gnu glibc powerpc64-linux-gnu mkdir-lib
PASS: compilers-powerpc64-linux-gnu gcc rm
PASS: compilers-powerpc64-linux-gnu gcc mkdir
PASS: compilers-powerpc64-linux-gnu gcc configure
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu build
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu install
PASS: compilers-powerpc64le-linux-gnu glibc powerpc64le-linux-gnu mkdir-lib
PASS: compilers-powerpc64le-linux-gnu gcc rm
PASS: compilers-powerpc64le-linux-gnu gcc mkdir
PASS: compilers-powerpc64le-linux-gnu gcc configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d glibc
riscv32-linux-gnu-rv32imafdc-ilp32d mkdir-lib
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc rm
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc mkdir
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc configure
PASS: compilers-mipsisa64r6el-linux-gnu gcc build
PASS: compilers-mipsisa64r6el-linux-gnu gcc install
PASS: compilers-mipsisa64r6el-linux-gnu done
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc build
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 gcc install
PASS: compilers-riscv32-linux-gnu-rv32imac-ilp32 done
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 gcc install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32 done
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 check-host-libraries
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 binutils rm
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 binutils mkdir
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 binutils configure
PASS: compilers-powerpc-linux-gnu gcc build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 check-host-libraries
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 binutils rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 binutils mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 binutils configure
PASS: compilers-powerpc-linux-gnu gcc install
PASS: compilers-powerpc-linux-gnu done
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d check-host-libraries
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d binutils rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d binutils mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d binutils configure
PASS: compilers-s390x-linux-gnu check-host-libraries
PASS: compilers-s390x-linux-gnu binutils rm
PASS: compilers-s390x-linux-gnu binutils mkdir
PASS: compilers-s390x-linux-gnu binutils configure
PASS: compilers-powerpc-linux-gnu-soft gcc build
PASS: compilers-powerpc-linux-gnu-soft gcc install
PASS: compilers-powerpc-linux-gnu-soft done
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 binutils build
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 binutils install
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 linux rm
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 linux mkdir
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 linux install-headers
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc-first rm
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc-first mkdir
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc-first configure
PASS: compilers-sh3-linux-gnu check-host-libraries
PASS: compilers-sh3-linux-gnu binutils rm
PASS: compilers-sh3-linux-gnu binutils mkdir
PASS: compilers-sh3-linux-gnu binutils configure
PASS: compilers-s390x-linux-gnu binutils build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 binutils build
PASS: compilers-s390x-linux-gnu binutils install
PASS: compilers-s390x-linux-gnu linux rm
PASS: compilers-s390x-linux-gnu linux mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 binutils install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 linux rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 linux mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d binutils build
PASS: compilers-s390x-linux-gnu linux install-headers
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d binutils install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d linux rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d linux mkdir
PASS: compilers-s390x-linux-gnu gcc-first rm
PASS: compilers-s390x-linux-gnu gcc-first mkdir
PASS: compilers-s390x-linux-gnu gcc-first configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 linux install-headers
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc-first rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc-first mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc-first configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d linux install-headers
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc-first rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc-first mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc-first configure
PASS: compilers-powerpc64-linux-gnu gcc build
PASS: compilers-powerpc64-linux-gnu gcc install
PASS: compilers-powerpc64-linux-gnu done
PASS: compilers-sh3eb-linux-gnu check-host-libraries
PASS: compilers-sh3eb-linux-gnu binutils rm
PASS: compilers-sh3eb-linux-gnu binutils mkdir
PASS: compilers-sh3eb-linux-gnu binutils configure
PASS: compilers-sh3-linux-gnu binutils build
PASS: compilers-sh3-linux-gnu binutils install
PASS: compilers-sh3-linux-gnu linux rm
PASS: compilers-sh3-linux-gnu linux mkdir
PASS: compilers-sh3-linux-gnu linux install-headers
PASS: compilers-sh3-linux-gnu gcc-first rm
PASS: compilers-sh3-linux-gnu gcc-first mkdir
PASS: compilers-sh3-linux-gnu gcc-first configure
PASS: compilers-sh3eb-linux-gnu binutils build
PASS: compilers-sh3eb-linux-gnu binutils install
PASS: compilers-sh3eb-linux-gnu linux rm
PASS: compilers-sh3eb-linux-gnu linux mkdir
PASS: compilers-sh3eb-linux-gnu linux install-headers
PASS: compilers-sh3eb-linux-gnu gcc-first rm
PASS: compilers-sh3eb-linux-gnu gcc-first mkdir
PASS: compilers-sh3eb-linux-gnu gcc-first configure
PASS: compilers-powerpc64le-linux-gnu gcc build
PASS: compilers-powerpc64le-linux-gnu gcc install
PASS: compilers-powerpc64le-linux-gnu done
PASS: compilers-sh4-linux-gnu check-host-libraries
PASS: compilers-sh4-linux-gnu binutils rm
PASS: compilers-sh4-linux-gnu binutils mkdir
PASS: compilers-sh4-linux-gnu binutils configure
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc build
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d gcc install
PASS: compilers-riscv32-linux-gnu-rv32imafdc-ilp32d done
PASS: compilers-sh4-linux-gnu-soft check-host-libraries
PASS: compilers-sh4-linux-gnu-soft binutils rm
PASS: compilers-sh4-linux-gnu-soft binutils mkdir
PASS: compilers-sh4-linux-gnu-soft binutils configure
PASS: compilers-sh4-linux-gnu binutils build
PASS: compilers-sh4-linux-gnu binutils install
PASS: compilers-sh4-linux-gnu linux rm
PASS: compilers-sh4-linux-gnu linux mkdir
PASS: compilers-sh4-linux-gnu linux install-headers
PASS: compilers-sh4-linux-gnu gcc-first rm
PASS: compilers-sh4-linux-gnu gcc-first mkdir
PASS: compilers-sh4-linux-gnu gcc-first configure
PASS: compilers-sh4-linux-gnu-soft binutils build
PASS: compilers-sh4-linux-gnu-soft binutils install
PASS: compilers-sh4-linux-gnu-soft linux rm
PASS: compilers-sh4-linux-gnu-soft linux mkdir
PASS: compilers-sh4-linux-gnu-soft linux install-headers
PASS: compilers-sh4-linux-gnu-soft gcc-first rm
PASS: compilers-sh4-linux-gnu-soft gcc-first mkdir
PASS: compilers-sh4-linux-gnu-soft gcc-first configure
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc-first build
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc-first install
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 rm
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 mkdir
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc-first build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc-first build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc-first install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc-first install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 configure
PASS: compilers-sh3-linux-gnu gcc-first build
PASS: compilers-sh3-linux-gnu gcc-first install
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu rm
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu mkdir
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu configure
PASS: compilers-s390x-linux-gnu gcc-first build
PASS: compilers-s390x-linux-gnu gcc-first install
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu rm
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu mkdir
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu configure
PASS: compilers-sh3eb-linux-gnu gcc-first build
PASS: compilers-sh3eb-linux-gnu gcc-first install
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu rm
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu mkdir
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu configure
PASS: compilers-sh4-linux-gnu gcc-first build
PASS: compilers-sh4-linux-gnu gcc-first install
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu rm
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu mkdir
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu configure
PASS: compilers-sh4-linux-gnu-soft gcc-first build
PASS: compilers-sh4-linux-gnu-soft gcc-first install
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft rm
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft mkdir
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft configure
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 build
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 install
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 glibc
riscv64-linux-gnu-rv64imac-lp64 mkdir-lib
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc rm
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc mkdir
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d glibc
riscv64-linux-gnu-rv64imafdc-lp64d mkdir-lib
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 glibc
riscv64-linux-gnu-rv64imafdc-lp64 mkdir-lib
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc rm
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc mkdir
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc configure
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu build
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu install
PASS: compilers-sh3-linux-gnu glibc sh3-linux-gnu mkdir-lib
PASS: compilers-sh3-linux-gnu gcc rm
PASS: compilers-sh3-linux-gnu gcc mkdir
PASS: compilers-sh3-linux-gnu gcc configure
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu build
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu build
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu install
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu install
PASS: compilers-sh3eb-linux-gnu glibc sh3eb-linux-gnu mkdir-lib
PASS: compilers-sh3eb-linux-gnu gcc rm
PASS: compilers-sh3eb-linux-gnu gcc mkdir
PASS: compilers-sh3eb-linux-gnu gcc configure
PASS: compilers-s390x-linux-gnu glibc s390x-linux-gnu mkdir-lib
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu rm
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu mkdir
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu configure
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu build
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft build
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu install
PASS: compilers-sh4-linux-gnu glibc sh4-linux-gnu mkdir-lib
PASS: compilers-sh4-linux-gnu gcc rm
PASS: compilers-sh4-linux-gnu gcc mkdir
PASS: compilers-sh4-linux-gnu gcc configure
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft install
PASS: compilers-sh4-linux-gnu-soft glibc sh4-linux-gnu-soft mkdir-lib
PASS: compilers-sh4-linux-gnu-soft gcc rm
PASS: compilers-sh4-linux-gnu-soft gcc mkdir
PASS: compilers-sh4-linux-gnu-soft gcc configure
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu build
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu install
PASS: compilers-s390x-linux-gnu glibc s390-linux-gnu mkdir-lib
PASS: compilers-s390x-linux-gnu gcc rm
PASS: compilers-s390x-linux-gnu gcc mkdir
PASS: compilers-s390x-linux-gnu gcc configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc build
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc build
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d gcc install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64d done
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 gcc install
PASS: compilers-riscv64-linux-gnu-rv64imac-lp64 done
PASS: compilers-sh4eb-linux-gnu check-host-libraries
PASS: compilers-sh4eb-linux-gnu binutils rm
PASS: compilers-sh4eb-linux-gnu binutils mkdir
PASS: compilers-sh4eb-linux-gnu binutils configure
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 gcc install
PASS: compilers-riscv64-linux-gnu-rv64imafdc-lp64 done
PASS: compilers-sh4eb-linux-gnu-soft check-host-libraries
PASS: compilers-sh4eb-linux-gnu-soft binutils rm
PASS: compilers-sh4eb-linux-gnu-soft binutils mkdir
PASS: compilers-sh4eb-linux-gnu-soft binutils configure
PASS: compilers-sh4eb-linux-gnu binutils build
PASS: compilers-sh4eb-linux-gnu binutils install
PASS: compilers-sh4eb-linux-gnu linux rm
PASS: compilers-sh4eb-linux-gnu linux mkdir
PASS: compilers-sh4eb-linux-gnu linux install-headers
PASS: compilers-sh4eb-linux-gnu gcc-first rm
PASS: compilers-sh4eb-linux-gnu gcc-first mkdir
PASS: compilers-sh4eb-linux-gnu gcc-first configure
PASS: compilers-sh4eb-linux-gnu-soft binutils build
PASS: compilers-sh4eb-linux-gnu-soft binutils install
PASS: compilers-sh4eb-linux-gnu-soft linux rm
PASS: compilers-sh4eb-linux-gnu-soft linux mkdir
PASS: compilers-sh4eb-linux-gnu-soft linux install-headers
PASS: compilers-sh4eb-linux-gnu-soft gcc-first rm
PASS: compilers-sh4eb-linux-gnu-soft gcc-first mkdir
PASS: compilers-sh4eb-linux-gnu-soft gcc-first configure
PASS: compilers-sh3-linux-gnu gcc build
PASS: compilers-sh3-linux-gnu gcc install
PASS: compilers-sh3-linux-gnu done
PASS: compilers-sparc64-linux-gnu check-host-libraries
PASS: compilers-sparc64-linux-gnu binutils rm
PASS: compilers-sparc64-linux-gnu binutils mkdir
PASS: compilers-sparc64-linux-gnu binutils configure
PASS: compilers-x86_64-linux-gnu check-host-libraries
PASS: compilers-x86_64-linux-gnu binutils rm
PASS: compilers-x86_64-linux-gnu binutils mkdir
PASS: compilers-x86_64-linux-gnu binutils configure
PASS: compilers-sh3eb-linux-gnu gcc build
PASS: compilers-sh3eb-linux-gnu gcc install
PASS: compilers-sh3eb-linux-gnu done
PASS: compilers-sparc64-linux-gnu binutils build
PASS: compilers-sparc64-linux-gnu binutils install
PASS: compilers-sparc64-linux-gnu linux rm
PASS: compilers-sparc64-linux-gnu linux mkdir
PASS: compilers-sparc64-linux-gnu linux install-headers
PASS: compilers-sparc64-linux-gnu gcc-first rm
PASS: compilers-sparc64-linux-gnu gcc-first mkdir
PASS: compilers-sparc64-linux-gnu gcc-first configure
PASS: compilers-x86_64-linux-gnu binutils build
PASS: compilers-x86_64-linux-gnu binutils install
PASS: compilers-x86_64-linux-gnu linux rm
PASS: compilers-x86_64-linux-gnu linux mkdir
PASS: compilers-x86_64-linux-gnu linux install-headers
PASS: compilers-x86_64-linux-gnu gcc-first rm
PASS: compilers-x86_64-linux-gnu gcc-first mkdir
PASS: compilers-x86_64-linux-gnu gcc-first configure
PASS: compilers-sh4-linux-gnu-soft gcc build
PASS: compilers-sh4-linux-gnu-soft gcc install
PASS: compilers-sh4-linux-gnu-soft done
PASS: compilers-sh4-linux-gnu gcc build
PASS: compilers-sh4-linux-gnu gcc install
PASS: compilers-sh4-linux-gnu done
PASS: compilers-sh4eb-linux-gnu gcc-first build
PASS: compilers-sh4eb-linux-gnu gcc-first install
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu rm
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu mkdir
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu configure
PASS: compilers-sh4eb-linux-gnu-soft gcc-first build
PASS: compilers-sh4eb-linux-gnu-soft gcc-first install
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft rm
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft mkdir
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft configure
PASS: compilers-sparc64-linux-gnu gcc-first build
PASS: compilers-sparc64-linux-gnu gcc-first install
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu rm
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu mkdir
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu configure
PASS: compilers-s390x-linux-gnu gcc build
PASS: compilers-x86_64-linux-gnu gcc-first build
PASS: compilers-x86_64-linux-gnu gcc-first install
PASS: compilers-s390x-linux-gnu gcc install
PASS: compilers-s390x-linux-gnu done
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu rm
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu mkdir
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu configure
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu build
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu install
PASS: compilers-sh4eb-linux-gnu glibc sh4eb-linux-gnu mkdir-lib
PASS: compilers-sh4eb-linux-gnu gcc rm
PASS: compilers-sh4eb-linux-gnu gcc mkdir
PASS: compilers-sh4eb-linux-gnu gcc configure
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft build
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu build
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft install
PASS: compilers-sh4eb-linux-gnu-soft glibc sh4eb-linux-gnu-soft mkdir-lib
PASS: compilers-sh4eb-linux-gnu-soft gcc rm
PASS: compilers-sh4eb-linux-gnu-soft gcc mkdir
PASS: compilers-sh4eb-linux-gnu-soft gcc configure
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu install
PASS: compilers-sparc64-linux-gnu glibc sparc64-linux-gnu mkdir-lib
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu rm
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu mkdir
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu configure
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu build
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu install
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu mkdir-lib
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 rm
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 mkdir
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 configure
PASS: compilers-sh4eb-linux-gnu gcc build
PASS: compilers-sh4eb-linux-gnu gcc install
PASS: compilers-sh4eb-linux-gnu done
PASS: compilers-sh4eb-linux-gnu-soft gcc build
PASS: compilers-sh4eb-linux-gnu-soft gcc install
PASS: compilers-sh4eb-linux-gnu-soft done
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu build
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 build
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu install
PASS: compilers-sparc64-linux-gnu glibc sparcv9-linux-gnu mkdir-lib
PASS: compilers-sparc64-linux-gnu gcc rm
PASS: compilers-sparc64-linux-gnu gcc mkdir
PASS: compilers-sparc64-linux-gnu gcc configure
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 install
PASS: compilers-x86_64-linux-gnu glibc x86_64-linux-gnu-x32 mkdir-lib
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu rm
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu mkdir
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu configure
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu build
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu install
PASS: compilers-x86_64-linux-gnu glibc i686-linux-gnu mkdir-lib
PASS: compilers-x86_64-linux-gnu gcc rm
PASS: compilers-x86_64-linux-gnu gcc mkdir
PASS: compilers-x86_64-linux-gnu gcc configure
PASS: compilers-sparc64-linux-gnu gcc build
PASS: compilers-sparc64-linux-gnu gcc install
PASS: compilers-sparc64-linux-gnu done
PASS: compilers-x86_64-linux-gnu gcc build
PASS: compilers-x86_64-linux-gnu gcc install
PASS: compilers-x86_64-linux-gnu done
BUILD-GLIBC
PASS: glibcs-arceb-linux-gnu check-compilers
PASS: glibcs-arceb-linux-gnu rm
PASS: glibcs-arceb-linux-gnu mkdir
PASS: glibcs-arceb-linux-gnu configure
PASS: glibcs-arc-linux-gnuhf check-compilers
PASS: glibcs-arc-linux-gnuhf rm
PASS: glibcs-arc-linux-gnuhf mkdir
PASS: glibcs-arc-linux-gnuhf configure
PASS: glibcs-arc-linux-gnu check-compilers
PASS: glibcs-arc-linux-gnu rm
PASS: glibcs-arc-linux-gnu mkdir
PASS: glibcs-arc-linux-gnu configure
PASS: glibcs-alpha-linux-gnu check-compilers
PASS: glibcs-alpha-linux-gnu rm
PASS: glibcs-alpha-linux-gnu mkdir
PASS: glibcs-alpha-linux-gnu configure
PASS: glibcs-arm-linux-gnueabi check-compilers
PASS: glibcs-arm-linux-gnueabi rm
PASS: glibcs-arm-linux-gnueabi mkdir
PASS: glibcs-arm-linux-gnueabi configure
PASS: glibcs-aarch64-linux-gnu check-compilers
PASS: glibcs-aarch64-linux-gnu rm
PASS: glibcs-aarch64-linux-gnu mkdir
PASS: glibcs-aarch64-linux-gnu configure
PASS: glibcs-aarch64_be-linux-gnu check-compilers
PASS: glibcs-aarch64_be-linux-gnu rm
PASS: glibcs-aarch64_be-linux-gnu mkdir
PASS: glibcs-aarch64_be-linux-gnu configure
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch rm
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch configure
PASS: glibcs-arc-linux-gnuhf build
PASS: glibcs-arceb-linux-gnu build
PASS: glibcs-arc-linux-gnu build
PASS: glibcs-arc-linux-gnuhf install
PASS: glibcs-arc-linux-gnuhf mkdir-lib
PASS: glibcs-arc-linux-gnu install
PASS: glibcs-arc-linux-gnu mkdir-lib
PASS: glibcs-arceb-linux-gnu install
PASS: glibcs-arceb-linux-gnu mkdir-lib
PASS: glibcs-arm-linux-gnueabi build
PASS: glibcs-alpha-linux-gnu build
PASS: glibcs-arm-linux-gnueabi install
PASS: glibcs-arm-linux-gnueabi mkdir-lib
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch build
PASS: glibcs-aarch64-linux-gnu build
PASS: glibcs-alpha-linux-gnu install
PASS: glibcs-alpha-linux-gnu mkdir-lib
PASS: glibcs-aarch64_be-linux-gnu build
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch install
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-aarch64-linux-gnu install
PASS: glibcs-aarch64-linux-gnu mkdir-lib
PASS: glibcs-aarch64_be-linux-gnu install
PASS: glibcs-aarch64_be-linux-gnu mkdir-lib
PASS: glibcs-arc-linux-gnu check
PASS: glibcs-arceb-linux-gnu check
PASS: glibcs-arc-linux-gnu save-logs
PASS: glibcs-arc-linux-gnu cleanup
PASS: glibcs-arceb-linux-gnu save-logs
PASS: glibcs-arceb-linux-gnu cleanup
PASS: glibcs-arc-linux-gnuhf check
PASS: glibcs-arm-linux-gnueabi-v4t check-compilers
PASS: glibcs-arm-linux-gnueabi-v4t rm
PASS: glibcs-arm-linux-gnueabi-v4t mkdir
PASS: glibcs-arm-linux-gnueabi-v4t configure
PASS: glibcs-arc-linux-gnuhf save-logs
PASS: glibcs-arc-linux-gnuhf cleanup
PASS: glibcs-arm-linux-gnueabihf check-compilers
PASS: glibcs-arm-linux-gnueabihf rm
PASS: glibcs-arm-linux-gnueabihf mkdir
PASS: glibcs-arm-linux-gnueabihf configure
PASS: glibcs-arm-linux-gnueabihf-thumb check-compilers
PASS: glibcs-arm-linux-gnueabihf-thumb rm
PASS: glibcs-arm-linux-gnueabihf-thumb mkdir
PASS: glibcs-arm-linux-gnueabihf-thumb configure
PASS: glibcs-arm-linux-gnueabi check
PASS: glibcs-arm-linux-gnueabi save-logs
PASS: glibcs-arm-linux-gnueabi cleanup
PASS: glibcs-arm-linux-gnueabihf-v7a check-compilers
PASS: glibcs-arm-linux-gnueabihf-v7a rm
PASS: glibcs-arm-linux-gnueabihf-v7a mkdir
PASS: glibcs-arm-linux-gnueabihf-v7a configure
PASS: glibcs-alpha-linux-gnu check
PASS: glibcs-alpha-linux-gnu save-logs
PASS: glibcs-alpha-linux-gnu cleanup
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch check-compilers
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch rm
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch mkdir
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch configure
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch check
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-aarch64-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-armeb-linux-gnueabi check-compilers
PASS: glibcs-armeb-linux-gnueabi rm
PASS: glibcs-armeb-linux-gnueabi mkdir
PASS: glibcs-armeb-linux-gnueabi configure
PASS: glibcs-aarch64-linux-gnu check
PASS: glibcs-aarch64-linux-gnu save-logs
PASS: glibcs-aarch64-linux-gnu cleanup
PASS: glibcs-armeb-linux-gnueabi-be8 check-compilers
PASS: glibcs-armeb-linux-gnueabi-be8 rm
PASS: glibcs-armeb-linux-gnueabi-be8 mkdir
PASS: glibcs-armeb-linux-gnueabi-be8 configure
PASS: glibcs-aarch64_be-linux-gnu check
PASS: glibcs-aarch64_be-linux-gnu save-logs
PASS: glibcs-aarch64_be-linux-gnu cleanup
PASS: glibcs-armeb-linux-gnueabihf check-compilers
PASS: glibcs-armeb-linux-gnueabihf rm
PASS: glibcs-armeb-linux-gnueabihf mkdir
PASS: glibcs-armeb-linux-gnueabihf configure
PASS: glibcs-arm-linux-gnueabihf build
PASS: glibcs-arm-linux-gnueabi-v4t build
PASS: glibcs-arm-linux-gnueabihf-thumb build
PASS: glibcs-arm-linux-gnueabihf-v7a build
PASS: glibcs-arm-linux-gnueabihf install
PASS: glibcs-arm-linux-gnueabihf mkdir-lib
PASS: glibcs-arm-linux-gnueabi-v4t install
PASS: glibcs-arm-linux-gnueabi-v4t mkdir-lib
PASS: glibcs-arm-linux-gnueabihf-thumb install
PASS: glibcs-arm-linux-gnueabihf-thumb mkdir-lib
PASS: glibcs-arm-linux-gnueabihf-v7a install
PASS: glibcs-arm-linux-gnueabihf-v7a mkdir-lib
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch build
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch install
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch mkdir-lib
PASS: glibcs-armeb-linux-gnueabi build
PASS: glibcs-armeb-linux-gnueabi-be8 build
PASS: glibcs-armeb-linux-gnueabihf build
PASS: glibcs-armeb-linux-gnueabi install
PASS: glibcs-armeb-linux-gnueabi mkdir-lib
PASS: glibcs-armeb-linux-gnueabi-be8 install
PASS: glibcs-armeb-linux-gnueabi-be8 mkdir-lib
PASS: glibcs-armeb-linux-gnueabihf install
PASS: glibcs-armeb-linux-gnueabihf mkdir-lib
PASS: glibcs-arm-linux-gnueabi-v4t check
PASS: glibcs-arm-linux-gnueabi-v4t save-logs
PASS: glibcs-arm-linux-gnueabi-v4t cleanup
PASS: glibcs-armeb-linux-gnueabihf-be8 check-compilers
PASS: glibcs-armeb-linux-gnueabihf-be8 rm
PASS: glibcs-armeb-linux-gnueabihf-be8 mkdir
PASS: glibcs-armeb-linux-gnueabihf-be8 configure
PASS: glibcs-arm-linux-gnueabihf check
PASS: glibcs-arm-linux-gnueabihf save-logs
PASS: glibcs-arm-linux-gnueabihf cleanup
PASS: glibcs-csky-linux-gnuabiv2 check-compilers
PASS: glibcs-csky-linux-gnuabiv2 rm
PASS: glibcs-csky-linux-gnuabiv2 mkdir
PASS: glibcs-csky-linux-gnuabiv2 configure
PASS: glibcs-arm-linux-gnueabihf-thumb check
PASS: glibcs-arm-linux-gnueabihf-thumb save-logs
PASS: glibcs-arm-linux-gnueabihf-thumb cleanup
PASS: glibcs-arm-linux-gnueabihf-v7a check
PASS: glibcs-arm-linux-gnueabihf-v7a save-logs
PASS: glibcs-arm-linux-gnueabihf-v7a cleanup
PASS: glibcs-csky-linux-gnuabiv2-soft check-compilers
PASS: glibcs-csky-linux-gnuabiv2-soft rm
PASS: glibcs-csky-linux-gnuabiv2-soft mkdir
PASS: glibcs-csky-linux-gnuabiv2-soft configure
PASS: glibcs-hppa-linux-gnu check-compilers
PASS: glibcs-hppa-linux-gnu rm
PASS: glibcs-hppa-linux-gnu mkdir
PASS: glibcs-hppa-linux-gnu configure
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch check
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch save-logs
PASS: glibcs-arm-linux-gnueabihf-v7a-disable-multi-arch cleanup
PASS: glibcs-i486-linux-gnu check-compilers
PASS: glibcs-i486-linux-gnu rm
PASS: glibcs-i486-linux-gnu mkdir
PASS: glibcs-i486-linux-gnu configure
PASS: glibcs-armeb-linux-gnueabi check
PASS: glibcs-armeb-linux-gnueabi save-logs
PASS: glibcs-armeb-linux-gnueabi cleanup
PASS: glibcs-i586-linux-gnu check-compilers
PASS: glibcs-i586-linux-gnu rm
PASS: glibcs-i586-linux-gnu mkdir
PASS: glibcs-i586-linux-gnu configure
PASS: glibcs-armeb-linux-gnueabi-be8 check
PASS: glibcs-armeb-linux-gnueabi-be8 save-logs
PASS: glibcs-armeb-linux-gnueabi-be8 cleanup
PASS: glibcs-i686-gnu check-compilers
PASS: glibcs-i686-gnu rm
PASS: glibcs-i686-gnu mkdir
PASS: glibcs-i686-gnu configure
PASS: glibcs-armeb-linux-gnueabihf check
PASS: glibcs-armeb-linux-gnueabihf save-logs
PASS: glibcs-armeb-linux-gnueabihf cleanup
PASS: glibcs-i686-linux-gnu check-compilers
PASS: glibcs-i686-linux-gnu rm
PASS: glibcs-i686-linux-gnu mkdir
PASS: glibcs-i686-linux-gnu configure
PASS: glibcs-csky-linux-gnuabiv2 build
PASS: glibcs-csky-linux-gnuabiv2 install
PASS: glibcs-csky-linux-gnuabiv2 mkdir-lib
PASS: glibcs-hppa-linux-gnu build
PASS: glibcs-csky-linux-gnuabiv2-soft build
PASS: glibcs-armeb-linux-gnueabihf-be8 build
PASS: glibcs-hppa-linux-gnu install
PASS: glibcs-hppa-linux-gnu mkdir-lib
PASS: glibcs-csky-linux-gnuabiv2-soft install
PASS: glibcs-csky-linux-gnuabiv2-soft mkdir-lib
PASS: glibcs-armeb-linux-gnueabihf-be8 install
PASS: glibcs-armeb-linux-gnueabihf-be8 mkdir-lib
PASS: glibcs-i486-linux-gnu build
PASS: glibcs-i486-linux-gnu install
PASS: glibcs-i486-linux-gnu mkdir-lib
PASS: glibcs-i586-linux-gnu build
PASS: glibcs-i586-linux-gnu install
PASS: glibcs-i586-linux-gnu mkdir-lib
PASS: glibcs-i686-linux-gnu build
PASS: glibcs-i686-linux-gnu install
PASS: glibcs-i686-linux-gnu mkdir-lib
PASS: glibcs-i686-gnu build
PASS: glibcs-i686-gnu install
PASS: glibcs-i686-gnu mkdir-lib
PASS: glibcs-csky-linux-gnuabiv2 check
PASS: glibcs-csky-linux-gnuabiv2 save-logs
PASS: glibcs-csky-linux-gnuabiv2 cleanup
PASS: glibcs-i686-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-i686-linux-gnu-disable-multi-arch rm
PASS: glibcs-i686-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-i686-linux-gnu-disable-multi-arch configure
PASS: glibcs-csky-linux-gnuabiv2-soft check
PASS: glibcs-csky-linux-gnuabiv2-soft save-logs
PASS: glibcs-csky-linux-gnuabiv2-soft cleanup
PASS: glibcs-i686-linux-gnu-static-pie check-compilers
PASS: glibcs-i686-linux-gnu-static-pie rm
PASS: glibcs-i686-linux-gnu-static-pie mkdir
PASS: glibcs-i686-linux-gnu-static-pie configure
PASS: glibcs-armeb-linux-gnueabihf-be8 check
PASS: glibcs-armeb-linux-gnueabihf-be8 save-logs
PASS: glibcs-armeb-linux-gnueabihf-be8 cleanup
PASS: glibcs-ia64-linux-gnu check-compilers
PASS: glibcs-ia64-linux-gnu rm
PASS: glibcs-ia64-linux-gnu mkdir
PASS: glibcs-ia64-linux-gnu configure
PASS: glibcs-hppa-linux-gnu check
PASS: glibcs-hppa-linux-gnu save-logs
PASS: glibcs-hppa-linux-gnu cleanup
PASS: glibcs-m68k-linux-gnu check-compilers
PASS: glibcs-m68k-linux-gnu rm
PASS: glibcs-m68k-linux-gnu mkdir
PASS: glibcs-m68k-linux-gnu configure
PASS: glibcs-i486-linux-gnu check
PASS: glibcs-i486-linux-gnu save-logs
PASS: glibcs-i486-linux-gnu cleanup
PASS: glibcs-m68k-linux-gnu-coldfire check-compilers
PASS: glibcs-m68k-linux-gnu-coldfire rm
PASS: glibcs-m68k-linux-gnu-coldfire mkdir
PASS: glibcs-m68k-linux-gnu-coldfire configure
PASS: glibcs-i586-linux-gnu check
PASS: glibcs-i586-linux-gnu save-logs
PASS: glibcs-i586-linux-gnu cleanup
PASS: glibcs-m68k-linux-gnu-coldfire-soft check-compilers
PASS: glibcs-m68k-linux-gnu-coldfire-soft rm
PASS: glibcs-m68k-linux-gnu-coldfire-soft mkdir
PASS: glibcs-m68k-linux-gnu-coldfire-soft configure
PASS: glibcs-i686-linux-gnu check
PASS: glibcs-i686-linux-gnu save-logs
PASS: glibcs-i686-linux-gnu cleanup
PASS: glibcs-microblaze-linux-gnu check-compilers
PASS: glibcs-microblaze-linux-gnu rm
PASS: glibcs-microblaze-linux-gnu mkdir
PASS: glibcs-microblaze-linux-gnu configure
PASS: glibcs-i686-linux-gnu-disable-multi-arch build
PASS: glibcs-i686-linux-gnu-disable-multi-arch install
PASS: glibcs-i686-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-i686-linux-gnu-static-pie build
PASS: glibcs-i686-linux-gnu-static-pie install
PASS: glibcs-i686-linux-gnu-static-pie mkdir-lib
PASS: glibcs-m68k-linux-gnu build
PASS: glibcs-ia64-linux-gnu build
PASS: glibcs-m68k-linux-gnu install
PASS: glibcs-m68k-linux-gnu mkdir-lib
PASS: glibcs-ia64-linux-gnu install
PASS: glibcs-ia64-linux-gnu mkdir-lib
PASS: glibcs-m68k-linux-gnu-coldfire build
PASS: glibcs-m68k-linux-gnu-coldfire install
PASS: glibcs-m68k-linux-gnu-coldfire mkdir-lib
PASS: glibcs-m68k-linux-gnu-coldfire-soft build
PASS: glibcs-m68k-linux-gnu-coldfire-soft install
PASS: glibcs-m68k-linux-gnu-coldfire-soft mkdir-lib
PASS: glibcs-microblaze-linux-gnu build
PASS: glibcs-microblaze-linux-gnu install
PASS: glibcs-microblaze-linux-gnu mkdir-lib
PASS: glibcs-i686-gnu check
PASS: glibcs-i686-gnu save-logs
PASS: glibcs-i686-gnu cleanup
PASS: glibcs-microblazeel-linux-gnu check-compilers
PASS: glibcs-microblazeel-linux-gnu rm
PASS: glibcs-microblazeel-linux-gnu mkdir
PASS: glibcs-microblazeel-linux-gnu configure
PASS: glibcs-i686-linux-gnu-disable-multi-arch check
PASS: glibcs-i686-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-i686-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-mips-linux-gnu check-compilers
PASS: glibcs-mips-linux-gnu rm
PASS: glibcs-mips-linux-gnu mkdir
PASS: glibcs-mips-linux-gnu configure
PASS: glibcs-i686-linux-gnu-static-pie check
PASS: glibcs-i686-linux-gnu-static-pie save-logs
PASS: glibcs-i686-linux-gnu-static-pie cleanup
PASS: glibcs-mips-linux-gnu-nan2008 check-compilers
PASS: glibcs-mips-linux-gnu-nan2008 rm
PASS: glibcs-mips-linux-gnu-nan2008 mkdir
PASS: glibcs-mips-linux-gnu-nan2008 configure
PASS: glibcs-ia64-linux-gnu check
PASS: glibcs-ia64-linux-gnu save-logs
PASS: glibcs-ia64-linux-gnu cleanup
PASS: glibcs-mips-linux-gnu-nan2008-soft check-compilers
PASS: glibcs-mips-linux-gnu-nan2008-soft rm
PASS: glibcs-mips-linux-gnu-nan2008-soft mkdir
PASS: glibcs-mips-linux-gnu-nan2008-soft configure
PASS: glibcs-m68k-linux-gnu check
PASS: glibcs-m68k-linux-gnu save-logs
PASS: glibcs-m68k-linux-gnu cleanup
PASS: glibcs-mips-linux-gnu-soft check-compilers
PASS: glibcs-mips-linux-gnu-soft rm
PASS: glibcs-mips-linux-gnu-soft mkdir
PASS: glibcs-mips-linux-gnu-soft configure
PASS: glibcs-microblaze-linux-gnu check
PASS: glibcs-microblaze-linux-gnu save-logs
PASS: glibcs-microblaze-linux-gnu cleanup
PASS: glibcs-microblazeel-linux-gnu build
PASS: glibcs-mips64-linux-gnu-n32 check-compilers
PASS: glibcs-mips64-linux-gnu-n32 rm
PASS: glibcs-mips64-linux-gnu-n32 mkdir
PASS: glibcs-mips64-linux-gnu-n32 configure
PASS: glibcs-microblazeel-linux-gnu install
PASS: glibcs-microblazeel-linux-gnu mkdir-lib
PASS: glibcs-m68k-linux-gnu-coldfire check
PASS: glibcs-m68k-linux-gnu-coldfire save-logs
PASS: glibcs-m68k-linux-gnu-coldfire cleanup
PASS: glibcs-mips64-linux-gnu-n32-nan2008 check-compilers
PASS: glibcs-mips64-linux-gnu-n32-nan2008 rm
PASS: glibcs-mips64-linux-gnu-n32-nan2008 mkdir
PASS: glibcs-mips64-linux-gnu-n32-nan2008 configure
PASS: glibcs-mips-linux-gnu build
PASS: glibcs-mips-linux-gnu install
PASS: glibcs-mips-linux-gnu mkdir-lib
PASS: glibcs-m68k-linux-gnu-coldfire-soft check
PASS: glibcs-m68k-linux-gnu-coldfire-soft save-logs
PASS: glibcs-m68k-linux-gnu-coldfire-soft cleanup
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft check-compilers
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft rm
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft mkdir
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft configure
PASS: glibcs-mips-linux-gnu-nan2008 build
PASS: glibcs-mips-linux-gnu-nan2008 install
PASS: glibcs-mips-linux-gnu-nan2008 mkdir-lib
PASS: glibcs-mips-linux-gnu-nan2008-soft build
PASS: glibcs-mips-linux-gnu-nan2008-soft install
PASS: glibcs-mips-linux-gnu-nan2008-soft mkdir-lib
PASS: glibcs-mips-linux-gnu-soft build
PASS: glibcs-mips-linux-gnu-soft install
PASS: glibcs-mips-linux-gnu-soft mkdir-lib
PASS: glibcs-mips64-linux-gnu-n32 build
PASS: glibcs-mips64-linux-gnu-n32 install
PASS: glibcs-mips64-linux-gnu-n32 mkdir-lib
PASS: glibcs-microblazeel-linux-gnu check
PASS: glibcs-microblazeel-linux-gnu save-logs
PASS: glibcs-microblazeel-linux-gnu cleanup
PASS: glibcs-mips64-linux-gnu-n32-soft check-compilers
PASS: glibcs-mips64-linux-gnu-n32-soft rm
PASS: glibcs-mips64-linux-gnu-n32-soft mkdir
PASS: glibcs-mips64-linux-gnu-n32-soft configure
PASS: glibcs-mips64-linux-gnu-n32-nan2008 build
PASS: glibcs-mips64-linux-gnu-n32-nan2008 install
PASS: glibcs-mips64-linux-gnu-n32-nan2008 mkdir-lib
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft build
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft install
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft mkdir-lib
PASS: glibcs-mips-linux-gnu check
PASS: glibcs-mips-linux-gnu save-logs
PASS: glibcs-mips-linux-gnu cleanup
PASS: glibcs-mips64-linux-gnu-n64 check-compilers
PASS: glibcs-mips64-linux-gnu-n64 rm
PASS: glibcs-mips64-linux-gnu-n64 mkdir
PASS: glibcs-mips64-linux-gnu-n64 configure
PASS: glibcs-mips-linux-gnu-nan2008 check
PASS: glibcs-mips-linux-gnu-nan2008 save-logs
PASS: glibcs-mips-linux-gnu-nan2008 cleanup
PASS: glibcs-mips64-linux-gnu-n64-nan2008 check-compilers
PASS: glibcs-mips64-linux-gnu-n64-nan2008 rm
PASS: glibcs-mips64-linux-gnu-n64-nan2008 mkdir
PASS: glibcs-mips64-linux-gnu-n64-nan2008 configure
PASS: glibcs-mips64-linux-gnu-n32-soft build
PASS: glibcs-mips64-linux-gnu-n32-soft install
PASS: glibcs-mips64-linux-gnu-n32-soft mkdir-lib
PASS: glibcs-mips-linux-gnu-nan2008-soft check
PASS: glibcs-mips-linux-gnu-nan2008-soft save-logs
PASS: glibcs-mips-linux-gnu-nan2008-soft cleanup
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft check-compilers
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft rm
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft mkdir
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft configure
PASS: glibcs-mips-linux-gnu-soft check
PASS: glibcs-mips-linux-gnu-soft save-logs
PASS: glibcs-mips-linux-gnu-soft cleanup
PASS: glibcs-mips64-linux-gnu-n64-soft check-compilers
PASS: glibcs-mips64-linux-gnu-n64-soft rm
PASS: glibcs-mips64-linux-gnu-n64-soft mkdir
PASS: glibcs-mips64-linux-gnu-n64-soft configure
PASS: glibcs-mips64-linux-gnu-n32 check
PASS: glibcs-mips64-linux-gnu-n32 save-logs
PASS: glibcs-mips64-linux-gnu-n32 cleanup
PASS: glibcs-mips64el-linux-gnu-n32 check-compilers
PASS: glibcs-mips64el-linux-gnu-n32 rm
PASS: glibcs-mips64el-linux-gnu-n32 mkdir
PASS: glibcs-mips64el-linux-gnu-n32 configure
PASS: glibcs-mips64-linux-gnu-n32-nan2008 check
PASS: glibcs-mips64-linux-gnu-n32-nan2008 save-logs
PASS: glibcs-mips64-linux-gnu-n32-nan2008 cleanup
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 check-compilers
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 rm
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 mkdir
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 configure
PASS: glibcs-mips64-linux-gnu-n64 build
PASS: glibcs-mips64-linux-gnu-n64 install
PASS: glibcs-mips64-linux-gnu-n64 mkdir-lib
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft check
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft save-logs
PASS: glibcs-mips64-linux-gnu-n32-nan2008-soft cleanup
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft check-compilers
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft rm
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft mkdir
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft configure
PASS: glibcs-mips64-linux-gnu-n64-nan2008 build
PASS: glibcs-mips64-linux-gnu-n64-nan2008 install
PASS: glibcs-mips64-linux-gnu-n64-nan2008 mkdir-lib
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft build
PASS: glibcs-mips64-linux-gnu-n64-soft build
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft install
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft mkdir-lib
PASS: glibcs-mips64-linux-gnu-n64-soft install
PASS: glibcs-mips64-linux-gnu-n64-soft mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n32 build
PASS: glibcs-mips64el-linux-gnu-n32 install
PASS: glibcs-mips64el-linux-gnu-n32 mkdir-lib
PASS: glibcs-mips64-linux-gnu-n32-soft check
PASS: glibcs-mips64-linux-gnu-n32-soft save-logs
PASS: glibcs-mips64-linux-gnu-n32-soft cleanup
PASS: glibcs-mips64el-linux-gnu-n32-soft check-compilers
PASS: glibcs-mips64el-linux-gnu-n32-soft rm
PASS: glibcs-mips64el-linux-gnu-n32-soft mkdir
PASS: glibcs-mips64el-linux-gnu-n32-soft configure
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 build
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 install
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft build
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft install
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft mkdir-lib
PASS: glibcs-mips64-linux-gnu-n64 check
PASS: glibcs-mips64-linux-gnu-n64 save-logs
PASS: glibcs-mips64-linux-gnu-n64 cleanup
PASS: glibcs-mips64el-linux-gnu-n64 check-compilers
PASS: glibcs-mips64el-linux-gnu-n64 rm
PASS: glibcs-mips64el-linux-gnu-n64 mkdir
PASS: glibcs-mips64el-linux-gnu-n64 configure
PASS: glibcs-mips64-linux-gnu-n64-nan2008 check
PASS: glibcs-mips64-linux-gnu-n64-nan2008 save-logs
PASS: glibcs-mips64-linux-gnu-n64-nan2008 cleanup
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 check-compilers
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 rm
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 mkdir
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 configure
PASS: glibcs-mips64el-linux-gnu-n32-soft build
PASS: glibcs-mips64el-linux-gnu-n32-soft install
PASS: glibcs-mips64el-linux-gnu-n32-soft mkdir-lib
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft check
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft save-logs
PASS: glibcs-mips64-linux-gnu-n64-nan2008-soft cleanup
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft check-compilers
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft rm
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft mkdir
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft configure
PASS: glibcs-mips64-linux-gnu-n64-soft check
PASS: glibcs-mips64-linux-gnu-n64-soft save-logs
PASS: glibcs-mips64-linux-gnu-n64-soft cleanup
PASS: glibcs-mips64el-linux-gnu-n64-soft check-compilers
PASS: glibcs-mips64el-linux-gnu-n64-soft rm
PASS: glibcs-mips64el-linux-gnu-n64-soft mkdir
PASS: glibcs-mips64el-linux-gnu-n64-soft configure
PASS: glibcs-mips64el-linux-gnu-n32 check
PASS: glibcs-mips64el-linux-gnu-n32 save-logs
PASS: glibcs-mips64el-linux-gnu-n32 cleanup
PASS: glibcs-mipsel-linux-gnu check-compilers
PASS: glibcs-mipsel-linux-gnu rm
PASS: glibcs-mipsel-linux-gnu mkdir
PASS: glibcs-mipsel-linux-gnu configure
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 check
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 save-logs
PASS: glibcs-mips64el-linux-gnu-n32-nan2008 cleanup
PASS: glibcs-mipsel-linux-gnu-nan2008 check-compilers
PASS: glibcs-mipsel-linux-gnu-nan2008 rm
PASS: glibcs-mipsel-linux-gnu-nan2008 mkdir
PASS: glibcs-mipsel-linux-gnu-nan2008 configure
PASS: glibcs-mips64el-linux-gnu-n64 build
PASS: glibcs-mips64el-linux-gnu-n64 install
PASS: glibcs-mips64el-linux-gnu-n64 mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft check
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft save-logs
PASS: glibcs-mips64el-linux-gnu-n32-nan2008-soft cleanup
PASS: glibcs-mipsel-linux-gnu-nan2008-soft check-compilers
PASS: glibcs-mipsel-linux-gnu-nan2008-soft rm
PASS: glibcs-mipsel-linux-gnu-nan2008-soft mkdir
PASS: glibcs-mipsel-linux-gnu-nan2008-soft configure
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 build
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 install
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft build
PASS: glibcs-mipsel-linux-gnu build
PASS: glibcs-mips64el-linux-gnu-n64-soft build
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft install
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft mkdir-lib
PASS: glibcs-mipsel-linux-gnu install
PASS: glibcs-mipsel-linux-gnu mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n64-soft install
PASS: glibcs-mips64el-linux-gnu-n64-soft mkdir-lib
PASS: glibcs-mipsel-linux-gnu-nan2008 build
PASS: glibcs-mipsel-linux-gnu-nan2008 install
PASS: glibcs-mipsel-linux-gnu-nan2008 mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n32-soft check
PASS: glibcs-mips64el-linux-gnu-n32-soft save-logs
PASS: glibcs-mips64el-linux-gnu-n32-soft cleanup
PASS: glibcs-mipsel-linux-gnu-soft check-compilers
PASS: glibcs-mipsel-linux-gnu-soft rm
PASS: glibcs-mipsel-linux-gnu-soft mkdir
PASS: glibcs-mipsel-linux-gnu-soft configure
PASS: glibcs-mipsel-linux-gnu-nan2008-soft build
PASS: glibcs-mipsel-linux-gnu-nan2008-soft install
PASS: glibcs-mipsel-linux-gnu-nan2008-soft mkdir-lib
PASS: glibcs-mips64el-linux-gnu-n64 check
PASS: glibcs-mips64el-linux-gnu-n64 save-logs
PASS: glibcs-mips64el-linux-gnu-n64 cleanup
PASS: glibcs-mipsisa32r6el-linux-gnu check-compilers
PASS: glibcs-mipsisa32r6el-linux-gnu rm
PASS: glibcs-mipsisa32r6el-linux-gnu mkdir
PASS: glibcs-mipsisa32r6el-linux-gnu configure
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 check
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 save-logs
PASS: glibcs-mips64el-linux-gnu-n64-nan2008 cleanup
PASS: glibcs-mipsel-linux-gnu-soft build
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 check-compilers
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 rm
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 mkdir
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 configure
PASS: glibcs-mipsel-linux-gnu-soft install
PASS: glibcs-mipsel-linux-gnu-soft mkdir-lib
PASS: glibcs-mipsel-linux-gnu check
PASS: glibcs-mipsel-linux-gnu save-logs
PASS: glibcs-mipsel-linux-gnu cleanup
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 check-compilers
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 rm
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 mkdir
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 configure
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft check
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft save-logs
PASS: glibcs-mips64el-linux-gnu-n64-nan2008-soft cleanup
PASS: glibcs-nios2-linux-gnu check-compilers
PASS: glibcs-nios2-linux-gnu rm
PASS: glibcs-nios2-linux-gnu mkdir
PASS: glibcs-nios2-linux-gnu configure
PASS: glibcs-mips64el-linux-gnu-n64-soft check
PASS: glibcs-mips64el-linux-gnu-n64-soft save-logs
PASS: glibcs-mips64el-linux-gnu-n64-soft cleanup
PASS: glibcs-powerpc-linux-gnu check-compilers
PASS: glibcs-powerpc-linux-gnu rm
PASS: glibcs-powerpc-linux-gnu mkdir
PASS: glibcs-powerpc-linux-gnu configure
PASS: glibcs-mipsel-linux-gnu-nan2008 check
PASS: glibcs-mipsel-linux-gnu-nan2008 save-logs
PASS: glibcs-mipsel-linux-gnu-nan2008 cleanup
PASS: glibcs-powerpc-linux-gnu-power4 check-compilers
PASS: glibcs-powerpc-linux-gnu-power4 rm
PASS: glibcs-powerpc-linux-gnu-power4 mkdir
PASS: glibcs-powerpc-linux-gnu-power4 configure
PASS: glibcs-mipsisa32r6el-linux-gnu build
PASS: glibcs-mipsel-linux-gnu-nan2008-soft check
PASS: glibcs-mipsel-linux-gnu-nan2008-soft save-logs
PASS: glibcs-mipsel-linux-gnu-nan2008-soft cleanup
PASS: glibcs-powerpc-linux-gnu-soft check-compilers
PASS: glibcs-powerpc-linux-gnu-soft rm
PASS: glibcs-powerpc-linux-gnu-soft mkdir
PASS: glibcs-powerpc-linux-gnu-soft configure
PASS: glibcs-mipsisa32r6el-linux-gnu install
PASS: glibcs-mipsisa32r6el-linux-gnu mkdir-lib
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 build
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 install
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 mkdir-lib
PASS: glibcs-nios2-linux-gnu build
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 build
PASS: glibcs-nios2-linux-gnu install
PASS: glibcs-nios2-linux-gnu mkdir-lib
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 install
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 mkdir-lib
PASS: glibcs-powerpc-linux-gnu build
PASS: glibcs-mipsel-linux-gnu-soft check
PASS: glibcs-mipsel-linux-gnu-soft save-logs
PASS: glibcs-mipsel-linux-gnu-soft cleanup
PASS: glibcs-powerpc64-linux-gnu check-compilers
PASS: glibcs-powerpc64-linux-gnu rm
PASS: glibcs-powerpc64-linux-gnu mkdir
PASS: glibcs-powerpc64-linux-gnu configure
PASS: glibcs-powerpc-linux-gnu install
PASS: glibcs-powerpc-linux-gnu mkdir-lib
PASS: glibcs-powerpc-linux-gnu-power4 build
PASS: glibcs-powerpc-linux-gnu-power4 install
PASS: glibcs-powerpc-linux-gnu-power4 mkdir-lib
PASS: glibcs-powerpc-linux-gnu-soft build
PASS: glibcs-powerpc-linux-gnu-soft install
PASS: glibcs-powerpc-linux-gnu-soft mkdir-lib
PASS: glibcs-mipsisa32r6el-linux-gnu check
PASS: glibcs-mipsisa32r6el-linux-gnu save-logs
PASS: glibcs-mipsisa32r6el-linux-gnu cleanup
PASS: glibcs-powerpc64le-linux-gnu check-compilers
PASS: glibcs-powerpc64le-linux-gnu rm
PASS: glibcs-powerpc64le-linux-gnu mkdir
PASS: glibcs-powerpc64le-linux-gnu configure
PASS: glibcs-nios2-linux-gnu check
PASS: glibcs-nios2-linux-gnu save-logs
PASS: glibcs-nios2-linux-gnu cleanup
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch rm
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch configure
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 check
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 save-logs
PASS: glibcs-mipsisa64r6el-linux-gnu-n32 cleanup
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 check-compilers
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 rm
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 mkdir
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 configure
PASS: glibcs-powerpc64-linux-gnu build
PASS: glibcs-powerpc-linux-gnu check
PASS: glibcs-powerpc-linux-gnu save-logs
PASS: glibcs-powerpc-linux-gnu cleanup
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 check-compilers
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 rm
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 mkdir
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 configure
PASS: glibcs-powerpc64-linux-gnu install
PASS: glibcs-powerpc64-linux-gnu mkdir-lib
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 check
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 save-logs
PASS: glibcs-mipsisa64r6el-linux-gnu-n64 cleanup
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d check-compilers
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d rm
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d mkdir
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d configure
PASS: glibcs-powerpc-linux-gnu-power4 check
PASS: glibcs-powerpc-linux-gnu-power4 save-logs
PASS: glibcs-powerpc-linux-gnu-power4 cleanup
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 check-compilers
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 rm
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 mkdir
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 configure
PASS: glibcs-powerpc-linux-gnu-soft check
PASS: glibcs-powerpc-linux-gnu-soft save-logs
PASS: glibcs-powerpc-linux-gnu-soft cleanup
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 check-compilers
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 rm
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 mkdir
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 configure
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 build
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch build
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 install
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 mkdir-lib
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch install
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-powerpc64le-linux-gnu build
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 build
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d build
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 install
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 mkdir-lib
PASS: glibcs-powerpc64le-linux-gnu install
PASS: glibcs-powerpc64le-linux-gnu mkdir-lib
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d install
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d mkdir-lib
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 build
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 build
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 install
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 mkdir-lib
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 install
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 mkdir-lib
PASS: glibcs-powerpc64-linux-gnu check
PASS: glibcs-powerpc64-linux-gnu save-logs
PASS: glibcs-powerpc64-linux-gnu cleanup
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d check-compilers
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d rm
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d mkdir
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d configure
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d build
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d install
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d mkdir-lib
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch check
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-powerpc64le-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-s390-linux-gnu check-compilers
PASS: glibcs-s390-linux-gnu rm
PASS: glibcs-s390-linux-gnu mkdir
PASS: glibcs-s390-linux-gnu configure
PASS: glibcs-powerpc64le-linux-gnu check
PASS: glibcs-powerpc64le-linux-gnu save-logs
PASS: glibcs-powerpc64le-linux-gnu cleanup
PASS: glibcs-s390x-linux-gnu check-compilers
PASS: glibcs-s390x-linux-gnu rm
PASS: glibcs-s390x-linux-gnu mkdir
PASS: glibcs-s390x-linux-gnu configure
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 check
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 save-logs
PASS: glibcs-riscv32-linux-gnu-rv32imac-ilp32 cleanup
PASS: glibcs-s390x-linux-gnu-O3 check-compilers
PASS: glibcs-s390x-linux-gnu-O3 rm
PASS: glibcs-s390x-linux-gnu-O3 mkdir
PASS: glibcs-s390x-linux-gnu-O3 configure
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 check
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 save-logs
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32 cleanup
PASS: glibcs-sh3-linux-gnu check-compilers
PASS: glibcs-sh3-linux-gnu rm
PASS: glibcs-sh3-linux-gnu mkdir
PASS: glibcs-sh3-linux-gnu configure
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d check
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d save-logs
PASS: glibcs-riscv32-linux-gnu-rv32imafdc-ilp32d cleanup
PASS: glibcs-sh3eb-linux-gnu check-compilers
PASS: glibcs-sh3eb-linux-gnu rm
PASS: glibcs-sh3eb-linux-gnu mkdir
PASS: glibcs-sh3eb-linux-gnu configure
PASS: glibcs-s390-linux-gnu build
PASS: glibcs-s390-linux-gnu install
PASS: glibcs-s390-linux-gnu mkdir-lib
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 check
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 save-logs
PASS: glibcs-riscv64-linux-gnu-rv64imac-lp64 cleanup
PASS: glibcs-sh4-linux-gnu check-compilers
PASS: glibcs-sh4-linux-gnu rm
PASS: glibcs-sh4-linux-gnu mkdir
PASS: glibcs-sh4-linux-gnu configure
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 check
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 save-logs
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64 cleanup
PASS: glibcs-sh4-linux-gnu-soft check-compilers
PASS: glibcs-sh4-linux-gnu-soft rm
PASS: glibcs-sh4-linux-gnu-soft mkdir
PASS: glibcs-sh4-linux-gnu-soft configure
PASS: glibcs-s390x-linux-gnu build
PASS: glibcs-s390x-linux-gnu-O3 build
PASS: glibcs-s390x-linux-gnu install
PASS: glibcs-s390x-linux-gnu mkdir-lib
PASS: glibcs-s390x-linux-gnu-O3 install
PASS: glibcs-s390x-linux-gnu-O3 mkdir-lib
PASS: glibcs-sh3-linux-gnu build
PASS: glibcs-sh3-linux-gnu install
PASS: glibcs-sh3-linux-gnu mkdir-lib
PASS: glibcs-sh3eb-linux-gnu build
PASS: glibcs-sh3eb-linux-gnu install
PASS: glibcs-sh3eb-linux-gnu mkdir-lib
PASS: glibcs-s390-linux-gnu check
PASS: glibcs-s390-linux-gnu save-logs
PASS: glibcs-s390-linux-gnu cleanup
PASS: glibcs-sh4eb-linux-gnu check-compilers
PASS: glibcs-sh4eb-linux-gnu rm
PASS: glibcs-sh4eb-linux-gnu mkdir
PASS: glibcs-sh4eb-linux-gnu configure
PASS: glibcs-sh4-linux-gnu build
PASS: glibcs-sh4-linux-gnu-soft build
PASS: glibcs-sh4-linux-gnu install
PASS: glibcs-sh4-linux-gnu mkdir-lib
PASS: glibcs-sh4-linux-gnu-soft install
PASS: glibcs-sh4-linux-gnu-soft mkdir-lib
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d check
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d save-logs
PASS: glibcs-riscv64-linux-gnu-rv64imafdc-lp64d cleanup
PASS: glibcs-sh4eb-linux-gnu-soft check-compilers
PASS: glibcs-sh4eb-linux-gnu-soft rm
PASS: glibcs-sh4eb-linux-gnu-soft mkdir
PASS: glibcs-sh4eb-linux-gnu-soft configure
PASS: glibcs-s390x-linux-gnu-O3 check
PASS: glibcs-s390x-linux-gnu-O3 save-logs
PASS: glibcs-s390x-linux-gnu-O3 cleanup
PASS: glibcs-sparc64-linux-gnu check-compilers
PASS: glibcs-sparc64-linux-gnu rm
PASS: glibcs-sparc64-linux-gnu mkdir
PASS: glibcs-sparc64-linux-gnu configure
PASS: glibcs-sh3-linux-gnu check
PASS: glibcs-sh3-linux-gnu save-logs
PASS: glibcs-sh3-linux-gnu cleanup
PASS: glibcs-s390x-linux-gnu check
PASS: glibcs-s390x-linux-gnu save-logs
PASS: glibcs-s390x-linux-gnu cleanup
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch rm
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch configure
PASS: glibcs-sparcv8-linux-gnu-leon3 check-compilers
PASS: glibcs-sparcv8-linux-gnu-leon3 rm
PASS: glibcs-sparcv8-linux-gnu-leon3 mkdir
PASS: glibcs-sparcv8-linux-gnu-leon3 configure
PASS: glibcs-sh3eb-linux-gnu check
PASS: glibcs-sh3eb-linux-gnu save-logs
PASS: glibcs-sh3eb-linux-gnu cleanup
PASS: glibcs-sparcv9-linux-gnu check-compilers
PASS: glibcs-sparcv9-linux-gnu rm
PASS: glibcs-sparcv9-linux-gnu mkdir
PASS: glibcs-sparcv9-linux-gnu configure
PASS: glibcs-sh4eb-linux-gnu build
PASS: glibcs-sh4eb-linux-gnu install
PASS: glibcs-sh4eb-linux-gnu mkdir-lib
PASS: glibcs-sh4eb-linux-gnu-soft build
PASS: glibcs-sh4eb-linux-gnu-soft install
PASS: glibcs-sh4eb-linux-gnu-soft mkdir-lib
PASS: glibcs-sh4-linux-gnu-soft check
PASS: glibcs-sh4-linux-gnu-soft save-logs
PASS: glibcs-sh4-linux-gnu-soft cleanup
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch rm
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch configure
PASS: glibcs-sh4-linux-gnu check
PASS: glibcs-sh4-linux-gnu save-logs
PASS: glibcs-sh4-linux-gnu cleanup
PASS: glibcs-x86_64-linux-gnu check-compilers
PASS: glibcs-x86_64-linux-gnu rm
PASS: glibcs-x86_64-linux-gnu mkdir
PASS: glibcs-x86_64-linux-gnu configure
PASS: glibcs-sparc64-linux-gnu build
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch build
PASS: glibcs-sparc64-linux-gnu install
PASS: glibcs-sparc64-linux-gnu mkdir-lib
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch install
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-sparcv8-linux-gnu-leon3 build
PASS: glibcs-sparcv8-linux-gnu-leon3 install
PASS: glibcs-sparcv8-linux-gnu-leon3 mkdir-lib
PASS: glibcs-sparcv9-linux-gnu build
PASS: glibcs-sparcv9-linux-gnu install
PASS: glibcs-sparcv9-linux-gnu mkdir-lib
PASS: glibcs-sh4eb-linux-gnu check
PASS: glibcs-sh4eb-linux-gnu save-logs
PASS: glibcs-sh4eb-linux-gnu cleanup
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch check-compilers
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch rm
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch mkdir
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch configure
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch build
PASS: glibcs-sh4eb-linux-gnu-soft check
PASS: glibcs-sh4eb-linux-gnu-soft save-logs
PASS: glibcs-sh4eb-linux-gnu-soft cleanup
PASS: glibcs-x86_64-linux-gnu-minimal check-compilers
PASS: glibcs-x86_64-linux-gnu-minimal rm
PASS: glibcs-x86_64-linux-gnu-minimal mkdir
PASS: glibcs-x86_64-linux-gnu-minimal configure
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch install
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-x86_64-linux-gnu build
PASS: glibcs-x86_64-linux-gnu install
PASS: glibcs-x86_64-linux-gnu mkdir-lib
PASS: glibcs-sparc64-linux-gnu check
PASS: glibcs-sparc64-linux-gnu save-logs
PASS: glibcs-sparc64-linux-gnu cleanup
PASS: glibcs-x86_64-linux-gnu-static-pie check-compilers
PASS: glibcs-x86_64-linux-gnu-static-pie rm
PASS: glibcs-x86_64-linux-gnu-static-pie mkdir
PASS: glibcs-x86_64-linux-gnu-static-pie configure
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch check
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-sparc64-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-x86_64-linux-gnu-x32 check-compilers
PASS: glibcs-x86_64-linux-gnu-x32 rm
PASS: glibcs-x86_64-linux-gnu-x32 mkdir
PASS: glibcs-x86_64-linux-gnu-x32 configure
PASS: glibcs-sparcv8-linux-gnu-leon3 check
PASS: glibcs-sparcv8-linux-gnu-leon3 save-logs
PASS: glibcs-sparcv8-linux-gnu-leon3 cleanup
PASS: glibcs-x86_64-linux-gnu-x32-static-pie check-compilers
PASS: glibcs-x86_64-linux-gnu-x32-static-pie rm
PASS: glibcs-x86_64-linux-gnu-x32-static-pie mkdir
PASS: glibcs-x86_64-linux-gnu-x32-static-pie configure
PASS: glibcs-x86_64-linux-gnu-minimal build
PASS: glibcs-x86_64-linux-gnu-minimal install
PASS: glibcs-x86_64-linux-gnu-minimal mkdir-lib
PASS: glibcs-sparcv9-linux-gnu check
PASS: glibcs-sparcv9-linux-gnu save-logs
PASS: glibcs-sparcv9-linux-gnu cleanup
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch build
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch install
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch mkdir-lib
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch check
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-sparcv9-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-x86_64-linux-gnu check
PASS: glibcs-x86_64-linux-gnu save-logs
PASS: glibcs-x86_64-linux-gnu cleanup
PASS: glibcs-x86_64-linux-gnu-static-pie build
PASS: glibcs-x86_64-linux-gnu-x32 build
PASS: glibcs-x86_64-linux-gnu-x32-static-pie build
PASS: glibcs-x86_64-linux-gnu-static-pie install
PASS: glibcs-x86_64-linux-gnu-static-pie mkdir-lib
PASS: glibcs-x86_64-linux-gnu-x32 install
PASS: glibcs-x86_64-linux-gnu-x32 mkdir-lib
PASS: glibcs-x86_64-linux-gnu-x32-static-pie install
PASS: glibcs-x86_64-linux-gnu-x32-static-pie mkdir-lib
PASS: glibcs-x86_64-linux-gnu-minimal check
PASS: glibcs-x86_64-linux-gnu-minimal save-logs
PASS: glibcs-x86_64-linux-gnu-minimal cleanup
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch check
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch save-logs
PASS: glibcs-x86_64-linux-gnu-disable-multi-arch cleanup
PASS: glibcs-x86_64-linux-gnu-static-pie check
PASS: glibcs-x86_64-linux-gnu-static-pie save-logs
PASS: glibcs-x86_64-linux-gnu-static-pie cleanup
PASS: glibcs-x86_64-linux-gnu-x32 check
PASS: glibcs-x86_64-linux-gnu-x32 save-logs
PASS: glibcs-x86_64-linux-gnu-x32 cleanup
PASS: glibcs-x86_64-linux-gnu-x32-static-pie check
PASS: glibcs-x86_64-linux-gnu-x32-static-pie save-logs
PASS: glibcs-x86_64-linux-gnu-x32-static-pie cleanup
```

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-22  0:40                   ` H.J. Lu
@ 2021-10-25 16:41                     ` Joseph Myers
  0 siblings, 0 replies; 106+ messages in thread
From: Joseph Myers @ 2021-10-25 16:41 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

On Thu, 21 Oct 2021, H.J. Lu via Libc-alpha wrote:

> On Thu, Oct 21, 2021 at 5:19 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Thu, 21 Oct 2021, Noah Goldstein via Libc-alpha wrote:
> >
> > > > > The compiler knows other semantics of memcmp (it might sometimes expand a
> > > > > memcmp with a small fixed size inline, for example).  So changing to a
> > > > > direct call to __memcmpeq by hand isn't even always an optimization;
> > > Will compilers not implement the same optimization for __memcmpeq?
> >
> > Why should they?  It's intended as an ABI, not an API - that is, an
> > alternative assembler name the compiler name generate calls to, not a
> > function for which it should find calls in its input.
> >
> 
> Compiler builtin optimization doesn't work well for glibc:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220

1. So let's fix that in the compiler.  This doesn't seem like something so 
hard to fix that it should justify obfuscating the source code in glibc by 
putting in unnecessary direct calls to an internal name.

2. If we need a single redirection of __memcmpeq to the hidden alias 
__GI___memcmpeq, we could certainly put that in 
sysdeps/generic/symbol-hacks.h as we do for a few other functions.  A 
redirection like that in one place isn't problematic the same way putting 
in lots of direct calls to an internal name in the source code (for 
something better optimized in the compiler) is.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
                     ` (3 preceding siblings ...)
  2021-10-25  2:45   ` [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
@ 2021-10-26 18:55   ` H.J. Lu
  2021-10-26 22:29     ` Noah Goldstein
  4 siblings, 1 reply; 106+ messages in thread
From: H.J. Lu @ 2021-10-26 18:55 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha, hjl.tools, carlos

On Sat, Oct 23, 2021 at 06:24:01PM -0500, Noah Goldstein wrote:
> No bug.
> 
> This commit adds support for __memcmpeq() as a new ABI for all
> targets. In this commit __memcmpeq() is implemented only as an alias
> to the corresponding targets memcmp() implementation. __memcmpeq() is
> added as a new symbol starting with GLIBC_2.35 and defined in string.h
> with comments explaining its behavior. Basic tests that it is callable
> and works where added in string/tester.c
> 
> As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> is shares the same specifications as memcmp() except the return value
> for non-equal byte sequences is any non-zero value. This is less
> strict than memcmp()'s return value specification and can be better
> optimized when a boolean return is all that is needed.
> 
> __memcmpeq() is meant to only be called by compilers if they can prove
> that the return value of a memcmp() call is only used for its boolean
> value.
> 
> All tests in string/tester.c passed. As well build succeeds on
> x86_64-linux-gnu target.
> ---
>  string/Versions                                  |  3 +++
>  string/memcmp.c                                  |  3 +++
>  string/string.h                                  | 16 ++++++++++++++++
>  string/tester.c                                  | 16 ++++++++++++++++
>  sysdeps/aarch64/memcmp.S                         |  2 ++
>  sysdeps/csky/abiv2/memcmp.S                      |  1 +
>  sysdeps/i386/i686/memcmp.S                       |  2 ++
>  sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
>  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
>  sysdeps/i386/memcmp.S                            |  2 ++
>  sysdeps/ia64/memcmp.S                            |  1 +
>  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
>  .../powerpc32/power4/multiarch/memcmp-power7.S   |  3 +++
>  .../powerpc32/power4/multiarch/memcmp-ppc32.S    |  4 ++++
>  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
>  .../powerpc/powerpc64/multiarch/memcmp-power10.S |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power4.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power7.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-power8.S  |  2 ++
>  .../powerpc/powerpc64/multiarch/memcmp-ppc64.c   |  4 ++++
>  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
>  sysdeps/s390/memcmp-z900.S                       |  1 +
>  sysdeps/s390/memcmp.c                            |  1 +
>  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
>  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
>  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
>  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
>  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
>  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
>  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
>  sysdeps/x86_64/memcmp.S                          |  2 ++
>  sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
>  64 files changed, 120 insertions(+)
> 
> diff --git a/string/Versions b/string/Versions
> index 298ecd401a..864c4cf7a4 100644
> --- a/string/Versions
> +++ b/string/Versions
> @@ -89,4 +89,7 @@ libc {
>      sigdescr_np; sigabbrev_np;
>      strerrordesc_np; strerrorname_np;
>    }
> +  GLIBC_2.35 {
> +    __memcmpeq;
> +  }
>  }
> diff --git a/string/memcmp.c b/string/memcmp.c
> index 9b46d7a905..eac4112530 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -359,3 +359,6 @@ libc_hidden_builtin_def(memcmp)
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
>  #endif
> +
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/string/string.h b/string/string.h
> index b1b083edce..e70feeaeea 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
>  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
>       __THROW __attribute_pure__ __nonnull ((1, 2));
>  
> +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> +   Return some non-zero value otherwise.
> +
> +   Essentially __memcmpeq has the exact same semantics as memcmp
> +   except the return value is less constrained.  memcmp is always a
> +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> +   or bcmp are correct implementations.
> +
> +   __memcmpeq is meant to be used by compilers when memcmp return is
> +   only used for its bolean value.
> +
> +   __memcmpeq is declared only for use by compilers.  Programs should
> +   continue to use memcmp.  */
> +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> +     __THROW __attribute_pure__ __nonnull ((1, 2));
> +
>  /* Search N bytes of S for C.  */
>  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++"
> diff --git a/string/tester.c b/string/tester.c
> index 778160ae6e..605b3f00f9 100644
> --- a/string/tester.c
> +++ b/string/tester.c
> @@ -1449,6 +1449,19 @@ test_bcmp (void)
>    check(bcmp("abc", "def", 0) == 0, 8);	/* Zero count. */
>  }
>  
> +static void
> +test_memcmpeq (void)
> +{
> +  it = "__memcmpeq";
> +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> +}
> +
>  static void
>  test_strerror (void)
>  {
> @@ -1611,6 +1624,9 @@ main (void)
>    /* bcmp - somewhat like memcmp.  */
>    test_bcmp ();
>  
> +  /* __memcmpeq - somewhat like memcmp.  */
> +  test_memcmpeq ();
> +
>    /* strndup.  */
>    test_strndup ();
>  
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index c1937f6f5c..37f37b9191 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -177,4 +177,6 @@ L(ret_0):
>  END (memcmp)
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 1560387618..2a4ae577b0 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -138,5 +138,6 @@ ENTRY (memcmp)
>  	br	.L_s1_aligned
>  END (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index b26b124fad..90266d904b 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -405,4 +405,6 @@ L(table_32bytes) :
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> index 5f6658b89a..a5b5c3d349 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> @@ -30,6 +30,9 @@
>  
>  # undef weak_alias
>  # define weak_alias(original, alias)
> +
> +# undef strong_alias
> +# define strong_alias(original, alias)
>  #endif
>  
>  #include <sysdeps/i386/i686/memcmp.S>
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 6e058a8857..3b2815edbc 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -29,4 +29,5 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 1f212b0f6d..02473c2c0c 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -70,4 +70,6 @@ END (memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 97539c23fd..7722908751 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -160,4 +160,5 @@ ENTRY(memcmp)
>  END(memcmp)
>  
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index c5da10a0cd..e849d6fa35 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
>  GLIBC_2.34 shm_open F
>  GLIBC_2.34 shm_unlink F
>  GLIBC_2.34 timespec_getres F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index 6a6a54d90f..c2836040a7 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -126,3 +126,4 @@ L(st2):
>  END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index 814d2f211d..f58e34aba5 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>  
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> index 8a929b2b44..b17d0e43b7 100644
> --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> @@ -38,4 +38,7 @@
>  #undef weak_alias
>  #define weak_alias(a, b)
>  
> +#undef strong_alias
> +#define strong_alias(a, b)
> +
>  #include <sysdeps/powerpc/powerpc32/power7/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> index 317523b743..893b6cac9c 100644
> --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> @@ -40,6 +40,10 @@
>  # undef weak_alias
>  # define weak_alias(a, b)					\
>    .weak b ; b = __memcmp_ppc
> +
> +# undef strong_alias
> +# define strong_alias(a, b)					\
> +  .globl b ; b = __memcmp_ppc
>  #endif
>  
>  #include <sysdeps/powerpc/powerpc32/power4/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index 8a19953e2d..f8deb4e32c 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1373,3 +1373,4 @@ END (memcmp)
>  
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index 52f244e7e7..f81c73a29c 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -177,3 +177,4 @@ L(tail8):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> index 73a0debd4a..22399f143d 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>  
>  #include <sysdeps/powerpc/powerpc64/le/power10/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> index d2b6c2f934..fe68912a3b 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>  
>  #include <sysdeps/powerpc/powerpc64/power4/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> index 8671e930f0..5739471a7d 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>  
>  #include <sysdeps/powerpc/powerpc64/power7/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> index eb2273d468..e6a93e88c6 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> @@ -22,5 +22,7 @@
>  #define libc_hidden_builtin_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
> +#undef strong_alias
> +#define strong_alias(name,alias)
>  
>  #include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> index 1f9f219971..2bc5fa50d7 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> @@ -22,6 +22,10 @@
>  #define weak_alias(name, aliasname) \
>    extern __typeof (__memcmp_ppc) aliasname \
>      __attribute__ ((weak, alias ("__memcmp_ppc")));
> +#undef strong_alias
> +#define strong_alias(name, aliasname) \
> +  extern __typeof (__memcmp_ppc) aliasname \
> +    __attribute__ ((alias ("__memcmp_ppc")));
>  #if IS_IN (libc) && defined(SHARED)
>  # undef libc_hidden_builtin_def
>  # define libc_hidden_builtin_def(name) \
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index dc1be3a0d8..cc82be115f 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index bc034a55bc..3044f7ede9 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1059,3 +1059,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index b676b09a9b..0c6a154502 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1442,3 +1442,4 @@ L(duzeroLength):
>  END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index 995d52e47d..d625bf90dd 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
>     Otherwise see sysdeps/s390/memcmp.c.  */
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
> +strong_alias (memcmp, __memcmpeq)
>  #endif
>  
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 0b4e9da717..52c20af772 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>  		      })
>  		      )
>  weak_alias (memcmp, bcmp);
> +strong_alias (memcmp, __memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index d8d9ff9b24..fefeee5f5d 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -137,4 +137,6 @@ END(memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 21a2e50a88..f227ae6cee 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index a201fd69ba..0ccc3fc73e 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index 2611436937..fd80704787 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a426241965..2ae6c58b8a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 02f80418cc..fcfd1e8594 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
>  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index b7676eb372..ba034b8541 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f6965c9d95..b7460bec8a 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 2e7603d9ed..a4dc341ded 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index dd3a56d3fe..94b222dbc7 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c1e0ea9c10..12fd3b6310 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
>  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 93161048ca..4d2296007a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 0aaeec8a27..a223278a3d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index bec5f456c9..780a4f5b0b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 97d2127f78..cd65136062 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index acb0756c11..b5b9902db5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index ebc21dde1e..57593d5f94 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c68f7e3c6c..e944d76bed 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e5b6834f14..8af5a3a90d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 132707c8ad..3a0213b39f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 0af2be31a0..f57df0234b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index cf864632d0..259a0cfc51 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index d566d675d0..126541daf1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index c9a7eacb32..05df4d13d2 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 8299131cb2..8e349cbff8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index c3fe78f77f..e9de402766 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 83e542aa8c..1a010c745d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dc502f6833..22ce530975 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index cba1abb556..960df07b83 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index d4a516fb47..eedb376f3d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
>  GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 6268875ba3..86e0c92bef 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 095e914b73..5e59d90623 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
>  GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index dd910f7fe9..94412dc134 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
>  GLIBC_2.34 tss_delete F
>  GLIBC_2.34 tss_get F
>  GLIBC_2.34 tss_set F
> +GLIBC_2.35 __memcmpeq F
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 870e15c5a0..1b351ee092 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -358,4 +358,6 @@ END(memcmp)
>  
>  #undef bcmp
>  weak_alias (memcmp, bcmp)
> +#undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> index b135fa2d40..af737c5e6c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
> +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> @@ -26,6 +26,9 @@
>  
>  # undef weak_alias
>  # define weak_alias(ignored1, ignored2)
> +
> +# undef strong_alias
> +# define strong_alias(ignored1, ignored2)
>  #endif
>  
>  #include <sysdeps/x86_64/memcmp.S>
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index fe725f3563..4a3aad2c9c 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -29,6 +29,8 @@
>  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  # undef bcmp
>  weak_alias (memcmp, bcmp)
> +# undef __memcmpeq
> +strong_alias (memcmp, __memcmpeq)
>  
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> -- 
> 2.25.1
> 

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
  2021-10-23 23:24   ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
@ 2021-10-26 18:56     ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-26 18:56 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha, hjl.tools, carlos

On Sat, Oct 23, 2021 at 06:24:02PM -0500, Noah Goldstein wrote:
> No bug.
> 
> This commit adds hidden defs for all declarations of __memcmpeq. This
> enables usage of __memcmpeq without the PLT for usage internal to
> GLIBC.
> ---
>  include/string.h                                           | 1 +
>  string/memcmp.c                                            | 1 +
>  sysdeps/aarch64/memcmp.S                                   | 1 +
>  sysdeps/csky/abiv2/memcmp.S                                | 1 +
>  sysdeps/i386/i686/memcmp.S                                 | 1 +
>  sysdeps/i386/i686/multiarch/memcmp-ia32.S                  | 4 ++++
>  sysdeps/i386/i686/multiarch/memcmp.c                       | 1 +
>  sysdeps/i386/memcmp.S                                      | 1 +
>  sysdeps/ia64/memcmp.S                                      | 1 +
>  sysdeps/powerpc/powerpc32/405/memcmp.S                     | 1 +
>  sysdeps/powerpc/powerpc32/power4/memcmp.S                  | 1 +
>  sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S | 3 +++
>  sysdeps/powerpc/powerpc32/power7/memcmp.S                  | 1 +
>  sysdeps/powerpc/powerpc64/le/power10/memcmp.S              | 1 +
>  sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S       | 2 ++
>  sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S        | 2 ++
>  sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S        | 2 ++
>  sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S        | 2 ++
>  sysdeps/powerpc/powerpc64/power4/memcmp.S                  | 1 +
>  sysdeps/powerpc/powerpc64/power7/memcmp.S                  | 1 +
>  sysdeps/powerpc/powerpc64/power8/memcmp.S                  | 1 +
>  sysdeps/s390/memcmp-z900.S                                 | 1 +
>  sysdeps/s390/memcmp.c                                      | 1 +
>  sysdeps/sparc/sparc64/memcmp.S                             | 1 +
>  sysdeps/x86_64/memcmp.S                                    | 1 +
>  sysdeps/x86_64/multiarch/memcmp-sse2.S                     | 3 +++
>  sysdeps/x86_64/multiarch/memcmp.c                          | 1 +
>  27 files changed, 38 insertions(+)
> 
> diff --git a/include/string.h b/include/string.h
> index 81dab39891..21f641a413 100644
> --- a/include/string.h
> +++ b/include/string.h
> @@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
>  libc_hidden_proto (__strsep_g)
>  libc_hidden_proto (strnlen)
>  libc_hidden_proto (__strnlen)
> +libc_hidden_proto (__memcmpeq)
>  libc_hidden_proto (memmem)
>  extern __typeof (memmem) __memmem;
>  libc_hidden_proto (__memmem)
> diff --git a/string/memcmp.c b/string/memcmp.c
> index eac4112530..4620e79f29 100644
> --- a/string/memcmp.c
> +++ b/string/memcmp.c
> @@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp)
>  
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def(__memcmpeq)
> diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> index 37f37b9191..5dc4ee5f0b 100644
> --- a/sysdeps/aarch64/memcmp.S
> +++ b/sysdeps/aarch64/memcmp.S
> @@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> index 2a4ae577b0..9aacfd4cab 100644
> --- a/sysdeps/csky/abiv2/memcmp.S
> +++ b/sysdeps/csky/abiv2/memcmp.S
> @@ -140,4 +140,5 @@ END (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_def (memcmp)
> +libc_hidden_def (__memcmpeq)
>  .weak memcmp
> diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> index 90266d904b..cc3329bef4 100644
> --- a/sysdeps/i386/i686/memcmp.S
> +++ b/sysdeps/i386/i686/memcmp.S
> @@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> index a5b5c3d349..74188f74ab 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> @@ -26,6 +26,10 @@
>     used by IFUNC.  */
>  #  define libc_hidden_builtin_def(name) \
>  	.globl __GI_memcmp; __GI_memcmp = memcmp
> +
> +#  undef libc_hidden_def
> +#  define libc_hidden_def(name) \
> +	.globl __GI___memcmpeq; __GI___memcmpeq = __memcmpeq
>  # endif
>  
>  # undef weak_alias
> diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> index 3b2815edbc..eb7cb9f2e2 100644
> --- a/sysdeps/i386/i686/multiarch/memcmp.c
> +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> @@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
> diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> index 02473c2c0c..f224db4681 100644
> --- a/sysdeps/i386/memcmp.S
> +++ b/sysdeps/i386/memcmp.S
> @@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> index 7722908751..3ab04d4f8a 100644
> --- a/sysdeps/ia64/memcmp.S
> +++ b/sysdeps/ia64/memcmp.S
> @@ -162,3 +162,4 @@ END(memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> index c2836040a7..339091be0d 100644
> --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> @@ -127,3 +127,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp,bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> index f58e34aba5..0df97dbf49 100644
> --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> @@ -1374,3 +1374,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> index b17d0e43b7..cb1338c650 100644
> --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> @@ -35,6 +35,9 @@
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name)
>  
> +#undef libc_hidden_def
> +#define libc_hidden_def(name)
> +
>  #undef weak_alias
>  #define weak_alias(a, b)
>  
> diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> index f8deb4e32c..25be9a7f51 100644
> --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> @@ -1374,3 +1374,4 @@ END (memcmp)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> index f81c73a29c..b0cd3ddde7 100644
> --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> @@ -178,3 +178,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> index 22399f143d..07a83b07b9 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> @@ -20,6 +20,8 @@
>  
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name)
> +#undef libc_hidden_def
> +#define libc_hidden_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
>  #undef strong_alias
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> index fe68912a3b..3308222a4b 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> @@ -20,6 +20,8 @@
>  
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name)
> +#undef libc_hidden_def
> +#define libc_hidden_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
>  #undef strong_alias
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> index 5739471a7d..b02174b328 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> @@ -20,6 +20,8 @@
>  
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name)
> +#undef libc_hidden_def
> +#define libc_hidden_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
>  #undef strong_alias
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> index e6a93e88c6..5eb4b58691 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> @@ -20,6 +20,8 @@
>  
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name)
> +#undef libc_hidden_def
> +#define libc_hidden_def(name)
>  #undef weak_alias
>  #define weak_alias(name,alias)
>  #undef strong_alias
> diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> index cc82be115f..3731bb0a73 100644
> --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> @@ -1375,3 +1375,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> index 3044f7ede9..29ae19d843 100644
> --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> @@ -1060,3 +1060,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> index 0c6a154502..897a5713ce 100644
> --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> @@ -1443,3 +1443,4 @@ END (MEMCMP)
>  libc_hidden_builtin_def (memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> index d625bf90dd..5808f9365d 100644
> --- a/sysdeps/s390/memcmp-z900.S
> +++ b/sysdeps/s390/memcmp-z900.S
> @@ -165,6 +165,7 @@ END(MEMCMP_Z196)
>  strong_alias (MEMCMP_DEFAULT, memcmp)
>  weak_alias (memcmp, bcmp)
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
>  
>  #if defined SHARED && IS_IN (libc)
> diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> index 52c20af772..cc58279389 100644
> --- a/sysdeps/s390/memcmp.c
> +++ b/sysdeps/s390/memcmp.c
> @@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
>  		      )
>  weak_alias (memcmp, bcmp);
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  #endif
> diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> index fefeee5f5d..d237945554 100644
> --- a/sysdeps/sparc/sparc64/memcmp.S
> +++ b/sysdeps/sparc/sparc64/memcmp.S
> @@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> index 1b351ee092..8a03e572e8 100644
> --- a/sysdeps/x86_64/memcmp.S
> +++ b/sysdeps/x86_64/memcmp.S
> @@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp)
>  #undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
>  libc_hidden_builtin_def (memcmp)
> +libc_hidden_def (__memcmpeq)
> diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> index af737c5e6c..7b30b7ca2e 100644
> --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
> +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> @@ -22,6 +22,9 @@
>  # ifdef SHARED
>  #  undef libc_hidden_builtin_def
>  #  define libc_hidden_builtin_def(name)
> +
> +#  undef libc_hidden_def
> +#  define libc_hidden_def(ignored)
>  # endif
>  
>  # undef weak_alias
> diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> index 4a3aad2c9c..7b3409b1dd 100644
> --- a/sysdeps/x86_64/multiarch/memcmp.c
> +++ b/sysdeps/x86_64/multiarch/memcmp.c
> @@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
>  weak_alias (memcmp, bcmp)
>  # undef __memcmpeq
>  strong_alias (memcmp, __memcmpeq)
> +libc_hidden_def (__memcmpeq)
>  
>  # ifdef SHARED
>  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> -- 
> 2.25.1
> 

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 3/4] String: Add tests for __memcmpeq
  2021-10-23 23:24   ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
@ 2021-10-26 18:57     ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-26 18:57 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha, hjl.tools, carlos

On Sat, Oct 23, 2021 at 06:24:03PM -0500, Noah Goldstein wrote:
> No bug.
> 
> This commit adds tests for the new function __memcmpeq. The new tests
> use the existing tests in 'test-memcmp.c' but relax the result
> requirement to only check for zero or non-zero returns.
> 
> All string tests include test-memcmpeq are passing.
> ---
>  string/Makefile        |  4 ++--
>  string/test-memcmp.c   | 34 ++++++++++++++++++++++------------
>  string/test-memcmpeq.c | 21 +++++++++++++++++++++
>  3 files changed, 45 insertions(+), 14 deletions(-)
>  create mode 100644 string/test-memcmpeq.c
> 
> diff --git a/string/Makefile b/string/Makefile
> index f0fce2a0b8..40d6fac133 100644
> --- a/string/Makefile
> +++ b/string/Makefile
> @@ -48,8 +48,8 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
>  		   sigdescr_np sigabbrev_np strerrorname_np		\
>  		   strerrordesc_np
>  
> -strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
> -		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
> +strop-tests	:= memchr memcmp memcpy memcmpeq memmove mempcpy memset	\
> +		   memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
>  		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
>  		   strstr strcasestr strnlen strcasecmp strncasecmp	\
>  		   strncat rawmemchr strchrnul bcopy bzero memrchr	\
> diff --git a/string/test-memcmp.c b/string/test-memcmp.c
> index 6ddbc05d2f..fdf148102c 100644
> --- a/string/test-memcmp.c
> +++ b/string/test-memcmp.c
> @@ -17,11 +17,14 @@
>     <https://www.gnu.org/licenses/>.  */
>  
>  #define TEST_MAIN
> -#ifdef WIDE
> +#ifdef TEST_MEMCMPEQ
> +# define TEST_NAME "__memcmpeq"
> +#elif defined WIDE
>  # define TEST_NAME "wmemcmp"
>  #else
>  # define TEST_NAME "memcmp"
>  #endif
> +
>  #include "test-string.h"
>  #ifdef WIDE
>  # include <inttypes.h>
> @@ -35,8 +38,9 @@
>  # define CHARBYTES 4
>  # define CHAR__MIN WCHAR_MIN
>  # define CHAR__MAX WCHAR_MAX
> +
>  int
> -simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
> +SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
>  {
>    int ret = 0;
>    /* Warning!
> @@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
>  }
>  #else
>  # include <limits.h>
> -
> -# define MEMCMP memcmp
> +# ifdef TEST_MEMCMPEQ
> +#  define MEMCMP __memcmpeq
> +#  define SIMPLE_MEMCMP simple_memcmpeq
> +# else
> +#  define MEMCMP memcmp
> +#  define SIMPLE_MEMCMP simple_memcmp
> +# endif
>  # define MEMCPY memcpy
> -# define SIMPLE_MEMCMP simple_memcmp
>  # define CHAR char
>  # define MAX_CHAR 255
>  # define UCHAR unsigned char
> @@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
>  # define CHAR__MAX CHAR_MAX
>  
>  int
> -simple_memcmp (const char *s1, const char *s2, size_t n)
> +SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
>  {
>    int ret = 0;
>  
> @@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
>  }
>  #endif
>  
> +#ifndef BAD_RESULT
> +# define BAD_RESULT(result, expec)                                      \
> +    (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) ||    \
> +     ((result) > 0 && (expec) <= 0))
> +# endif
> +
>  typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
>  
>  IMPL (SIMPLE_MEMCMP, 0)
> @@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
>  	      int exp_result)
>  {
>    int result = CALL (impl, s1, s2, len);
> -  if ((exp_result == 0 && result != 0)
> -      || (exp_result < 0 && result >= 0)
> -      || (exp_result > 0 && result <= 0))
> +  if (BAD_RESULT(result, exp_result))
>      {
>        error (0, 0, "Wrong result in function %s %d %d", impl->name,
>  	     result, exp_result);
> @@ -186,9 +198,7 @@ do_random_tests (void)
>  	{
>  	  r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
>  		    len);
> -	  if ((r == 0 && result)
> -	      || (r < 0 && result >= 0)
> -	      || (r > 0 && result <= 0))
> +	  if (BAD_RESULT(r, result))
>  	    {
>  	      error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
>  		     n, impl->name, align1 * CHARBYTES & 63,  align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
> diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
> new file mode 100644
> index 0000000000..8889117868
> --- /dev/null
> +++ b/string/test-memcmpeq.c
> @@ -0,0 +1,21 @@
> +/* Test and measure __memcmpeq functions.
> +   Copyright (C) 2012-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#define BAD_RESULT(result, expec) ((!(result)) != (!(expec)))
> +#define TEST_MEMCMPEQ 1
> +#include "test-memcmp.c"
> -- 
> 2.25.1
> 

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.


H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 4/4] NEWS: Add item for __memcmpeq
  2021-10-23 23:24   ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
@ 2021-10-26 18:58     ` H.J. Lu
  0 siblings, 0 replies; 106+ messages in thread
From: H.J. Lu @ 2021-10-26 18:58 UTC (permalink / raw)
  To: Noah Goldstein; +Cc: libc-alpha, hjl.tools, carlos

On Sat, Oct 23, 2021 at 06:24:04PM -0500, Noah Goldstein wrote:
> ---
>  NEWS | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/NEWS b/NEWS
> index b39b1e5e33..82b7016aef 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -60,6 +60,10 @@ Major new features:
>    DSO sorting algorithms.  The default setting of '1' uses the current existing
>    algorithm, while a value of '2' selects the new DFS-based algorithm.
>  
> +* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant
> +  to be used by compilers for optimizing usage of 'memcmp' when its
> +  return value is only used for its boolean status.
> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * The r_version update in the debugger interface makes the glibc binary
> -- 
> 2.25.1
> 

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.


H.J.

^ permalink raw reply	[flat|nested] 106+ messages in thread

* Re: [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets
  2021-10-26 18:55   ` H.J. Lu
@ 2021-10-26 22:29     ` Noah Goldstein
  0 siblings, 0 replies; 106+ messages in thread
From: Noah Goldstein @ 2021-10-26 22:29 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, Carlos O'Donell

On Tue, Oct 26, 2021 at 1:55 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Oct 23, 2021 at 06:24:01PM -0500, Noah Goldstein wrote:
> > No bug.
> >
> > This commit adds support for __memcmpeq() as a new ABI for all
> > targets. In this commit __memcmpeq() is implemented only as an alias
> > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > with comments explaining its behavior. Basic tests that it is callable
> > and works where added in string/tester.c
> >
> > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > is shares the same specifications as memcmp() except the return value
> > for non-equal byte sequences is any non-zero value. This is less
> > strict than memcmp()'s return value specification and can be better
> > optimized when a boolean return is all that is needed.
> >
> > __memcmpeq() is meant to only be called by compilers if they can prove
> > that the return value of a memcmp() call is only used for its boolean
> > value.
> >
> > All tests in string/tester.c passed. As well build succeeds on
> > x86_64-linux-gnu target.
> > ---
> >  string/Versions                                  |  3 +++
> >  string/memcmp.c                                  |  3 +++
> >  string/string.h                                  | 16 ++++++++++++++++
> >  string/tester.c                                  | 16 ++++++++++++++++
> >  sysdeps/aarch64/memcmp.S                         |  2 ++
> >  sysdeps/csky/abiv2/memcmp.S                      |  1 +
> >  sysdeps/i386/i686/memcmp.S                       |  2 ++
> >  sysdeps/i386/i686/multiarch/memcmp-ia32.S        |  3 +++
> >  sysdeps/i386/i686/multiarch/memcmp.c             |  1 +
> >  sysdeps/i386/memcmp.S                            |  2 ++
> >  sysdeps/ia64/memcmp.S                            |  1 +
> >  sysdeps/mach/hurd/i386/libc.abilist              |  1 +
> >  sysdeps/powerpc/powerpc32/405/memcmp.S           |  1 +
> >  sysdeps/powerpc/powerpc32/power4/memcmp.S        |  1 +
> >  .../powerpc32/power4/multiarch/memcmp-power7.S   |  3 +++
> >  .../powerpc32/power4/multiarch/memcmp-ppc32.S    |  4 ++++
> >  sysdeps/powerpc/powerpc32/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/le/power10/memcmp.S    |  1 +
> >  .../powerpc/powerpc64/multiarch/memcmp-power10.S |  2 ++
> >  .../powerpc/powerpc64/multiarch/memcmp-power4.S  |  2 ++
> >  .../powerpc/powerpc64/multiarch/memcmp-power7.S  |  2 ++
> >  .../powerpc/powerpc64/multiarch/memcmp-power8.S  |  2 ++
> >  .../powerpc/powerpc64/multiarch/memcmp-ppc64.c   |  4 ++++
> >  sysdeps/powerpc/powerpc64/power4/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power7/memcmp.S        |  1 +
> >  sysdeps/powerpc/powerpc64/power8/memcmp.S        |  1 +
> >  sysdeps/s390/memcmp-z900.S                       |  1 +
> >  sysdeps/s390/memcmp.c                            |  1 +
> >  sysdeps/sparc/sparc64/memcmp.S                   |  2 ++
> >  sysdeps/unix/sysv/linux/aarch64/libc.abilist     |  1 +
> >  sysdeps/unix/sysv/linux/alpha/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/arc/libc.abilist         |  1 +
> >  sysdeps/unix/sysv/linux/arm/be/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/arm/le/libc.abilist      |  1 +
> >  sysdeps/unix/sysv/linux/csky/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/hppa/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/i386/libc.abilist        |  1 +
> >  sysdeps/unix/sysv/linux/ia64/libc.abilist        |  1 +
> >  .../unix/sysv/linux/m68k/coldfire/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist |  1 +
> >  .../unix/sysv/linux/microblaze/be/libc.abilist   |  1 +
> >  .../unix/sysv/linux/microblaze/le/libc.abilist   |  1 +
> >  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist |  1 +
> >  .../sysv/linux/mips/mips32/nofpu/libc.abilist    |  1 +
> >  .../unix/sysv/linux/mips/mips64/n32/libc.abilist |  1 +
> >  .../unix/sysv/linux/mips/mips64/n64/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/nios2/libc.abilist       |  1 +
> >  .../linux/powerpc/powerpc32/fpu/libc.abilist     |  1 +
> >  .../linux/powerpc/powerpc32/nofpu/libc.abilist   |  1 +
> >  .../sysv/linux/powerpc/powerpc64/be/libc.abilist |  1 +
> >  .../sysv/linux/powerpc/powerpc64/le/libc.abilist |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist  |  1 +
> >  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist  |  1 +
> >  .../unix/sysv/linux/s390/s390-32/libc.abilist    |  1 +
> >  .../unix/sysv/linux/s390/s390-64/libc.abilist    |  1 +
> >  sysdeps/unix/sysv/linux/sh/be/libc.abilist       |  1 +
> >  sysdeps/unix/sysv/linux/sh/le/libc.abilist       |  1 +
> >  .../unix/sysv/linux/sparc/sparc32/libc.abilist   |  1 +
> >  .../unix/sysv/linux/sparc/sparc64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist   |  1 +
> >  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist  |  1 +
> >  sysdeps/x86_64/memcmp.S                          |  2 ++
> >  sysdeps/x86_64/multiarch/memcmp-sse2.S           |  3 +++
> >  sysdeps/x86_64/multiarch/memcmp.c                |  2 ++
> >  64 files changed, 120 insertions(+)
> >
> > diff --git a/string/Versions b/string/Versions
> > index 298ecd401a..864c4cf7a4 100644
> > --- a/string/Versions
> > +++ b/string/Versions
> > @@ -89,4 +89,7 @@ libc {
> >      sigdescr_np; sigabbrev_np;
> >      strerrordesc_np; strerrorname_np;
> >    }
> > +  GLIBC_2.35 {
> > +    __memcmpeq;
> > +  }
> >  }
> > diff --git a/string/memcmp.c b/string/memcmp.c
> > index 9b46d7a905..eac4112530 100644
> > --- a/string/memcmp.c
> > +++ b/string/memcmp.c
> > @@ -359,3 +359,6 @@ libc_hidden_builtin_def(memcmp)
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> >  #endif
> > +
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/string/string.h b/string/string.h
> > index b1b083edce..e70feeaeea 100644
> > --- a/string/string.h
> > +++ b/string/string.h
> > @@ -64,6 +64,22 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
> >  extern int memcmp (const void *__s1, const void *__s2, size_t __n)
> >       __THROW __attribute_pure__ __nonnull ((1, 2));
> >
> > +/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.
> > +   Return some non-zero value otherwise.
> > +
> > +   Essentially __memcmpeq has the exact same semantics as memcmp
> > +   except the return value is less constrained.  memcmp is always a
> > +   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,
> > +   or bcmp are correct implementations.
> > +
> > +   __memcmpeq is meant to be used by compilers when memcmp return is
> > +   only used for its bolean value.
> > +
> > +   __memcmpeq is declared only for use by compilers.  Programs should
> > +   continue to use memcmp.  */
> > +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
> > +     __THROW __attribute_pure__ __nonnull ((1, 2));
> > +
> >  /* Search N bytes of S for C.  */
> >  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> >  extern "C++"
> > diff --git a/string/tester.c b/string/tester.c
> > index 778160ae6e..605b3f00f9 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -1449,6 +1449,19 @@ test_bcmp (void)
> >    check(bcmp("abc", "def", 0) == 0, 8);      /* Zero count. */
> >  }
> >
> > +static void
> > +test_memcmpeq (void)
> > +{
> > +  it = "__memcmpeq";
> > +  check (__memcmpeq ("a", "a", 1) == 0, 1); /* Identity.  */
> > +  check (__memcmpeq ("abc", "abc", 3) == 0, 2); /* Multicharacter.  */
> > +  check (__memcmpeq ("abcd", "abce", 4) != 0, 3); /* Honestly unequal.  */
> > +  check (__memcmpeq ("abce", "abcd", 4) != 0, 4);
> > +  check (__memcmpeq ("alph", "beta", 4) != 0, 5);
> > +  check (__memcmpeq ("abce", "abcd", 3) == 0, 6); /* Count limited.  */
> > +  check (__memcmpeq ("abc", "def", 0) == 0, 8); /* Zero count.  */
> > +}
> > +
> >  static void
> >  test_strerror (void)
> >  {
> > @@ -1611,6 +1624,9 @@ main (void)
> >    /* bcmp - somewhat like memcmp.  */
> >    test_bcmp ();
> >
> > +  /* __memcmpeq - somewhat like memcmp.  */
> > +  test_memcmpeq ();
> > +
> >    /* strndup.  */
> >    test_strndup ();
> >
> > diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
> > index c1937f6f5c..37f37b9191 100644
> > --- a/sysdeps/aarch64/memcmp.S
> > +++ b/sysdeps/aarch64/memcmp.S
> > @@ -177,4 +177,6 @@ L(ret_0):
> >  END (memcmp)
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
> > index 1560387618..2a4ae577b0 100644
> > --- a/sysdeps/csky/abiv2/memcmp.S
> > +++ b/sysdeps/csky/abiv2/memcmp.S
> > @@ -138,5 +138,6 @@ ENTRY (memcmp)
> >       br      .L_s1_aligned
> >  END (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_def (memcmp)
> >  .weak memcmp
> > diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
> > index b26b124fad..90266d904b 100644
> > --- a/sysdeps/i386/i686/memcmp.S
> > +++ b/sysdeps/i386/i686/memcmp.S
> > @@ -405,4 +405,6 @@ L(table_32bytes) :
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> > index 5f6658b89a..a5b5c3d349 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> > +++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
> > @@ -30,6 +30,9 @@
> >
> >  # undef weak_alias
> >  # define weak_alias(original, alias)
> > +
> > +# undef strong_alias
> > +# define strong_alias(original, alias)
> >  #endif
> >
> >  #include <sysdeps/i386/i686/memcmp.S>
> > diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
> > index 6e058a8857..3b2815edbc 100644
> > --- a/sysdeps/i386/i686/multiarch/memcmp.c
> > +++ b/sysdeps/i386/i686/multiarch/memcmp.c
> > @@ -29,4 +29,5 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
> > index 1f212b0f6d..02473c2c0c 100644
> > --- a/sysdeps/i386/memcmp.S
> > +++ b/sysdeps/i386/memcmp.S
> > @@ -70,4 +70,6 @@ END (memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
> > index 97539c23fd..7722908751 100644
> > --- a/sysdeps/ia64/memcmp.S
> > +++ b/sysdeps/ia64/memcmp.S
> > @@ -160,4 +160,5 @@ ENTRY(memcmp)
> >  END(memcmp)
> >
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> > index c5da10a0cd..e849d6fa35 100644
> > --- a/sysdeps/mach/hurd/i386/libc.abilist
> > +++ b/sysdeps/mach/hurd/i386/libc.abilist
> > @@ -2285,6 +2285,7 @@ GLIBC_2.34 res_send F
> >  GLIBC_2.34 shm_open F
> >  GLIBC_2.34 shm_unlink F
> >  GLIBC_2.34 timespec_getres F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > index 6a6a54d90f..c2836040a7 100644
> > --- a/sysdeps/powerpc/powerpc32/405/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
> > @@ -126,3 +126,4 @@ L(st2):
> >  END (memcmp)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp,bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > index 814d2f211d..f58e34aba5 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> > index 8a929b2b44..b17d0e43b7 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
> > @@ -38,4 +38,7 @@
> >  #undef weak_alias
> >  #define weak_alias(a, b)
> >
> > +#undef strong_alias
> > +#define strong_alias(a, b)
> > +
> >  #include <sysdeps/powerpc/powerpc32/power7/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> > index 317523b743..893b6cac9c 100644
> > --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> > +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
> > @@ -40,6 +40,10 @@
> >  # undef weak_alias
> >  # define weak_alias(a, b)                                    \
> >    .weak b ; b = __memcmp_ppc
> > +
> > +# undef strong_alias
> > +# define strong_alias(a, b)                                  \
> > +  .globl b ; b = __memcmp_ppc
> >  #endif
> >
> >  #include <sysdeps/powerpc/powerpc32/power4/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > index 8a19953e2d..f8deb4e32c 100644
> > --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
> > @@ -1373,3 +1373,4 @@ END (memcmp)
> >
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > index 52f244e7e7..f81c73a29c 100644
> > --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
> > @@ -177,3 +177,4 @@ L(tail8):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> > index 73a0debd4a..22399f143d 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S
> > @@ -22,5 +22,7 @@
> >  #define libc_hidden_builtin_def(name)
> >  #undef weak_alias
> >  #define weak_alias(name,alias)
> > +#undef strong_alias
> > +#define strong_alias(name,alias)
> >
> >  #include <sysdeps/powerpc/powerpc64/le/power10/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> > index d2b6c2f934..fe68912a3b 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
> > @@ -22,5 +22,7 @@
> >  #define libc_hidden_builtin_def(name)
> >  #undef weak_alias
> >  #define weak_alias(name,alias)
> > +#undef strong_alias
> > +#define strong_alias(name,alias)
> >
> >  #include <sysdeps/powerpc/powerpc64/power4/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> > index 8671e930f0..5739471a7d 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
> > @@ -22,5 +22,7 @@
> >  #define libc_hidden_builtin_def(name)
> >  #undef weak_alias
> >  #define weak_alias(name,alias)
> > +#undef strong_alias
> > +#define strong_alias(name,alias)
> >
> >  #include <sysdeps/powerpc/powerpc64/power7/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> > index eb2273d468..e6a93e88c6 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
> > @@ -22,5 +22,7 @@
> >  #define libc_hidden_builtin_def(name)
> >  #undef weak_alias
> >  #define weak_alias(name,alias)
> > +#undef strong_alias
> > +#define strong_alias(name,alias)
> >
> >  #include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> > index 1f9f219971..2bc5fa50d7 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
> > @@ -22,6 +22,10 @@
> >  #define weak_alias(name, aliasname) \
> >    extern __typeof (__memcmp_ppc) aliasname \
> >      __attribute__ ((weak, alias ("__memcmp_ppc")));
> > +#undef strong_alias
> > +#define strong_alias(name, aliasname) \
> > +  extern __typeof (__memcmp_ppc) aliasname \
> > +    __attribute__ ((alias ("__memcmp_ppc")));
> >  #if IS_IN (libc) && defined(SHARED)
> >  # undef libc_hidden_builtin_def
> >  # define libc_hidden_builtin_def(name) \
> > diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > index dc1be3a0d8..cc82be115f 100644
> > --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
> > @@ -1374,3 +1374,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > index bc034a55bc..3044f7ede9 100644
> > --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
> > @@ -1059,3 +1059,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > index b676b09a9b..0c6a154502 100644
> > --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
> > @@ -1442,3 +1442,4 @@ L(duzeroLength):
> >  END (MEMCMP)
> >  libc_hidden_builtin_def (memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> > diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
> > index 995d52e47d..d625bf90dd 100644
> > --- a/sysdeps/s390/memcmp-z900.S
> > +++ b/sysdeps/s390/memcmp-z900.S
> > @@ -164,6 +164,7 @@ END(MEMCMP_Z196)
> >     Otherwise see sysdeps/s390/memcmp.c.  */
> >  strong_alias (MEMCMP_DEFAULT, memcmp)
> >  weak_alias (memcmp, bcmp)
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> >
> >  #if defined SHARED && IS_IN (libc)
> > diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
> > index 0b4e9da717..52c20af772 100644
> > --- a/sysdeps/s390/memcmp.c
> > +++ b/sysdeps/s390/memcmp.c
> > @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
> >                     })
> >                     )
> >  weak_alias (memcmp, bcmp);
> > +strong_alias (memcmp, __memcmpeq)
> >  #endif
> > diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
> > index d8d9ff9b24..fefeee5f5d 100644
> > --- a/sysdeps/sparc/sparc64/memcmp.S
> > +++ b/sysdeps/sparc/sparc64/memcmp.S
> > @@ -137,4 +137,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > index 21a2e50a88..f227ae6cee 100644
> > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> > @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > index a201fd69ba..0ccc3fc73e 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> > @@ -2709,6 +2709,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > index 2611436937..fd80704787 100644
> > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> > @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > index a426241965..2ae6c58b8a 100644
> > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> > @@ -491,6 +491,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > index 02f80418cc..fcfd1e8594 100644
> > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> > @@ -488,6 +488,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > index b7676eb372..ba034b8541 100644
> > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> > @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > index f6965c9d95..b7460bec8a 100644
> > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> > @@ -2596,6 +2596,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > index 2e7603d9ed..a4dc341ded 100644
> > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> > @@ -2780,6 +2780,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > index dd3a56d3fe..94b222dbc7 100644
> > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> > @@ -2547,6 +2547,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > index c1e0ea9c10..12fd3b6310 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> > @@ -492,6 +492,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _Exit F
> >  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> >  GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > index 93161048ca..4d2296007a 100644
> > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> > @@ -2723,6 +2723,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > index 0aaeec8a27..a223278a3d 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> > @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > index bec5f456c9..780a4f5b0b 100644
> > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> > @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > index 97d2127f78..cd65136062 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> > @@ -2688,6 +2688,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > index acb0756c11..b5b9902db5 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> > @@ -2686,6 +2686,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > index ebc21dde1e..57593d5f94 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> > @@ -2694,6 +2694,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > index c68f7e3c6c..e944d76bed 100644
> > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> > @@ -2598,6 +2598,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > index e5b6834f14..8af5a3a90d 100644
> > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> > @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > index 132707c8ad..3a0213b39f 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> > @@ -2750,6 +2750,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > index 0af2be31a0..f57df0234b 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> > @@ -2783,6 +2783,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > index cf864632d0..259a0cfc51 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> > @@ -2506,6 +2506,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > index d566d675d0..126541daf1 100644
> > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> > @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > index c9a7eacb32..05df4d13d2 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> > @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > index 8299131cb2..8e349cbff8 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> > @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > index c3fe78f77f..e9de402766 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> > @@ -2748,6 +2748,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > index 83e542aa8c..1a010c745d 100644
> > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> > @@ -2543,6 +2543,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > index dc502f6833..22ce530975 100644
> > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> > @@ -2603,6 +2603,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > index cba1abb556..960df07b83 100644
> > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> > @@ -2600,6 +2600,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > index d4a516fb47..eedb376f3d 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> > @@ -2743,6 +2743,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 _IO_fprintf F
> >  GLIBC_2.4 _IO_printf F
> >  GLIBC_2.4 _IO_sprintf F
> > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > index 6268875ba3..86e0c92bef 100644
> > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> > @@ -2570,6 +2570,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > index 095e914b73..5e59d90623 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> > @@ -2521,6 +2521,7 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> >  GLIBC_2.4 __confstr_chk F
> >  GLIBC_2.4 __fgets_chk F
> >  GLIBC_2.4 __fgets_unlocked_chk F
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > index dd910f7fe9..94412dc134 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> > @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F
> >  GLIBC_2.34 tss_delete F
> >  GLIBC_2.34 tss_get F
> >  GLIBC_2.34 tss_set F
> > +GLIBC_2.35 __memcmpeq F
> > diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
> > index 870e15c5a0..1b351ee092 100644
> > --- a/sysdeps/x86_64/memcmp.S
> > +++ b/sysdeps/x86_64/memcmp.S
> > @@ -358,4 +358,6 @@ END(memcmp)
> >
> >  #undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +#undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >  libc_hidden_builtin_def (memcmp)
> > diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> > index b135fa2d40..af737c5e6c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
> > +++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
> > @@ -26,6 +26,9 @@
> >
> >  # undef weak_alias
> >  # define weak_alias(ignored1, ignored2)
> > +
> > +# undef strong_alias
> > +# define strong_alias(ignored1, ignored2)
> >  #endif
> >
> >  #include <sysdeps/x86_64/memcmp.S>
> > diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
> > index fe725f3563..4a3aad2c9c 100644
> > --- a/sysdeps/x86_64/multiarch/memcmp.c
> > +++ b/sysdeps/x86_64/multiarch/memcmp.c
> > @@ -29,6 +29,8 @@
> >  libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
> >  # undef bcmp
> >  weak_alias (memcmp, bcmp)
> > +# undef __memcmpeq
> > +strong_alias (memcmp, __memcmpeq)
> >
> >  # ifdef SHARED
> >  __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
> > --
> > 2.25.1
> >
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
>
> Thanks.
>
> H.J.

Thanks! Pushed.

^ permalink raw reply	[flat|nested] 106+ messages in thread

end of thread, other threads:[~2021-10-26 22:29 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-09-27 20:43 ` Joseph Myers
2021-09-27 21:06   ` Noah Goldstein
2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
2021-09-27 21:52   ` Joseph Myers
2021-09-28  1:24     ` Noah Goldstein
2021-09-28  1:24 ` [PATCH v3] " Noah Goldstein
2021-09-28  8:15   ` Andreas Schwab
2021-09-28 16:47     ` Noah Goldstein
2021-09-28  8:40   ` Florian Weimer
2021-09-28 16:47     ` Noah Goldstein
2021-09-28 16:51       ` Florian Weimer
2021-09-28 16:46 ` [PATCH v4] " Noah Goldstein
2021-09-28 16:50 ` [PATCH v5] " Noah Goldstein
2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
2021-09-29  8:36   ` Florian Weimer
2021-09-29 15:17     ` Noah Goldstein
2021-09-29  8:52   ` Andreas Schwab
2021-09-29  9:18     ` Florian Weimer
2021-09-29  9:31       ` Andreas Schwab
2021-09-29  9:44         ` Florian Weimer
2021-09-28 16:57 ` [PATCH v1] " Noah Goldstein
2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
2021-09-30 19:31   ` Noah Goldstein
2021-10-11  2:33   ` Noah Goldstein
2021-10-18 14:47     ` Noah Goldstein
2021-10-21 19:28   ` H.J. Lu
2021-10-21 19:58     ` Noah Goldstein
2021-10-21 20:00       ` H.J. Lu
2021-10-21 21:04         ` Noah Goldstein
2021-10-21 20:02       ` Adhemerval Zanella
2021-10-21 20:23         ` Noah Goldstein
2021-10-21 20:26           ` Adhemerval Zanella
2021-10-21 19:33   ` Adhemerval Zanella
2021-10-21 20:01     ` Noah Goldstein
2021-10-21 20:06       ` Adhemerval Zanella
2021-10-21 21:18         ` Florian Weimer
2021-10-21 20:07       ` H.J. Lu
2021-10-21 20:11         ` Noah Goldstein
2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
2021-10-21 22:38   ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-21 22:52     ` H.J. Lu
2021-10-21 23:08       ` Joseph Myers
2021-10-21 23:10         ` H.J. Lu
2021-10-21 23:14           ` Joseph Myers
2021-10-21 23:39             ` Noah Goldstein
2021-10-21 23:45               ` Noah Goldstein
2021-10-22  0:19                 ` Joseph Myers
2021-10-22  0:40                   ` H.J. Lu
2021-10-25 16:41                     ` Joseph Myers
2021-10-22  0:18               ` Joseph Myers
2021-10-21 22:38   ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-21 22:57     ` H.J. Lu
2021-10-21 23:47       ` Noah Goldstein
2021-10-22  0:41         ` H.J. Lu
2021-10-22  1:01           ` Noah Goldstein
2021-10-21 22:50   ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-21 23:42     ` Noah Goldstein
2021-10-22  2:38       ` H.J. Lu
2021-10-22  4:04         ` Noah Goldstein
2021-10-22  5:49 ` [PATCH v9 " Noah Goldstein
2021-10-22 12:38   ` H.J. Lu
2021-10-22 16:07     ` Noah Goldstein
2021-10-22 17:19   ` Noah Goldstein
2021-10-22 17:40     ` Noah Goldstein
2021-10-22 17:44       ` H.J. Lu
2021-10-22 18:09         ` Noah Goldstein
2021-10-22 18:33           ` H.J. Lu
2021-10-22  5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 12:44   ` H.J. Lu
2021-10-22  5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 12:42   ` H.J. Lu
2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 16:06   ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 16:06   ` [PATCH v10 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 16:06   ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 16:12     ` H.J. Lu
2021-10-22 16:12   ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 16:18     ` Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 " Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 19:46   ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 19:46   ` [PATCH v12 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 19:46   ` [PATCH v12 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 20:28   ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 20:33     ` Noah Goldstein
2021-10-22 20:45       ` H.J. Lu
2021-10-22 21:24         ` Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
2021-10-22 21:23   ` [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 21:23   ` [PATCH v13 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 21:23   ` [PATCH v13 4/4] NEWS: Add item " Noah Goldstein
2021-10-23 23:23   ` [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
2021-10-23 23:24   ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-26 18:56     ` H.J. Lu
2021-10-23 23:24   ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-26 18:57     ` H.J. Lu
2021-10-23 23:24   ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
2021-10-26 18:58     ` H.J. Lu
2021-10-25  2:45   ` [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-26 18:55   ` H.J. Lu
2021-10-26 22:29     ` Noah Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).