diff mbox series

[v2,03/13] signal: Move sys_errlist to a compat symbol

Message ID 20200603183444.587742-3-adhemerval.zanella@linaro.org
State Superseded
Delegated to: Carlos O'Donell
Headers show
Series [v2,01/13] signal: Add signum-{generic,arch}.h | expand

Commit Message

Adhemerval Zanella June 3, 2020, 6:34 p.m. UTC
Changes from previous version:

  - Consolidated hurd implementation.

---

The symbol is deprecated by strerror and its usage imposes some issues
such as copy relocations.

Its internal names is changed to _sys_errlist_internal to avoid static
linking usage.  The compat code is also refactored by removing the over
enginered errlist-compat.c generation from manual entried and extra
comment token in linker script file.  It disantangle the code generation
from manual and simplify both Linux and Hurd compat code.

A new test is added to avoid a new errno addition without an associated
entry in manual.

The error list (errlist.h) is now generated from processing a new
errlist.def by scripts/gen-errlist.py.  The auto-generation is to
simplify the new test and avoid requiring either parsing a C file
to obtain the errno definitions or add a runtime check.

Checked on x86_64-linux-gnu and i686-linux-gnu. I also run a check-abi
on all affected platforms.
---
 NEWS                                          |    6 +
 include/stdio.h                               |    2 +-
 libio/Makefile                                |    2 +-
 libio/stdio.h                                 |    6 -
 scripts/build-many-glibcs.py                  |    3 +-
 scripts/gen-errlist.py                        |   53 +
 stdio-common/Makefile                         |   18 +
 stdio-common/errlist-compat.c                 |    1 +
 stdio-common/errlist.c                        |   29 +-
 stdio-common/errlist.def                      |   12 +
 stdio-common/tst-errno-manual.py              |   66 +
 string/_strerror.c                            |    6 +-
 string/strerror_l.c                           |    8 +-
 string/xpg-strerror.c                         |    9 +-
 sysdeps/gnu/Makefile                          |   43 -
 sysdeps/gnu/errlist-compat.awk                |  133 --
 sysdeps/gnu/errlist.awk                       |  110 --
 sysdeps/gnu/errlist.c                         | 1495 -----------------
 sysdeps/mach/hurd/err_hurd.sub                |    5 +-
 sysdeps/mach/hurd/errlist.c                   |   11 +-
 sysdeps/mach/hurd/errlist.def                 |  104 ++
 sysdeps/unix/sysv/linux/Versions              |   10 -
 sysdeps/unix/sysv/linux/alpha/Versions        |   12 -
 .../unix/sysv/linux/alpha/errlist-compat.c    |   43 +
 .../{bits/sys_errlist.h => errlist-compat.c}  |   29 +-
 sysdeps/unix/sysv/linux/errlist-compat.h      |   43 +
 sysdeps/unix/sysv/linux/errlist.def           |  133 ++
 sysdeps/unix/sysv/linux/hppa/Versions         |   10 -
 sysdeps/unix/sysv/linux/hppa/errlist-compat.c |   39 +
 sysdeps/unix/sysv/linux/mips/Versions         |    7 -
 .../unix/sysv/linux/mips/errlist-compat.c     |   14 +-
 sysdeps/unix/sysv/linux/sparc/Versions        |   10 -
 .../unix/sysv/linux/sparc/errlist-compat.c    |   43 +
 33 files changed, 617 insertions(+), 1898 deletions(-)
 create mode 100755 scripts/gen-errlist.py
 create mode 100644 stdio-common/errlist-compat.c
 create mode 100644 stdio-common/errlist.def
 create mode 100755 stdio-common/tst-errno-manual.py
 delete mode 100644 sysdeps/gnu/errlist-compat.awk
 delete mode 100644 sysdeps/gnu/errlist.awk
 delete mode 100644 sysdeps/gnu/errlist.c
 create mode 100644 sysdeps/mach/hurd/errlist.def
 create mode 100644 sysdeps/unix/sysv/linux/alpha/errlist-compat.c
 rename sysdeps/unix/sysv/linux/{bits/sys_errlist.h => errlist-compat.c} (56%)
 create mode 100644 sysdeps/unix/sysv/linux/errlist-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/errlist.def
 create mode 100644 sysdeps/unix/sysv/linux/hppa/errlist-compat.c
 rename bits/sys_errlist.h => sysdeps/unix/sysv/linux/mips/errlist-compat.c (69%)
 create mode 100644 sysdeps/unix/sysv/linux/sparc/errlist-compat.c
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index 0f5fa0f3b1..df03a34657 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,12 @@  Deprecated and removed features, and other changes affecting compatibility:
   compatibility symbols to support old binaries.  All programs should use
   strsignal instead.
 
+* The deprecated symbols sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr
+  are no longer available to newly linked binaries, and their declarations
+  have been removed from from <stdio.h>.  They are exported solely as
+  compatibility symbols to support old binaries.  All programs should use
+  strerror or strerror_r instead.
+
 Changes to build and runtime requirements:
 
 * powerpc64le requires GCC 7.4 or newer.  This is required for supporting
diff --git a/include/stdio.h b/include/stdio.h
index 9df98b2833..9e3bf6fe42 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -186,7 +186,7 @@  ssize_t __libc_readline_unlocked (FILE *fp, char *buffer, size_t length);
 libc_hidden_proto (__libc_readline_unlocked);
 
 extern const char *const _sys_errlist_internal[] attribute_hidden;
-extern int _sys_nerr_internal attribute_hidden;
+extern const char *__get_errlist (int) attribute_hidden;
 
 libc_hidden_ldbl_proto (__asprintf)
 
diff --git a/libio/Makefile b/libio/Makefile
index 59e1f68e9c..926df1870b 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -23,7 +23,7 @@  subdir	:= libio
 include ../Makeconfig
 
 headers	:= stdio.h \
-	   bits/stdio.h bits/stdio2.h bits/sys_errlist.h bits/stdio-ldbl.h \
+	   bits/stdio.h bits/stdio2.h bits/stdio-ldbl.h \
 	   bits/types/FILE.h bits/types/__FILE.h bits/types/struct_FILE.h \
 	   bits/types/__fpos_t.h bits/types/__fpos64_t.h \
 	   bits/types/cookie_io_functions_t.h
diff --git a/libio/stdio.h b/libio/stdio.h
index 07f2d9afb5..998470943e 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -779,12 +779,6 @@  extern int ferror_unlocked (FILE *__stream) __THROW __wur;
    marked with __THROW.  */
 extern void perror (const char *__s);
 
-/* Provide the declarations for `sys_errlist' and `sys_nerr' if they
-   are available on this system.  Even if available, these variables
-   should not be used directly.  The `strerror' function provides
-   all the necessary functionality.  */
-#include <bits/sys_errlist.h>
-
 
 #ifdef	__USE_POSIX
 /* Return the system file descriptor for STREAM.  */
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 6c6615b200..8cb110220c 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -892,8 +892,7 @@  class Context(object):
         # Some other files have such dependencies but do not need to
         # be touched because nothing in a build depends on the files
         # in question.
-        for f in ('sysdeps/gnu/errlist.c',
-                  'sysdeps/mach/hurd/bits/errno.h'):
+        for f in ('sysdeps/mach/hurd/bits/errno.h',):
             to_touch = os.path.join(srcdir, f)
             subprocess.run(['touch', '-c', to_touch], check=True)
         for dirpath, dirnames, filenames in os.walk(srcdir):
diff --git a/scripts/gen-errlist.py b/scripts/gen-errlist.py
new file mode 100755
index 0000000000..6531d0f3df
--- /dev/null
+++ b/scripts/gen-errlist.py
@@ -0,0 +1,53 @@ 
+#!/usr/bin/python3
+# Generate the errlist.h for errlist.c.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+#
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <https://www.gnu.org/licenses/>.
+
+import sys
+import argparse
+
+# The input file should be in the form
+#
+#   VALUE, DESCRIPTION
+#
+# An entry for each will be created in the output file in the form:
+#
+#   [VALUE] = "DESCRIPTION",
+
+def generate_errlist(input_file, output_file):
+    with open(input_file, 'r') as fin, open(output_file, 'w') as fout:
+        fout.write("#ifndef ERR_MAP\n")
+        fout.write("#define ERR_MAP(value) value\n")
+        fout.write("#endif\n")
+        for line in fin:
+            if line.lstrip().startswith('#'):
+                continue
+            fields = [f.strip() for f in line.rstrip('\n').split(',')]
+            fout.write("[ERR_MAP(%s)] = N_(\"%s\"),\n" % (fields[0],
+                                                          fields[1]))
+
+def main():
+    parser = argparse.ArgumentParser(description='Generate errlist.h')
+    parser.add_argument('-i', dest='input', metavar='FILE',
+                        help='Error definitions')
+    parser.add_argument('-o', dest='output', metavar='FILE',
+                        help='Include file')
+    args = parser.parse_args()
+    generate_errlist(args.input, args.output)
+
+if __name__ == '__main__':
+    main()
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 0a8d66b846..48f3ba7c3a 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -84,8 +84,19 @@  generated += tst-printf-bz18872.c tst-printf-bz18872.mtrace \
 	     tst-printf-bz25691.mtrace tst-printf-bz25691-mem.out
 endif
 
+tests-special += $(objpfx)tst-errno-manual.out
+
 include ../Rules
 
+errlist-def = $(firstword $(wildcard $(addsuffix /errlist.def,$(sysdirs) .)))
+
+$(objpfx)errlist.h: $(errlist-def) \
+		    $(..)scripts/gen-errlist.py
+	$(PYTHON) $(..)scripts/gen-errlist.py -i $(errlist-def) -o $@
+
+$(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
+          $(objpfx)errlist$o): $(objpfx)errlist.h
+
 ifeq ($(run-built-tests),yes)
 LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ISO-8859-1 ja_JP.EUC-JP
 include ../gen-locales.mk
@@ -128,6 +139,13 @@  $(objpfx)tst-%-mem.out: $(objpfx)tst-%.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-$*.mtrace > $@; \
 	$(evaluate-test)
 
+$(objpfx)tst-errno-manual.out: tst-errno-manual.py \
+			       $(errlist-def) \
+			       $(..)manual/errno.texi
+	$(PYTHON) tst-errno-manual.py -m $(..)manual/errno.texi \
+				      -e $(errlist-def) > $@; \
+	$(evaluate-test)
+
 CFLAGS-vfprintf.c += -Wno-uninitialized
 CFLAGS-vfwprintf.c += -Wno-uninitialized
 
diff --git a/stdio-common/errlist-compat.c b/stdio-common/errlist-compat.c
new file mode 100644
index 0000000000..6e25b021ab
--- /dev/null
+++ b/stdio-common/errlist-compat.c
@@ -0,0 +1 @@ 
+/* Empty.  */
diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c
index 91fa789be0..dc9bb93eda 100644
--- a/stdio-common/errlist.c
+++ b/stdio-common/errlist.c
@@ -15,22 +15,23 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <stdio.h>
+#include <errno.h>
+#include <libintl.h>
 #include <array_length.h>
-#include <stddef.h>
 
-const char *const _sys_errlist[] =
+const char *const  _sys_errlist_internal[] =
   {
-    "Error 0",			/* 0 */
-    "Argument out of function's domain", /* 1 = EDOM */
-    "Result out of range",	/* 2 = ERANGE */
-    "Operation not implemented", /* 3 = ENOSYS */
-    "Invalid argument",		/* 4 = EINVAL */
-    "Illegal seek",		/* 5 = ESPIPE */
-    "Bad file descriptor",	/* 6 = EBADF */
-    "Cannot allocate memory",	/* 7 = ENOMEM */
-    "Permission denied",	/* 8 = EACCES */
-    "Too many open files in system", /* 9 = ENFILE */
-    "Too many open files",	/* 10 = EMFILE */
+/* This file is auto-generated from errlist.def.  */
+#include <errlist.h>
   };
 
-const int _sys_nerr = array_length (_sys_errlist);
+const char *
+__get_errlist (int errnum)
+{
+  if (errnum >= 0 && errnum < array_length (_sys_errlist_internal))
+    return _sys_errlist_internal[errnum];
+  return NULL;
+}
+
+#include <errlist-compat.c>
diff --git a/stdio-common/errlist.def b/stdio-common/errlist.def
new file mode 100644
index 0000000000..165e206981
--- /dev/null
+++ b/stdio-common/errlist.def
@@ -0,0 +1,12 @@ 
+# Used by scripts/gen-errlist.py to generate errlist.h.
+0,      Error
+EDOM,   Argument out of function's domain
+ERANGE, Result out of range
+ENOSYS, Operation not implemented
+EINVAL, Invalid argument
+ESPIPE, Illegal seek
+EBADF,  Bad file descriptor
+ENOMEM, Cannot allocate memory
+EACCES, Permission denied
+ENFILE, Too many open files in system
+EMFILE, Too many open files
diff --git a/stdio-common/tst-errno-manual.py b/stdio-common/tst-errno-manual.py
new file mode 100755
index 0000000000..b95cd235fd
--- /dev/null
+++ b/stdio-common/tst-errno-manual.py
@@ -0,0 +1,66 @@ 
+#!/usr/bin/python3
+# Check is errno definition are present in manual documentation.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+#
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <https://www.gnu.org/licenses/>.
+
+import argparse
+import sys
+import re
+
+RE_ERRLIST = re.compile(
+    r'(E[a-zA-Z0-9]+)')
+
+RE_MANUAL = re.compile(
+    r'(?:^@errno){(\w+)')
+
+PASS=0
+FAIL=1
+
+def parse_file(r, f, idx):
+    ret = []
+    for line in f:
+        m = r.search(line)
+        if not m:
+            continue
+        ret.append(m.group(idx))
+    return ret
+
+def check_errno_definitions(manual_fname, errlist_fname):
+    with open(manual_fname, 'r') as mfile, open(errlist_fname, 'r') as efile:
+        merr = parse_file(RE_MANUAL,  mfile, 1)
+        eerr = parse_file(RE_ERRLIST, efile, 0)
+        diff = set(eerr).difference(merr)
+        if not diff:
+            sys.exit(PASS)
+        else:
+            print("Failure: the following value(s) are not in manual:",
+                  ", ".join(str(e) for e in diff))
+            sys.exit(FAIL)
+
+def main():
+    parser = argparse.ArgumentParser(description='Generate errlist.h')
+    parser.add_argument('-m', dest='manual', metavar='FILE',
+                        help='manual errno texi file')
+    parser.add_argument('-e', dest='errlist', metavar='FILE',
+                        help='errlist with errno definitions')
+    args = parser.parse_args()
+
+    check_errno_definitions(args.manual, args.errlist)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/string/_strerror.c b/string/_strerror.c
index af6be56fdc..01226e3d4b 100644
--- a/string/_strerror.c
+++ b/string/_strerror.c
@@ -36,8 +36,8 @@ 
 char *
 __strerror_r (int errnum, char *buf, size_t buflen)
 {
-  if (__builtin_expect (errnum < 0 || errnum >= _sys_nerr_internal
-			|| _sys_errlist_internal[errnum] == NULL, 0))
+  char *err = (char *) __get_errlist (errnum);
+  if (__glibc_unlikely (err == NULL))
     {
       /* Buffer we use to print the number in.  For a maximum size for
 	 `int' of 8 bytes we never need more than 20 digits.  */
@@ -68,7 +68,7 @@  __strerror_r (int errnum, char *buf, size_t buflen)
       return buf;
     }
 
-  return (char *) _(_sys_errlist_internal[errnum]);
+  return _(err);
 }
 weak_alias (__strerror_r, strerror_r)
 libc_hidden_def (__strerror_r)
diff --git a/string/strerror_l.c b/string/strerror_l.c
index c8c3d4a6ef..309f42e66b 100644
--- a/string/strerror_l.c
+++ b/string/strerror_l.c
@@ -40,10 +40,8 @@  translate (const char *str, locale_t loc)
 char *
 strerror_l (int errnum, locale_t loc)
 {
-
-
-  if (__builtin_expect (errnum < 0 || errnum >= _sys_nerr_internal
-			|| _sys_errlist_internal[errnum] == NULL, 0))
+  char *err = (char *) __get_errlist (errnum);
+  if (__glibc_unlikely (err == NULL))
     {
       free (last_value);
       if (__asprintf (&last_value, "%s%d",
@@ -53,7 +51,7 @@  strerror_l (int errnum, locale_t loc)
       return last_value;
     }
 
-  return (char *) translate (_sys_errlist_internal[errnum], loc);
+  return (char *) translate (err, loc);
 }
 
 void
diff --git a/string/xpg-strerror.c b/string/xpg-strerror.c
index 5290b63f18..95311b75e9 100644
--- a/string/xpg-strerror.c
+++ b/string/xpg-strerror.c
@@ -32,16 +32,9 @@  __xpg_strerror_r (int errnum, char *buf, size_t buflen)
      string) if errnum is invalid, otherwise it returns a string whose
      storage has indefinite extent.  */
   if (estr == buf)
-    {
-      assert (errnum < 0 || errnum >= _sys_nerr_internal
-	      || _sys_errlist_internal[errnum] == NULL);
-      return EINVAL;
-    }
+    return EINVAL;
   else
     {
-      assert (errnum >= 0 && errnum < _sys_nerr_internal
-	      && _sys_errlist_internal[errnum] != NULL);
-
       size_t estrlen = strlen (estr);
 
       /* Terminate the string in any case.  */
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index 97fcb6fb90..9cf34c8ac6 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -15,49 +15,6 @@ 
 # License along with the GNU C Library; if not, see
 # <https://www.gnu.org/licenses/>.
 
-# Generate the list of strings for errno codes from the section of the
-# manual which documents the codes.
-
-$(..)sysdeps/gnu/errlist.c: $(..)sysdeps/gnu/errlist.awk \
-			    $(..)manual/errno.texi
-	$(AWK) -f $^ > $@-tmp
-# Make it unwritable so noone will edit it by mistake.
-	-chmod a-w $@-tmp
-	mv -f $@-tmp $@
-
-ifeq ($(subdir),stdio-common)
-
-errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
-
-libof-errlist-compat = extramodules
-
-ifeq ($(build-shared),yes)
-$(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
-			   $(common-objpfx)Versions.v.i $(before-compile)
-else
-$(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
-			   $(before-compile)
-endif
-	$(make-target-directory)
-	$(AWK) -v maxerr=`\
-	  $(CC) -S $(CPPFLAGS) $(CFLAGS) -DEMIT_ERR_MAX $< -o - \
-	  | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \
-	       -f $(..)sysdeps/gnu/errlist-compat.awk \
-	       $(wildcard $(sysdirs:=/Versions)) > $@T
-# Make it unwritable so noone will edit it by mistake.
-	-chmod a-w $@T
-	mv -f $@T $@
-$(objpfx)errlist-compat.h: $(objpfx)errlist-compat.c
-	sed -n '1p;/ERR_MAX/p' $< > $@T
-	-chmod a-w $@T
-	mv -f $@T $@
-generated += errlist-compat.c errlist-compat.h
-
-# This will force the generation above to happy if need be.
-$(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
-	  $(objpfx)errlist$o): $(objpfx)errlist-compat.h
-endif
-
 ifeq ($(subdir),login)
 sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
 		   pututxline utmpxname updwtmpx getutmpx getutmp
diff --git a/sysdeps/gnu/errlist-compat.awk b/sysdeps/gnu/errlist-compat.awk
deleted file mode 100644
index 07334c63d8..0000000000
--- a/sysdeps/gnu/errlist-compat.awk
+++ /dev/null
@@ -1,133 +0,0 @@ 
-# awk script to generate errlist-compat.c
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-#
-# This script takes the Versions file as input and looks for #errlist-compat
-# magic comments, which have the form:
-#	#errlist-compat NNN
-# where NNN is the number of elements in the sys_errlist for that version set.
-# We need the awk variable `maxerr' defined to the current size of sys_errlist.
-#
-# If there is no magic comment matching the current size, we barf.
-# Otherwise we generate code (errlist-compat.c) to define all the
-# necessary compatibility symbols for older, smaller versions of sys_errlist.
-#
-
-# These two rules catch the Versions file contents.
-NF == 2 && $2 == "{" { last_version = $1; next }
-$1 == "#errlist-compat" {
-  # Don't process any further Versions files
-  ARGC = ARGIND + 1;
-  cnt = $2 + 0;
-  if (cnt < 80) {
-    print "*** this line seems bogus:", $0 > "/dev/stderr";
-    exit 1;
-  }
-  version[pos + 0] = cnt SUBSEP last_version;
-  pos++;
-  if (cnt < highest) {
-    printf "*** %s #errlist-compat counts are not sorted\n", ARGV[ARGIND];
-    exit 1;
-  }
-  if (cnt > highest)
-    highest = cnt;
-  highest_version = last_version;
-  next;
-}
-
-END {
-  if (! highest_version) {
-    print "/* No sys_errlist/sys_nerr symbols defined on this platform.  */";
-    exit 0;
-  }
-
-  count = maxerr + 1;
-
-  if (highest < count) {
-    printf "*** errlist.c count %d vs Versions sys_errlist@%s count %d\n", \
-      count, highest_version, highest > "/dev/stderr";
-    exit 1;
-  }
-
-  lastv = "";
-  for (n = 0; n < pos; ++n) {
-    split(version[n], t, SUBSEP)
-    v = t[2];
-    gsub(/[^A-Z0-9_]/, "_", v);
-    if (lastv != "")
-      compat[lastv] = v;
-    lastv = v;
-    vcount[v] = t[1];
-  }
-
-  print "/* This file was generated by errlist-compat.awk; DO NOT EDIT!  */\n";
-  print "#include <shlib-compat.h>\n";
-
-  if (highest > count) {
-    printf "*** errlist.c count %d inflated to %s count %d (old errno.h?)\n", \
-      count, highest_version, highest > "/dev/stderr";
-    printf "#define ERR_MAX %d\n\n", highest - 1;
-  }
-
-  # same regardless of awk's ordering of the associative array.
-  num_compat_elems = asorti(compat, compat_indices)
-  for (i = 1; i <= num_compat_elems; i++) {
-    old = compat_indices[i]
-    new = compat[old];
-    n = vcount[old];
-    printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;
-    printf "# include <bits/wordsize.h>\n";
-    printf "extern const char *const __sys_errlist_%s[NERR];\n", old;
-    printf "const int __sys_nerr_%s = %d;\n", old, n;
-    printf "declare_symbol_alias (__sys_errlist_%s, _sys_errlist_internal,", \
-      old;
-    printf " object, __WORDSIZE/8*%d)\n", n;
-    printf "compat_symbol (libc, __sys_errlist_%s, sys_errlist, %s);\n", \
-      old, old;
-    printf "compat_symbol (libc, __sys_nerr_%s, sys_nerr, %s);\n", old, old;
-
-    printf "extern const char *const ___sys_errlist_%s[NERR];\n", old;
-    printf "extern const int __sys_nerr_%s;\n", old;
-    printf "declare_symbol_alias (___sys_errlist_%s, _sys_errlist_internal,", \
-      old;
-    printf " object, __WORDSIZE/8*%d)\n", n;
-    printf "strong_alias (__sys_nerr_%s, ___sys_nerr_%s)\n", old, old;
-    printf "compat_symbol (libc, ___sys_errlist_%s, _sys_errlist, %s);\n", \
-      old, old;
-    printf "compat_symbol (libc, ___sys_nerr_%s, _sys_nerr, %s);\n", old, old;
-    printf "#endif\n\n";
-  }
-
-  printf "\
-extern const char *const __sys_errlist_internal[NERR];\n\
-extern const int __sys_nerr_internal;\n\
-strong_alias (_sys_errlist_internal, __sys_errlist_internal)\n\
-strong_alias (_sys_nerr_internal, __sys_nerr_internal)\n\
-extern const char *const sys_errlist[NERR];\n\
-versioned_symbol (libc, _sys_errlist_internal, sys_errlist, %s);\n\
-versioned_symbol (libc, __sys_errlist_internal, _sys_errlist, %s);\n\
-versioned_symbol (libc, _sys_nerr_internal, sys_nerr, %s);\n\
-versioned_symbol (libc, __sys_nerr_internal, _sys_nerr, %s);\n", \
-    lastv, lastv, lastv, lastv;
-
-  print "\n\
-link_warning (sys_errlist, \"\
-`sys_errlist' is deprecated; use `strerror' or `strerror_r' instead\")\n\
-link_warning (sys_nerr, \"\
-`sys_nerr' is deprecated; use `strerror' or `strerror_r' instead\")";
-}
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
deleted file mode 100644
index 09f80f5b44..0000000000
--- a/sysdeps/gnu/errlist.awk
+++ /dev/null
@@ -1,110 +0,0 @@ 
-# Copyright (C) 1991-2020 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-# errno.texi contains lines like:
-# @deftypevr Macro int ENOSYS
-# @errno{ENOSYS, 78, Function not implemented}
-# Descriptive paragraph...
-# @end deftypevr
-
-BEGIN {
-
-    # Here we list the E* names that might be duplicate names for the
-    # same integer value on some systems.  This causes the code below
-    # to generate ``#if defined (ALIAS) && ALIAS != ORIGINAL'' in the code,
-    # so the output does not presume that these are in fact aliases.
-    # We list here all the known potential cases on any system,
-    # so that the C source we produce will do the right thing based
-    # on the actual #define'd values it's compiled with.
-    alias["EWOULDBLOCK"]= "EAGAIN";
-    alias["EDEADLOCK"]	= "EDEADLK";
-    alias["ENOTSUP"]	= "EOPNOTSUPP";
-
-    print "/* This file is generated from errno.texi by errlist.awk.  */"
-    print "";
-    print "#include <errno.h>";
-    print "#include <libintl.h>";
-    print "";
-    print "#ifndef ERR_REMAP";
-    print "# define ERR_REMAP(n) n";
-    print "#endif";
-    print "";
-
-    print "#if !defined EMIT_ERR_MAX && !defined ERRLIST_NO_COMPAT";
-    print "# include <errlist-compat.h>";
-    print "#endif";
-    print "#ifdef ERR_MAX";
-    print "# define ERRLIST_SIZE ERR_MAX + 1";
-    print "#else"
-    print "# define ERR_MAX 0";
-    print "# define ERRLIST_SIZE";
-    print "#endif";
-
-    print "const char *const _sys_errlist_internal[ERRLIST_SIZE] =";
-    print "  {";
-    print "    [0] = N_(\"Success\"),"
-  }
-
-/^@errno\{/ \
-  {
-    etext = $3;
-    for (i = 4; i <= NF; ++i)
-      etext = etext " " $i;
-    etext = substr(etext, 1, length(etext)-1)
-    e = substr($1, 8, length($1)-8)
-    errno = substr($2, 1, length($2)-1) + 0
-    if (alias[e])
-      printf "#if defined (%s) && %s != %s\n", e, e, alias[e];
-    else
-      printf "#ifdef %s\n", e;
-    errnoh = 4;
-    desc="";
-    next;
-  }
-errnoh == 4 && $1 == "@end" && $2 == "deftypevr" \
-  {
-    printf "/*%s */\n", desc;
-    printf "    [ERR_REMAP (%s)] = N_(\"%s\"),\n", e, etext;
-    printf "# if %s > ERR_MAX\n", e;
-    print  "# undef ERR_MAX";
-    printf "# define ERR_MAX %s\n", e;
-    print  "# endif";
-    print "#endif";
-    errnoh = 0;
-    next;
-  }
-errnoh == 4 \
-  {
-    # This magic tag in C comments gets them copied into libc.pot.
-    desc = desc "\nTRANS" ($0 != "" ? " " : "") $0; next
-  }
-END {
-  print "  };";
-  print "";
-  print "#define NERR \\";
-  print "  (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0])";
-  print "const int _sys_nerr_internal = NERR;"
-  print "";
-  print "#if IS_IN (libc) && !defined ERRLIST_NO_COMPAT";
-  print "# include <errlist-compat.c>";
-  print "#endif";
-  print "";
-  print "#ifdef EMIT_ERR_MAX";
-  print "void dummy (void)"
-  print "{ asm volatile (\" @@@ %0 @@@ \" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
-  print "#endif";
-}
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
deleted file mode 100644
index 77577bf3e1..0000000000
--- a/sysdeps/gnu/errlist.c
+++ /dev/null
@@ -1,1495 +0,0 @@ 
-/* This file is generated from errno.texi by errlist.awk.  */
-
-#include <errno.h>
-#include <libintl.h>
-
-#ifndef ERR_REMAP
-# define ERR_REMAP(n) n
-#endif
-
-#if !defined EMIT_ERR_MAX && !defined ERRLIST_NO_COMPAT
-# include <errlist-compat.h>
-#endif
-#ifdef ERR_MAX
-# define ERRLIST_SIZE ERR_MAX + 1
-#else
-# define ERR_MAX 0
-# define ERRLIST_SIZE
-#endif
-const char *const _sys_errlist_internal[ERRLIST_SIZE] =
-  {
-    [0] = N_("Success"),
-#ifdef EPERM
-/*
-TRANS Only the owner of the file (or other resource)
-TRANS or processes with special privileges can perform the operation. */
-    [ERR_REMAP (EPERM)] = N_("Operation not permitted"),
-# if EPERM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPERM
-# endif
-#endif
-#ifdef ENOENT
-/*
-TRANS This is a ``file doesn't exist'' error
-TRANS for ordinary files that are referenced in contexts where they are
-TRANS expected to already exist. */
-    [ERR_REMAP (ENOENT)] = N_("No such file or directory"),
-# if ENOENT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOENT
-# endif
-#endif
-#ifdef ESRCH
-/*
-TRANS No process matches the specified process ID. */
-    [ERR_REMAP (ESRCH)] = N_("No such process"),
-# if ESRCH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESRCH
-# endif
-#endif
-#ifdef EINTR
-/*
-TRANS An asynchronous signal occurred and prevented
-TRANS completion of the call.  When this happens, you should try the call
-TRANS again.
-TRANS
-TRANS You can choose to have functions resume after a signal that is handled,
-TRANS rather than failing with @code{EINTR}; see @ref{Interrupted
-TRANS Primitives}. */
-    [ERR_REMAP (EINTR)] = N_("Interrupted system call"),
-# if EINTR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EINTR
-# endif
-#endif
-#ifdef EIO
-/*
-TRANS Usually used for physical read or write errors. */
-    [ERR_REMAP (EIO)] = N_("Input/output error"),
-# if EIO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EIO
-# endif
-#endif
-#ifdef ENXIO
-/*
-TRANS The system tried to use the device
-TRANS represented by a file you specified, and it couldn't find the device.
-TRANS This can mean that the device file was installed incorrectly, or that
-TRANS the physical device is missing or not correctly attached to the
-TRANS computer. */
-    [ERR_REMAP (ENXIO)] = N_("No such device or address"),
-# if ENXIO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENXIO
-# endif
-#endif
-#ifdef E2BIG
-/*
-TRANS Used when the arguments passed to a new program
-TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
-TRANS File}) occupy too much memory space.  This condition never arises on
-TRANS @gnuhurdsystems{}. */
-    [ERR_REMAP (E2BIG)] = N_("Argument list too long"),
-# if E2BIG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX E2BIG
-# endif
-#endif
-#ifdef ENOEXEC
-/*
-TRANS Invalid executable file format.  This condition is detected by the
-TRANS @code{exec} functions; see @ref{Executing a File}. */
-    [ERR_REMAP (ENOEXEC)] = N_("Exec format error"),
-# if ENOEXEC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOEXEC
-# endif
-#endif
-#ifdef EBADF
-/*
-TRANS For example, I/O on a descriptor that has been
-TRANS closed or reading from a descriptor open only for writing (or vice
-TRANS versa). */
-    [ERR_REMAP (EBADF)] = N_("Bad file descriptor"),
-# if EBADF > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADF
-# endif
-#endif
-#ifdef ECHILD
-/*
-TRANS This error happens on operations that are
-TRANS supposed to manipulate child processes, when there aren't any processes
-TRANS to manipulate. */
-    [ERR_REMAP (ECHILD)] = N_("No child processes"),
-# if ECHILD > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECHILD
-# endif
-#endif
-#ifdef EDEADLK
-/*
-TRANS Allocating a system resource would have resulted in a
-TRANS deadlock situation.  The system does not guarantee that it will notice
-TRANS all such situations.  This error means you got lucky and the system
-TRANS noticed; it might just hang.  @xref{File Locks}, for an example. */
-    [ERR_REMAP (EDEADLK)] = N_("Resource deadlock avoided"),
-# if EDEADLK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDEADLK
-# endif
-#endif
-#ifdef ENOMEM
-/*
-TRANS The system cannot allocate more virtual memory
-TRANS because its capacity is full. */
-    [ERR_REMAP (ENOMEM)] = N_("Cannot allocate memory"),
-# if ENOMEM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOMEM
-# endif
-#endif
-#ifdef EACCES
-/*
-TRANS The file permissions do not allow the attempted operation. */
-    [ERR_REMAP (EACCES)] = N_("Permission denied"),
-# if EACCES > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EACCES
-# endif
-#endif
-#ifdef EFAULT
-/*
-TRANS An invalid pointer was detected.
-TRANS On @gnuhurdsystems{}, this error never happens; you get a signal instead. */
-    [ERR_REMAP (EFAULT)] = N_("Bad address"),
-# if EFAULT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EFAULT
-# endif
-#endif
-#ifdef ENOTBLK
-/*
-TRANS A file that isn't a block special file was given in a situation that
-TRANS requires one.  For example, trying to mount an ordinary file as a file
-TRANS system in Unix gives this error. */
-    [ERR_REMAP (ENOTBLK)] = N_("Block device required"),
-# if ENOTBLK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTBLK
-# endif
-#endif
-#ifdef EBUSY
-/*
-TRANS A system resource that can't be shared is already in use.
-TRANS For example, if you try to delete a file that is the root of a currently
-TRANS mounted filesystem, you get this error. */
-    [ERR_REMAP (EBUSY)] = N_("Device or resource busy"),
-# if EBUSY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBUSY
-# endif
-#endif
-#ifdef EEXIST
-/*
-TRANS An existing file was specified in a context where it only
-TRANS makes sense to specify a new file. */
-    [ERR_REMAP (EEXIST)] = N_("File exists"),
-# if EEXIST > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EEXIST
-# endif
-#endif
-#ifdef EXDEV
-/*
-TRANS An attempt to make an improper link across file systems was detected.
-TRANS This happens not only when you use @code{link} (@pxref{Hard Links}) but
-TRANS also when you rename a file with @code{rename} (@pxref{Renaming Files}). */
-    [ERR_REMAP (EXDEV)] = N_("Invalid cross-device link"),
-# if EXDEV > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EXDEV
-# endif
-#endif
-#ifdef ENODEV
-/*
-TRANS The wrong type of device was given to a function that expects a
-TRANS particular sort of device. */
-    [ERR_REMAP (ENODEV)] = N_("No such device"),
-# if ENODEV > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENODEV
-# endif
-#endif
-#ifdef ENOTDIR
-/*
-TRANS A file that isn't a directory was specified when a directory is required. */
-    [ERR_REMAP (ENOTDIR)] = N_("Not a directory"),
-# if ENOTDIR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTDIR
-# endif
-#endif
-#ifdef EISDIR
-/*
-TRANS You cannot open a directory for writing,
-TRANS or create or remove hard links to it. */
-    [ERR_REMAP (EISDIR)] = N_("Is a directory"),
-# if EISDIR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EISDIR
-# endif
-#endif
-#ifdef EINVAL
-/*
-TRANS This is used to indicate various kinds of problems
-TRANS with passing the wrong argument to a library function. */
-    [ERR_REMAP (EINVAL)] = N_("Invalid argument"),
-# if EINVAL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EINVAL
-# endif
-#endif
-#ifdef EMFILE
-/*
-TRANS The current process has too many files open and can't open any more.
-TRANS Duplicate descriptors do count toward this limit.
-TRANS
-TRANS In BSD and GNU, the number of open files is controlled by a resource
-TRANS limit that can usually be increased.  If you get this error, you might
-TRANS want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
-TRANS @pxref{Limits on Resources}. */
-    [ERR_REMAP (EMFILE)] = N_("Too many open files"),
-# if EMFILE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EMFILE
-# endif
-#endif
-#ifdef ENFILE
-/*
-TRANS There are too many distinct file openings in the entire system.  Note
-TRANS that any number of linked channels count as just one file opening; see
-TRANS @ref{Linked Channels}.  This error never occurs on @gnuhurdsystems{}. */
-    [ERR_REMAP (ENFILE)] = N_("Too many open files in system"),
-# if ENFILE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENFILE
-# endif
-#endif
-#ifdef ENOTTY
-/*
-TRANS Inappropriate I/O control operation, such as trying to set terminal
-TRANS modes on an ordinary file. */
-    [ERR_REMAP (ENOTTY)] = N_("Inappropriate ioctl for device"),
-# if ENOTTY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTTY
-# endif
-#endif
-#ifdef ETXTBSY
-/*
-TRANS An attempt to execute a file that is currently open for writing, or
-TRANS write to a file that is currently being executed.  Often using a
-TRANS debugger to run a program is considered having it open for writing and
-TRANS will cause this error.  (The name stands for ``text file busy''.)  This
-TRANS is not an error on @gnuhurdsystems{}; the text is copied as necessary. */
-    [ERR_REMAP (ETXTBSY)] = N_("Text file busy"),
-# if ETXTBSY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ETXTBSY
-# endif
-#endif
-#ifdef EFBIG
-/*
-TRANS The size of a file would be larger than allowed by the system. */
-    [ERR_REMAP (EFBIG)] = N_("File too large"),
-# if EFBIG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EFBIG
-# endif
-#endif
-#ifdef ENOSPC
-/*
-TRANS Write operation on a file failed because the
-TRANS disk is full. */
-    [ERR_REMAP (ENOSPC)] = N_("No space left on device"),
-# if ENOSPC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOSPC
-# endif
-#endif
-#ifdef ESPIPE
-/*
-TRANS Invalid seek operation (such as on a pipe). */
-    [ERR_REMAP (ESPIPE)] = N_("Illegal seek"),
-# if ESPIPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESPIPE
-# endif
-#endif
-#ifdef EROFS
-/*
-TRANS An attempt was made to modify something on a read-only file system. */
-    [ERR_REMAP (EROFS)] = N_("Read-only file system"),
-# if EROFS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EROFS
-# endif
-#endif
-#ifdef EMLINK
-/*
-TRANS The link count of a single file would become too large.
-TRANS @code{rename} can cause this error if the file being renamed already has
-TRANS as many links as it can take (@pxref{Renaming Files}). */
-    [ERR_REMAP (EMLINK)] = N_("Too many links"),
-# if EMLINK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EMLINK
-# endif
-#endif
-#ifdef EPIPE
-/*
-TRANS There is no process reading from the other end of a pipe.
-TRANS Every library function that returns this error code also generates a
-TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
-TRANS or blocked.  Thus, your program will never actually see @code{EPIPE}
-TRANS unless it has handled or blocked @code{SIGPIPE}. */
-    [ERR_REMAP (EPIPE)] = N_("Broken pipe"),
-# if EPIPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPIPE
-# endif
-#endif
-#ifdef EDOM
-/*
-TRANS Used by mathematical functions when an argument value does
-TRANS not fall into the domain over which the function is defined. */
-    [ERR_REMAP (EDOM)] = N_("Numerical argument out of domain"),
-# if EDOM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDOM
-# endif
-#endif
-#ifdef ERANGE
-/*
-TRANS Used by mathematical functions when the result value is
-TRANS not representable because of overflow or underflow. */
-    [ERR_REMAP (ERANGE)] = N_("Numerical result out of range"),
-# if ERANGE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ERANGE
-# endif
-#endif
-#ifdef EAGAIN
-/*
-TRANS The call might work if you try again
-TRANS later.  The macro @code{EWOULDBLOCK} is another name for @code{EAGAIN};
-TRANS they are always the same in @theglibc{}.
-TRANS
-TRANS This error can happen in a few different situations:
-TRANS
-TRANS @itemize @bullet
-TRANS @item
-TRANS An operation that would block was attempted on an object that has
-TRANS non-blocking mode selected.  Trying the same operation again will block
-TRANS until some external condition makes it possible to read, write, or
-TRANS connect (whatever the operation).  You can use @code{select} to find out
-TRANS when the operation will be possible; @pxref{Waiting for I/O}.
-TRANS
-TRANS @strong{Portability Note:} In many older Unix systems, this condition
-TRANS was indicated by @code{EWOULDBLOCK}, which was a distinct error code
-TRANS different from @code{EAGAIN}.  To make your program portable, you should
-TRANS check for both codes and treat them the same.
-TRANS
-TRANS @item
-TRANS A temporary resource shortage made an operation impossible.  @code{fork}
-TRANS can return this error.  It indicates that the shortage is expected to
-TRANS pass, so your program can try the call again later and it may succeed.
-TRANS It is probably a good idea to delay for a few seconds before trying it
-TRANS again, to allow time for other processes to release scarce resources.
-TRANS Such shortages are usually fairly serious and affect the whole system,
-TRANS so usually an interactive program should report the error to the user
-TRANS and return to its command loop.
-TRANS @end itemize */
-    [ERR_REMAP (EAGAIN)] = N_("Resource temporarily unavailable"),
-# if EAGAIN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EAGAIN
-# endif
-#endif
-#if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
-/*
-TRANS In @theglibc{}, this is another name for @code{EAGAIN} (above).
-TRANS The values are always the same, on every operating system.
-TRANS
-TRANS C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
-TRANS separate error code. */
-    [ERR_REMAP (EWOULDBLOCK)] = N_("Operation would block"),
-# if EWOULDBLOCK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EWOULDBLOCK
-# endif
-#endif
-#ifdef EINPROGRESS
-/*
-TRANS An operation that cannot complete immediately was initiated on an object
-TRANS that has non-blocking mode selected.  Some functions that must always
-TRANS block (such as @code{connect}; @pxref{Connecting}) never return
-TRANS @code{EAGAIN}.  Instead, they return @code{EINPROGRESS} to indicate that
-TRANS the operation has begun and will take some time.  Attempts to manipulate
-TRANS the object before the call completes return @code{EALREADY}.  You can
-TRANS use the @code{select} function to find out when the pending operation
-TRANS has completed; @pxref{Waiting for I/O}. */
-    [ERR_REMAP (EINPROGRESS)] = N_("Operation now in progress"),
-# if EINPROGRESS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EINPROGRESS
-# endif
-#endif
-#ifdef EALREADY
-/*
-TRANS An operation is already in progress on an object that has non-blocking
-TRANS mode selected. */
-    [ERR_REMAP (EALREADY)] = N_("Operation already in progress"),
-# if EALREADY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EALREADY
-# endif
-#endif
-#ifdef ENOTSOCK
-/*
-TRANS A file that isn't a socket was specified when a socket is required. */
-    [ERR_REMAP (ENOTSOCK)] = N_("Socket operation on non-socket"),
-# if ENOTSOCK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTSOCK
-# endif
-#endif
-#ifdef EMSGSIZE
-/*
-TRANS The size of a message sent on a socket was larger than the supported
-TRANS maximum size. */
-    [ERR_REMAP (EMSGSIZE)] = N_("Message too long"),
-# if EMSGSIZE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EMSGSIZE
-# endif
-#endif
-#ifdef EPROTOTYPE
-/*
-TRANS The socket type does not support the requested communications protocol. */
-    [ERR_REMAP (EPROTOTYPE)] = N_("Protocol wrong type for socket"),
-# if EPROTOTYPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROTOTYPE
-# endif
-#endif
-#ifdef ENOPROTOOPT
-/*
-TRANS You specified a socket option that doesn't make sense for the
-TRANS particular protocol being used by the socket.  @xref{Socket Options}. */
-    [ERR_REMAP (ENOPROTOOPT)] = N_("Protocol not available"),
-# if ENOPROTOOPT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOPROTOOPT
-# endif
-#endif
-#ifdef EPROTONOSUPPORT
-/*
-TRANS The socket domain does not support the requested communications protocol
-TRANS (perhaps because the requested protocol is completely invalid).
-TRANS @xref{Creating a Socket}. */
-    [ERR_REMAP (EPROTONOSUPPORT)] = N_("Protocol not supported"),
-# if EPROTONOSUPPORT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROTONOSUPPORT
-# endif
-#endif
-#ifdef ESOCKTNOSUPPORT
-/*
-TRANS The socket type is not supported. */
-    [ERR_REMAP (ESOCKTNOSUPPORT)] = N_("Socket type not supported"),
-# if ESOCKTNOSUPPORT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESOCKTNOSUPPORT
-# endif
-#endif
-#ifdef EOPNOTSUPP
-/*
-TRANS The operation you requested is not supported.  Some socket functions
-TRANS don't make sense for all types of sockets, and others may not be
-TRANS implemented for all communications protocols.  On @gnuhurdsystems{}, this
-TRANS error can happen for many calls when the object does not support the
-TRANS particular operation; it is a generic indication that the server knows
-TRANS nothing to do for that call. */
-    [ERR_REMAP (EOPNOTSUPP)] = N_("Operation not supported"),
-# if EOPNOTSUPP > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EOPNOTSUPP
-# endif
-#endif
-#ifdef EPFNOSUPPORT
-/*
-TRANS The socket communications protocol family you requested is not supported. */
-    [ERR_REMAP (EPFNOSUPPORT)] = N_("Protocol family not supported"),
-# if EPFNOSUPPORT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPFNOSUPPORT
-# endif
-#endif
-#ifdef EAFNOSUPPORT
-/*
-TRANS The address family specified for a socket is not supported; it is
-TRANS inconsistent with the protocol being used on the socket.  @xref{Sockets}. */
-    [ERR_REMAP (EAFNOSUPPORT)] = N_("Address family not supported by protocol"),
-# if EAFNOSUPPORT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EAFNOSUPPORT
-# endif
-#endif
-#ifdef EADDRINUSE
-/*
-TRANS The requested socket address is already in use.  @xref{Socket Addresses}. */
-    [ERR_REMAP (EADDRINUSE)] = N_("Address already in use"),
-# if EADDRINUSE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EADDRINUSE
-# endif
-#endif
-#ifdef EADDRNOTAVAIL
-/*
-TRANS The requested socket address is not available; for example, you tried
-TRANS to give a socket a name that doesn't match the local host name.
-TRANS @xref{Socket Addresses}. */
-    [ERR_REMAP (EADDRNOTAVAIL)] = N_("Cannot assign requested address"),
-# if EADDRNOTAVAIL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EADDRNOTAVAIL
-# endif
-#endif
-#ifdef ENETDOWN
-/*
-TRANS A socket operation failed because the network was down. */
-    [ERR_REMAP (ENETDOWN)] = N_("Network is down"),
-# if ENETDOWN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENETDOWN
-# endif
-#endif
-#ifdef ENETUNREACH
-/*
-TRANS A socket operation failed because the subnet containing the remote host
-TRANS was unreachable. */
-    [ERR_REMAP (ENETUNREACH)] = N_("Network is unreachable"),
-# if ENETUNREACH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENETUNREACH
-# endif
-#endif
-#ifdef ENETRESET
-/*
-TRANS A network connection was reset because the remote host crashed. */
-    [ERR_REMAP (ENETRESET)] = N_("Network dropped connection on reset"),
-# if ENETRESET > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENETRESET
-# endif
-#endif
-#ifdef ECONNABORTED
-/*
-TRANS A network connection was aborted locally. */
-    [ERR_REMAP (ECONNABORTED)] = N_("Software caused connection abort"),
-# if ECONNABORTED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECONNABORTED
-# endif
-#endif
-#ifdef ECONNRESET
-/*
-TRANS A network connection was closed for reasons outside the control of the
-TRANS local host, such as by the remote machine rebooting or an unrecoverable
-TRANS protocol violation. */
-    [ERR_REMAP (ECONNRESET)] = N_("Connection reset by peer"),
-# if ECONNRESET > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECONNRESET
-# endif
-#endif
-#ifdef ENOBUFS
-/*
-TRANS The kernel's buffers for I/O operations are all in use.  In GNU, this
-TRANS error is always synonymous with @code{ENOMEM}; you may get one or the
-TRANS other from network operations. */
-    [ERR_REMAP (ENOBUFS)] = N_("No buffer space available"),
-# if ENOBUFS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOBUFS
-# endif
-#endif
-#ifdef EISCONN
-/*
-TRANS You tried to connect a socket that is already connected.
-TRANS @xref{Connecting}. */
-    [ERR_REMAP (EISCONN)] = N_("Transport endpoint is already connected"),
-# if EISCONN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EISCONN
-# endif
-#endif
-#ifdef ENOTCONN
-/*
-TRANS The socket is not connected to anything.  You get this error when you
-TRANS try to transmit data over a socket, without first specifying a
-TRANS destination for the data.  For a connectionless socket (for datagram
-TRANS protocols, such as UDP), you get @code{EDESTADDRREQ} instead. */
-    [ERR_REMAP (ENOTCONN)] = N_("Transport endpoint is not connected"),
-# if ENOTCONN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTCONN
-# endif
-#endif
-#ifdef EDESTADDRREQ
-/*
-TRANS No default destination address was set for the socket.  You get this
-TRANS error when you try to transmit data over a connectionless socket,
-TRANS without first specifying a destination for the data with @code{connect}. */
-    [ERR_REMAP (EDESTADDRREQ)] = N_("Destination address required"),
-# if EDESTADDRREQ > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDESTADDRREQ
-# endif
-#endif
-#ifdef ESHUTDOWN
-/*
-TRANS The socket has already been shut down. */
-    [ERR_REMAP (ESHUTDOWN)] = N_("Cannot send after transport endpoint shutdown"),
-# if ESHUTDOWN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESHUTDOWN
-# endif
-#endif
-#ifdef ETOOMANYREFS
-/* */
-    [ERR_REMAP (ETOOMANYREFS)] = N_("Too many references: cannot splice"),
-# if ETOOMANYREFS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ETOOMANYREFS
-# endif
-#endif
-#ifdef ETIMEDOUT
-/*
-TRANS A socket operation with a specified timeout received no response during
-TRANS the timeout period. */
-    [ERR_REMAP (ETIMEDOUT)] = N_("Connection timed out"),
-# if ETIMEDOUT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ETIMEDOUT
-# endif
-#endif
-#ifdef ECONNREFUSED
-/*
-TRANS A remote host refused to allow the network connection (typically because
-TRANS it is not running the requested service). */
-    [ERR_REMAP (ECONNREFUSED)] = N_("Connection refused"),
-# if ECONNREFUSED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECONNREFUSED
-# endif
-#endif
-#ifdef ELOOP
-/*
-TRANS Too many levels of symbolic links were encountered in looking up a file name.
-TRANS This often indicates a cycle of symbolic links. */
-    [ERR_REMAP (ELOOP)] = N_("Too many levels of symbolic links"),
-# if ELOOP > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELOOP
-# endif
-#endif
-#ifdef ENAMETOOLONG
-/*
-TRANS Filename too long (longer than @code{PATH_MAX}; @pxref{Limits for
-TRANS Files}) or host name too long (in @code{gethostname} or
-TRANS @code{sethostname}; @pxref{Host Identification}). */
-    [ERR_REMAP (ENAMETOOLONG)] = N_("File name too long"),
-# if ENAMETOOLONG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENAMETOOLONG
-# endif
-#endif
-#ifdef EHOSTDOWN
-/*
-TRANS The remote host for a requested network connection is down. */
-    [ERR_REMAP (EHOSTDOWN)] = N_("Host is down"),
-# if EHOSTDOWN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EHOSTDOWN
-# endif
-#endif
-#ifdef EHOSTUNREACH
-/*
-TRANS The remote host for a requested network connection is not reachable. */
-    [ERR_REMAP (EHOSTUNREACH)] = N_("No route to host"),
-# if EHOSTUNREACH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EHOSTUNREACH
-# endif
-#endif
-#ifdef ENOTEMPTY
-/*
-TRANS Directory not empty, where an empty directory was expected.  Typically,
-TRANS this error occurs when you are trying to delete a directory. */
-    [ERR_REMAP (ENOTEMPTY)] = N_("Directory not empty"),
-# if ENOTEMPTY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTEMPTY
-# endif
-#endif
-#ifdef EPROCLIM
-/*
-TRANS This means that the per-user limit on new process would be exceeded by
-TRANS an attempted @code{fork}.  @xref{Limits on Resources}, for details on
-TRANS the @code{RLIMIT_NPROC} limit. */
-    [ERR_REMAP (EPROCLIM)] = N_("Too many processes"),
-# if EPROCLIM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROCLIM
-# endif
-#endif
-#ifdef EUSERS
-/*
-TRANS The file quota system is confused because there are too many users.
-TRANS @c This can probably happen in a GNU system when using NFS. */
-    [ERR_REMAP (EUSERS)] = N_("Too many users"),
-# if EUSERS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EUSERS
-# endif
-#endif
-#ifdef EDQUOT
-/*
-TRANS The user's disk quota was exceeded. */
-    [ERR_REMAP (EDQUOT)] = N_("Disk quota exceeded"),
-# if EDQUOT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDQUOT
-# endif
-#endif
-#ifdef ESTALE
-/*
-TRANS This indicates an internal confusion in the
-TRANS file system which is due to file system rearrangements on the server host
-TRANS for NFS file systems or corruption in other file systems.
-TRANS Repairing this condition usually requires unmounting, possibly repairing
-TRANS and remounting the file system. */
-    [ERR_REMAP (ESTALE)] = N_("Stale file handle"),
-# if ESTALE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESTALE
-# endif
-#endif
-#ifdef EREMOTE
-/*
-TRANS An attempt was made to NFS-mount a remote file system with a file name that
-TRANS already specifies an NFS-mounted file.
-TRANS (This is an error on some operating systems, but we expect it to work
-TRANS properly on @gnuhurdsystems{}, making this error code impossible.) */
-    [ERR_REMAP (EREMOTE)] = N_("Object is remote"),
-# if EREMOTE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EREMOTE
-# endif
-#endif
-#ifdef EBADRPC
-/* */
-    [ERR_REMAP (EBADRPC)] = N_("RPC struct is bad"),
-# if EBADRPC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADRPC
-# endif
-#endif
-#ifdef ERPCMISMATCH
-/* */
-    [ERR_REMAP (ERPCMISMATCH)] = N_("RPC version wrong"),
-# if ERPCMISMATCH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ERPCMISMATCH
-# endif
-#endif
-#ifdef EPROGUNAVAIL
-/* */
-    [ERR_REMAP (EPROGUNAVAIL)] = N_("RPC program not available"),
-# if EPROGUNAVAIL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROGUNAVAIL
-# endif
-#endif
-#ifdef EPROGMISMATCH
-/* */
-    [ERR_REMAP (EPROGMISMATCH)] = N_("RPC program version wrong"),
-# if EPROGMISMATCH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROGMISMATCH
-# endif
-#endif
-#ifdef EPROCUNAVAIL
-/* */
-    [ERR_REMAP (EPROCUNAVAIL)] = N_("RPC bad procedure for program"),
-# if EPROCUNAVAIL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROCUNAVAIL
-# endif
-#endif
-#ifdef ENOLCK
-/*
-TRANS This is used by the file locking facilities; see
-TRANS @ref{File Locks}.  This error is never generated by @gnuhurdsystems{}, but
-TRANS it can result from an operation to an NFS server running another
-TRANS operating system. */
-    [ERR_REMAP (ENOLCK)] = N_("No locks available"),
-# if ENOLCK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOLCK
-# endif
-#endif
-#ifdef EFTYPE
-/*
-TRANS The file was the wrong type for the
-TRANS operation, or a data file had the wrong format.
-TRANS
-TRANS On some systems @code{chmod} returns this error if you try to set the
-TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
-    [ERR_REMAP (EFTYPE)] = N_("Inappropriate file type or format"),
-# if EFTYPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EFTYPE
-# endif
-#endif
-#ifdef EAUTH
-/* */
-    [ERR_REMAP (EAUTH)] = N_("Authentication error"),
-# if EAUTH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EAUTH
-# endif
-#endif
-#ifdef ENEEDAUTH
-/* */
-    [ERR_REMAP (ENEEDAUTH)] = N_("Need authenticator"),
-# if ENEEDAUTH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENEEDAUTH
-# endif
-#endif
-#ifdef ENOSYS
-/*
-TRANS This indicates that the function called is
-TRANS not implemented at all, either in the C library itself or in the
-TRANS operating system.  When you get this error, you can be sure that this
-TRANS particular function will always fail with @code{ENOSYS} unless you
-TRANS install a new version of the C library or the operating system. */
-    [ERR_REMAP (ENOSYS)] = N_("Function not implemented"),
-# if ENOSYS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOSYS
-# endif
-#endif
-#if defined (ENOTSUP) && ENOTSUP != EOPNOTSUPP
-/*
-TRANS A function returns this error when certain parameter
-TRANS values are valid, but the functionality they request is not available.
-TRANS This can mean that the function does not implement a particular command
-TRANS or option value or flag bit at all.  For functions that operate on some
-TRANS object given in a parameter, such as a file descriptor or a port, it
-TRANS might instead mean that only @emph{that specific object} (file
-TRANS descriptor, port, etc.) is unable to support the other parameters given;
-TRANS different file descriptors might support different ranges of parameter
-TRANS values.
-TRANS
-TRANS If the entire function is not available at all in the implementation,
-TRANS it returns @code{ENOSYS} instead. */
-    [ERR_REMAP (ENOTSUP)] = N_("Not supported"),
-# if ENOTSUP > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTSUP
-# endif
-#endif
-#ifdef EILSEQ
-/*
-TRANS While decoding a multibyte character the function came along an invalid
-TRANS or an incomplete sequence of bytes or the given wide character is invalid. */
-    [ERR_REMAP (EILSEQ)] = N_("Invalid or incomplete multibyte or wide character"),
-# if EILSEQ > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EILSEQ
-# endif
-#endif
-#ifdef EBACKGROUND
-/*
-TRANS On @gnuhurdsystems{}, servers supporting the @code{term} protocol return
-TRANS this error for certain operations when the caller is not in the
-TRANS foreground process group of the terminal.  Users do not usually see this
-TRANS error because functions such as @code{read} and @code{write} translate
-TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal.  @xref{Job Control},
-TRANS for information on process groups and these signals. */
-    [ERR_REMAP (EBACKGROUND)] = N_("Inappropriate operation for background process"),
-# if EBACKGROUND > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBACKGROUND
-# endif
-#endif
-#ifdef EDIED
-/*
-TRANS On @gnuhurdsystems{}, opening a file returns this error when the file is
-TRANS translated by a program and the translator program dies while starting
-TRANS up, before it has connected to the file. */
-    [ERR_REMAP (EDIED)] = N_("Translator died"),
-# if EDIED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDIED
-# endif
-#endif
-#ifdef ED
-/*
-TRANS The experienced user will know what is wrong.
-TRANS @c This error code is a joke.  Its perror text is part of the joke.
-TRANS @c Don't change it. */
-    [ERR_REMAP (ED)] = N_("?"),
-# if ED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ED
-# endif
-#endif
-#ifdef EGREGIOUS
-/*
-TRANS You did @strong{what}? */
-    [ERR_REMAP (EGREGIOUS)] = N_("You really blew it this time"),
-# if EGREGIOUS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EGREGIOUS
-# endif
-#endif
-#ifdef EIEIO
-/*
-TRANS Go home and have a glass of warm, dairy-fresh milk.
-TRANS @c Okay.  Since you are dying to know, I'll tell you.
-TRANS @c This is a joke, obviously.  There is a children's song which begins,
-TRANS @c "Old McDonald had a farm, e-i-e-i-o."  Every time I see the (real)
-TRANS @c errno macro EIO, I think about that song.  Probably most of my
-TRANS @c compatriots who program on Unix do, too.  One of them must have stayed
-TRANS @c up a little too late one night and decided to add it to Hurd or Glibc.
-TRANS @c Whoever did it should be castigated, but it made me laugh.
-TRANS @c  --jtobey@channel1.com
-TRANS @c
-TRANS @c "bought the farm" means "died".  -jtobey
-TRANS @c
-TRANS @c Translators, please do not translate this litteraly, translate it into
-TRANS @c an idiomatic funny way of saying that the computer died. */
-    [ERR_REMAP (EIEIO)] = N_("Computer bought the farm"),
-# if EIEIO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EIEIO
-# endif
-#endif
-#ifdef EGRATUITOUS
-/*
-TRANS This error code has no purpose. */
-    [ERR_REMAP (EGRATUITOUS)] = N_("Gratuitous error"),
-# if EGRATUITOUS > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EGRATUITOUS
-# endif
-#endif
-#ifdef EBADMSG
-/* */
-    [ERR_REMAP (EBADMSG)] = N_("Bad message"),
-# if EBADMSG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADMSG
-# endif
-#endif
-#ifdef EIDRM
-/* */
-    [ERR_REMAP (EIDRM)] = N_("Identifier removed"),
-# if EIDRM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EIDRM
-# endif
-#endif
-#ifdef EMULTIHOP
-/* */
-    [ERR_REMAP (EMULTIHOP)] = N_("Multihop attempted"),
-# if EMULTIHOP > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EMULTIHOP
-# endif
-#endif
-#ifdef ENODATA
-/* */
-    [ERR_REMAP (ENODATA)] = N_("No data available"),
-# if ENODATA > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENODATA
-# endif
-#endif
-#ifdef ENOLINK
-/* */
-    [ERR_REMAP (ENOLINK)] = N_("Link has been severed"),
-# if ENOLINK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOLINK
-# endif
-#endif
-#ifdef ENOMSG
-/* */
-    [ERR_REMAP (ENOMSG)] = N_("No message of desired type"),
-# if ENOMSG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOMSG
-# endif
-#endif
-#ifdef ENOSR
-/* */
-    [ERR_REMAP (ENOSR)] = N_("Out of streams resources"),
-# if ENOSR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOSR
-# endif
-#endif
-#ifdef ENOSTR
-/* */
-    [ERR_REMAP (ENOSTR)] = N_("Device not a stream"),
-# if ENOSTR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOSTR
-# endif
-#endif
-#ifdef EOVERFLOW
-/* */
-    [ERR_REMAP (EOVERFLOW)] = N_("Value too large for defined data type"),
-# if EOVERFLOW > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EOVERFLOW
-# endif
-#endif
-#ifdef EPROTO
-/* */
-    [ERR_REMAP (EPROTO)] = N_("Protocol error"),
-# if EPROTO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EPROTO
-# endif
-#endif
-#ifdef ETIME
-/* */
-    [ERR_REMAP (ETIME)] = N_("Timer expired"),
-# if ETIME > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ETIME
-# endif
-#endif
-#ifdef ECANCELED
-/*
-TRANS An asynchronous operation was canceled before it
-TRANS completed.  @xref{Asynchronous I/O}.  When you call @code{aio_cancel},
-TRANS the normal result is for the operations affected to complete with this
-TRANS error; @pxref{Cancel AIO Operations}. */
-    [ERR_REMAP (ECANCELED)] = N_("Operation canceled"),
-# if ECANCELED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECANCELED
-# endif
-#endif
-#ifdef EOWNERDEAD
-/* */
-    [ERR_REMAP (EOWNERDEAD)] = N_("Owner died"),
-# if EOWNERDEAD > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EOWNERDEAD
-# endif
-#endif
-#ifdef ENOTRECOVERABLE
-/* */
-    [ERR_REMAP (ENOTRECOVERABLE)] = N_("State not recoverable"),
-# if ENOTRECOVERABLE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTRECOVERABLE
-# endif
-#endif
-#ifdef ERESTART
-/* */
-    [ERR_REMAP (ERESTART)] = N_("Interrupted system call should be restarted"),
-# if ERESTART > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ERESTART
-# endif
-#endif
-#ifdef ECHRNG
-/* */
-    [ERR_REMAP (ECHRNG)] = N_("Channel number out of range"),
-# if ECHRNG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECHRNG
-# endif
-#endif
-#ifdef EL2NSYNC
-/* */
-    [ERR_REMAP (EL2NSYNC)] = N_("Level 2 not synchronized"),
-# if EL2NSYNC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EL2NSYNC
-# endif
-#endif
-#ifdef EL3HLT
-/* */
-    [ERR_REMAP (EL3HLT)] = N_("Level 3 halted"),
-# if EL3HLT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EL3HLT
-# endif
-#endif
-#ifdef EL3RST
-/* */
-    [ERR_REMAP (EL3RST)] = N_("Level 3 reset"),
-# if EL3RST > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EL3RST
-# endif
-#endif
-#ifdef ELNRNG
-/* */
-    [ERR_REMAP (ELNRNG)] = N_("Link number out of range"),
-# if ELNRNG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELNRNG
-# endif
-#endif
-#ifdef EUNATCH
-/* */
-    [ERR_REMAP (EUNATCH)] = N_("Protocol driver not attached"),
-# if EUNATCH > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EUNATCH
-# endif
-#endif
-#ifdef ENOCSI
-/* */
-    [ERR_REMAP (ENOCSI)] = N_("No CSI structure available"),
-# if ENOCSI > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOCSI
-# endif
-#endif
-#ifdef EL2HLT
-/* */
-    [ERR_REMAP (EL2HLT)] = N_("Level 2 halted"),
-# if EL2HLT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EL2HLT
-# endif
-#endif
-#ifdef EBADE
-/* */
-    [ERR_REMAP (EBADE)] = N_("Invalid exchange"),
-# if EBADE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADE
-# endif
-#endif
-#ifdef EBADR
-/* */
-    [ERR_REMAP (EBADR)] = N_("Invalid request descriptor"),
-# if EBADR > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADR
-# endif
-#endif
-#ifdef EXFULL
-/* */
-    [ERR_REMAP (EXFULL)] = N_("Exchange full"),
-# if EXFULL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EXFULL
-# endif
-#endif
-#ifdef ENOANO
-/* */
-    [ERR_REMAP (ENOANO)] = N_("No anode"),
-# if ENOANO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOANO
-# endif
-#endif
-#ifdef EBADRQC
-/* */
-    [ERR_REMAP (EBADRQC)] = N_("Invalid request code"),
-# if EBADRQC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADRQC
-# endif
-#endif
-#ifdef EBADSLT
-/* */
-    [ERR_REMAP (EBADSLT)] = N_("Invalid slot"),
-# if EBADSLT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADSLT
-# endif
-#endif
-#if defined (EDEADLOCK) && EDEADLOCK != EDEADLK
-/* */
-    [ERR_REMAP (EDEADLOCK)] = N_("File locking deadlock error"),
-# if EDEADLOCK > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDEADLOCK
-# endif
-#endif
-#ifdef EBFONT
-/* */
-    [ERR_REMAP (EBFONT)] = N_("Bad font file format"),
-# if EBFONT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBFONT
-# endif
-#endif
-#ifdef ENONET
-/* */
-    [ERR_REMAP (ENONET)] = N_("Machine is not on the network"),
-# if ENONET > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENONET
-# endif
-#endif
-#ifdef ENOPKG
-/* */
-    [ERR_REMAP (ENOPKG)] = N_("Package not installed"),
-# if ENOPKG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOPKG
-# endif
-#endif
-#ifdef EADV
-/* */
-    [ERR_REMAP (EADV)] = N_("Advertise error"),
-# if EADV > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EADV
-# endif
-#endif
-#ifdef ESRMNT
-/* */
-    [ERR_REMAP (ESRMNT)] = N_("Srmount error"),
-# if ESRMNT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESRMNT
-# endif
-#endif
-#ifdef ECOMM
-/* */
-    [ERR_REMAP (ECOMM)] = N_("Communication error on send"),
-# if ECOMM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ECOMM
-# endif
-#endif
-#ifdef EDOTDOT
-/* */
-    [ERR_REMAP (EDOTDOT)] = N_("RFS specific error"),
-# if EDOTDOT > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EDOTDOT
-# endif
-#endif
-#ifdef ENOTUNIQ
-/* */
-    [ERR_REMAP (ENOTUNIQ)] = N_("Name not unique on network"),
-# if ENOTUNIQ > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTUNIQ
-# endif
-#endif
-#ifdef EBADFD
-/* */
-    [ERR_REMAP (EBADFD)] = N_("File descriptor in bad state"),
-# if EBADFD > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EBADFD
-# endif
-#endif
-#ifdef EREMCHG
-/* */
-    [ERR_REMAP (EREMCHG)] = N_("Remote address changed"),
-# if EREMCHG > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EREMCHG
-# endif
-#endif
-#ifdef ELIBACC
-/* */
-    [ERR_REMAP (ELIBACC)] = N_("Can not access a needed shared library"),
-# if ELIBACC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELIBACC
-# endif
-#endif
-#ifdef ELIBBAD
-/* */
-    [ERR_REMAP (ELIBBAD)] = N_("Accessing a corrupted shared library"),
-# if ELIBBAD > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELIBBAD
-# endif
-#endif
-#ifdef ELIBSCN
-/* */
-    [ERR_REMAP (ELIBSCN)] = N_(".lib section in a.out corrupted"),
-# if ELIBSCN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELIBSCN
-# endif
-#endif
-#ifdef ELIBMAX
-/* */
-    [ERR_REMAP (ELIBMAX)] = N_("Attempting to link in too many shared libraries"),
-# if ELIBMAX > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELIBMAX
-# endif
-#endif
-#ifdef ELIBEXEC
-/* */
-    [ERR_REMAP (ELIBEXEC)] = N_("Cannot exec a shared library directly"),
-# if ELIBEXEC > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ELIBEXEC
-# endif
-#endif
-#ifdef ESTRPIPE
-/* */
-    [ERR_REMAP (ESTRPIPE)] = N_("Streams pipe error"),
-# if ESTRPIPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ESTRPIPE
-# endif
-#endif
-#ifdef EUCLEAN
-/* */
-    [ERR_REMAP (EUCLEAN)] = N_("Structure needs cleaning"),
-# if EUCLEAN > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EUCLEAN
-# endif
-#endif
-#ifdef ENOTNAM
-/* */
-    [ERR_REMAP (ENOTNAM)] = N_("Not a XENIX named type file"),
-# if ENOTNAM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTNAM
-# endif
-#endif
-#ifdef ENAVAIL
-/* */
-    [ERR_REMAP (ENAVAIL)] = N_("No XENIX semaphores available"),
-# if ENAVAIL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENAVAIL
-# endif
-#endif
-#ifdef EISNAM
-/* */
-    [ERR_REMAP (EISNAM)] = N_("Is a named type file"),
-# if EISNAM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EISNAM
-# endif
-#endif
-#ifdef EREMOTEIO
-/* */
-    [ERR_REMAP (EREMOTEIO)] = N_("Remote I/O error"),
-# if EREMOTEIO > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EREMOTEIO
-# endif
-#endif
-#ifdef ENOMEDIUM
-/* */
-    [ERR_REMAP (ENOMEDIUM)] = N_("No medium found"),
-# if ENOMEDIUM > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOMEDIUM
-# endif
-#endif
-#ifdef EMEDIUMTYPE
-/* */
-    [ERR_REMAP (EMEDIUMTYPE)] = N_("Wrong medium type"),
-# if EMEDIUMTYPE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EMEDIUMTYPE
-# endif
-#endif
-#ifdef ENOKEY
-/* */
-    [ERR_REMAP (ENOKEY)] = N_("Required key not available"),
-# if ENOKEY > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOKEY
-# endif
-#endif
-#ifdef EKEYEXPIRED
-/* */
-    [ERR_REMAP (EKEYEXPIRED)] = N_("Key has expired"),
-# if EKEYEXPIRED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EKEYEXPIRED
-# endif
-#endif
-#ifdef EKEYREVOKED
-/* */
-    [ERR_REMAP (EKEYREVOKED)] = N_("Key has been revoked"),
-# if EKEYREVOKED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EKEYREVOKED
-# endif
-#endif
-#ifdef EKEYREJECTED
-/* */
-    [ERR_REMAP (EKEYREJECTED)] = N_("Key was rejected by service"),
-# if EKEYREJECTED > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EKEYREJECTED
-# endif
-#endif
-#ifdef ERFKILL
-/* */
-    [ERR_REMAP (ERFKILL)] = N_("Operation not possible due to RF-kill"),
-# if ERFKILL > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ERFKILL
-# endif
-#endif
-#ifdef EHWPOISON
-/* */
-    [ERR_REMAP (EHWPOISON)] = N_("Memory page has hardware error"),
-# if EHWPOISON > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EHWPOISON
-# endif
-#endif
-  };
-
-#define NERR \
-  (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0])
-const int _sys_nerr_internal = NERR;
-
-#if IS_IN (libc) && !defined ERRLIST_NO_COMPAT
-# include <errlist-compat.c>
-#endif
-
-#ifdef EMIT_ERR_MAX
-void dummy (void)
-{ asm volatile (" @@@ %0 @@@ " : : "i" (ERR_REMAP (ERR_MAX))); }
-#endif
diff --git a/sysdeps/mach/hurd/err_hurd.sub b/sysdeps/mach/hurd/err_hurd.sub
index 4a4dee3aa3..3e9b37e155 100644
--- a/sysdeps/mach/hurd/err_hurd.sub
+++ b/sysdeps/mach/hurd/err_hurd.sub
@@ -1,12 +1,11 @@ 
 /* This file defines the Mach error system for Hurd server errors.  */
 
 #include <errno.h>
-
-extern const char *const _hurd_errlist[];
+#include <stdio.h>  /* For _sys_errlist_internal  */
 
 /* Omit `const' because we are included with `static'
    defined to `static const'.  */
 static struct error_subsystem err_hurd_sub[] =
   {
-    { "(os/hurd)", _HURD_ERRNOS, (const char *const *) _hurd_errlist },
+    { "(os/hurd)", _HURD_ERRNOS, _sys_errlist_internal },
   };
diff --git a/sysdeps/mach/hurd/errlist.c b/sysdeps/mach/hurd/errlist.c
index 451e8fa1eb..be752f02b9 100644
--- a/sysdeps/mach/hurd/errlist.c
+++ b/sysdeps/mach/hurd/errlist.c
@@ -15,14 +15,7 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* sys_errlist cannot have Unix semantics on the Hurd, so it is easier just
-   to rename it.  We also need to remap error codes to array indices by
-   taking their subcode. */
-#define _sys_errlist_internal	_hurd_errlist
-#define _sys_nerr_internal	_hurd_nerr
-#define ERRLIST_NO_COMPAT	1
-
 #include <mach/error.h>
-#define ERR_REMAP(n) (err_get_code (n))
 
-#include <sysdeps/gnu/errlist.c>
+#define ERR_MAP(value) err_get_code (value)
+#include <stdio-common/errlist.c>
diff --git a/sysdeps/mach/hurd/errlist.def b/sysdeps/mach/hurd/errlist.def
new file mode 100644
index 0000000000..a6f769d4f3
--- /dev/null
+++ b/sysdeps/mach/hurd/errlist.def
@@ -0,0 +1,104 @@ 
+0, Success
+ENOENT, No such file or directory
+ESRCH, No such process
+EINTR, Interrupted system call
+EIO, Input/output error
+ENXIO, No such device or address
+E2BIG, Argument list too long
+ENOEXEC, Exec format error
+EBADF, Bad file descriptor
+ECHILD, No child processes
+EDEADLK, Resource deadlock avoided
+ENOMEM, Cannot allocate memory
+EACCES, Permission denied
+EFAULT, Bad address
+ENOTBLK, Block device required
+EBUSY, Device or resource busy
+EEXIST, File exists
+EXDEV, Invalid cross-device link
+ENODEV, No such device
+ENOTDIR, Not a directory
+EISDIR, Is a directory
+EINVAL, Invalid argument
+EMFILE, Too many open files
+ENFILE, Too many open files in system
+ENOTTY, Inappropriate ioctl for device
+ETXTBSY, Text file busy
+EFBIG, File too large
+ENOSPC, No space left on device
+ESPIPE, Illegal seek
+EROFS, Read-only file system
+EMLINK, Too many links
+EPIPE, Broken pipe
+EDOM, Numerical argument out of domain
+ERANGE, Numerical result out of range
+EAGAIN, Resource temporarily unavailable
+EWOULDBLOCK, Operation would block
+EINPROGRESS, Operation now in progress
+EALREADY, Operation already in progress
+ENOTSOCK, Socket operation on non-socket
+EMSGSIZE, Message too long
+EPROTOTYPE, Protocol wrong type for socket
+ENOPROTOOPT, Protocol not available
+EPROTONOSUPPORT, Protocol not supported
+ESOCKTNOSUPPORT, Socket type not supported
+EOPNOTSUPP, Operation not supported
+EPFNOSUPPORT, Protocol family not supported
+EAFNOSUPPORT, Address family not supported by protocol
+EADDRINUSE, Address already in use
+EADDRNOTAVAIL, Cannot assign requested address
+ENETDOWN, Network is down
+ENETUNREACH, Network is unreachable
+ENETRESET, Network dropped connection on reset
+ECONNABORTED, Software caused connection abort
+ECONNRESET, Connection reset by peer
+ENOBUFS, No buffer space available
+EISCONN, Transport endpoint is already connected
+ENOTCONN, Transport endpoint is not connected
+EDESTADDRREQ, Destination address required
+ESHUTDOWN, Cannot send after transport endpoint shutdown
+ETOOMANYREFS, Too many references: cannot splice
+ETIMEDOUT, Connection timed out
+ECONNREFUSED, Connection refused
+ELOOP, Too many levels of symbolic links
+ENAMETOOLONG, File name too long
+EHOSTDOWN, Host is down
+EHOSTUNREACH, No route to host
+ENOTEMPTY, Directory not empty
+EPROCLIM, Too many processes
+EUSERS, Too many users
+EDQUOT, Disk quota exceeded
+ESTALE, Stale file handle
+EREMOTE, Object is remote
+EBADRPC, RPC struct is bad
+ERPCMISMATCH, RPC version wrong
+EPROGUNAVAIL, RPC program not available
+EPROGMISMATCH, RPC program version wrong
+EPROCUNAVAIL, RPC bad procedure for program
+ENOLCK, No locks available
+EFTYPE, Inappropriate file type or format
+EAUTH, Authentication error
+ENEEDAUTH, Need authenticator
+ENOSYS, Function not implemented
+ENOTSUP, Not supported
+EILSEQ, Invalid or incomplete multibyte or wide character
+EBACKGROUND, Inappropriate operation for background process
+EDIED, Translator died
+ED, ?
+EGREGIOUS, You really blew it this time
+EIEIO, Computer bought the farm
+EGRATUITOUS, Gratuitous error
+EBADMSG, Bad message
+EIDRM, Identifier removed
+EMULTIHOP, Multihop attempted
+ENODATA, No data available
+ENOLINK, Link has been severed
+ENOMSG, No message of desired type
+ENOSR, Out of streams resources
+ENOSTR, Device not a stream
+EOVERFLOW, Value too large for defined data type
+EPROTO, Protocol error
+ETIME, Timer expired
+ECANCELED, Operation canceled
+EOWNERDEAD, Owner died
+ENOTRECOVERABLE, State not recoverable
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 9a58dda9f2..c35f783e2a 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -1,9 +1,4 @@ 
 libc {
-  # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
-  # When you get an error from errlist-compat.awk, you need to add a new
-  # version here.  Don't do this blindly, since this means changing the ABI
-  # for all GNU/Linux configurations.
-
   GLIBC_2.0 {
     # functions used in inline functions or macros
     __cmsg_nxthdr;
@@ -56,7 +51,6 @@  libc {
     # u*
     umount; uselib;
 
-    #errlist-compat	123
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.1 {
@@ -84,7 +78,6 @@  libc {
     # u*
     umount2;
 
-    #errlist-compat	125
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.2 {
@@ -102,7 +95,6 @@  libc {
     # r*
     readahead;
 
-    #errlist-compat	126
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.3.2 {
@@ -120,7 +112,6 @@  libc {
 
     unshare;
 
-    #errlist-compat	132
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.5 {
@@ -142,7 +133,6 @@  libc {
     fallocate;
   }
   GLIBC_2.12 {
-    #errlist-compat	135
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     ntp_gettimex;
diff --git a/sysdeps/unix/sysv/linux/alpha/Versions b/sysdeps/unix/sysv/linux/alpha/Versions
index 3b7971c2a3..b90d5f2e5a 100644
--- a/sysdeps/unix/sysv/linux/alpha/Versions
+++ b/sysdeps/unix/sysv/linux/alpha/Versions
@@ -1,12 +1,5 @@ 
 libc {
-  # The comment lines with "#errlist-compat" are magic; see
-  # sysdeps/gnu/errlist-compat.awk.
-  # When you get an error from errlist-compat.awk, you need to add a new
-  # version here.  Don't do this blindly, since this means changing the ABI
-  # for all GNU/Linux configurations.
-
   GLIBC_2.0 {
-    #errlist-compat	131
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     # Unfortunately in wider use.
@@ -33,7 +26,6 @@  libc {
     pciconfig_read; pciconfig_write; sethae;
   }
   GLIBC_2.1 {
-    #errlist-compat	131
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     # Linux/Alpha 64-bit timeval functions.
@@ -70,19 +62,15 @@  libc {
     wordexp;
   }
   GLIBC_2.3 {
-    #errlist-compat	132
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.4 {
-    #errlist-compat	138
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.12 {
-    #errlist-compat	139
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.16 {
-    #errlist-compat	140
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.27 {
diff --git a/sysdeps/unix/sysv/linux/alpha/errlist-compat.c b/sysdeps/unix/sysv/linux/alpha/errlist-compat.c
new file mode 100644
index 0000000000..709807aa6b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/errlist-compat.c
@@ -0,0 +1,43 @@ 
+/* Linux sys_errlist compat symbol definitions.  Alpha version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errlist-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+DEFINE_COMPAT_ERRLIST (131, GLIBC_2_0)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3)
+DEFINE_COMPAT_ERRLIST (131, GLIBC_2_1)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_4)
+DEFINE_COMPAT_ERRLIST (132, GLIBC_2_3)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_12)
+DEFINE_COMPAT_ERRLIST (138, GLIBC_2_4)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_16)
+DEFINE_COMPAT_ERRLIST (139, GLIBC_2_12)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_16, GLIBC_2_32)
+DEFINE_COMPAT_ERRLIST (140, GLIBC_2_16)
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/sys_errlist.h b/sysdeps/unix/sysv/linux/errlist-compat.c
similarity index 56%
rename from sysdeps/unix/sysv/linux/bits/sys_errlist.h
rename to sysdeps/unix/sysv/linux/errlist-compat.c
index d6f5fa0a5e..c4d79b70aa 100644
--- a/sysdeps/unix/sysv/linux/bits/sys_errlist.h
+++ b/sysdeps/unix/sysv/linux/errlist-compat.c
@@ -1,5 +1,5 @@ 
-/* Declare sys_errlist and sys_nerr, or don't.  Compatibility (do) version.
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Linux sys_errlist compat symbol definitions.  Generic version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,24 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _STDIO_H
-# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead."
+#include <errlist-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+DEFINE_COMPAT_ERRLIST (123, GLIBC_2_0)
 #endif
 
-/* sys_errlist and sys_nerr are deprecated.  Use strerror instead.  */
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3)
+DEFINE_COMPAT_ERRLIST (125, GLIBC_2_1)
+#endif
 
-#ifdef  __USE_MISC
-extern int sys_nerr;
-extern const char *const sys_errlist[];
+#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_4)
+DEFINE_COMPAT_ERRLIST (126, GLIBC_2_3)
 #endif
-#ifdef  __USE_GNU
-extern int _sys_nerr;
-extern const char *const _sys_errlist[];
+
+#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_12)
+DEFINE_COMPAT_ERRLIST (132, GLIBC_2_4)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_32)
+DEFINE_COMPAT_ERRLIST (135, GLIBC_2_12)
 #endif
diff --git a/sysdeps/unix/sysv/linux/errlist-compat.h b/sysdeps/unix/sysv/linux/errlist-compat.h
new file mode 100644
index 0000000000..edd35fd4ed
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/errlist-compat.h
@@ -0,0 +1,43 @@ 
+/* Linux sys_errlist compatibility macro definitions.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ERRLIST_COMPAT_H
+#define _ERRLIST_COMPAT_H
+
+#include <shlib-compat.h>
+
+/* Define new compat symbols for symbols  _sys_errlist, sys_errlist,
+   _sys_nerr, and sys_nerr for version VERSION with NUMBERERR times number of
+   bytes per long int size.
+   Both _sys_errlist and sys_errlist alias to _sys_errlist_internal symbol
+   (defined on errlist.c) while _sys_nerr and sys_nerr created new variable
+   with the expected size.  */
+#define DEFINE_COMPAT_ERRLIST(NUMBERERR, VERSION) 			     \
+  const int __##VERSION##_sys_nerr = NUMBERERR;				     \
+  strong_alias (__##VERSION##_sys_nerr, __##VERSION##__sys_nerr); 	     \
+  declare_symbol_alias (__ ## VERSION ## _sys_errlist, _sys_errlist_internal,\
+			object, NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH));    \
+  declare_symbol_alias (__ ## VERSION ## __sys_errlist,			     \
+			_sys_errlist_internal, object,			     \
+			NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH));	     \
+  compat_symbol (libc, __## VERSION ## _sys_nerr, sys_nerr, VERSION);	     \
+  compat_symbol (libc, __## VERSION ## __sys_nerr, _sys_nerr, VERSION);      \
+  compat_symbol (libc, __## VERSION ## _sys_errlist, sys_errlist, VERSION);  \
+  compat_symbol (libc, __## VERSION ## __sys_errlist, _sys_errlist, VERSION);\
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/errlist.def b/sysdeps/unix/sysv/linux/errlist.def
new file mode 100644
index 0000000000..39be2eba83
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/errlist.def
@@ -0,0 +1,133 @@ 
+# Used by scripts/gen-errlist.py to generate errlist.h.
+0, Success
+EPERM, Operation not permitted
+ENOENT, No such file or directory
+ESRCH, No such process
+EINTR, Interrupted system call
+EIO, Input/output error
+ENXIO, No such device or address
+E2BIG, Argument list too long
+ENOEXEC, Exec format error
+EBADF, Bad file descriptor
+ECHILD, No child processes
+EDEADLK, Resource deadlock avoided
+ENOMEM, Cannot allocate memory
+EACCES, Permission denied
+EFAULT, Bad address
+ENOTBLK, Block device required
+EBUSY, Device or resource busy
+EEXIST, File exists
+EXDEV, Invalid cross-device link
+ENODEV, No such device
+ENOTDIR, Not a directory
+EISDIR, Is a directory
+EINVAL, Invalid argument
+EMFILE, Too many open files
+ENFILE, Too many open files in system
+ENOTTY, Inappropriate ioctl for device
+ETXTBSY, Text file busy
+EFBIG, File too large
+ENOSPC, No space left on device
+ESPIPE, Illegal seek
+EROFS, Read-only file system
+EMLINK, Too many links
+EPIPE, Broken pipe
+EDOM, Numerical argument out of domain
+ERANGE, Numerical result out of range
+EAGAIN, Resource temporarily unavailable
+EINPROGRESS, Operation now in progress
+EALREADY, Operation already in progress
+ENOTSOCK, Socket operation on non-socket
+EMSGSIZE, Message too long
+EPROTOTYPE, Protocol wrong type for socket
+ENOPROTOOPT, Protocol not available
+EPROTONOSUPPORT, Protocol not supported
+ESOCKTNOSUPPORT, Socket type not supported
+EOPNOTSUPP, Operation not supported
+EPFNOSUPPORT, Protocol family not supported
+EAFNOSUPPORT, Address family not supported by protocol
+EADDRINUSE, Address already in use
+EADDRNOTAVAIL, Cannot assign requested address
+ENETDOWN, Network is down
+ENETUNREACH, Network is unreachable
+ENETRESET, Network dropped connection on reset
+ECONNABORTED, Software caused connection abort
+ECONNRESET, Connection reset by peer
+ENOBUFS, No buffer space available
+EISCONN, Transport endpoint is already connected
+ENOTCONN, Transport endpoint is not connected
+EDESTADDRREQ, Destination address required
+ESHUTDOWN, Cannot send after transport endpoint shutdown
+ETOOMANYREFS, Too many references: cannot splice
+ETIMEDOUT, Connection timed out
+ECONNREFUSED, Connection refused
+ELOOP, Too many levels of symbolic links
+ENAMETOOLONG, File name too long
+EHOSTDOWN, Host is down
+EHOSTUNREACH, No route to host
+ENOTEMPTY, Directory not empty
+EUSERS, Too many users
+EDQUOT, Disk quota exceeded
+ESTALE, Stale file handle
+EREMOTE, Object is remote
+ENOLCK, No locks available
+ENOSYS, Function not implemented
+EILSEQ, Invalid or incomplete multibyte or wide character
+EBADMSG, Bad message
+EIDRM, Identifier removed
+EMULTIHOP, Multihop attempted
+ENODATA, No data available
+ENOLINK, Link has been severed
+ENOMSG, No message of desired type
+ENOSR, Out of streams resources
+ENOSTR, Device not a stream
+EOVERFLOW, Value too large for defined data type
+EPROTO, Protocol error
+ETIME, Timer expired
+ECANCELED, Operation canceled
+EOWNERDEAD, Owner died
+ENOTRECOVERABLE, State not recoverable
+ERESTART, Interrupted system call should be restarted
+ECHRNG, Channel number out of range
+EL2NSYNC, Level 2 not synchronized
+EL3HLT, Level 3 halted
+EL3RST, Level 3 reset
+ELNRNG, Link number out of range
+EUNATCH, Protocol driver not attached
+ENOCSI, No CSI structure available
+EL2HLT, Level 2 halted
+EBADE, Invalid exchange
+EBADR, Invalid request descriptor
+EXFULL, Exchange full
+ENOANO, No anode
+EBADRQC, Invalid request code
+EBADSLT, Invalid slot
+EBFONT, Bad font file format
+ENONET, Machine is not on the network
+ENOPKG, Package not installed
+EADV, Advertise error
+ESRMNT, Srmount error
+ECOMM, Communication error on send
+EDOTDOT, RFS specific error
+ENOTUNIQ, Name not unique on network
+EBADFD, File descriptor in bad state
+EREMCHG, Remote address changed
+ELIBACC, Can not access a needed shared library
+ELIBBAD, Accessing a corrupted shared library
+ELIBSCN, .lib section in a.out corrupted
+ELIBMAX, Attempting to link in too many shared libraries
+ELIBEXEC, Cannot exec a shared library directly
+ESTRPIPE, Streams pipe error
+EUCLEAN, Structure needs cleaning
+ENOTNAM, Not a XENIX named type file
+ENAVAIL, No XENIX semaphores available
+EISNAM, Is a named type file
+EREMOTEIO, Remote I/O error
+ENOMEDIUM, No medium found
+EMEDIUMTYPE, Wrong medium type
+ENOKEY, Required key not available
+EKEYEXPIRED, Key has expired
+EKEYREVOKED, Key has been revoked
+EKEYREJECTED, Key was rejected by service
+ERFKILL, Operation not possible due to RF-kill
+EHWPOISON, Memory page has hardware error
diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
index b5098b2171..9532d207fc 100644
--- a/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/sysdeps/unix/sysv/linux/hppa/Versions
@@ -1,11 +1,5 @@ 
 libc {
-  # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
-  # When you get an error from errlist-compat.awk, you need to add a new
-  # version here.  Don't do this blindly, since this means changing the ABI
-  # for all GNU/Linux configurations.
-
   GLIBC_2.1 {
-    #errlist-compat	253
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.2 {
@@ -13,22 +7,18 @@  libc {
     getrlimit; setrlimit; getrlimit64; setrlimit64;
   }
   GLIBC_2.3 {
-    #errlist-compat	254
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.4 {
-    #errlist-compat	256
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.11 {
     fallocate64;
   }
   GLIBC_2.12 {
-    #errlist-compat	257
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.17 {
-    #errlist-compat	260
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
     prlimit64;
   }
diff --git a/sysdeps/unix/sysv/linux/hppa/errlist-compat.c b/sysdeps/unix/sysv/linux/hppa/errlist-compat.c
new file mode 100644
index 0000000000..65860d884c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/errlist-compat.c
@@ -0,0 +1,39 @@ 
+/* Linux sys_errlist compat symbol definitions.  HPPA version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errlist-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3)
+DEFINE_COMPAT_ERRLIST (253, GLIBC_2_1)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_4)
+DEFINE_COMPAT_ERRLIST (254, GLIBC_2_3)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_12)
+DEFINE_COMPAT_ERRLIST (256, GLIBC_2_4)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_17)
+DEFINE_COMPAT_ERRLIST (257, GLIBC_2_12)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_17, GLIBC_2_32)
+DEFINE_COMPAT_ERRLIST (260, GLIBC_2_17)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions
index 453f276aad..0ec82dc480 100644
--- a/sysdeps/unix/sysv/linux/mips/Versions
+++ b/sysdeps/unix/sysv/linux/mips/Versions
@@ -5,13 +5,7 @@  ld {
   }
 }
 libc {
-  # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
-  # When you get an error from errlist-compat.awk, you need to add a new
-  # version here.  Don't do this blindly, since this means changing the ABI
-  # for all GNU/Linux configurations.
-
   GLIBC_2.0 {
-    #errlist-compat	123
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     # Exception handling support functions from libgcc
@@ -28,7 +22,6 @@  libc {
     sysmips;
   }
   GLIBC_2.2 {
-    #errlist-compat	1134
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     # _*
diff --git a/bits/sys_errlist.h b/sysdeps/unix/sysv/linux/mips/errlist-compat.c
similarity index 69%
rename from bits/sys_errlist.h
rename to sysdeps/unix/sysv/linux/mips/errlist-compat.c
index 40425a74c3..b720db9244 100644
--- a/bits/sys_errlist.h
+++ b/sysdeps/unix/sysv/linux/mips/errlist-compat.c
@@ -1,5 +1,5 @@ 
-/* Declare sys_errlist and sys_nerr, or don't.  Don't version.
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Linux sys_errlist compat symbol definitions.  MIPS version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,12 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _STDIO_H
-# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead."
+#include <errlist-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+DEFINE_COMPAT_ERRLIST (123, GLIBC_2_0)
 #endif
 
-/* sys_errlist and sys_nerr are deprecated.  Use strerror instead.  */
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_32)
+DEFINE_COMPAT_ERRLIST (1134, GLIBC_2_1)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/Versions b/sysdeps/unix/sysv/linux/sparc/Versions
index f056addee6..61e57fae99 100644
--- a/sysdeps/unix/sysv/linux/sparc/Versions
+++ b/sysdeps/unix/sysv/linux/sparc/Versions
@@ -1,30 +1,20 @@ 
 libc {
-  # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
-  # When you get an error from errlist-compat.awk, you need to add a new
-  # version here.
-
   GLIBC_2.0 {
-    #errlist-compat	127
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.1 {
-    #errlist-compat	127
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.3 {
-    #errlist-compat	128
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.4 {
-    #errlist-compat	134
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.12 {
-    #errlist-compat	135
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_2.16 {
-    #errlist-compat	136
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     __getshmlba;
diff --git a/sysdeps/unix/sysv/linux/sparc/errlist-compat.c b/sysdeps/unix/sysv/linux/sparc/errlist-compat.c
new file mode 100644
index 0000000000..43fc364add
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/errlist-compat.c
@@ -0,0 +1,43 @@ 
+/* Linux sys_errlist compat symbol definitions.  Sparc version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errlist-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+DEFINE_COMPAT_ERRLIST (127, GLIBC_2_0)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3)
+DEFINE_COMPAT_ERRLIST (127, GLIBC_2_1)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_4)
+DEFINE_COMPAT_ERRLIST (128, GLIBC_2_3)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_12)
+DEFINE_COMPAT_ERRLIST (134, GLIBC_2_4)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_16)
+DEFINE_COMPAT_ERRLIST (135, GLIBC_2_12)
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_16, GLIBC_2_32)
+DEFINE_COMPAT_ERRLIST (136, GLIBC_2_16)
+#endif