[PATCH v15 2/9] posix: let the getopt caller set the translation context
Vivien Kraus
vivien@planete-kraus.eu
Sat Oct 25 08:28:58 GMT 2025
Option names are typically one word, so they could be translated
differently in different parts of the program. The use of a context
lets the translator pick the most appropriate translation when used in
the command-line.
Another possibility would be to prepend two dashes to the option name
before translation, such that it would be obvious this is the
command-line option name. However, it would be difficult to mark this
string for translation (to be processed by xgettext).
This patch creates a new global variable / reentrant state field,
optctxt, a pointer, so that the caller can override it. It is
mandatory: if developers do not want to have option name translation,
they just have to never set optctxt, or set it to NULL.
pgettext_expr is not available yet, so we use a custom function to
combine the context and the long option name, and discard the context
if no translation was performed.
---
manual/getopt.texi | 14 +++++-
posix/Versions | 3 ++
posix/bits/getopt_ext.h | 7 +++
posix/getopt.c | 27 +++++++-----
posix/getopt1.c | 43 +++++++++++++++++--
posix/getopt_int.h | 6 ++-
posix/tstgetoptl.c | 6 ++-
posix/tstgetoptl.po | 2 +
sysdeps/mach/hurd/i386/libc.abilist | 1 +
sysdeps/mach/hurd/x86_64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arc/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 +
sysdeps/unix/sysv/linux/csky/libc.abilist | 1 +
sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 +
sysdeps/unix/sysv/linux/i386/libc.abilist | 1 +
.../sysv/linux/loongarch/lp64/libc.abilist | 1 +
.../sysv/linux/m68k/coldfire/libc.abilist | 1 +
.../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 +
.../sysv/linux/microblaze/be/libc.abilist | 1 +
.../sysv/linux/microblaze/le/libc.abilist | 1 +
.../sysv/linux/mips/mips32/fpu/libc.abilist | 1 +
.../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 +
.../sysv/linux/mips/mips64/n32/libc.abilist | 1 +
.../sysv/linux/mips/mips64/n64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/or1k/libc.abilist | 1 +
.../linux/powerpc/powerpc32/fpu/libc.abilist | 1 +
.../powerpc/powerpc32/nofpu/libc.abilist | 1 +
.../linux/powerpc/powerpc64/be/libc.abilist | 1 +
.../linux/powerpc/powerpc64/le/libc.abilist | 1 +
.../unix/sysv/linux/riscv/rv32/libc.abilist | 1 +
.../unix/sysv/linux/riscv/rv64/libc.abilist | 1 +
.../unix/sysv/linux/s390/s390-32/libc.abilist | 1 +
.../unix/sysv/linux/s390/s390-64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 +
.../sysv/linux/sparc/sparc32/libc.abilist | 1 +
.../sysv/linux/sparc/sparc64/libc.abilist | 1 +
.../unix/sysv/linux/x86_64/64/libc.abilist | 1 +
.../unix/sysv/linux/x86_64/x32/libc.abilist | 1 +
42 files changed, 124 insertions(+), 18 deletions(-)
diff --git a/manual/getopt.texi b/manual/getopt.texi
index da9df5225a..65e24f1143 100644
--- a/manual/getopt.texi
+++ b/manual/getopt.texi
@@ -53,6 +53,16 @@ This variable is set by @code{getopt} to point at the value of the
option argument, for those options that accept arguments.
@end deftypevar
+@deftypevar {const char *} optctxt
+In order to match translated option names, @code{getopt} looks the
+names in the current textdomain. Since option names may be short
+words instead of long sentences, they may have different translations
+in other places of the program. @xref{Contexts, , Using contexts for
+solving ambiguities, gettext, the GNU Gettext manual}, for more
+information. If this is @code{NULL}, then the translated option names
+will not be processed.
+@end deftypevar
+
@deftypefun int getopt (int @var{argc}, char *const *@var{argv}, const char *@var{options})
@standards{POSIX.2, unistd.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:getopt} @mtsenv{}}@asunsafe{@ascuheap{} @ascuintl{} @asulock{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}}
@@ -224,7 +234,9 @@ The @code{struct option} structure has these fields:
@item const char *name
This field is the name of the option. It is a string. In order for
@command{getopt_long} to accept either the long option name or its
-translated form, you should mark this string for translation.
+translated form, you should mark this string for translation with a
+translation context, and set @code{optctxt} to the translation
+context.
@item int has_arg
This field says whether the option takes an argument. It is an integer,
diff --git a/posix/Versions b/posix/Versions
index 0624d24bcc..5873e8ec56 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -159,6 +159,9 @@ libc {
GLIBC_2.35 {
posix_spawn_file_actions_addtcsetpgrp_np;
}
+ GLIBC_2.43 {
+ optctxt;
+ }
GLIBC_PRIVATE {
__libc_fork; __libc_pread; __libc_pwrite;
__nanosleep_nocancel; __pause_nocancel;
diff --git a/posix/bits/getopt_ext.h b/posix/bits/getopt_ext.h
index 42be8ec38e..07d9407b64 100644
--- a/posix/bits/getopt_ext.h
+++ b/posix/bits/getopt_ext.h
@@ -26,6 +26,13 @@
__BEGIN_DECLS
+#ifdef __USE_GNU
+/* Callers store the translation context in which to retrieve option
+ names. If unset, the option names will not be translated. */
+
+extern const char *optctxt;
+#endif
+
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of 'struct option' terminated by an element containing a name which is
diff --git a/posix/getopt.c b/posix/getopt.c
index 9540821e1f..28f0be03f8 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -182,17 +182,19 @@ exchange (char **argv, struct _getopt_data *d)
d->__last_nonopt = d->optind;
}
-/* Return 1 iff a translation for opt_name has been found and it
- matches the substring from argument, length argument_length.
+/* Return 1 iff translation_context is not NULL, a translation for
+ opt_name has been found and it matches the substring from argument,
+ length argument_length.
*/
static const int
-match_translated_option_name (char *(*translate) (const char *msgid),
+match_translated_option_name (char *(*translate) (const char *, const char *),
const char *argument, size_t argument_length,
+ const char *translation_context,
const char *opt_name)
{
const char *translated = opt_name;
if (translate)
- translated = translate (opt_name);
+ translated = translate (translation_context, opt_name);
return (!strncmp (translated, argument, argument_length)
&& argument_length == strlen (translated));
}
@@ -210,7 +212,7 @@ process_long_option (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind,
int long_only, struct _getopt_data *d,
int print_errors, const char *prefix,
- char *(*translate) (const char *msgid))
+ char *(*translate) (const char *, const char *))
{
char *nameend;
size_t namelen;
@@ -241,7 +243,9 @@ process_long_option (int argc, char **argv, const char *optstring,
/* Didn't find an exact match, try with translated option
names. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (match_translated_option_name (translate, d->__nextchar, namelen, p->name))
+ if (match_translated_option_name (translate,
+ d->__nextchar, namelen,
+ d->optctxt, p->name))
{
/* Exact match found with translation. */
pfound = p;
@@ -365,7 +369,7 @@ process_long_option (int argc, char **argv, const char *optstring,
/* We have found a matching long option. Consume it. */
d->optind++;
d->__nextchar = NULL;
- translated_option_name = translate (pfound->name);
+ translated_option_name = translate (d->optctxt, pfound->name);
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
@@ -531,7 +535,7 @@ int
_getopt_internal_r (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind,
int long_only, struct _getopt_data *d, int posixly_correct,
- char *(*translate) (const char *msgid))
+ char *(*translate) (const char *, const char *))
{
int print_errors = d->opterr;
@@ -766,12 +770,15 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int
_getopt_internal (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind, int long_only,
- int posixly_correct, char *(*translate) (const char *))
+ int posixly_correct,
+ char *(*translate) (const char *, const char *),
+ const char *ctxt)
{
int result;
getopt_data.optind = optind;
getopt_data.opterr = opterr;
+ getopt_data.optctxt = ctxt;
result = _getopt_internal_r (argc, argv, optstring, longopts,
longind, long_only, &getopt_data,
@@ -794,7 +801,7 @@ _getopt_internal (int argc, char **argv, const char *optstring,
{ \
return _getopt_internal (argc, (char **)argv, optstring, \
NULL, NULL, 0, POSIXLY_CORRECT, \
- NULL); \
+ NULL, NULL); \
}
#ifdef _LIBC
diff --git a/posix/getopt1.c b/posix/getopt1.c
index 6bf0087344..28d090019d 100644
--- a/posix/getopt1.c
+++ b/posix/getopt1.c
@@ -26,13 +26,48 @@
#include "getopt.h"
#include "getopt_int.h"
+#include <stdlib.h>
+#include <string.h>
+
+/* Callers store an optional context to enable option name
+ translation. */
+
+const char *optctxt = NULL;
+
+/* FIXME: use pgettext_expr. */
+static char *
+do_translate (const char *context, const char *msgid)
+{
+ char *full_msgid;
+ const char *translated = msgid;
+
+ if (context)
+ {
+ full_msgid = malloc (strlen (context) + 1 /* ^D */ + strlen (msgid) + 1);
+ if (msgid)
+ {
+ strcpy (full_msgid, context);
+ full_msgid[strlen (context)] = '\004';
+ strcpy (full_msgid + strlen (context) + 1, msgid);
+ translated = __dcgettext (NULL, full_msgid, LC_MESSAGES);
+ if (!strcmp (translated, full_msgid))
+ {
+ translated = msgid;
+ }
+ }
+ free (full_msgid);
+ }
+ else
+ translated = msgid;
+ return (char *) translated;
+}
int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 0, 0, gettext);
+ opt_index, 0, 0, do_translate, optctxt);
}
int
@@ -41,7 +76,7 @@ _getopt_long_r (int argc, char **argv, const char *options,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 0, d, 0, gettext);
+ 0, d, 0, do_translate);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -55,7 +90,7 @@ getopt_long_only (int argc, char *__getopt_argv_const *argv,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 1, 0, gettext);
+ opt_index, 1, 0, do_translate, optctxt);
}
int
@@ -64,7 +99,7 @@ _getopt_long_only_r (int argc, char **argv, const char *options,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 1, d, 0, gettext);
+ 1, d, 0, do_translate);
}
diff --git a/posix/getopt_int.h b/posix/getopt_int.h
index b15b21256a..1d091979c3 100644
--- a/posix/getopt_int.h
+++ b/posix/getopt_int.h
@@ -29,7 +29,8 @@ extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct,
- char *(*translate) (const char *msgid));
+ char *(*translate) (const char *, const char *),
+ const char *__optctxt);
/* Reentrant versions which can handle parsing multiple argument
@@ -71,6 +72,7 @@ struct _getopt_data
int opterr;
int optopt;
char *optarg;
+ const char *optctxt;
/* Internal members. */
@@ -107,7 +109,7 @@ extern int _getopt_internal_r (int ___argc, char **___argv,
const struct option *__longopts, int *__longind,
int __long_only, struct _getopt_data *__data,
int __posixly_correct,
- char *(*translate) (const char *msgid));
+ char *(*translate) (const char *, const char *));
extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts,
diff --git a/posix/tstgetoptl.c b/posix/tstgetoptl.c
index f880cf71e5..5ff1ba75c4 100644
--- a/posix/tstgetoptl.c
+++ b/posix/tstgetoptl.c
@@ -32,6 +32,8 @@
precedence over translated options, by translated "optional" as
"required". */
+#define TRANSLATION_CONTEXT "command-line option"
+
static int
prepare_localedir (void)
{
@@ -48,7 +50,7 @@ prepare_localedir (void)
return -1;
}
/* Check that the catalog is OK: */
- if (strcmp (gettext ("color"), "colour") != 0)
+ if (strcmp (gettext (TRANSLATION_CONTEXT "\004" "color"), "colour") != 0)
{
fputs ("The mo file does not work.\n", stderr);
return -1;
@@ -59,6 +61,7 @@ prepare_localedir (void)
int
main (int argc, char **argv)
{
+ static const char *translation_context = TRANSLATION_CONTEXT;
static const struct option options[] =
{
{"required", required_argument, NULL, 'r'},
@@ -85,6 +88,7 @@ main (int argc, char **argv)
fputs ("Error while setting up localedir.\n", stderr);
return 1;
}
+ optctxt = translation_context;
while ((c = getopt_long (argc, argv, "abc:", options, NULL)) >= 0)
switch (c)
{
diff --git a/posix/tstgetoptl.po b/posix/tstgetoptl.po
index 25cd595790..e060c0d6e3 100644
--- a/posix/tstgetoptl.po
+++ b/posix/tstgetoptl.po
@@ -16,10 +16,12 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: xxx.c:yy
+msgctxt "command-line option"
msgid "color"
msgstr "colour"
# This is to make sure the translator cannot redirect options.
#: xxx.c:yy
+msgctxt "command-line option"
msgid "optional"
msgstr "required"
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index a9d0e625af..0b10aa6dd0 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2665,6 +2665,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.43 pthread_cancel F
GLIBC_2.43 pthread_clockjoin_np F
GLIBC_2.43 pthread_detach F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index 2440c8f669..837465ecee 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -2346,6 +2346,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.43 pthread_cancel F
GLIBC_2.43 pthread_clockjoin_np F
GLIBC_2.43 pthread_detach F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index cd7d7e7f3f..7f03b14385 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2770,3 +2770,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index c772aa126c..4b55299d2d 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3117,6 +3117,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 773a94f23a..03f4274ab5 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2531,3 +2531,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index b6767ebce3..f09d94e7d9 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2823,6 +2823,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 34c59b8f0f..4f9d7ac6fc 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2820,6 +2820,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 045f0daafc..8f5efdfb0c 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2807,3 +2807,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 3e868398ba..80ac4f8811 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2844,6 +2844,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 4ac5171f46..4f6851ba38 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -3027,6 +3027,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
index b2f68316de..0843dbd192 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
@@ -2291,3 +2291,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index feb34915a1..90ffa80b0b 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2803,6 +2803,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index c497daba54..a8c8d21ee3 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2970,6 +2970,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index e8b15834e2..c3d556c7b0 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2856,3 +2856,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 8dc0f9d54f..72b29eabd7 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2853,3 +2853,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 53950e67d9..c1bad577ed 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2933,6 +2933,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index b60839335e..08fa1a2554 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2931,6 +2931,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ed12fb7352..3166f79a56 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2939,6 +2939,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 6ac6778e65..7578ac4f2e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2841,6 +2841,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index 7639a50bc4..d9b64af64e 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -2281,3 +2281,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 07171e7f6f..c389d799bc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3160,6 +3160,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 8cadb158d3..5d6e1ceb34 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3205,6 +3205,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index af449c5420..ee7e37ee09 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2914,6 +2914,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 4ae1fd8477..d559505b6a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2990,3 +2990,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index 42a37e3e84..07ed659556 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2534,3 +2534,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 66561593df..c7b5715904 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2734,3 +2734,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 99090f39a2..88f0e445f7 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3158,6 +3158,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 8b37af8f76..a4e0e67ada 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2951,6 +2951,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index db85b97e47..a90e95a7bd 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2850,6 +2850,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 733d6aaffa..cc73a43c03 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2847,6 +2847,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 85e15e34c1..c113fa766e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3181,6 +3181,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index fb90d0ab15..e73de156ab 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2817,6 +2817,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index aa3cdd6c69..19d2e87d13 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2766,6 +2766,7 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x8
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 1aeb3429c7..0d3049bccd 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2785,3 +2785,4 @@ GLIBC_2.42 ullabs F
GLIBC_2.43 __memset_explicit_chk F
GLIBC_2.43 memalignment F
GLIBC_2.43 memset_explicit F
+GLIBC_2.43 optctxt D 0x4
--
2.34.1
More information about the Libc-alpha
mailing list