[PATCH v17 2/9] posix: let the getopt caller set the translation context

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Nov 19 14:23:58 GMT 2025



On 18/11/25 18:22, Vivien Kraus wrote:
> 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.

I think the 'mandatory' is confusing here without adding this refers
to the translation itself (users might think one should now sets it
to NULL to explicit disable translations).

> 
> 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

I think it should be 'looks for'.

> +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. */

Double space after period.

> +
> +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 *))

Indentation seems off here (tabs before, whitespace now).

>  {
>    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)

No implicit checks.

> +    {
> +      full_msgid = malloc (strlen (context) + 1 /* ^D */ + strlen (msgid) + 1);

Shouldnt't it check the malloc return here?

> +      if (msgid)

Why malloc/free if you can just return NULL here ?

> +        {
> +          strcpy (full_msgid, context);
> +          full_msgid[strlen (context)] = '\004';
> +          strcpy (full_msgid + strlen (context) + 1, msgid);

I think you can simpify the code here to avoid the multiple strlen calls:

  size_t context_len = strlen (context);
  size_t msgif_len = strlen (msgid);
  full_msgid = malloc (context_len + 1 + msgid_len + 1);
  if (full_msgid == NULL)
    return NULL;
  memcpy (full_msgid, context, context_len);
  full_msgid[context_len˜= '\004';
  memcpy (full_msgid + context_len +1, msgid, msgid + 1);


> +          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 6099178c9e..d1c441a8a1 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -2673,6 +2673,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_create F
> diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
> index 1aab058a9f..a8acbe9471 100644
> --- a/sysdeps/mach/hurd/x86_64/libc.abilist
> +++ b/sysdeps/mach/hurd/x86_64/libc.abilist
> @@ -2351,6 +2351,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_create F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 2f049a4b41..1e0513f12c 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2771,4 +2771,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index bebfad9de2..d12d10ebb5 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -3118,6 +3118,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
> index d6341e98e7..c97274a7be 100644
> --- a/sysdeps/unix/sysv/linux/arc/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
> @@ -2532,4 +2532,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index a9076eb320..fd162d2f9e 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -2824,6 +2824,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index d3be53ea25..e301318258 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -2821,6 +2821,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index e110766976..27b0b81cfe 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2808,4 +2808,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index a079e7d1a0..3067baf9b6 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2845,6 +2845,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 421b3c742b..4835a0fb31 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -3028,6 +3028,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
> index 1d7a1de570..e6998b2755 100644
> --- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
> @@ -2292,4 +2292,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index b512384ed0..65f549ded4 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -2804,6 +2804,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 223e4825ab..8c916a2fc4 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2971,6 +2971,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index f314f55e1f..987a22a2d8 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2857,4 +2857,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index 8a33db2cb2..750543455e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2854,4 +2854,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 3f704bd87d..2a06dd4b62 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2934,6 +2934,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 633d031c72..729427d1f5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2932,6 +2932,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 8b8e5af806..8fbfee4e4b 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2940,6 +2940,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index f45d5075fd..56d2710038 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2842,6 +2842,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
> index 96b056d14a..0a2df2da16 100644
> --- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
> @@ -2282,4 +2282,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 6420f23d06..88caad6f7d 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -3161,6 +3161,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 9a2a258e02..da49982d8b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -3206,6 +3206,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index 6a20d8d031..2172b1da70 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2915,6 +2915,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index c0fa82e6a2..945136a977 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2991,4 +2991,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> index 5c46dcacdc..21f0a88d41 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
> @@ -2535,4 +2535,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 4ce2007c56..9dd988a92e 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2735,4 +2735,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 9a672c6a4c..a1bff04a5a 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -3159,6 +3159,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 1926e675ca..9ac68b7b00 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2952,6 +2952,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index b3510af9ef..1b9ce36b70 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2851,6 +2851,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index fc1fea412a..ed9c1856d7 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2848,6 +2848,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index fce9f948b7..8fa6f79ba4 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -3182,6 +3182,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 9d4721c16e..0567d53579 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2818,6 +2818,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index a836a57426..a2fb584c25 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2767,6 +2767,7 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x8
>  GLIBC_2.43 umaxabs F
>  GLIBC_2.5 __readlinkat_chk F
>  GLIBC_2.5 inet6_opt_append F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index aecce5bbc5..aece7b5279 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2786,4 +2786,5 @@ GLIBC_2.43 __memset_explicit_chk F
>  GLIBC_2.43 memalignment F
>  GLIBC_2.43 memset_explicit F
>  GLIBC_2.43 mseal F
> +GLIBC_2.43 optctxt D 0x4
>  GLIBC_2.43 umaxabs F



More information about the Libc-alpha mailing list