public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: gdb-patches@sourceware.org, binutils@sourceware.org
Cc: "Bruno Haible" <bruno@clisp.org>,
	"Iain Sandoe" <iain@sandoe.co.uk>,
	"Arsen Arsenović" <arsen@aarsen.me>
Subject: [PATCH 0/2] Replace intl/ with out-of-tree GNU gettext
Date: Mon, 25 Sep 2023 17:13:39 +0200	[thread overview]
Message-ID: <20230925153247.908901-1-arsen@aarsen.me> (raw)

Afternoon,

This patch series replaces the old (early 2000s era, AFAICT) libintl
implementation in-tree, which relies on C constructs some compilers
(newer clang, hopefully GCC 14) refuse to compile by default with
out-of-tree gettext, in a manner similar to GMP et al.

During that work I also noticed that the .pot files fail to regenerate
with new xgettext, leading to the discovery of a regression, but also a
slight simplification that can be made in the .pot file generation:
https://savannah.gnu.org/bugs/?64490#comment4

Brunos recommendation is included.  Thanks!

I've omitted a patch that simply drops the intl/ directory from this
patchset, as it was held for moderation on the GCC ML, and I suspect the
same would happen here.  It can be seen at:
https://git.sr.ht/~arsen/binutils-gdb/commit/300747ed91e6652e4e20b876c19b3c86c75ac57f

Note that this patch series results in some new symbols in
libinproctrace.so:

  ~/binutils-bld/gdbserver$ nm -g libinproctrace.so | grep libintl
  0000000000015090 T libintl_dcgettext
  0000000000015080 T libintl_gettext
  0000000000019a90 T libintl_set_relocation_prefix

This happens because the library gets linked against libintl.a (because
it is required by ax.cc, gdbserver/ax.cc:925:(.text+0x2f8): undefined
reference to `libintl_gettext'), and so, the default visibility symbols
from libintl.a 'leak' through.  I am decently sure this was also the
case with the in-tree intl implementation, though.

Perhaps it'd be good to add a version script to this library, to be more
selective about symbols.

Tested on x86_64-pc-linux-gnu --with-included-gettext,
x86_64-portbld-freebsd13.1, x86_64-darwin21, i686-darwin9 and
aarch64-darwin21 (thanks, Iain).

Example from FreeBSD:

  [arsen@fbsd132 ~/binutils-bld/_pfx/bin]$ LANG=sr_RS.UTF-8 ./ld --version
  ГНУ лд (GNU Binutils) 2.41.50.20230924
  Copyright (C) 2023 Free Software Foundation, Inc.
  Овај програм је слободан софтвер; можете да га расподељујете под одредбама
  Гнуове опште јавне лиценце издања 3 или (према вашем мишљењу) било ког
  новијег издања. Овај програм нема никакву гаранцију.
  [arsen@fbsd132 ~/binutils-bld/_pfx/bin]$ LANG=fr_FR.UTF-8 ./as --version
  Assembleur GNU (GNU Binutils) 2.41.50.20230924
  Copyright © 2023 Free Software Foundation, Inc.
  Ce logiciel est libre; vous pouvez le redistribuer selon les termes de la
  version 3 de la licence GNU General Public License ou suivante.
  Ce programme n'est couvert par AUCUNE garantie.
  Cet assembleur a été configuré pour la cible « x86_64-unknown-freebsd13.2 ».
  [arsen@fbsd132 ~/binutils-bld/_pfx/bin]$ LANG=fr_FR.UTF-8 ./gprof --version
  GNU gprof (GNU Binutils) 2.41.50.20230924
  Basé sur BSD gprof, copyright 1983 Regents de l'Université de Californie.
  Ce logiciel est libre. AUCUNE garantie ne lui est apportée.

A similar patch was also sent to the GCC developers for evaluation.  We
should coordinate to merge them around the same time, so that the same
code is merged.

Thanks in advance, have a lovely day.

Arsen Arsenović (2):
  *: add modern gettext support
  *: suppress xgettext 0.22 charset name error

 .gitignore               |    1 +
 Makefile.def             |   72 +-
 Makefile.in              | 1612 +++++++++++-----------
 bfd/aclocal.m4           |   10 +-
 bfd/configure            | 1980 ++++++++++++++++++++++++++-
 bfd/configure.ac         |    2 +-
 bfd/po/Make-in           |    8 +-
 binutils/aclocal.m4      |    2 +
 binutils/configure       | 2546 ++++++++++++++++++++++++++---------
 binutils/po/Make-in      |    5 +-
 config/gettext-sister.m4 |   35 +-
 config/gettext.m4        |  357 +++--
 config/iconv.m4          |  313 +++--
 config/intlmacosx.m4     |   65 +
 configure                |   44 +-
 configure.ac             |   44 +-
 gas/aclocal.m4           |    6 +
 gas/configure            | 1980 ++++++++++++++++++++++++++-
 gas/po/Make-in           |    5 +-
 gdb/acinclude.m4         |    3 +-
 gdb/aclocal.m4           |    5 +
 gdb/configure            | 2739 ++++++++++++++++++++++++++++----------
 gdb/configure.ac         |    3 +-
 gdbserver/Makefile.in    |    3 +-
 gdbserver/aclocal.m4     |    6 +
 gdbserver/configure      | 1817 ++++++++++++++++++++++++-
 gdbsupport/Makefile.am   |    1 +
 gdbsupport/aclocal.m4    |    6 +
 gdbsupport/configure     | 2109 ++++++++++++++++++++++++++---
 gold/aclocal.m4          |    8 +-
 gold/configure           | 1977 ++++++++++++++++++++++++++-
 gold/po/Make-in          |    5 +-
 gprof/aclocal.m4         |    6 +
 gprof/configure          | 1980 ++++++++++++++++++++++++++-
 gprof/po/Make-in         |    5 +-
 ld/aclocal.m4            |    6 +
 ld/configure             | 1980 ++++++++++++++++++++++++++-
 ld/po/Make-in            |    8 +-
 libctf/Makefile.am       |    2 +
 libctf/aclocal.m4        |    9 +
 libctf/configure         | 1952 ++++++++++++++++++++++++++-
 libctf/configure.ac      |    2 +-
 opcodes/aclocal.m4       |    6 +
 opcodes/configure        | 1980 ++++++++++++++++++++++++++-
 opcodes/configure.ac     |    2 +-
 opcodes/po/Make-in       |    5 +-
 46 files changed, 22750 insertions(+), 2962 deletions(-)
 create mode 100644 config/intlmacosx.m4

-- 
2.42.0


             reply	other threads:[~2023-09-25 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 15:13 Arsen Arsenović [this message]
2023-09-25 15:13 ` [PATCH 1/2] *: add modern gettext support Arsen Arsenović
2023-09-25 15:13 ` [PATCH 2/2] *: suppress xgettext 0.22 charset name error Arsen Arsenović
2023-09-25 15:46   ` Andreas Schwab
2023-09-25 15:55     ` Arsen Arsenović
2023-09-25 19:11 ` [PATCH 0/2] Replace intl/ with out-of-tree GNU gettext Kevin Buettner
2023-09-25 19:43   ` Arsen Arsenović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230925153247.908901-1-arsen@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=binutils@sourceware.org \
    --cc=bruno@clisp.org \
    --cc=gdb-patches@sourceware.org \
    --cc=iain@sandoe.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).