From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050:0:465::103]) by sourceware.org (Postfix) with ESMTPS id 924A63858CDA; Mon, 25 Sep 2023 15:33:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 924A63858CDA Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4RvRhq0mRYz9sT8; Mon, 25 Sep 2023 17:32:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1695655979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0rF3nqpWzM4zAidPRvn5iTLBhlsxoQzqFzk6/ObOno=; b=NBqc1wXgYV3AioLne6bI0ASqGDnfotRKnI9q8xfZifoRV1jVYGf+3HPDh35p9DUojNEHUf WEH9zpLfMItR7D5d0xEvNzgu5d8wnNQGJpra+K/BldXYLF8fBrniVTCd0V8DrYtgaOAgBG N8bDYD9MqO7RK9qdE72KT6xquH4NuswZYkiM44lSNZnJj6AZW6AW5Y0NN4vC4yxNoyYTo9 JeztDwUSRMKoxQu60229K8Wz26AJpVCLeL6Ud5ehaO2ip7+9ugjHy6rzrVNKEs2NRrMNvl EfNMbdGsnu3ymGaKjAkNMw2lqdHJp4gGncPp5te5wI/hSm9nbGY3j66lUiD7+w== From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= To: gdb-patches@sourceware.org, binutils@sourceware.org Cc: Bruno Haible , Iain Sandoe , =?UTF-8?q?Arsen=20Arsenovi=C4=87?= Subject: [PATCH 0/2] Replace intl/ with out-of-tree GNU gettext Date: Mon, 25 Sep 2023 17:13:39 +0200 Message-ID: <20230925153247.908901-1-arsen@aarsen.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_INFOUSMEBIZ,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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