public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
@ 2023-11-02  8:27 Arsen Arsenović
  2023-11-02  8:27 ` [PATCH v3 1/2] intl: remove, in favor of out-of-tree gettext Arsen Arsenović
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-02  8:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Iain Sandoe, Bruno Haible, Arsen Arsenović

Morning!

This patch is a rebase and slight wording tweak of
https://inbox.sourceware.org/20231006140501.3370874-1-arsen@aarsen.me

Changes since v2:
- Elaborate on the libintl requirement on non-glibc hosts, per Andrews
  request

Range diff since v2 (since it seems sufficiently readable here):
@@ gcc/doc/install.texi: which lets GCC output diagnostics in languages
  English.  Native Language Support is enabled by default if not doing a
  canadian cross build.  The @option{--disable-nls} option disables NLS@.
  
++Note that this functionality requires either libintl (provided by GNU
++gettext) or C standard library that contains support for gettext (such
++as the GNU C Library).
++@xref{with-included-gettext,,--with-included-gettext} for more
++information on the conditions required to get gettext support.
++
 +@item --with-libintl-prefix=@var{dir}
 +@itemx --without-libintl-prefix
 +Searches for libintl in @file{@var{dir}/include} and
@@ gcc/doc/install.texi: which lets GCC output diagnostics in languages
 +Specifies the type of library to search for when looking for libintl.
 +@var{type} can be one of @code{auto}, @code{static} or @code{shared}.
 +
++@anchor{with-included-gettext}
  @item --with-included-gettext


OK for trunk?  (granted that a regstrap + hand-test for working
localization passes - build's ongoing asynchronously)

Thanks in advance, have a lovely day.

Arsen Arsenović (2):
  intl: remove, in favor of out-of-tree gettext
  *: add modern gettext

 .gitignore                     |    1 +
 Makefile.def                   |   72 +-
 Makefile.in                    | 1612 +++----
 config/gettext-sister.m4       |   35 +-
 config/gettext.m4              |  357 +-
 config/iconv.m4                |  313 +-
 config/intlmacosx.m4           |   69 +
 configure                      |   44 +-
 configure.ac                   |   44 +-
 contrib/download_prerequisites |    2 +
 contrib/prerequisites.md5      |    1 +
 contrib/prerequisites.sha512   |    1 +
 gcc/Makefile.in                |    8 +-
 gcc/aclocal.m4                 |    4 +
 gcc/configure                  | 2001 +++++++-
 gcc/doc/install.texi           |   72 +-
 intl/ChangeLog                 |  306 --
 intl/Makefile.in               |  264 -
 intl/README                    |   21 -
 intl/VERSION                   |    1 -
 intl/aclocal.m4                |   33 -
 intl/bindtextdom.c             |  374 --
 intl/config.h.in               |  280 --
 intl/config.intl.in            |   12 -
 intl/configure                 | 8288 --------------------------------
 intl/configure.ac              |  108 -
 intl/dcgettext.c               |   59 -
 intl/dcigettext.c              | 1238 -----
 intl/dcngettext.c              |   60 -
 intl/dgettext.c                |   60 -
 intl/dngettext.c               |   62 -
 intl/eval-plural.h             |  114 -
 intl/explodename.c             |  192 -
 intl/finddomain.c              |  195 -
 intl/gettext.c                 |   64 -
 intl/gettextP.h                |  224 -
 intl/gmo.h                     |  148 -
 intl/hash-string.h             |   59 -
 intl/intl-compat.c             |  151 -
 intl/l10nflist.c               |  453 --
 intl/libgnuintl.h              |  341 --
 intl/loadinfo.h                |  156 -
 intl/loadmsgcat.c              | 1322 -----
 intl/localcharset.c            |  398 --
 intl/localcharset.h            |   42 -
 intl/locale.alias              |   78 -
 intl/localealias.c             |  419 --
 intl/localename.c              |  772 ---
 intl/log.c                     |  104 -
 intl/ngettext.c                |   68 -
 intl/osdep.c                   |   24 -
 intl/plural-config.h           |    1 -
 intl/plural-exp.c              |  156 -
 intl/plural-exp.h              |  132 -
 intl/plural.c                  | 1540 ------
 intl/plural.y                  |  434 --
 intl/relocatable.c             |  439 --
 intl/relocatable.h             |   67 -
 intl/textdomain.c              |  142 -
 libcpp/aclocal.m4              |    5 +
 libcpp/configure               | 2139 ++++++++-
 libstdc++-v3/configure         |  727 +--
 62 files changed, 5467 insertions(+), 21441 deletions(-)
 create mode 100644 config/intlmacosx.m4
 delete mode 100644 intl/ChangeLog
 delete mode 100644 intl/Makefile.in
 delete mode 100644 intl/README
 delete mode 100644 intl/VERSION
 delete mode 100644 intl/aclocal.m4
 delete mode 100644 intl/bindtextdom.c
 delete mode 100644 intl/config.h.in
 delete mode 100644 intl/config.intl.in
 delete mode 100755 intl/configure
 delete mode 100644 intl/configure.ac
 delete mode 100644 intl/dcgettext.c
 delete mode 100644 intl/dcigettext.c
 delete mode 100644 intl/dcngettext.c
 delete mode 100644 intl/dgettext.c
 delete mode 100644 intl/dngettext.c
 delete mode 100644 intl/eval-plural.h
 delete mode 100644 intl/explodename.c
 delete mode 100644 intl/finddomain.c
 delete mode 100644 intl/gettext.c
 delete mode 100644 intl/gettextP.h
 delete mode 100644 intl/gmo.h
 delete mode 100644 intl/hash-string.h
 delete mode 100644 intl/intl-compat.c
 delete mode 100644 intl/l10nflist.c
 delete mode 100644 intl/libgnuintl.h
 delete mode 100644 intl/loadinfo.h
 delete mode 100644 intl/loadmsgcat.c
 delete mode 100644 intl/localcharset.c
 delete mode 100644 intl/localcharset.h
 delete mode 100644 intl/locale.alias
 delete mode 100644 intl/localealias.c
 delete mode 100644 intl/localename.c
 delete mode 100644 intl/log.c
 delete mode 100644 intl/ngettext.c
 delete mode 100644 intl/osdep.c
 delete mode 100644 intl/plural-config.h
 delete mode 100644 intl/plural-exp.c
 delete mode 100644 intl/plural-exp.h
 delete mode 100644 intl/plural.c
 delete mode 100644 intl/plural.y
 delete mode 100644 intl/relocatable.c
 delete mode 100644 intl/relocatable.h
 delete mode 100644 intl/textdomain.c

-- 
2.42.0


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v3 1/2] intl: remove, in favor of out-of-tree gettext
  2023-11-02  8:27 [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
@ 2023-11-02  8:27 ` Arsen Arsenović
  2023-11-02  8:45 ` [PATCH v3 2/2] *: add modern gettext Arsen Arsenović
  2023-11-10 10:37 ` [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Richard Biener
  2 siblings, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-02  8:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Iain Sandoe, Bruno Haible, Arsen Arsenović

ChangeLog:

	* intl/*: Remove.
---
 intl/ChangeLog       |  306 --
 intl/Makefile.in     |  264 --
 intl/README          |   21 -
 intl/VERSION         |    1 -
 intl/aclocal.m4      |   33 -
 intl/bindtextdom.c   |  374 --
 intl/config.h.in     |  280 --
 intl/config.intl.in  |   12 -
 intl/configure       | 8288 ------------------------------------------
 intl/configure.ac    |  108 -
 intl/dcgettext.c     |   59 -
 intl/dcigettext.c    | 1238 -------
 intl/dcngettext.c    |   60 -
 intl/dgettext.c      |   60 -
 intl/dngettext.c     |   62 -
 intl/eval-plural.h   |  114 -
 intl/explodename.c   |  192 -
 intl/finddomain.c    |  195 -
 intl/gettext.c       |   64 -
 intl/gettextP.h      |  224 --
 intl/gmo.h           |  148 -
 intl/hash-string.h   |   59 -
 intl/intl-compat.c   |  151 -
 intl/l10nflist.c     |  453 ---
 intl/libgnuintl.h    |  341 --
 intl/loadinfo.h      |  156 -
 intl/loadmsgcat.c    | 1322 -------
 intl/localcharset.c  |  398 --
 intl/localcharset.h  |   42 -
 intl/locale.alias    |   78 -
 intl/localealias.c   |  419 ---
 intl/localename.c    |  772 ----
 intl/log.c           |  104 -
 intl/ngettext.c      |   68 -
 intl/osdep.c         |   24 -
 intl/plural-config.h |    1 -
 intl/plural-exp.c    |  156 -
 intl/plural-exp.h    |  132 -
 intl/plural.c        | 1540 --------
 intl/plural.y        |  434 ---
 intl/relocatable.c   |  439 ---
 intl/relocatable.h   |   67 -
 intl/textdomain.c    |  142 -
 43 files changed, 19401 deletions(-)
 delete mode 100644 intl/ChangeLog
 delete mode 100644 intl/Makefile.in
 delete mode 100644 intl/README
 delete mode 100644 intl/VERSION
 delete mode 100644 intl/aclocal.m4
 delete mode 100644 intl/bindtextdom.c
 delete mode 100644 intl/config.h.in
 delete mode 100644 intl/config.intl.in
 delete mode 100755 intl/configure
 delete mode 100644 intl/configure.ac
 delete mode 100644 intl/dcgettext.c
 delete mode 100644 intl/dcigettext.c
 delete mode 100644 intl/dcngettext.c
 delete mode 100644 intl/dgettext.c
 delete mode 100644 intl/dngettext.c
 delete mode 100644 intl/eval-plural.h
 delete mode 100644 intl/explodename.c
 delete mode 100644 intl/finddomain.c
 delete mode 100644 intl/gettext.c
 delete mode 100644 intl/gettextP.h
 delete mode 100644 intl/gmo.h
 delete mode 100644 intl/hash-string.h
 delete mode 100644 intl/intl-compat.c
 delete mode 100644 intl/l10nflist.c
 delete mode 100644 intl/libgnuintl.h
 delete mode 100644 intl/loadinfo.h
 delete mode 100644 intl/loadmsgcat.c
 delete mode 100644 intl/localcharset.c
 delete mode 100644 intl/localcharset.h
 delete mode 100644 intl/locale.alias
 delete mode 100644 intl/localealias.c
 delete mode 100644 intl/localename.c
 delete mode 100644 intl/log.c
 delete mode 100644 intl/ngettext.c
 delete mode 100644 intl/osdep.c
 delete mode 100644 intl/plural-config.h
 delete mode 100644 intl/plural-exp.c
 delete mode 100644 intl/plural-exp.h
 delete mode 100644 intl/plural.c
 delete mode 100644 intl/plural.y
 delete mode 100644 intl/relocatable.c
 delete mode 100644 intl/relocatable.h
 delete mode 100644 intl/textdomain.c

patch body dropped - it is just removals

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v3 2/2] *: add modern gettext
  2023-11-02  8:27 [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
  2023-11-02  8:27 ` [PATCH v3 1/2] intl: remove, in favor of out-of-tree gettext Arsen Arsenović
@ 2023-11-02  8:45 ` Arsen Arsenović
  2023-11-10 10:37 ` [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Richard Biener
  2 siblings, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-02  8:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: Iain Sandoe, Bruno Haible, Arsen Arsenović

This patch updates gettext.m4 and related .m4 files and adds
gettext-runtime as a gmp/mpfr/... style host library, allowing newer
libintl to be used.

This patch /does not/ add build-time tools required for
internationalizing (msgfmt et al), instead, it just updates the runtime
library.  The result should be a distribution that acts exactly the same
when a copy of gettext is present, and disables internationalization
otherwise.

There should be no changes in behavior when gettext is included in-tree.
When gettext is not included in tree, nor available on the system, the
programs will be built without localization.

ChangeLog:

	PR bootstrap/12596
	* .gitignore: Add '/gettext*'.
	* configure.ac (host_libs): Replace intl with gettext.
	(hbaseargs, bbaseargs, baseargs): Split baseargs into
	{h,b}baseargs.
	(skip_barg): New flag.  Skips appending current flag to
	bbaseargs.
	<library exemptions>: Exempt --with-libintl-{type,prefix} from
	target and build machine argument passing.
	* configure: Regenerate.
	* Makefile.def (host_modules): Replace intl module with gettext
	module.
	(configure-ld): Depend on configure-gettext.
	* Makefile.in: Regenerate.

config/ChangeLog:

	* intlmacosx.m4: Import from gettext-0.22 (serial 8).
	* gettext.m4: Sync with gettext-0.22 (serial 77).
	* gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Load gettext's
	uninstalled-config.sh, or call AM_GNU_GETTEXT if missing.
	* iconv.m4: Sync with gettext-0.22 (serial 26).

contrib/ChangeLog:

	* prerequisites.sha512: Add gettext.
	* prerequisites.md5: Add gettext.
	* download_prerequisites: Add gettext.

gcc/ChangeLog:

	* configure: Regenerate.
	* aclocal.m4: Regenerate.
	* Makefile.in (LIBDEPS): Remove (potential) ./ prefix from
	LIBINTL_DEP.
	* doc/install.texi: Document new (notable) flags added by the
	optional gettext tree and by AM_GNU_GETTEXT.  Document libintl/libc
	with gettext dependency.

libcpp/ChangeLog:

	* configure: Regenerate.
	* aclocal.m4: Regenerate.
---
 .gitignore                     |    1 +
 Makefile.def                   |   72 +-
 Makefile.in                    | 1612 ++++++++++++------------
 config/gettext-sister.m4       |   35 +-
 config/gettext.m4              |  357 +++---
 config/iconv.m4                |  313 +++--
 config/intlmacosx.m4           |   69 ++
 configure                      |   44 +-
 configure.ac                   |   44 +-
 contrib/download_prerequisites |    2 +
 contrib/prerequisites.md5      |    1 +
 contrib/prerequisites.sha512   |    1 +
 gcc/Makefile.in                |    8 +-
 gcc/aclocal.m4                 |    4 +
 gcc/configure                  | 2001 +++++++++++++++++++++++++++---
 gcc/doc/install.texi           |   72 +-
 libcpp/aclocal.m4              |    5 +
 libcpp/configure               | 2139 ++++++++++++++++++++++++++++----
 libstdc++-v3/configure         |  727 ++++-------
 19 files changed, 5467 insertions(+), 2040 deletions(-)
 create mode 100644 config/intlmacosx.m4

diff --git a/.gitignore b/.gitignore
index 5cc4a0fdfa61..93a16b0b950c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,3 +69,4 @@ stamp-*
 /mpc*
 /gmp*
 /isl*
+/gettext*
diff --git a/Makefile.def b/Makefile.def
index 15c068e4ac40..792f81447e1b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -74,8 +74,14 @@ host_modules= { module= isl; lib_path=.libs; bootstrap=true;
 host_modules= { module= gold; bootstrap=true; };
 host_modules= { module= gprof; };
 host_modules= { module= gprofng; };
-// intl acts on 'host_shared' directly, and does not support --with-pic.
-host_modules= { module= intl; bootstrap=true; };
+host_modules= { module= gettext; bootstrap=true; no_install=true;
+                module_srcdir= "gettext/gettext-runtime";
+		// We always build gettext with pic, because some packages (e.g. gdbserver)
+		// need it in some configuratons, which is determined via nontrivial tests.
+		// Always enabling pic seems to make sense for something tied to
+		// user-facing output.
+                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
+                lib_path=intl/.libs; };
 host_modules= { module= tcl;
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
@@ -345,7 +351,7 @@ dependencies = { module=all-build-fixincludes; on=all-build-libiberty; };
 dependencies = { module=all-build-libcpp; on=all-build-libiberty; };
 
 // Host modules specific to gcc.
-dependencies = { module=configure-gcc; on=configure-intl; };
+dependencies = { module=configure-gcc; on=configure-gettext; };
 dependencies = { module=configure-gcc; on=all-gmp; };
 dependencies = { module=configure-gcc; on=all-mpfr; };
 dependencies = { module=configure-gcc; on=all-mpc; };
@@ -357,7 +363,7 @@ dependencies = { module=configure-gcc; on=all-ld; };
 dependencies = { module=configure-gcc; on=all-gold; };
 dependencies = { module=configure-gcc; on=all-libiconv; };
 dependencies = { module=all-gcc; on=all-libiberty; hard=true; };
-dependencies = { module=all-gcc; on=all-intl; };
+dependencies = { module=all-gcc; on=all-gettext; };
 dependencies = { module=all-gcc; on=all-mpfr; };
 dependencies = { module=all-gcc; on=all-mpc; };
 dependencies = { module=all-gcc; on=all-isl; };
@@ -386,10 +392,10 @@ dependencies = { module=install-strip-gcc ; on=install-strip-fixincludes; };
 dependencies = { module=install-strip-gcc ; on=install-strip-lto-plugin; };
 
 dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; };
-dependencies = { module=configure-libcpp; on=configure-intl; };
+dependencies = { module=configure-libcpp; on=configure-gettext; };
 dependencies = { module=configure-libcpp; on=all-libiconv; };
 dependencies = { module=all-libcpp; on=all-libiberty; hard=true; };
-dependencies = { module=all-libcpp; on=all-intl; };
+dependencies = { module=all-libcpp; on=all-gettext; };
 dependencies = { module=all-libcpp; on=all-libiconv; };
 
 dependencies = { module=all-fixincludes; on=all-libiberty; };
@@ -411,16 +417,16 @@ dependencies = { module=all-gotools; on=all-target-libgo; };
 
 dependencies = { module=all-utils; on=all-libiberty; };
 
-dependencies = { module=configure-intl; on=all-libiconv; };
+dependencies = { module=configure-gettext; on=all-libiconv; };
 dependencies = { module=configure-mpfr; on=all-gmp; };
 dependencies = { module=configure-mpc; on=all-mpfr; };
 dependencies = { module=configure-isl; on=all-gmp; };
-dependencies = { module=all-intl; on=all-libiconv; };
+dependencies = { module=all-gettext; on=all-libiconv; };
 
 // Host modules specific to gdb.
 dependencies = { module=configure-gdb; on=all-gmp; };
 dependencies = { module=configure-gdb; on=all-mpfr; };
-dependencies = { module=configure-gdb; on=all-intl; };
+dependencies = { module=configure-gdb; on=all-gettext; };
 dependencies = { module=configure-gdb; on=configure-sim; };
 dependencies = { module=configure-gdb; on=all-bfd; };
 dependencies = { module=configure-gdb; on=all-gnulib; };
@@ -454,17 +460,17 @@ dependencies = { module=all-libgui; on=all-tk; };
 dependencies = { module=all-libgui; on=all-itcl; };
 
 dependencies = { module=configure-gdbsupport; on=configure-gnulib; };
-dependencies = { module=configure-gdbsupport; on=configure-intl; };
+dependencies = { module=configure-gdbsupport; on=configure-gettext; };
 dependencies = { module=all-gdbsupport; on=all-gnulib; };
-dependencies = { module=all-gdbsupport; on=all-intl; };
+dependencies = { module=all-gdbsupport; on=all-gettext; };
 
 // Host modules specific to binutils.
 // build libsframe before bfd for encoder/decoder support for linking
 // SFrame sections
 dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
-dependencies = { module=configure-bfd; on=configure-intl; };
+dependencies = { module=configure-bfd; on=configure-gettext; };
 dependencies = { module=all-bfd; on=all-libiberty; };
-dependencies = { module=all-bfd; on=all-intl; };
+dependencies = { module=all-bfd; on=all-gettext; };
 dependencies = { module=all-bfd; on=all-zlib; };
 dependencies = { module=all-bfd; on=all-libsframe; };
 dependencies = { module=configure-opcodes; on=configure-libiberty; hard=true; };
@@ -473,13 +479,13 @@ dependencies = { module=all-opcodes; on=all-libiberty; };
 // We must build gas before binutils, gprof, ld and gold to avoid race
 // condition in the prev-gcc/as script during bootstrap of combined tree
 // with GCC and binutils.  See PR gas/14899 for details.
-dependencies = { module=configure-binutils; on=configure-intl; };
+dependencies = { module=configure-binutils; on=configure-gettext; };
 dependencies = { module=all-binutils; on=all-libiberty; };
 dependencies = { module=all-binutils; on=all-opcodes; };
 dependencies = { module=all-binutils; on=all-bfd; };
 dependencies = { module=all-binutils; on=all-build-flex; };
 dependencies = { module=all-binutils; on=all-build-bison; };
-dependencies = { module=all-binutils; on=all-intl; };
+dependencies = { module=all-binutils; on=all-gettext; };
 dependencies = { module=all-binutils; on=all-gas; };
 dependencies = { module=all-binutils; on=all-libctf; };
 dependencies = { module=all-ld; on=all-libctf; };
@@ -508,51 +514,51 @@ dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; };
 dependencies = { module=install-opcodes; on=install-bfd; };
 dependencies = { module=install-strip-opcodes; on=install-strip-bfd; };
 
-dependencies = { module=configure-gas; on=configure-intl; };
+dependencies = { module=configure-gas; on=configure-gettext; };
 dependencies = { module=all-gas; on=all-libiberty; };
 dependencies = { module=all-gas; on=all-opcodes; };
 dependencies = { module=all-gas; on=all-bfd; };
-dependencies = { module=all-gas; on=all-intl; };
-dependencies = { module=configure-gprof; on=configure-intl; };
+dependencies = { module=all-gas; on=all-gettext; };
+dependencies = { module=configure-gprof; on=configure-gettext; };
 dependencies = { module=all-gprof; on=all-libiberty; };
 dependencies = { module=all-gprof; on=all-bfd; };
 dependencies = { module=all-gprof; on=all-opcodes; };
-dependencies = { module=all-gprof; on=all-intl; };
+dependencies = { module=all-gprof; on=all-gettext; };
 dependencies = { module=all-gprof; on=all-gas; };
 
-dependencies = { module=configure-gprofng; on=configure-intl; };
+dependencies = { module=configure-gprofng; on=configure-gettext; };
 dependencies = { module=all-gprofng; on=all-libiberty; };
 dependencies = { module=all-gprofng; on=all-bfd; };
 dependencies = { module=all-gprofng; on=all-opcodes; };
-dependencies = { module=all-gprofng; on=all-intl; };
+dependencies = { module=all-gprofng; on=all-gettext; };
 dependencies = { module=all-gprofng; on=all-gas; };
 dependencies = { module=install-gprofng; on=install-opcodes; };
 dependencies = { module=install-gprofng; on=install-bfd; };
 
-dependencies = { module=configure-ld; on=configure-intl; };
+dependencies = { module=configure-ld; on=configure-gettext; };
 dependencies = { module=all-ld; on=all-libiberty; };
 dependencies = { module=all-ld; on=all-bfd; };
 dependencies = { module=all-ld; on=all-opcodes; };
 dependencies = { module=all-ld; on=all-build-bison; };
 dependencies = { module=all-ld; on=all-build-flex; };
-dependencies = { module=all-ld; on=all-intl; };
+dependencies = { module=all-ld; on=all-gettext; };
 dependencies = { module=all-ld; on=all-gas; };
 dependencies = { module=all-ld; on=all-binutils; };
 dependencies = { module=install-ld; on=install-gold; };
 dependencies = { module=install-strip-ld; on=install-strip-gold; };
-dependencies = { module=configure-gold; on=configure-intl; };
+dependencies = { module=configure-gold; on=configure-gettext; };
 dependencies = { module=all-gold; on=all-libiberty; };
-dependencies = { module=all-gold; on=all-intl; };
+dependencies = { module=all-gold; on=all-gettext; };
 dependencies = { module=all-gold; on=all-bfd; };
 dependencies = { module=all-gold; on=all-build-bison; };
 dependencies = { module=all-gold; on=all-gas; };
 dependencies = { module=check-gold; on=all-binutils; };
 dependencies = { module=check-gold; on=all-gas; };
 
-dependencies = { module=configure-opcodes; on=configure-intl; };
+dependencies = { module=configure-opcodes; on=configure-gettext; };
 dependencies = { module=all-opcodes; on=all-bfd; };
 dependencies = { module=all-opcodes; on=all-libiberty; };
-dependencies = { module=all-opcodes; on=all-intl; };
+dependencies = { module=all-opcodes; on=all-gettext; };
 
 // Other host modules in the 'src' repository.
 dependencies = { module=all-dejagnu; on=all-tcl; };
@@ -586,8 +592,8 @@ dependencies = { module=install-sid; on=install-tk; };
 dependencies = { module=install-strip-sid; on=install-strip-tk; };
 
 dependencies = { module=configure-sim; on=all-gnulib; };
-dependencies = { module=configure-sim; on=configure-intl; };
-dependencies = { module=all-sim; on=all-intl; };
+dependencies = { module=configure-sim; on=configure-gettext; };
+dependencies = { module=all-sim; on=all-gettext; };
 dependencies = { module=all-sim; on=all-libiberty; };
 dependencies = { module=all-sim; on=all-bfd; };
 dependencies = { module=all-sim; on=all-opcodes; };
@@ -602,7 +608,7 @@ dependencies = { module=all-libctf; on=all-bfd; };
 dependencies = { module=all-libctf; on=all-zlib; };
 // So that checking for ELF support in BFD from libctf configure is possible.
 dependencies = { module=configure-libctf; on=all-bfd; };
-dependencies = { module=configure-libctf; on=all-intl; };
+dependencies = { module=configure-libctf; on=all-gettext; };
 dependencies = { module=configure-libctf; on=all-zlib; };
 dependencies = { module=configure-libctf; on=all-libiconv; };
 dependencies = { module=check-libctf; on=all-ld; };
@@ -615,13 +621,13 @@ dependencies = { module=distclean-gnulib; on=distclean-gdbserver; };
 dependencies = { module=distclean-gnulib; on=distclean-sim; };
 
 // Warning, these are not well tested.
-dependencies = { module=all-bison; on=all-intl; };
+dependencies = { module=all-bison; on=all-gettext; };
 dependencies = { module=all-bison; on=all-build-texinfo; };
 dependencies = { module=all-flex; on=all-build-bison; };
-dependencies = { module=all-flex; on=all-intl; };
+dependencies = { module=all-flex; on=all-gettext; };
 dependencies = { module=all-flex; on=all-m4; };
 dependencies = { module=all-flex; on=all-build-texinfo; };
-dependencies = { module=all-m4; on=all-intl; };
+dependencies = { module=all-m4; on=all-gettext; };
 dependencies = { module=all-m4; on=all-build-texinfo; };
 
 // Target modules.  These can also have dependencies on the language
diff --git a/Makefile.in b/Makefile.in
index 1dda62a03032..b65ab4953bce 100644
--- a/Makefile.in
+++ b/Makefile.in
File regenerated.
diff --git a/config/gettext-sister.m4 b/config/gettext-sister.m4
index e8e6b668416b..5bb385fd0def 100644
--- a/config/gettext-sister.m4
+++ b/config/gettext-sister.m4
@@ -10,19 +10,30 @@
 # the necessary substitutions and definitions for this directory.
 
 AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR],
-[# If we haven't got the data from the intl directory,
-# assume NLS is disabled.
-USE_NLS=no	AC_SUBST(USE_NLS)
-LIBINTL=	AC_SUBST(LIBINTL)
-LIBINTL_DEP=	AC_SUBST(LIBINTL_DEP)
-INCINTL=	AC_SUBST(INCINTL)
-XGETTEXT=	AC_SUBST(XGETTEXT)
-GMSGFMT=	AC_SUBST(GMSGFMT)
-POSUB=		AC_SUBST(POSUB)
-
-if test -f  ifelse([$1],,[../intl],[$1])/config.intl; then
-  .  ifelse([$1],,[../intl],[$1])/config.intl
+[
+m4_pushdef([gettext_builddir],
+           m4_default([$1], [../gettext]))
+m4_pushdef([gettext_cfg],
+           gettext_builddir[/uninstalled-config.sh])
+if test -f gettext_cfg; then
+  relative_builddir='[$(top_builddir)/]gettext_builddir'
+  .  gettext_cfg
+else
+  # The sister gettext directory doesn't exist and won't collect information on
+  # using gettext for us.  Call a bundled AM_GNU_GETTEXT.
+  AM_GNU_GETTEXT([external])
 fi
+m4_popdef([gettext_cfg])
+m4_popdef([gettext_builddir])
+
+AC_SUBST([USE_NLS])
+AC_SUBST([LIBINTL])
+AC_SUBST([LIBINTL_DEP])
+AC_SUBST([INCINTL])
+AC_SUBST([XGETTEXT])
+AC_SUBST([GMSGFMT])
+AC_SUBST([POSUB])
+
 AC_MSG_CHECKING([whether NLS is requested])
 if test x"$USE_NLS" != xyes; then
   AC_MSG_RESULT(no)
diff --git a/config/gettext.m4 b/config/gettext.m4
index 5b42bb165231..f4492405bd29 100644
--- a/config/gettext.m4
+++ b/config/gettext.m4
@@ -1,43 +1,39 @@
-# gettext.m4 serial 20 (gettext-0.12)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# gettext.m4 serial 72 (gettext-0.21.1)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
 
 dnl Macro to add for using GNU gettext.
 
 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
-dnl    default (if it is not specified or empty) is 'no-libtool'.
-dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
-dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext, and
+dnl    'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
-dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
-dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl    AM-DISABLE-SHARED).
 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 dnl    implementations (in libc or libintl) without the ngettext() function
 dnl    will be ignored.  If NEEDSYMBOL is specified and is
 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 dnl INTLDIR is used to find the intl libraries.  If empty,
-dnl    the value `$(top_builddir)/intl/' is used.
+dnl    the value '$(top_builddir)/intl/' is used.
 dnl
 dnl The result of the configuration is one of three cases:
 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
@@ -59,17 +55,22 @@ dnl
 AC_DEFUN([AM_GNU_GETTEXT],
 [
   dnl Argument checking.
-  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+  m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])])
-  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+])])])])
+  m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old],
+    [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
+])])
+  m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
-  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
-  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+  define([gt_included_intl],
+    m4_if([$1], [external], [no], [yes]))
+  gt_NEEDS_INIT
+  AM_GNU_GETTEXT_NEED([$2])
 
   AC_REQUIRE([AM_PO_SUBDIRS])dnl
-  ifelse(gt_included_intl, yes, [
+  m4_if(gt_included_intl, yes, [
     AC_REQUIRE([AM_INTL_SUBDIR])dnl
   ])
 
@@ -80,22 +81,24 @@ AC_DEFUN([AM_GNU_GETTEXT],
   dnl Sometimes libintl requires libiconv, so first search for libiconv.
   dnl Ideally we would do this search only after the
   dnl      if test "$USE_NLS" = "yes"; then
-  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
-  dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
   dnl the configure script would need to contain the same shell code
   dnl again, outside any 'if'. There are two solutions:
   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
-  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
-  dnl documented, we avoid it.
-  ifelse(gt_included_intl, yes, , [
+  dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
+  m4_if(gt_included_intl, yes, , [
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
+  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+  gt_INTL_MACOSX
+
   dnl Set USE_NLS.
-  AM_NLS
+  AC_REQUIRE([AM_NLS])
 
-  ifelse(gt_included_intl, yes, [
+  m4_if(gt_included_intl, yes, [
     BUILD_INCLUDED_LIBINTL=no
     USE_INCLUDED_LIBINTL=no
   ])
@@ -103,16 +106,25 @@ AC_DEFUN([AM_GNU_GETTEXT],
   LTLIBINTL=
   POSUB=
 
+  dnl Add a version number to the cache macros.
+  case " $gt_needs " in
+    *" need-formatstring-macros "*) gt_api_version=3 ;;
+    *" need-ngettext "*) gt_api_version=2 ;;
+    *) gt_api_version=1 ;;
+  esac
+  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
   dnl If we use NLS figure out what method
   if test "$USE_NLS" = "yes"; then
     gt_use_preinstalled_gnugettext=no
-    ifelse(gt_included_intl, yes, [
+    m4_if(gt_included_intl, yes, [
       AC_MSG_CHECKING([whether included gettext is requested])
-      AC_ARG_WITH(included-gettext,
+      AC_ARG_WITH([included-gettext],
         [  --with-included-gettext use the GNU gettext library included here],
         nls_cv_force_use_gnu_gettext=$withval,
         nls_cv_force_use_gnu_gettext=no)
-      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+      AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
 
       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
@@ -121,13 +133,29 @@ AC_DEFUN([AM_GNU_GETTEXT],
         dnl to use.  If GNU gettext is available we use this.  Else we have
         dnl to fall back to GNU NLS library.
 
-        dnl Add a version number to the cache macros.
-        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
-        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
-        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
+        if test $gt_api_version -ge 3; then
+          gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+        else
+          gt_revision_test_code=
+        fi
+        if test $gt_api_version -ge 2; then
+          gt_expression_test_code=' + * ngettext ("", "", 0)'
+        else
+          gt_expression_test_code=
+        fi
 
-        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
-         [AC_TRY_LINK([#include <libintl.h>
+        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+         [AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[
+#include <libintl.h>
 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern int *_nl_domain_bindings;
@@ -135,22 +163,18 @@ extern int *_nl_domain_bindings;
 #else
 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
 #endif
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], []),
-            [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
-            gt_cv_func_gnugettext_libc=yes,
-            gt_cv_func_gnugettext_libc=no)])
+$gt_revision_test_code
+               ]],
+               [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+               ]])],
+            [eval "$gt_func_gnugettext_libc=yes"],
+            [eval "$gt_func_gnugettext_libc=no"])])
 
-        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
           dnl Sometimes libintl requires libiconv, so first search for libiconv.
-          ifelse(gt_included_intl, yes, , [
+          m4_if(gt_included_intl, yes, , [
             AM_ICONV_LINK
           ])
           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
@@ -159,65 +183,63 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
           dnl even if libiconv doesn't exist.
           AC_LIB_LINKFLAGS_BODY([intl])
           AC_CACHE_CHECK([for GNU gettext in libintl],
-            gt_cv_func_gnugettext_libintl,
+            [$gt_func_gnugettext_libintl],
            [gt_save_CPPFLAGS="$CPPFLAGS"
             CPPFLAGS="$CPPFLAGS $INCINTL"
             gt_save_LIBS="$LIBS"
             LIBS="$LIBS $LIBINTL"
             dnl Now see whether libintl exists and does not depend on libiconv.
-            AC_TRY_LINK([#include <libintl.h>
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[
+#include <libintl.h>
 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();
-#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
 #else
 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
 #endif
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], []),
-              [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
-              gt_cv_func_gnugettext_libintl=yes,
-              gt_cv_func_gnugettext_libintl=no)
+$gt_revision_test_code
+                 ]],
+                 [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                 ]])],
+              [eval "$gt_func_gnugettext_libintl=yes"],
+              [eval "$gt_func_gnugettext_libintl=no"])
             dnl Now see whether libintl exists and depends on libiconv.
-            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
               LIBS="$LIBS $LIBICONV"
-              AC_TRY_LINK([#include <libintl.h>
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[
+#include <libintl.h>
 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();
-#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
 #else
 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
 #endif
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], []),
-                [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
-               [LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                gt_cv_func_gnugettext_libintl=yes
-               ])
+$gt_revision_test_code
+                   ]],
+                   [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                   ]])],
+                [LIBINTL="$LIBINTL $LIBICONV"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
+                ])
             fi
             CPPFLAGS="$gt_save_CPPFLAGS"
             LIBS="$gt_save_LIBS"])
@@ -227,8 +249,8 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
         dnl use it.  But if this macro is used in GNU gettext, and GNU
         dnl gettext is already preinstalled in libintl, we update this
         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
-        if test "$gt_cv_func_gnugettext_libc" = "yes" \
-           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
                 && test "$PACKAGE" != gettext-runtime \
                 && test "$PACKAGE" != gettext-tools; }; then
           gt_use_preinstalled_gnugettext=yes
@@ -239,7 +261,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
           INCINTL=
         fi
 
-    ifelse(gt_included_intl, yes, [
+    m4_if(gt_included_intl, yes, [
         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
           dnl GNU gettext is not found in the C library.
           dnl Fall back on included GNU gettext library.
@@ -251,11 +273,12 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
         dnl Mark actions used to generate GNU NLS library.
         BUILD_INCLUDED_LIBINTL=yes
         USE_INCLUDED_LIBINTL=yes
-        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
-        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+        LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
+        LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
+      CATOBJEXT=
       if test "$gt_use_preinstalled_gnugettext" = "yes" \
          || test "$nls_cv_use_gnu_gettext" = "yes"; then
         dnl Mark actions to use GNU gettext tools.
@@ -263,9 +286,18 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
       fi
     ])
 
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Some extra flags are needed during linking.
+        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
     if test "$gt_use_preinstalled_gnugettext" = "yes" \
        || test "$nls_cv_use_gnu_gettext" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1,
+      AC_DEFINE([ENABLE_NLS], [1],
         [Define to 1 if translation of program messages to the user's native language
    is requested.])
     else
@@ -278,7 +310,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
   if test "$USE_NLS" = "yes"; then
     AC_MSG_CHECKING([where the gettext function comes from])
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         gt_source="external libintl"
       else
         gt_source="libc"
@@ -292,16 +324,16 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
   if test "$USE_NLS" = "yes"; then
 
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         AC_MSG_CHECKING([how to link with libintl])
         AC_MSG_RESULT([$LIBINTL])
         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
       fi
 
       dnl For backward compatibility. Some packages may be using this.
-      AC_DEFINE(HAVE_GETTEXT, 1,
+      AC_DEFINE([HAVE_GETTEXT], [1],
        [Define if the GNU gettext() function is already present or preinstalled.])
-      AC_DEFINE(HAVE_DCGETTEXT, 1,
+      AC_DEFINE([HAVE_DCGETTEXT], [1],
        [Define if the GNU dcgettext() function is already present or preinstalled.])
     fi
 
@@ -309,125 +341,46 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
     POSUB=po
   fi
 
-  ifelse(gt_included_intl, yes, [
-    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
-    dnl to 'yes' because some of the testsuite requires it.
-    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
-      BUILD_INCLUDED_LIBINTL=yes
-    fi
+  m4_if(gt_included_intl, yes, [
+    dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
+    dnl because some of the testsuite requires it.
+    BUILD_INCLUDED_LIBINTL=yes
 
     dnl Make all variables we use known to autoconf.
-    AC_SUBST(BUILD_INCLUDED_LIBINTL)
-    AC_SUBST(USE_INCLUDED_LIBINTL)
-    AC_SUBST(CATOBJEXT)
-
-    dnl For backward compatibility. Some configure.acs may be using this.
-    nls_cv_header_intl=
-    nls_cv_header_libgt=
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    DATADIRNAME=share
-    AC_SUBST(DATADIRNAME)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    INSTOBJEXT=.mo
-    AC_SUBST(INSTOBJEXT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    GENCAT=gencat
-    AC_SUBST(GENCAT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    if test "$USE_INCLUDED_LIBINTL" = yes; then
-      INTLOBJS="\$(GETTOBJS)"
-    fi
-    AC_SUBST(INTLOBJS)
-
-    dnl Enable libtool support if the surrounding package wishes it.
-    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
-    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+    AC_SUBST([BUILD_INCLUDED_LIBINTL])
+    AC_SUBST([USE_INCLUDED_LIBINTL])
+    AC_SUBST([CATOBJEXT])
   ])
 
   dnl For backward compatibility. Some Makefiles may be using this.
   INTLLIBS="$LIBINTL"
-  AC_SUBST(INTLLIBS)
+  AC_SUBST([INTLLIBS])
 
   dnl Make all documented variables known to autoconf.
-  AC_SUBST(LIBINTL)
-  AC_SUBST(LTLIBINTL)
-  AC_SUBST(POSUB)
+  AC_SUBST([LIBINTL])
+  AC_SUBST([LTLIBINTL])
+  AC_SUBST([POSUB])
 ])
 
 
-dnl Checks for all prerequisites of the intl subdirectory,
-dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
-dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
-AC_DEFUN([AM_INTL_SUBDIR],
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
 [
-  AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
-  AC_REQUIRE([AC_PROG_CC])dnl
-  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-  AC_REQUIRE([AC_PROG_RANLIB])dnl
-  AC_REQUIRE([AC_ISC_POSIX])dnl
-  AC_REQUIRE([AC_HEADER_STDC])dnl
-  AC_REQUIRE([AC_C_CONST])dnl
-  AC_REQUIRE([AC_C_INLINE])dnl
-  AC_REQUIRE([AC_TYPE_OFF_T])dnl
-  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
-  AC_REQUIRE([AC_FUNC_MMAP])dnl
-  AC_REQUIRE([jm_GLIBC21])dnl
-  AC_REQUIRE([gt_INTDIV0])dnl
-  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
-  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
-  AC_REQUIRE([gt_INTTYPES_PRI])dnl
-
-  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
-  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
-geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
-strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
-__fsetlocking])
+  m4_divert_text([DEFAULTS], [gt_needs=])
+  m4_define([gt_NEEDS_INIT], [])
+])
 
-  AM_ICONV
-  AM_LANGINFO_CODESET
-  if test $ac_cv_header_locale_h = yes; then
-    AM_LC_MESSAGES
-  fi
 
-  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
-  dnl because plural.y uses bison specific features. It requires at least
-  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
-  dnl compile.
-  dnl bison is only needed for the maintainer (who touches plural.y). But in
-  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
-  dnl the rule in general Makefile. Now, some people carelessly touch the
-  dnl files or have a broken "make" program, hence the plural.c rule will
-  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
-  dnl present or too old.
-  AC_CHECK_PROGS([INTLBISON], [bison])
-  if test -z "$INTLBISON"; then
-    ac_verc_fail=yes
-  else
-    dnl Found it, now check the version.
-    AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
-    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-    case $ac_prog_version in
-      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
-         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-    esac
-    AC_MSG_RESULT([$ac_prog_version])
-  fi
-  if test $ac_verc_fail = yes; then
-    INTLBISON=:
-  fi
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
 ])
 
 
 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+
+
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
diff --git a/config/iconv.m4 b/config/iconv.m4
index f1e54c5aedc9..ff5d52611397 100644
--- a/config/iconv.m4
+++ b/config/iconv.m4
@@ -1,13 +1,17 @@
-# iconv.m4 serial AM4 (gettext-0.11.3)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# iconv.m4 serial 26
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
-dnl with modifications to support building with in-tree libiconv
+
+AC_PREREQ([2.64])
+
+dnl Note: AM_ICONV is documented in the GNU gettext manual
+dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
+dnl Don't make changes that are incompatible with that documentation!
 
 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 [
@@ -24,107 +28,266 @@ AC_DEFUN([AM_ICONV_LINK],
 [
   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
   dnl those with the standalone portable GNU libiconv installed).
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
   dnl accordingly.
   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
-  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libiconv and not disabled its use
+  dnl via --without-libiconv-prefix, he wants to use it. The first
+  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
+  am_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
-    dnl Add $INCICONV to CPPFLAGS before performing the first check,
-    dnl because if the user has installed libiconv and not disabled its use
-    dnl via --without-libiconv-prefix, he wants to use it. This first
-    dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
-    am_save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $INCICONV"
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
-      am_cv_func_iconv=yes)
-    CPPFLAGS="$am_save_CPPFLAGS"
-
-    if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
-      for _libs in .libs _libs; do
-        am_save_CPPFLAGS="$CPPFLAGS"
-        am_save_LIBS="$LIBS"
-        CPPFLAGS="$CPPFLAGS -I../libiconv/include"
-        LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
-        AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-          [iconv_t cd = iconv_open("","");
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[
+#include <stdlib.h>
+#include <iconv.h>
+         ]],
+         [[iconv_t cd = iconv_open("","");
            iconv(cd,NULL,NULL,NULL,NULL);
-           iconv_close(cd);],
-          INCICONV="-I../libiconv/include"
-          LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
-          LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
-          am_cv_lib_iconv=yes
-          am_cv_func_iconv=yes)
-        CPPFLAGS="$am_save_CPPFLAGS"
-        LIBS="$am_save_LIBS"
-        if test "$am_cv_func_iconv" = "yes"; then
-          break
-        fi
-      done
-    fi
-
+           iconv_close(cd);]])],
+      [am_cv_func_iconv=yes])
     if test "$am_cv_func_iconv" != yes; then
-      am_save_CPPFLAGS="$CPPFLAGS"
       am_save_LIBS="$LIBS"
-      CPPFLAGS="$CPPFLAGS $INCICONV"
       LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-        am_cv_lib_iconv=yes
-        am_cv_func_iconv=yes)
-      CPPFLAGS="$am_save_CPPFLAGS"
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+#include <stdlib.h>
+#include <iconv.h>
+           ]],
+           [[iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);]])],
+        [am_cv_lib_iconv=yes]
+        [am_cv_func_iconv=yes])
       LIBS="$am_save_LIBS"
     fi
   ])
   if test "$am_cv_func_iconv" = yes; then
-    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+      dnl Solaris 10.
+      am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
+  /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+     successful returns.  This is even documented in
+     <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
+    ])
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
+    AC_DEFINE([HAVE_ICONV], [1],
+      [Define if you have the iconv() function and it works.])
   fi
   if test "$am_cv_lib_iconv" = yes; then
-    AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
     AC_MSG_CHECKING([how to link with libiconv])
     AC_MSG_RESULT([$LIBICONV])
   else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
     LIBICONV=
     LTLIBICONV=
   fi
-  AC_SUBST(LIBICONV)
-  AC_SUBST(LTLIBICONV)
+  AC_SUBST([LIBICONV])
+  AC_SUBST([LTLIBICONV])
 ])
 
-AC_DEFUN([AM_ICONV],
+dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+AC_DEFUN_ONCE([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
-    AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL(am_cv_proto_iconv, [
-      AC_TRY_COMPILE([
+    AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
+      [gl_cv_iconv_nonconst],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[
 #include <stdlib.h>
 #include <iconv.h>
 extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
-    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([$]{ac_t:-
-         }[$]am_cv_proto_iconv)
-    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
-      [Define as const if the declaration of iconv() needs const.])
+            ]],
+            [[]])],
+         [gl_cv_iconv_nonconst=yes],
+         [gl_cv_iconv_nonconst=no])
+      ])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    gl_cv_iconv_nonconst=yes
+  fi
+  if test $gl_cv_iconv_nonconst = yes; then
+    iconv_arg1=""
+  else
+    iconv_arg1="const"
+  fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test $gl_cv_iconv_nonconst != yes; then
+       ICONV_CONST="const"
+     fi
+    ])
+
+  dnl A summary result, for those packages which want to print a summary at the
+  dnl end of the configuration.
+  if test "$am_func_iconv" = yes; then
+    if test -n "$LIBICONV"; then
+      am_cv_func_iconv_summary='yes, in libiconv'
+    else
+      am_cv_func_iconv_summary='yes, in libc'
+    fi
+  else
+    if test "$am_cv_func_iconv" = yes; then
+      am_cv_func_iconv_summary='not working, consider installing GNU libiconv'
+    else
+      am_cv_func_iconv_summary='no, consider installing GNU libiconv'
+    fi
   fi
 ])
diff --git a/config/intlmacosx.m4 b/config/intlmacosx.m4
new file mode 100644
index 000000000000..3141bf8c5e4c
--- /dev/null
+++ b/config/intlmacosx.m4
@@ -0,0 +1,69 @@
+# intlmacosx.m4 serial 9 (gettext-0.22.3)
+dnl Copyright (C) 2004-2014, 2016, 2019-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on Mac OS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+  dnl Check for API introduced in Mac OS X 10.4.
+  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+    [gt_cv_func_CFPreferencesCopyAppValue],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFPreferences.h>]],
+          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
+       [gt_cv_func_CFPreferencesCopyAppValue=yes],
+       [gt_cv_func_CFPreferencesCopyAppValue=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+  fi
+  dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+  dnl because in macOS 10.13.4 it has the following behaviour:
+  dnl When two or more languages are specified in the
+  dnl "System Preferences > Language & Region > Preferred Languages" panel,
+  dnl it returns en_CC where CC is the territory (even when English is not among
+  dnl the preferred languages!).  What we want instead is what
+  dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+  dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+  dnl first among the preferred languages and CC is the territory.
+  AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFLocale.h>]],
+          [[CFLocaleCopyPreferredLanguages();]])],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    dnl Starting with macOS version 14, CoreFoundation relies on CoreServices,
+    dnl and we have to link it in explicitly, otherwise an exception
+    dnl NSInvalidArgumentException "unrecognized selector sent to instance"
+    dnl occurs.
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreServices"
+  fi
+  AC_SUBST([INTL_MACOSX_LIBS])
+])
diff --git a/configure b/configure
index 18fc7d6c4681..f8abb26b4711 100755
--- a/configure
+++ b/configure
File regenerated.
diff --git a/configure.ac b/configure.ac
index 692dc7163434..d5490982542a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,7 +133,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
 
 # these libraries are used by various programs built for the host environment
 #f
-host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe"
+host_libs="gettext libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -3239,7 +3239,8 @@ AC_SUBST_FILE(serialization_dependencies)
 # files altogether, and which should be passed on to subconfigures.
 # Also strip program-prefix, program-suffix, and program-transform-name,
 # so that we can pass down a consistent program-transform-name.
-baseargs=
+hbaseargs=
+bbaseargs=
 tbaseargs=
 keep_next=no
 skip_next=no
@@ -3255,7 +3256,8 @@ do
       *\'*)
 	ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    baseargs="$baseargs '$ac_arg'"
+    hbaseargs="$hbaseargs '$ac_arg'"
+    bbaseargs="$bbaseargs '$ac_arg'"
     tbaseargs="$tbaseargs '$ac_arg'"
     keep_next=no
     continue
@@ -3279,6 +3281,7 @@ do
   esac
 
   skip_targ=no
+  skip_barg=no
   case $ac_arg in
 changequote(,)
   --with-* | --without-*)
@@ -3291,6 +3294,12 @@ changequote(,)
     *[-_]lib)
       lib=`echo "$libopt" | sed 's,[-_]lib$,,'`
       ;;
+    *[-_]prefix)
+      lib=`echo "$libopt" | sed 's,[-_]prefix$,,'`
+      ;;
+    *[-_]type)
+      lib=`echo "$libopt" | sed 's,[-_]type$,,'`
+      ;;
     *)
       lib=$libopt
       ;;
@@ -3307,6 +3316,11 @@ changequote([,])
         skip_targ=yes
       fi
       ;;
+    libintl | libiconv)
+      # We don't want libintl (and co.) in anything but the host arguments.
+      skip_targ=yes
+      skip_barg=yes
+      ;;
     esac
     ;;
   esac
@@ -3315,7 +3329,8 @@ changequote([,])
     --cache-file=/dev/null | \
     -cache-file=/dev/null )
       # Handled here to avoid the test to skip args below.
-      baseargs="$baseargs '$ac_arg'"
+      hbaseargs="$hbaseargs '$ac_arg'"
+      bbaseargs="$bbaseargs '$ac_arg'"
       tbaseargs="$tbaseargs '$ac_arg'"
       # Assert: $separate_arg should always be no.
       keep_next=$separate_arg
@@ -3346,7 +3361,10 @@ changequote([,])
 	*\'*)
 	  ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
       esac
-      baseargs="$baseargs '$ac_arg'"
+      hbaseargs="$hbaseargs '$ac_arg'"
+      if test X"$skip_barg" = Xno; then
+	bbaseargs="$bbaseargs '$ac_arg'"
+      fi
       if test X"$skip_targ" = Xno; then
         tbaseargs="$tbaseargs '$ac_arg'"
       fi
@@ -3361,7 +3379,8 @@ changequote([,])
 done
 # Remove the initial space we just introduced and, as these will be
 # expanded by make, quote '$'.
-baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
+hbaseargs=`echo "x$hbaseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
+bbaseargs=`echo "x$bbaseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
 
 # Add in --program-transform-name, after --program-prefix and
 # --program-suffix have been applied to it.  Autoconf has already
@@ -3375,14 +3394,17 @@ ${program_transform_name}
 EOF_SED
 gcc_transform_name=`cat conftestsed.out`
 rm -f conftestsed.out
-baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
+hbaseargs="$hbaseargs --program-transform-name='${gcc_transform_name}'"
+bbaseargs="$bbaseargs --program-transform-name='${gcc_transform_name}'"
 tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'"
 if test "$silent" = yes; then
-  baseargs="$baseargs --silent"
+  bbaseargs="$bbaseargs --silent"
+  hbaseargs="$hbaseargs --silent"
   tbaseargs="$tbaseargs --silent"
 fi
 
-baseargs="$baseargs --disable-option-checking"
+bbaseargs="$bbaseargs --disable-option-checking"
+hbaseargs="$hbaseargs --disable-option-checking"
 tbaseargs="$tbaseargs --disable-option-checking"
 
 if test "$enable_year2038" = no; then
@@ -3403,7 +3425,7 @@ AC_ARG_VAR([target_configargs],
 # desired.  We can't even use the same cache file for all build-side
 # libraries, as they're compiled differently; some with C, some with
 # C++ or with different feature-enabling options.
-build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
+build_configargs="$build_configargs --cache-file=./config.cache ${bbaseargs}"
 
 # For host modules, accept cache file option, or specification as blank.
 case "${cache_file}" in
@@ -3417,7 +3439,7 @@ esac
 
 # Host dirs don't like to share a cache file either, horribly enough.
 # This seems to be due to autoconf 2.5x stupidity.
-host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
+host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${hbaseargs}"
 
 target_configargs="$target_configargs ${tbaseargs}"
 
diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
index 930f3a2a09ec..9568091c0dba 100755
--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -31,6 +31,7 @@ gmp='gmp-6.2.1.tar.bz2'
 mpfr='mpfr-4.1.0.tar.bz2'
 mpc='mpc-1.2.1.tar.gz'
 isl='isl-0.24.tar.bz2'
+gettext='gettext-0.22.tar.gz'
 
 base_url='http://gcc.gnu.org/pub/gcc/infrastructure/'
 
@@ -38,6 +39,7 @@ echo_archives() {
     echo "${gmp}"
     echo "${mpfr}"
     echo "${mpc}"
+    echo "${gettext}"
     if [ ${graphite} -gt 0 ]; then echo "${isl}"; fi
 }
 
diff --git a/contrib/prerequisites.md5 b/contrib/prerequisites.md5
index a20f986c2e05..716a9ff910c7 100644
--- a/contrib/prerequisites.md5
+++ b/contrib/prerequisites.md5
@@ -2,3 +2,4 @@
 44b892bc5a45bafb4294d134e13aad1d  mpfr-4.1.0.tar.bz2
 9f16c976c25bb0f76b50be749cd7a3a8  mpc-1.2.1.tar.gz
 dd2f7b78e118c25bd96134a52aae7f4d  isl-0.24.tar.bz2
+c092102240f8f66134d22718421d5115  gettext-0.22.tar.gz
diff --git a/contrib/prerequisites.sha512 b/contrib/prerequisites.sha512
index 89541b9ad4dc..f71398bdbc31 100644
--- a/contrib/prerequisites.sha512
+++ b/contrib/prerequisites.sha512
@@ -2,3 +2,4 @@
 410208ee0d48474c1c10d3d4a59decd2dfa187064183b09358ec4c4666e34d74383128436b404123b831e585d81a9176b24c7ced9d913967c5fce35d4040a0b4  mpfr-4.1.0.tar.bz2
 3279f813ab37f47fdcc800e4ac5f306417d07f539593ca715876e43e04896e1d5bceccfb288ef2908a3f24b760747d0dbd0392a24b9b341bc3e12082e5c836ee  mpc-1.2.1.tar.gz
 aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c38231af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95  isl-0.24.tar.bz2
+e2a58dde1cae3e6b79c03e7ef3d888f7577c1f4cba283b3b0f31123ceea8c33d7c9700e83de57104644de23e5f5c374868caa0e091f9c45edbbe87b98ee51c04  gettext-0.22.tar.gz
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 83f294652edc..9a4d6718e43d 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
File regenerated.
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 126e09bbcd1b..c0fcbeb5f990 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
File regenerated.
diff --git a/gcc/configure b/gcc/configure
index d4ad988000f0..b887b87b8b15 100755
--- a/gcc/configure
+++ b/gcc/configure
File regenerated.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 959a0415550b..f995b775f836 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -477,6 +477,17 @@ is shown below:
 @code{sys} and @code{time}.
 @end table
 
+@item GNU gettext
+
+Necessary to build GCC with internationalization support via
+@option{--enable-nls}.  It can be downloaded from
+@uref{https://gnu.org/s/gettext/}.  If a GNU gettext distribution is
+found in a subdirectory of your GCC sources named @file{gettext}, it
+will be built together with GCC, unless present in the system (either in
+libc or as a stand-alone library).
+
+The in-tree configuration requires GNU gettext version 0.22 or later.
+
 @end table
 
 @heading Tools/packages necessary for modifying GCC
@@ -633,14 +644,14 @@ components of the binutils you intend to build alongside the compiler
 (@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
 @file{opcodes}, @dots{}) to the directory containing the GCC sources.
 
-Likewise the GMP, MPFR and MPC libraries can be automatically built
-together with GCC.  You may simply run the
+Likewise the GMP, MPFR, MPC and Gettext libraries can be automatically
+built together with GCC.  You may simply run the
 @command{contrib/download_prerequisites} script in the GCC source directory
 to set up everything.
-Otherwise unpack the GMP, MPFR and/or MPC source
+Otherwise unpack the GMP, MPFR, MPC and/or Gettext source
 distributions in the directory containing the GCC sources and rename
-their directories to @file{gmp}, @file{mpfr} and @file{mpc},
-respectively (or use symbolic links with the same name).
+their directories to @file{gmp}, @file{mpfr}, @file{mpc} and
+@file{gettext}, respectively (or use symbolic links with the same name).
 
 @html
 <hr />
@@ -2219,9 +2230,56 @@ which lets GCC output diagnostics in languages other than American
 English.  Native Language Support is enabled by default if not doing a
 canadian cross build.  The @option{--disable-nls} option disables NLS@.
 
+Note that this functionality requires either libintl (provided by GNU
+gettext) or C standard library that contains support for gettext (such
+as the GNU C Library).
+@xref{with-included-gettext,,--with-included-gettext} for more
+information on the conditions required to get gettext support.
+
+@item --with-libintl-prefix=@var{dir}
+@itemx --without-libintl-prefix
+Searches for libintl in @file{@var{dir}/include} and
+@file{@var{dir}/lib}, or disables manual searching for it, letting the
+linker handle it.
+
+@item --with-libintl-type=@var{type}
+Specifies the type of library to search for when looking for libintl.
+@var{type} can be one of @code{auto}, @code{static} or @code{shared}.
+
+@anchor{with-included-gettext}
 @item --with-included-gettext
-If NLS is enabled, the @option{--with-included-gettext} option causes the build
-procedure to prefer its copy of GNU @command{gettext}.
+Only available if @file{gettext} is present in the source tree.
+
+Forces the gettext tree to be configured to build and use a new static
+libintl, overriding the system libintl.  Results in GCC being built
+against the newly built libintl rather than the system libintl.
+
+The build system makes a somewhat complicated choice when picking where
+to get gettext routines from.  The following table is a summary of the
+possible options:
+
+@c Thanks for summary, Bruno!
+@multitable @columnfractions .12 .12 .12 .2 .44
+@headitem GNU gettext present in sources
+@tab libintl installed on the system
+@tab @code{gettext} present in libc
+@tab @code{--with-included-gettext}
+@tab Effects on localization
+
+@item No @tab No  @tab No  @tab (ignored) @tab No localization
+@item No @tab No  @tab Yes @tab (ignored) @tab Localized, libc gettext
+@item No @tab Yes @tab No  @tab (ignored) @tab Localized, libintl
+@item No @tab Yes @tab Yes @tab (ignored) @tab Localized, libintl
+
+@item Yes @tab No  @tab No  @tab No  @tab Localized, new, static libintl
+@item Yes @tab No  @tab No  @tab Yes @tab Localized, new, static libintl
+@item Yes @tab No  @tab Yes @tab No  @tab Localized, libc gettext
+@item Yes @tab No  @tab Yes @tab Yes @tab Localized, new, static libintl
+@item Yes @tab Yes @tab No  @tab No  @tab Localized, libintl
+@item Yes @tab Yes @tab No  @tab Yes @tab Localized, new, static libintl
+@item Yes @tab Yes @tab Yes @tab No  @tab Localized, libintl
+@item Yes @tab Yes @tab Yes @tab Yes @tab Localized, new, static libintl
+@end multitable
 
 @item --with-catgets
 If NLS is enabled, and if the host lacks @code{gettext} but has the
diff --git a/libcpp/aclocal.m4 b/libcpp/aclocal.m4
index 70c3eff750b0..4fc81709622e 100644
--- a/libcpp/aclocal.m4
+++ b/libcpp/aclocal.m4
File regenerated.
diff --git a/libcpp/configure b/libcpp/configure
index ed98f40a1c18..caea7ac283d5 100755
--- a/libcpp/configure
+++ b/libcpp/configure
File regenerated.
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 9f12c5baa3f3..f533890a67f1 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
File regenerated.
-- 
2.42.0


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-02  8:27 [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
  2023-11-02  8:27 ` [PATCH v3 1/2] intl: remove, in favor of out-of-tree gettext Arsen Arsenović
  2023-11-02  8:45 ` [PATCH v3 2/2] *: add modern gettext Arsen Arsenović
@ 2023-11-10 10:37 ` Richard Biener
  2 siblings, 0 replies; 38+ messages in thread
From: Richard Biener @ 2023-11-10 10:37 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches, Iain Sandoe, Bruno Haible

On Thu, Nov 2, 2023 at 9:43 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
> Morning!
>
> This patch is a rebase and slight wording tweak of
> https://inbox.sourceware.org/20231006140501.3370874-1-arsen@aarsen.me
>
> Changes since v2:
> - Elaborate on the libintl requirement on non-glibc hosts, per Andrews
>   request
>
> Range diff since v2 (since it seems sufficiently readable here):
> @@ gcc/doc/install.texi: which lets GCC output diagnostics in languages
>   English.  Native Language Support is enabled by default if not doing a
>   canadian cross build.  The @option{--disable-nls} option disables NLS@.
>
> ++Note that this functionality requires either libintl (provided by GNU
> ++gettext) or C standard library that contains support for gettext (such
> ++as the GNU C Library).
> ++@xref{with-included-gettext,,--with-included-gettext} for more
> ++information on the conditions required to get gettext support.
> ++
>  +@item --with-libintl-prefix=@var{dir}
>  +@itemx --without-libintl-prefix
>  +Searches for libintl in @file{@var{dir}/include} and
> @@ gcc/doc/install.texi: which lets GCC output diagnostics in languages
>  +Specifies the type of library to search for when looking for libintl.
>  +@var{type} can be one of @code{auto}, @code{static} or @code{shared}.
>  +
> ++@anchor{with-included-gettext}
>   @item --with-included-gettext
>
>
> OK for trunk?  (granted that a regstrap + hand-test for working
> localization passes - build's ongoing asynchronously)

OK on Monday if there are no objections until then.  Please also
sync with the binutils tree then.

Thanks,
Richard.

> Thanks in advance, have a lovely day.
>
> Arsen Arsenović (2):
>   intl: remove, in favor of out-of-tree gettext
>   *: add modern gettext
>
>  .gitignore                     |    1 +
>  Makefile.def                   |   72 +-
>  Makefile.in                    | 1612 +++----
>  config/gettext-sister.m4       |   35 +-
>  config/gettext.m4              |  357 +-
>  config/iconv.m4                |  313 +-
>  config/intlmacosx.m4           |   69 +
>  configure                      |   44 +-
>  configure.ac                   |   44 +-
>  contrib/download_prerequisites |    2 +
>  contrib/prerequisites.md5      |    1 +
>  contrib/prerequisites.sha512   |    1 +
>  gcc/Makefile.in                |    8 +-
>  gcc/aclocal.m4                 |    4 +
>  gcc/configure                  | 2001 +++++++-
>  gcc/doc/install.texi           |   72 +-
>  intl/ChangeLog                 |  306 --
>  intl/Makefile.in               |  264 -
>  intl/README                    |   21 -
>  intl/VERSION                   |    1 -
>  intl/aclocal.m4                |   33 -
>  intl/bindtextdom.c             |  374 --
>  intl/config.h.in               |  280 --
>  intl/config.intl.in            |   12 -
>  intl/configure                 | 8288 --------------------------------
>  intl/configure.ac              |  108 -
>  intl/dcgettext.c               |   59 -
>  intl/dcigettext.c              | 1238 -----
>  intl/dcngettext.c              |   60 -
>  intl/dgettext.c                |   60 -
>  intl/dngettext.c               |   62 -
>  intl/eval-plural.h             |  114 -
>  intl/explodename.c             |  192 -
>  intl/finddomain.c              |  195 -
>  intl/gettext.c                 |   64 -
>  intl/gettextP.h                |  224 -
>  intl/gmo.h                     |  148 -
>  intl/hash-string.h             |   59 -
>  intl/intl-compat.c             |  151 -
>  intl/l10nflist.c               |  453 --
>  intl/libgnuintl.h              |  341 --
>  intl/loadinfo.h                |  156 -
>  intl/loadmsgcat.c              | 1322 -----
>  intl/localcharset.c            |  398 --
>  intl/localcharset.h            |   42 -
>  intl/locale.alias              |   78 -
>  intl/localealias.c             |  419 --
>  intl/localename.c              |  772 ---
>  intl/log.c                     |  104 -
>  intl/ngettext.c                |   68 -
>  intl/osdep.c                   |   24 -
>  intl/plural-config.h           |    1 -
>  intl/plural-exp.c              |  156 -
>  intl/plural-exp.h              |  132 -
>  intl/plural.c                  | 1540 ------
>  intl/plural.y                  |  434 --
>  intl/relocatable.c             |  439 --
>  intl/relocatable.h             |   67 -
>  intl/textdomain.c              |  142 -
>  libcpp/aclocal.m4              |    5 +
>  libcpp/configure               | 2139 ++++++++-
>  libstdc++-v3/configure         |  727 +--
>  62 files changed, 5467 insertions(+), 21441 deletions(-)
>  create mode 100644 config/intlmacosx.m4
>  delete mode 100644 intl/ChangeLog
>  delete mode 100644 intl/Makefile.in
>  delete mode 100644 intl/README
>  delete mode 100644 intl/VERSION
>  delete mode 100644 intl/aclocal.m4
>  delete mode 100644 intl/bindtextdom.c
>  delete mode 100644 intl/config.h.in
>  delete mode 100644 intl/config.intl.in
>  delete mode 100755 intl/configure
>  delete mode 100644 intl/configure.ac
>  delete mode 100644 intl/dcgettext.c
>  delete mode 100644 intl/dcigettext.c
>  delete mode 100644 intl/dcngettext.c
>  delete mode 100644 intl/dgettext.c
>  delete mode 100644 intl/dngettext.c
>  delete mode 100644 intl/eval-plural.h
>  delete mode 100644 intl/explodename.c
>  delete mode 100644 intl/finddomain.c
>  delete mode 100644 intl/gettext.c
>  delete mode 100644 intl/gettextP.h
>  delete mode 100644 intl/gmo.h
>  delete mode 100644 intl/hash-string.h
>  delete mode 100644 intl/intl-compat.c
>  delete mode 100644 intl/l10nflist.c
>  delete mode 100644 intl/libgnuintl.h
>  delete mode 100644 intl/loadinfo.h
>  delete mode 100644 intl/loadmsgcat.c
>  delete mode 100644 intl/localcharset.c
>  delete mode 100644 intl/localcharset.h
>  delete mode 100644 intl/locale.alias
>  delete mode 100644 intl/localealias.c
>  delete mode 100644 intl/localename.c
>  delete mode 100644 intl/log.c
>  delete mode 100644 intl/ngettext.c
>  delete mode 100644 intl/osdep.c
>  delete mode 100644 intl/plural-config.h
>  delete mode 100644 intl/plural-exp.c
>  delete mode 100644 intl/plural-exp.h
>  delete mode 100644 intl/plural.c
>  delete mode 100644 intl/plural.y
>  delete mode 100644 intl/relocatable.c
>  delete mode 100644 intl/relocatable.h
>  delete mode 100644 intl/textdomain.c
>
> --
> 2.42.0
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-21 13:13                                         ` Arsen Arsenović
  2023-11-21 16:28                                           ` David Edelsohn
@ 2023-11-21 20:58                                           ` Eric Gallager
  1 sibling, 0 replies; 38+ messages in thread
From: Eric Gallager @ 2023-11-21 20:58 UTC (permalink / raw)
  To: Arsen Arsenović
  Cc: Bruno Haible, David Edelsohn, Richard Biener, gcc-patches

On Tue, Nov 21, 2023 at 8:51 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>
> Arsen Arsenović <arsen@aarsen.me> writes:
>
> > Bruno Haible <bruno@clisp.org> writes:
> >
> >> Arsen Arsenović wrote:
> >>>   Comparing stages 2 and 3
> >>>   Bootstrap comparison failure!
> >>>   gettext/libasprintf/autosprintf.o differs
> >>>   make[2]: *** [Makefile:23435: compare] Error 1
> >>
> >> You should be able to work around this by passing the additional option
> >> --disable-libasprintf to gettext-runtime/configure. Nothing in GCC needs
> >> libasprintf; therefore there is no need to build it.
> >
> > Ah, sure, that works for me too (note that the fix is to pass
> > -frandom-seed=, according to Jakub, should this show up again).
>
> Indeed, that got a bootstrap to pass.  I've also taken the opportunity
> to check the problems Eric Gallager reported.  The install tree seems
> clean now, and the info et al targets appear to work again.  David,
> Eric, could you check whether the attached patch works for you in the
> scenarios you ran into problems with?  Make sure to fetch gettext-0.22.4
> into your trees.
>

OK, I can confirm that with this patch, my GitHub Actions CI workflow
that had previously been failing is now passing again; you can see the
results here:
https://github.com/cooljeanius/gcc/actions/runs/6948834515/job/18905670645
...and here's a link to a zip of the logfiles generated from the build:
https://github.com/cooljeanius/gcc/suites/18389727422/artifacts/1065350046

>
> If these work, I'll update download_prerequisites and see about posting
> the patch for review.
>
> Thanks, have a lovely day.
>
> >> And while at it, I would also pass --disable-java and --disable-csharp.
> >
> > Yes, I noticed those and disabled them already.
> >
> >> Bruno
>
>
> --
> Arsen Arsenović

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-21 13:13                                         ` Arsen Arsenović
@ 2023-11-21 16:28                                           ` David Edelsohn
  2023-11-21 20:58                                           ` Eric Gallager
  1 sibling, 0 replies; 38+ messages in thread
From: David Edelsohn @ 2023-11-21 16:28 UTC (permalink / raw)
  To: Arsen Arsenović
  Cc: Bruno Haible, Richard Biener, gcc-patches, Eric Gallager

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

On Tue, Nov 21, 2023 at 8:51 AM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> Arsen Arsenović <arsen@aarsen.me> writes:
>
> > Bruno Haible <bruno@clisp.org> writes:
> >
> >> Arsen Arsenović wrote:
> >>>   Comparing stages 2 and 3
> >>>   Bootstrap comparison failure!
> >>>   gettext/libasprintf/autosprintf.o differs
> >>>   make[2]: *** [Makefile:23435: compare] Error 1
> >>
> >> You should be able to work around this by passing the additional option
> >> --disable-libasprintf to gettext-runtime/configure. Nothing in GCC needs
> >> libasprintf; therefore there is no need to build it.
> >
> > Ah, sure, that works for me too (note that the fix is to pass
> > -frandom-seed=, according to Jakub, should this show up again).
>
> Indeed, that got a bootstrap to pass.  I've also taken the opportunity
> to check the problems Eric Gallager reported.  The install tree seems
> clean now, and the info et al targets appear to work again.  David,
> Eric, could you check whether the attached patch works for you in the
> scenarios you ran into problems with?  Make sure to fetch gettext-0.22.4
> into your trees.
>
>
> If these work, I'll update download_prerequisites and see about posting
> the patch for review.
>
> Thanks, have a lovely day.
>

I don't build in tree, but the patch seems to address the previous issues.

Thanks, David

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-21  0:45                                       ` Arsen Arsenović
@ 2023-11-21 13:13                                         ` Arsen Arsenović
  2023-11-21 16:28                                           ` David Edelsohn
  2023-11-21 20:58                                           ` Eric Gallager
  0 siblings, 2 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-21 13:13 UTC (permalink / raw)
  To: Arsen Arsenović
  Cc: Bruno Haible, David Edelsohn, Richard Biener, gcc-patches, Eric Gallager


[-- Attachment #1.1: Type: text/plain, Size: 1021 bytes --]


Arsen Arsenović <arsen@aarsen.me> writes:

> Bruno Haible <bruno@clisp.org> writes:
>
>> Arsen Arsenović wrote:
>>>   Comparing stages 2 and 3
>>>   Bootstrap comparison failure!
>>>   gettext/libasprintf/autosprintf.o differs
>>>   make[2]: *** [Makefile:23435: compare] Error 1
>>
>> You should be able to work around this by passing the additional option
>> --disable-libasprintf to gettext-runtime/configure. Nothing in GCC needs
>> libasprintf; therefore there is no need to build it.
>
> Ah, sure, that works for me too (note that the fix is to pass
> -frandom-seed=, according to Jakub, should this show up again).

Indeed, that got a bootstrap to pass.  I've also taken the opportunity
to check the problems Eric Gallager reported.  The install tree seems
clean now, and the info et al targets appear to work again.  David,
Eric, could you check whether the attached patch works for you in the
scenarios you ran into problems with?  Make sure to fetch gettext-0.22.4
into your trees.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: [PATCH] gettext: disable install, docs targets, libasprintf, threads --]
[-- Type: text/x-patch, Size: 14982 bytes --]

From d0f8b623f9720947b805d71c05a5d6a638daefb8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Thu, 16 Nov 2023 23:50:30 +0100
Subject: [PATCH] gettext: disable install, docs targets, libasprintf, threads

This fixes issues reported by David Edelsohn <dje.gcc@gmail.com>, and by
Eric Gallager <egallager@gcc.gnu.org>.

ChangeLog:

	* Makefile.def (gettext): Disable (via missing)
	{install-,}{pdf,html,info,dvi} and TAGS targets.  Set no_install
	to true.  Add --disable-threads --disable-libasprintf.
	* Makefile.in: Regenerate.
---
 Makefile.def |  13 +++-
 Makefile.in  | 202 ++++++++-------------------------------------------
 2 files changed, 40 insertions(+), 175 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 792f81447e1b..6b03deb49506 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -80,8 +80,17 @@ host_modules= { module= gettext; bootstrap=true; no_install=true;
 		// need it in some configuratons, which is determined via nontrivial tests.
 		// Always enabling pic seems to make sense for something tied to
 		// user-facing output.
-                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
-                lib_path=intl/.libs; };
+                extra_configure_flags='--disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf';
+		missing= pdf;
+		missing= html;
+		missing= info;
+		missing= dvi;
+		missing= install-pdf;
+		missing= install-html;
+		missing= install-info;
+		missing= install-dvi;
+		missing= TAGS;
+		no_install= true;};
 host_modules= { module= tcl;
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
diff --git a/Makefile.in b/Makefile.in
index da2344b3f3dc..3bd7d37e9605 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -768,7 +768,7 @@ TARGET_LIB_PATH_libatomic = $$r/$(TARGET_SUBDIR)/libatomic/.libs:
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the host machine work.
-HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)$(HOST_LIB_PATH_gettext)
+HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)
 
 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
@@ -796,11 +796,6 @@ HOST_LIB_PATH_isl = \
   $$r/$(HOST_SUBDIR)/isl/.libs:$$r/$(HOST_SUBDIR)/prev-isl/.libs:
 @endif isl
 
-@if gettext
-HOST_LIB_PATH_gettext = \
-  $$r/$(HOST_SUBDIR)/gettext/intl/.libs:$$r/$(HOST_SUBDIR)/prev-gettext/intl/.libs:
-@endif gettext
-
 
 CXX_FOR_TARGET_FLAG_TO_PASS = \
 	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
@@ -19827,7 +19822,7 @@ configure-gettext:
 	  $$s/$$module_srcdir/configure \
 	  --srcdir=$${topdir}/$$module_srcdir \
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-	  --target=${target_alias} --disable-shared --disable-java --disable-csharp --with-pic \
+	  --target=${target_alias} --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf \
 	  || exit 1
 @endif gettext
 
@@ -19863,7 +19858,7 @@ configure-stage1-gettext:
 	  --target=${target_alias} \
 	   \
 	  $(STAGE1_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stage2-gettext maybe-configure-stage2-gettext
@@ -19897,7 +19892,7 @@ configure-stage2-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE2_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stage3-gettext maybe-configure-stage3-gettext
@@ -19931,7 +19926,7 @@ configure-stage3-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE3_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stage4-gettext maybe-configure-stage4-gettext
@@ -19965,7 +19960,7 @@ configure-stage4-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE4_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stageprofile-gettext maybe-configure-stageprofile-gettext
@@ -19999,7 +19994,7 @@ configure-stageprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stagetrain-gettext maybe-configure-stagetrain-gettext
@@ -20033,7 +20028,7 @@ configure-stagetrain-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEtrain_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stagefeedback-gettext maybe-configure-stagefeedback-gettext
@@ -20067,7 +20062,7 @@ configure-stagefeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEfeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautoprofile-gettext maybe-configure-stageautoprofile-gettext
@@ -20101,7 +20096,7 @@ configure-stageautoprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautoprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautofeedback-gettext maybe-configure-stageautofeedback-gettext
@@ -20135,7 +20130,7 @@ configure-stageautofeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautofeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic --disable-libasprintf
 @endif gettext-bootstrap
 
 
@@ -20592,23 +20587,8 @@ maybe-info-gettext:
 @if gettext
 maybe-info-gettext: info-gettext
 
-info-gettext: \
-    configure-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing info in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          info) \
-	  || exit 1
+# gettext doesn't support info.
+info-gettext:
 
 @endif gettext
 
@@ -20617,23 +20597,8 @@ maybe-dvi-gettext:
 @if gettext
 maybe-dvi-gettext: dvi-gettext
 
-dvi-gettext: \
-    configure-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing dvi in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          dvi) \
-	  || exit 1
+# gettext doesn't support dvi.
+dvi-gettext:
 
 @endif gettext
 
@@ -20642,23 +20607,8 @@ maybe-pdf-gettext:
 @if gettext
 maybe-pdf-gettext: pdf-gettext
 
-pdf-gettext: \
-    configure-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing pdf in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          pdf) \
-	  || exit 1
+# gettext doesn't support pdf.
+pdf-gettext:
 
 @endif gettext
 
@@ -20667,23 +20617,8 @@ maybe-html-gettext:
 @if gettext
 maybe-html-gettext: html-gettext
 
-html-gettext: \
-    configure-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing html in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          html) \
-	  || exit 1
+# gettext doesn't support html.
+html-gettext:
 
 @endif gettext
 
@@ -20692,23 +20627,8 @@ maybe-TAGS-gettext:
 @if gettext
 maybe-TAGS-gettext: TAGS-gettext
 
-TAGS-gettext: \
-    configure-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing TAGS in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          TAGS) \
-	  || exit 1
+# gettext doesn't support TAGS.
+TAGS-gettext:
 
 @endif gettext
 
@@ -20717,24 +20637,8 @@ maybe-install-info-gettext:
 @if gettext
 maybe-install-info-gettext: install-info-gettext
 
-install-info-gettext: \
-    configure-gettext \
-    info-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing install-info in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          install-info) \
-	  || exit 1
+# gettext doesn't support install-info.
+install-info-gettext:
 
 @endif gettext
 
@@ -20743,24 +20647,8 @@ maybe-install-dvi-gettext:
 @if gettext
 maybe-install-dvi-gettext: install-dvi-gettext
 
-install-dvi-gettext: \
-    configure-gettext \
-    dvi-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing install-dvi in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          install-dvi) \
-	  || exit 1
+# gettext doesn't support install-dvi.
+install-dvi-gettext:
 
 @endif gettext
 
@@ -20769,24 +20657,8 @@ maybe-install-pdf-gettext:
 @if gettext
 maybe-install-pdf-gettext: install-pdf-gettext
 
-install-pdf-gettext: \
-    configure-gettext \
-    pdf-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing install-pdf in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          install-pdf) \
-	  || exit 1
+# gettext doesn't support install-pdf.
+install-pdf-gettext:
 
 @endif gettext
 
@@ -20795,24 +20667,8 @@ maybe-install-html-gettext:
 @if gettext
 maybe-install-html-gettext: install-html-gettext
 
-install-html-gettext: \
-    configure-gettext \
-    html-gettext 
-	@[ -f ./gettext/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing install-html in gettext"; \
-	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          install-html) \
-	  || exit 1
+# gettext doesn't support install-html.
+install-html-gettext:
 
 @endif gettext
 
-- 
2.42.1


[-- Attachment #1.3: Type: text/plain, Size: 300 bytes --]


If these work, I'll update download_prerequisites and see about posting
the patch for review.

Thanks, have a lovely day.

>> And while at it, I would also pass --disable-java and --disable-csharp.
>
> Yes, I noticed those and disabled them already.
>
>> Bruno


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-20 23:00                                     ` Bruno Haible
@ 2023-11-21  0:45                                       ` Arsen Arsenović
  2023-11-21 13:13                                         ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-21  0:45 UTC (permalink / raw)
  To: Bruno Haible; +Cc: David Edelsohn, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]


Bruno Haible <bruno@clisp.org> writes:

> Arsen Arsenović wrote:
>>   Comparing stages 2 and 3
>>   Bootstrap comparison failure!
>>   gettext/libasprintf/autosprintf.o differs
>>   make[2]: *** [Makefile:23435: compare] Error 1
>
> You should be able to work around this by passing the additional option
> --disable-libasprintf to gettext-runtime/configure. Nothing in GCC needs
> libasprintf; therefore there is no need to build it.

Ah, sure, that works for me too (note that the fix is to pass
-frandom-seed=, according to Jakub, should this show up again).

> And while at it, I would also pass --disable-java and --disable-csharp.

Yes, I noticed those and disabled them already.

> Bruno


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-20 21:38                                     ` David Edelsohn
@ 2023-11-21  0:44                                       ` Arsen Arsenović
  0 siblings, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-21  0:44 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Bruno Haible, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 4182 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> _GLOBAL__F_xxx is the EH frame data.
>
> It's using the filename with full path for the unique name, which is why it
> includes .._.._.. .  Apparently it is adding a random number as well for
> uniqueness.  I guess that this is the downside of building in tree, and
> apparently it is rebuilding gettext itself with the different stages of the
> compiler, so the appended random number changes.

Jakub pointed me to -frandom-seed=, which stabilized this, it'd seem.
Running a clean build to test (hacking an existing one worked).

Will report back.

> Thanks, David
>
>
> On Mon, Nov 20, 2023 at 4:23 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > On Sun, Nov 19, 2023 at 5:15 PM Bruno Haible <bruno@clisp.org> wrote:
>> >
>> >> David Edelsohn wrote:
>> >> > --disable-threads currently does not completely disable threads.
>> Bruno
>> >> is
>> >> > suggesting --enable-threads=isoc that relies on mtx mutex functions in
>> >> libc.
>> >>
>> >> Unfortunately, as said in the other mail today, relying only on mtx_*
>> >> functions
>> >> did not drop the dependency towards libpthreads.
>> >>
>> >> So, I've made a new release gettext-0.22.4, that includes only these
>> >> changes:
>> >>
>> >>   - AM_GNU_GETTEXT now recognizes a statically built libintl on macOS
>> and
>> >> AIX.
>> >>
>> >>   - Passing --disable-threads now builds a libintl that, on AIX, does
>> not
>> >>     need -lpthread.
>> >>
>> >>   - Other build fixes on AIX.
>> >>
>> >> > Yes, GCC should configure the in tree gettext with --disable-threads,
>> but
>> >> > that configure option is not completely effective and does not
>> produce a
>> >> > build without threads references.
>> >>
>> >> Now it is effective. But you (Arsen) should state in the documentation
>> >> (gcc/doc/install.texi) that for --disable-threads to have this effect,
>> >> one needs gettext version 0.22.4 or newer.
>> >>
>> >
>> > So the question is do we want to change GCC on AIX to always link against
>> > pthreads so that GCC can build with default, external builds of gettext
>> > libintl.  I don't see a path for i18n support to work for GCC on AIX
>> > without that unfortunate change.
>>
>> Well, if detectable by the build system for, I imagine we could avoid
>> pthread if gettext is built without them.  With the 'private' gettext
>> build, we should never need threads anyway.
>>
>> P.S: Building on AIX is nearly successful.  gettext-0.22.4 builds, twice
>> or even thrice, but ends up producing a bootstrap comparison fail:
>>
>>   make[3]: Leaving directory '/home/arsen/build'
>>   Comparing stages 2 and 3
>>   Bootstrap comparison failure!
>>   gettext/libasprintf/autosprintf.o differs
>>   make[2]: *** [Makefile:23435: compare] Error 1
>>
>> Upon inspecting these files, I see the following diff:
>>
>> ~ 1 $ git diff <(objdump --all-headers autosprintf.o2) <(objdump
>> --all-headers autosprintf.o3)
>> diff --git a/dev/fd/63 b/dev/fd/62
>> --- a/dev/fd/63
>> +++ b/dev/fd/62
>> ...
>> @@ -92,7 +92,7 @@ AUX indx   30 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0
>> snstb 0
>>  AUX val    23 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
>>  [ 58](sec  1)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x00000460
>> _autosprintf.ro_
>>  AUX val   312 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
>> -[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460
>> _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0xa20d51b1d7a1772f
>> +[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460
>> _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0x9c04058e89d7a7a4
>>  AUX indx   58 prmhsh 0 snhsh 0 typ 2 algn 0 clss 1 stb 0 snstb 0
>>  [ 62](sec  2)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x000005a0
>> _autosprintf.rw_
>>  AUX val     0 prmhsh 0 snhsh 0 typ 1 algn 4 clss 5 stb 0 snstb 0
>>
>> I am unsure what this symbol is.  It does not appear in the stripped
>> binary.
>> --
>> Arsen Arsenović
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-20 21:18                                   ` Arsen Arsenović
  2023-11-20 21:38                                     ` David Edelsohn
@ 2023-11-20 23:00                                     ` Bruno Haible
  2023-11-21  0:45                                       ` Arsen Arsenović
  1 sibling, 1 reply; 38+ messages in thread
From: Bruno Haible @ 2023-11-20 23:00 UTC (permalink / raw)
  To: David Edelsohn, Arsen Arsenović; +Cc: Richard Biener, gcc-patches

Arsen Arsenović wrote:
>   Comparing stages 2 and 3
>   Bootstrap comparison failure!
>   gettext/libasprintf/autosprintf.o differs
>   make[2]: *** [Makefile:23435: compare] Error 1

You should be able to work around this by passing the additional option
--disable-libasprintf to gettext-runtime/configure. Nothing in GCC needs
libasprintf; therefore there is no need to build it.

And while at it, I would also pass --disable-java and --disable-csharp.

Bruno




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-20 21:18                                   ` Arsen Arsenović
@ 2023-11-20 21:38                                     ` David Edelsohn
  2023-11-21  0:44                                       ` Arsen Arsenović
  2023-11-20 23:00                                     ` Bruno Haible
  1 sibling, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-20 21:38 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Bruno Haible, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3842 bytes --]

_GLOBAL__F_xxx is the EH frame data.

It's using the filename with full path for the unique name, which is why it
includes .._.._.. .  Apparently it is adding a random number as well for
uniqueness.  I guess that this is the downside of building in tree, and
apparently it is rebuilding gettext itself with the different stages of the
compiler, so the appended random number changes.

Thanks, David


On Mon, Nov 20, 2023 at 4:23 PM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > On Sun, Nov 19, 2023 at 5:15 PM Bruno Haible <bruno@clisp.org> wrote:
> >
> >> David Edelsohn wrote:
> >> > --disable-threads currently does not completely disable threads.
> Bruno
> >> is
> >> > suggesting --enable-threads=isoc that relies on mtx mutex functions in
> >> libc.
> >>
> >> Unfortunately, as said in the other mail today, relying only on mtx_*
> >> functions
> >> did not drop the dependency towards libpthreads.
> >>
> >> So, I've made a new release gettext-0.22.4, that includes only these
> >> changes:
> >>
> >>   - AM_GNU_GETTEXT now recognizes a statically built libintl on macOS
> and
> >> AIX.
> >>
> >>   - Passing --disable-threads now builds a libintl that, on AIX, does
> not
> >>     need -lpthread.
> >>
> >>   - Other build fixes on AIX.
> >>
> >> > Yes, GCC should configure the in tree gettext with --disable-threads,
> but
> >> > that configure option is not completely effective and does not
> produce a
> >> > build without threads references.
> >>
> >> Now it is effective. But you (Arsen) should state in the documentation
> >> (gcc/doc/install.texi) that for --disable-threads to have this effect,
> >> one needs gettext version 0.22.4 or newer.
> >>
> >
> > So the question is do we want to change GCC on AIX to always link against
> > pthreads so that GCC can build with default, external builds of gettext
> > libintl.  I don't see a path for i18n support to work for GCC on AIX
> > without that unfortunate change.
>
> Well, if detectable by the build system for, I imagine we could avoid
> pthread if gettext is built without them.  With the 'private' gettext
> build, we should never need threads anyway.
>
> P.S: Building on AIX is nearly successful.  gettext-0.22.4 builds, twice
> or even thrice, but ends up producing a bootstrap comparison fail:
>
>   make[3]: Leaving directory '/home/arsen/build'
>   Comparing stages 2 and 3
>   Bootstrap comparison failure!
>   gettext/libasprintf/autosprintf.o differs
>   make[2]: *** [Makefile:23435: compare] Error 1
>
> Upon inspecting these files, I see the following diff:
>
> ~ 1 $ git diff <(objdump --all-headers autosprintf.o2) <(objdump
> --all-headers autosprintf.o3)
> diff --git a/dev/fd/63 b/dev/fd/62
> --- a/dev/fd/63
> +++ b/dev/fd/62
> ...
> @@ -92,7 +92,7 @@ AUX indx   30 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0
> snstb 0
>  AUX val    23 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
>  [ 58](sec  1)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x00000460
> _autosprintf.ro_
>  AUX val   312 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
> -[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460
> _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0xa20d51b1d7a1772f
> +[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460
> _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0x9c04058e89d7a7a4
>  AUX indx   58 prmhsh 0 snhsh 0 typ 2 algn 0 clss 1 stb 0 snstb 0
>  [ 62](sec  2)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x000005a0
> _autosprintf.rw_
>  AUX val     0 prmhsh 0 snhsh 0 typ 1 algn 4 clss 5 stb 0 snstb 0
>
> I am unsure what this symbol is.  It does not appear in the stripped
> binary.
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-20  1:17                                 ` David Edelsohn
@ 2023-11-20 21:18                                   ` Arsen Arsenović
  2023-11-20 21:38                                     ` David Edelsohn
  2023-11-20 23:00                                     ` Bruno Haible
  0 siblings, 2 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-20 21:18 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Bruno Haible, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3177 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Sun, Nov 19, 2023 at 5:15 PM Bruno Haible <bruno@clisp.org> wrote:
>
>> David Edelsohn wrote:
>> > --disable-threads currently does not completely disable threads.  Bruno
>> is
>> > suggesting --enable-threads=isoc that relies on mtx mutex functions in
>> libc.
>>
>> Unfortunately, as said in the other mail today, relying only on mtx_*
>> functions
>> did not drop the dependency towards libpthreads.
>>
>> So, I've made a new release gettext-0.22.4, that includes only these
>> changes:
>>
>>   - AM_GNU_GETTEXT now recognizes a statically built libintl on macOS and
>> AIX.
>>
>>   - Passing --disable-threads now builds a libintl that, on AIX, does not
>>     need -lpthread.
>>
>>   - Other build fixes on AIX.
>>
>> > Yes, GCC should configure the in tree gettext with --disable-threads, but
>> > that configure option is not completely effective and does not produce a
>> > build without threads references.
>>
>> Now it is effective. But you (Arsen) should state in the documentation
>> (gcc/doc/install.texi) that for --disable-threads to have this effect,
>> one needs gettext version 0.22.4 or newer.
>>
>
> So the question is do we want to change GCC on AIX to always link against
> pthreads so that GCC can build with default, external builds of gettext
> libintl.  I don't see a path for i18n support to work for GCC on AIX
> without that unfortunate change.

Well, if detectable by the build system for, I imagine we could avoid
pthread if gettext is built without them.  With the 'private' gettext
build, we should never need threads anyway.

P.S: Building on AIX is nearly successful.  gettext-0.22.4 builds, twice
or even thrice, but ends up producing a bootstrap comparison fail:

  make[3]: Leaving directory '/home/arsen/build'
  Comparing stages 2 and 3
  Bootstrap comparison failure!
  gettext/libasprintf/autosprintf.o differs
  make[2]: *** [Makefile:23435: compare] Error 1

Upon inspecting these files, I see the following diff:

~ 1 $ git diff <(objdump --all-headers autosprintf.o2) <(objdump --all-headers autosprintf.o3)
diff --git a/dev/fd/63 b/dev/fd/62
--- a/dev/fd/63
+++ b/dev/fd/62
...
@@ -92,7 +92,7 @@ AUX indx   30 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0
 AUX val    23 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
 [ 58](sec  1)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x00000460 _autosprintf.ro_
 AUX val   312 prmhsh 0 snhsh 0 typ 1 algn 4 clss 1 stb 0 snstb 0
-[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460 _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0xa20d51b1d7a1772f
+[ 60](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 1) 0x00000460 _GLOBAL__F_.._.._.._gcc_gettext_gettext_runtime_libasprintf_autosprintf.cc_DFF67DD7_0x9c04058e89d7a7a4
 AUX indx   58 prmhsh 0 snhsh 0 typ 2 algn 0 clss 1 stb 0 snstb 0
 [ 62](sec  2)(fl 0x00)(ty    0)(scl 107) (nx 1) 0x000005a0 _autosprintf.rw_
 AUX val     0 prmhsh 0 snhsh 0 typ 1 algn 4 clss 5 stb 0 snstb 0

I am unsure what this symbol is.  It does not appear in the stripped
binary.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-19 21:55                               ` Bruno Haible
  2023-11-19 23:00                                 ` Bruno Haible
@ 2023-11-20  1:17                                 ` David Edelsohn
  2023-11-20 21:18                                   ` Arsen Arsenović
  1 sibling, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-20  1:17 UTC (permalink / raw)
  To: Bruno Haible; +Cc: Arsen Arsenović, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

On Sun, Nov 19, 2023 at 5:15 PM Bruno Haible <bruno@clisp.org> wrote:

> David Edelsohn wrote:
> > --disable-threads currently does not completely disable threads.  Bruno
> is
> > suggesting --enable-threads=isoc that relies on mtx mutex functions in
> libc.
>
> Unfortunately, as said in the other mail today, relying only on mtx_*
> functions
> did not drop the dependency towards libpthreads.
>
> So, I've made a new release gettext-0.22.4, that includes only these
> changes:
>
>   - AM_GNU_GETTEXT now recognizes a statically built libintl on macOS and
> AIX.
>
>   - Passing --disable-threads now builds a libintl that, on AIX, does not
>     need -lpthread.
>
>   - Other build fixes on AIX.
>
> > Yes, GCC should configure the in tree gettext with --disable-threads, but
> > that configure option is not completely effective and does not produce a
> > build without threads references.
>
> Now it is effective. But you (Arsen) should state in the documentation
> (gcc/doc/install.texi) that for --disable-threads to have this effect,
> one needs gettext version 0.22.4 or newer.
>

So the question is do we want to change GCC on AIX to always link against
pthreads so that GCC can build with default, external builds of gettext
libintl.  I don't see a path for i18n support to work for GCC on AIX
without that unfortunate change.

Thanks, David

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-19 23:00                                 ` Bruno Haible
@ 2023-11-19 23:06                                   ` Andrew Pinski
  0 siblings, 0 replies; 38+ messages in thread
From: Andrew Pinski @ 2023-11-19 23:06 UTC (permalink / raw)
  To: Bruno Haible
  Cc: Arsen Arsenović, David Edelsohn, Richard Biener, gcc-patches

On Sun, Nov 19, 2023 at 3:01 PM Bruno Haible <bruno@clisp.org> wrote:
>
> I wrote:
> > you (Arsen) should state in the documentation
> > (gcc/doc/install.texi) that for --disable-threads to have this effect,
> > one needs gettext version 0.22.4 or newer.
>
> Not in gcc/doc/install.texi, but elsewhere. This topic is not relevant to
> the average user who installs GCC from a tarball or from a git checkout.
> Only to GCC hackers who have peculiar needs.

That still is documented in install.texi really.
https://gcc.gnu.org/install/specific.html#x-ibm-aix is generated from
that and it talks about other options dealing with NLS there.
Which seems like that part might need to be updated too.

Thanks,
Andrew


>
> Bruno
>
>
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-19 21:55                               ` Bruno Haible
@ 2023-11-19 23:00                                 ` Bruno Haible
  2023-11-19 23:06                                   ` Andrew Pinski
  2023-11-20  1:17                                 ` David Edelsohn
  1 sibling, 1 reply; 38+ messages in thread
From: Bruno Haible @ 2023-11-19 23:00 UTC (permalink / raw)
  To: Arsen Arsenović, David Edelsohn; +Cc: Richard Biener, gcc-patches

I wrote:
> you (Arsen) should state in the documentation
> (gcc/doc/install.texi) that for --disable-threads to have this effect,
> one needs gettext version 0.22.4 or newer.

Not in gcc/doc/install.texi, but elsewhere. This topic is not relevant to
the average user who installs GCC from a tarball or from a git checkout.
Only to GCC hackers who have peculiar needs.

Bruno




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17 16:07                             ` David Edelsohn
  2023-11-18 18:10                               ` Arsen Arsenović
@ 2023-11-19 21:55                               ` Bruno Haible
  2023-11-19 23:00                                 ` Bruno Haible
  2023-11-20  1:17                                 ` David Edelsohn
  1 sibling, 2 replies; 38+ messages in thread
From: Bruno Haible @ 2023-11-19 21:55 UTC (permalink / raw)
  To: Arsen Arsenović, David Edelsohn; +Cc: Richard Biener, gcc-patches

David Edelsohn wrote:
> --disable-threads currently does not completely disable threads.  Bruno is
> suggesting --enable-threads=isoc that relies on mtx mutex functions in libc.

Unfortunately, as said in the other mail today, relying only on mtx_* functions
did not drop the dependency towards libpthreads.

So, I've made a new release gettext-0.22.4, that includes only these changes:

  - AM_GNU_GETTEXT now recognizes a statically built libintl on macOS and AIX.

  - Passing --disable-threads now builds a libintl that, on AIX, does not
    need -lpthread.

  - Other build fixes on AIX.

> Yes, GCC should configure the in tree gettext with --disable-threads, but
> that configure option is not completely effective and does not produce a
> build without threads references.

Now it is effective. But you (Arsen) should state in the documentation
(gcc/doc/install.texi) that for --disable-threads to have this effect,
one needs gettext version 0.22.4 or newer.

Bruno




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17 16:07                             ` David Edelsohn
@ 2023-11-18 18:10                               ` Arsen Arsenović
  2023-11-19 21:55                               ` Bruno Haible
  1 sibling, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-18 18:10 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 8231 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Fri, Nov 17, 2023 at 10:17 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > On Fri, Nov 17, 2023 at 3:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>> >
>> >>
>> >> David Edelsohn <dje.gcc@gmail.com> writes:
>> >>
>> >> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me>
>> wrote:
>> >> >
>> >> > [snip]
>> >> >> Sure, but my patch does insert --disable-shared:
>> >> >>
>> >> >> --8<---------------cut here---------------start------------->8---
>> >> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
>> >> >>                 module_srcdir= "gettext/gettext-runtime";
>> >> >>                 // We always build gettext with pic, because some
>> >> packages
>> >> >> (e.g. gdbserver)
>> >> >>                 // need it in some configuratons, which is determined
>> >> via
>> >> >> nontrivial tests.
>> >> >>                 // Always enabling pic seems to make sense for
>> something
>> >> >> tied to
>> >> >>                 // user-facing output.
>> >> >>                 extra_configure_flags='--disable-shared
>> --disable-java
>> >> >> --disable-csharp --with-pic';
>> >> >>                 lib_path=intl/.libs; };
>> >> >> --8<---------------cut here---------------end--------------->8---
>> >> >>
>> >> >> ... and it is applied:
>> >> >>
>> >> >> --8<---------------cut here---------------start------------->8---
>> >> >> -bash-5.1$ ./config.status --config
>> >> >> --srcdir=../../gcc/gettext/gettext-runtime
>> --cache-file=./config.cache
>> >> >>   --disable-werror --with-gmp=/opt/cfarm
>> >> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>> >> >>   --with-included-gettext --program-transform-name=s,y,y,
>> >> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
>> >> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
>> >> >>   --disable-intermodule --enable-checking=yes,types,extra
>> >> >>   --disable-coverage --enable-languages=c,c++
>> >> >>   --disable-build-format-warnings --disable-shared --disable-java
>> >> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
>> >> >>   host_alias=powerpc-ibm-aix7.3.1.0
>> target_alias=powerpc-ibm-aix7.3.1.0
>> >> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
>> >> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
>> >> >> --8<---------------cut here---------------end--------------->8---
>> >> >>
>> >> >> I'm unsure how to tell what the produced binaries are w.r.t static or
>> >> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I
>> see
>> >> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
>> >> >>
>> >> >
>> >> > An AIX shared library created by libtool will look like
>> >> > libfoo.a[libfoo.so.N], where N is the package major version number.
>> >> > Normally with one file.
>> >>
>> >> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
>> >> > with multiple object files.
>> >> >
>> >> > An AIX archive can contain a combination of shared objects and
>> >> > normal object files.
>> >> >
>> >> > AIX normally uses the convention shr.o or shr_64.o for the name
>> >> > of the shared object file.  Hint, hint, an AIX archive can contain
>> >> > both 32 bit and 64 bit object files or shared objects.
>> >> >
>> >> > I don't know why the gettext build system would create
>> >> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
>> >> > if --disable-shared was requested.  That clearly is using the
>> >> > naming of a libtool AIX shared object and failing due to
>> >> > the missing shared object.  Although in this case, the problem
>> >> > seems to be the shared library load path.  AIX uses LIBPATH,
>> >> > not LD_LIBRARY_PATH.
>> >>
>> >> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
>> >> libintl.a contains a bunch of objects, as I'd expect of a static
>> >> library:
>> >>
>> >> --8<---------------cut here---------------start------------->8---
>> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
>> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
>> >> bindtextdom.o
>> >> dcgettext.o
>> >> ...
>> >> --8<---------------cut here---------------end--------------->8---
>> >>
>> >>
>> >> > Also, for me, the out of tree path was
>> >> >
>> >> > gettext/gettext-runtime/intl/.libs
>> >> >
>> >> > Is your search path missing a level?
>> >>
>> >> No, the above is generated by the GCC build system and builds
>> >> gettext-runtime directly (per Brunos recommendation a while ago) as it
>> >> is replacing intl/ of similar functionality.
>> >>
>> >> I'm currently building GCC with libintl with the threads hack you
>> >> mentioned applied (as I got undefined references to the pthread
>> >> functions you discovered).  I suspect that, bar this issue (which, IIUC,
>> >> Bruno will fix in a new release?) the patch above will fix the issues
>> >> you've encountered on AIX (note that if you want to use gettext in-tree,
>> >> you'd still have to fetch gettext into the tree).
>> >>
>> >> Maybe we should provide a download-prerequisite-y script that skips
>> >> everything but GNU gettext, to retain same behavior?
>> >>
>> >> Have a lovely day.
>> >>
>> >
>> > I'm concerned that the gettext fixes are working around AIX support for
>> > libpthread.a as opposed to making --disable-threads function.
>>
>> Indeed, my intention is to --disable-threads.  The goal of the
>> workaround is simply to test the patch I wrote.
>>
>
> --disable-threads currently does not completely disable threads.  Bruno is
> suggesting --enable-threads=isoc that relies on mtx mutex functions in libc.

Even with --enable-threads=isoc in place of --disable-threads, I get a
link error:

(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing Symbol
 ----------------------------------------------------------------------------------------------
 .pthread_mutex_lock       [26]    ER PR ../../../../gcc/gettext/gettext-runtime/intl/gnulib-lib/setlocale_null.c(./../gettext/intl/.libs/libintl.a[libgnu_la-setlocale_null.o])
                                   00000388 .text    R_RBR    [99]    <.setlocale_null_with_lock>
 .pthread_mutex_unlock     [30]    ER PR ../../../../gcc/gettext/gettext-runtime/intl/gnulib-lib/setlocale_null.c(./../gettext/intl/.libs/libintl.a[libgnu_la-setlocale_null.o])
                                   000003bc .text    R_RBR    [99]    <.setlocale_null_with_lock>
ER: The return code is 8.
collect2: error: ld returned 8 exit status

Bruno, am I missing something?

-bash-5.1$ ./config.status --config
--srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache --disable-werror --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch --with-included-gettext --program-transform-name=s,y,y, --disable-option-checking --build=powerpc-ibm-aix7.3.1.0 --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0 --disable-intermodule --enable-checking=yes,types,extra --disable-coverage --enable-languages=c,c++ --disable-build-format-warnings --disable-shared --enable-threads=isoc --disable-java --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0 host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0 CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g

This is on gcc119.

TIA, have a lovely night.

> Yes, GCC should configure the in tree gettext with --disable-threads, but
> that configure option is not completely effective and does not produce a
> build without threads references.
>
> Thanks, David
>
>
>>
>> > --enabled-threads=isoc use of mtx_* is a workaround, but it's still not
>> > allowing users to truly disable threads.
>> >
>> > Thanks, David
>>
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17 15:16                           ` Arsen Arsenović
@ 2023-11-17 16:07                             ` David Edelsohn
  2023-11-18 18:10                               ` Arsen Arsenović
  2023-11-19 21:55                               ` Bruno Haible
  0 siblings, 2 replies; 38+ messages in thread
From: David Edelsohn @ 2023-11-17 16:07 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 6012 bytes --]

On Fri, Nov 17, 2023 at 10:17 AM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > On Fri, Nov 17, 2023 at 3:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:
> >
> >>
> >> David Edelsohn <dje.gcc@gmail.com> writes:
> >>
> >> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me>
> wrote:
> >> >
> >> > [snip]
> >> >> Sure, but my patch does insert --disable-shared:
> >> >>
> >> >> --8<---------------cut here---------------start------------->8---
> >> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
> >> >>                 module_srcdir= "gettext/gettext-runtime";
> >> >>                 // We always build gettext with pic, because some
> >> packages
> >> >> (e.g. gdbserver)
> >> >>                 // need it in some configuratons, which is determined
> >> via
> >> >> nontrivial tests.
> >> >>                 // Always enabling pic seems to make sense for
> something
> >> >> tied to
> >> >>                 // user-facing output.
> >> >>                 extra_configure_flags='--disable-shared
> --disable-java
> >> >> --disable-csharp --with-pic';
> >> >>                 lib_path=intl/.libs; };
> >> >> --8<---------------cut here---------------end--------------->8---
> >> >>
> >> >> ... and it is applied:
> >> >>
> >> >> --8<---------------cut here---------------start------------->8---
> >> >> -bash-5.1$ ./config.status --config
> >> >> --srcdir=../../gcc/gettext/gettext-runtime
> --cache-file=./config.cache
> >> >>   --disable-werror --with-gmp=/opt/cfarm
> >> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
> >> >>   --with-included-gettext --program-transform-name=s,y,y,
> >> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
> >> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
> >> >>   --disable-intermodule --enable-checking=yes,types,extra
> >> >>   --disable-coverage --enable-languages=c,c++
> >> >>   --disable-build-format-warnings --disable-shared --disable-java
> >> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
> >> >>   host_alias=powerpc-ibm-aix7.3.1.0
> target_alias=powerpc-ibm-aix7.3.1.0
> >> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
> >> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
> >> >> --8<---------------cut here---------------end--------------->8---
> >> >>
> >> >> I'm unsure how to tell what the produced binaries are w.r.t static or
> >> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I
> see
> >> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
> >> >>
> >> >
> >> > An AIX shared library created by libtool will look like
> >> > libfoo.a[libfoo.so.N], where N is the package major version number.
> >> > Normally with one file.
> >>
> >> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
> >> > with multiple object files.
> >> >
> >> > An AIX archive can contain a combination of shared objects and
> >> > normal object files.
> >> >
> >> > AIX normally uses the convention shr.o or shr_64.o for the name
> >> > of the shared object file.  Hint, hint, an AIX archive can contain
> >> > both 32 bit and 64 bit object files or shared objects.
> >> >
> >> > I don't know why the gettext build system would create
> >> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
> >> > if --disable-shared was requested.  That clearly is using the
> >> > naming of a libtool AIX shared object and failing due to
> >> > the missing shared object.  Although in this case, the problem
> >> > seems to be the shared library load path.  AIX uses LIBPATH,
> >> > not LD_LIBRARY_PATH.
> >>
> >> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
> >> libintl.a contains a bunch of objects, as I'd expect of a static
> >> library:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
> >> bindtextdom.o
> >> dcgettext.o
> >> ...
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >>
> >> > Also, for me, the out of tree path was
> >> >
> >> > gettext/gettext-runtime/intl/.libs
> >> >
> >> > Is your search path missing a level?
> >>
> >> No, the above is generated by the GCC build system and builds
> >> gettext-runtime directly (per Brunos recommendation a while ago) as it
> >> is replacing intl/ of similar functionality.
> >>
> >> I'm currently building GCC with libintl with the threads hack you
> >> mentioned applied (as I got undefined references to the pthread
> >> functions you discovered).  I suspect that, bar this issue (which, IIUC,
> >> Bruno will fix in a new release?) the patch above will fix the issues
> >> you've encountered on AIX (note that if you want to use gettext in-tree,
> >> you'd still have to fetch gettext into the tree).
> >>
> >> Maybe we should provide a download-prerequisite-y script that skips
> >> everything but GNU gettext, to retain same behavior?
> >>
> >> Have a lovely day.
> >>
> >
> > I'm concerned that the gettext fixes are working around AIX support for
> > libpthread.a as opposed to making --disable-threads function.
>
> Indeed, my intention is to --disable-threads.  The goal of the
> workaround is simply to test the patch I wrote.
>

--disable-threads currently does not completely disable threads.  Bruno is
suggesting --enable-threads=isoc that relies on mtx mutex functions in libc.

Yes, GCC should configure the in tree gettext with --disable-threads, but
that configure option is not completely effective and does not produce a
build without threads references.

Thanks, David


>
> > --enabled-threads=isoc use of mtx_* is a workaround, but it's still not
> > allowing users to truly disable threads.
> >
> > Thanks, David
>
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17 14:41                         ` David Edelsohn
@ 2023-11-17 15:16                           ` Arsen Arsenović
  2023-11-17 16:07                             ` David Edelsohn
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-17 15:16 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 5329 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Fri, Nov 17, 2023 at 3:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>> >
>> > [snip]
>> >> Sure, but my patch does insert --disable-shared:
>> >>
>> >> --8<---------------cut here---------------start------------->8---
>> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
>> >>                 module_srcdir= "gettext/gettext-runtime";
>> >>                 // We always build gettext with pic, because some
>> packages
>> >> (e.g. gdbserver)
>> >>                 // need it in some configuratons, which is determined
>> via
>> >> nontrivial tests.
>> >>                 // Always enabling pic seems to make sense for something
>> >> tied to
>> >>                 // user-facing output.
>> >>                 extra_configure_flags='--disable-shared --disable-java
>> >> --disable-csharp --with-pic';
>> >>                 lib_path=intl/.libs; };
>> >> --8<---------------cut here---------------end--------------->8---
>> >>
>> >> ... and it is applied:
>> >>
>> >> --8<---------------cut here---------------start------------->8---
>> >> -bash-5.1$ ./config.status --config
>> >> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
>> >>   --disable-werror --with-gmp=/opt/cfarm
>> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>> >>   --with-included-gettext --program-transform-name=s,y,y,
>> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
>> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
>> >>   --disable-intermodule --enable-checking=yes,types,extra
>> >>   --disable-coverage --enable-languages=c,c++
>> >>   --disable-build-format-warnings --disable-shared --disable-java
>> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
>> >>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
>> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
>> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
>> >> --8<---------------cut here---------------end--------------->8---
>> >>
>> >> I'm unsure how to tell what the produced binaries are w.r.t static or
>> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
>> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
>> >>
>> >
>> > An AIX shared library created by libtool will look like
>> > libfoo.a[libfoo.so.N], where N is the package major version number.
>> > Normally with one file.
>>
>> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
>> > with multiple object files.
>> >
>> > An AIX archive can contain a combination of shared objects and
>> > normal object files.
>> >
>> > AIX normally uses the convention shr.o or shr_64.o for the name
>> > of the shared object file.  Hint, hint, an AIX archive can contain
>> > both 32 bit and 64 bit object files or shared objects.
>> >
>> > I don't know why the gettext build system would create
>> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
>> > if --disable-shared was requested.  That clearly is using the
>> > naming of a libtool AIX shared object and failing due to
>> > the missing shared object.  Although in this case, the problem
>> > seems to be the shared library load path.  AIX uses LIBPATH,
>> > not LD_LIBRARY_PATH.
>>
>> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
>> libintl.a contains a bunch of objects, as I'd expect of a static
>> library:
>>
>> --8<---------------cut here---------------start------------->8---
>> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
>> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
>> bindtextdom.o
>> dcgettext.o
>> ...
>> --8<---------------cut here---------------end--------------->8---
>>
>>
>> > Also, for me, the out of tree path was
>> >
>> > gettext/gettext-runtime/intl/.libs
>> >
>> > Is your search path missing a level?
>>
>> No, the above is generated by the GCC build system and builds
>> gettext-runtime directly (per Brunos recommendation a while ago) as it
>> is replacing intl/ of similar functionality.
>>
>> I'm currently building GCC with libintl with the threads hack you
>> mentioned applied (as I got undefined references to the pthread
>> functions you discovered).  I suspect that, bar this issue (which, IIUC,
>> Bruno will fix in a new release?) the patch above will fix the issues
>> you've encountered on AIX (note that if you want to use gettext in-tree,
>> you'd still have to fetch gettext into the tree).
>>
>> Maybe we should provide a download-prerequisite-y script that skips
>> everything but GNU gettext, to retain same behavior?
>>
>> Have a lovely day.
>>
>
> I'm concerned that the gettext fixes are working around AIX support for
> libpthread.a as opposed to making --disable-threads function.

Indeed, my intention is to --disable-threads.  The goal of the
workaround is simply to test the patch I wrote.

> --enabled-threads=isoc use of mtx_* is a workaround, but it's still not
> allowing users to truly disable threads.
>
> Thanks, David


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17  8:34                       ` Arsen Arsenović
  2023-11-17  8:50                         ` Richard Biener
@ 2023-11-17 14:41                         ` David Edelsohn
  2023-11-17 15:16                           ` Arsen Arsenović
  1 sibling, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-17 14:41 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 5018 bytes --]

On Fri, Nov 17, 2023 at 3:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:
> >
> > [snip]
> >> Sure, but my patch does insert --disable-shared:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
> >>                 module_srcdir= "gettext/gettext-runtime";
> >>                 // We always build gettext with pic, because some
> packages
> >> (e.g. gdbserver)
> >>                 // need it in some configuratons, which is determined
> via
> >> nontrivial tests.
> >>                 // Always enabling pic seems to make sense for something
> >> tied to
> >>                 // user-facing output.
> >>                 extra_configure_flags='--disable-shared --disable-java
> >> --disable-csharp --with-pic';
> >>                 lib_path=intl/.libs; };
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >> ... and it is applied:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> -bash-5.1$ ./config.status --config
> >> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
> >>   --disable-werror --with-gmp=/opt/cfarm
> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
> >>   --with-included-gettext --program-transform-name=s,y,y,
> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
> >>   --disable-intermodule --enable-checking=yes,types,extra
> >>   --disable-coverage --enable-languages=c,c++
> >>   --disable-build-format-warnings --disable-shared --disable-java
> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
> >>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >> I'm unsure how to tell what the produced binaries are w.r.t static or
> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
> >>
> >
> > An AIX shared library created by libtool will look like
> > libfoo.a[libfoo.so.N], where N is the package major version number.
> > Normally with one file.
>
> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
> > with multiple object files.
> >
> > An AIX archive can contain a combination of shared objects and
> > normal object files.
> >
> > AIX normally uses the convention shr.o or shr_64.o for the name
> > of the shared object file.  Hint, hint, an AIX archive can contain
> > both 32 bit and 64 bit object files or shared objects.
> >
> > I don't know why the gettext build system would create
> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
> > if --disable-shared was requested.  That clearly is using the
> > naming of a libtool AIX shared object and failing due to
> > the missing shared object.  Although in this case, the problem
> > seems to be the shared library load path.  AIX uses LIBPATH,
> > not LD_LIBRARY_PATH.
>
> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
> libintl.a contains a bunch of objects, as I'd expect of a static
> library:
>
> --8<---------------cut here---------------start------------->8---
> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
> bindtextdom.o
> dcgettext.o
> ...
> --8<---------------cut here---------------end--------------->8---
>
>
> > Also, for me, the out of tree path was
> >
> > gettext/gettext-runtime/intl/.libs
> >
> > Is your search path missing a level?
>
> No, the above is generated by the GCC build system and builds
> gettext-runtime directly (per Brunos recommendation a while ago) as it
> is replacing intl/ of similar functionality.
>
> I'm currently building GCC with libintl with the threads hack you
> mentioned applied (as I got undefined references to the pthread
> functions you discovered).  I suspect that, bar this issue (which, IIUC,
> Bruno will fix in a new release?) the patch above will fix the issues
> you've encountered on AIX (note that if you want to use gettext in-tree,
> you'd still have to fetch gettext into the tree).
>
> Maybe we should provide a download-prerequisite-y script that skips
> everything but GNU gettext, to retain same behavior?
>
> Have a lovely day.
>

I'm concerned that the gettext fixes are working around AIX support for
libpthread.a as opposed to making --disable-threads function.

--enabled-threads=isoc use of mtx_* is a workaround, but it's still not
allowing users to truly disable threads.

Thanks, David

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17  8:50                         ` Richard Biener
@ 2023-11-17  8:56                           ` Arsen Arsenović
  0 siblings, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-17  8:56 UTC (permalink / raw)
  To: Richard Biener; +Cc: David Edelsohn, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 5043 bytes --]


Richard Biener <richard.guenther@gmail.com> writes:

> On Fri, Nov 17, 2023 at 9:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>> >
>> > [snip]
>> >> Sure, but my patch does insert --disable-shared:
>> >>
>> >> --8<---------------cut here---------------start------------->8---
>> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
>> >>                 module_srcdir= "gettext/gettext-runtime";
>> >>                 // We always build gettext with pic, because some packages
>> >> (e.g. gdbserver)
>> >>                 // need it in some configuratons, which is determined via
>> >> nontrivial tests.
>> >>                 // Always enabling pic seems to make sense for something
>> >> tied to
>> >>                 // user-facing output.
>> >>                 extra_configure_flags='--disable-shared --disable-java
>> >> --disable-csharp --with-pic';
>> >>                 lib_path=intl/.libs; };
>> >> --8<---------------cut here---------------end--------------->8---
>> >>
>> >> ... and it is applied:
>> >>
>> >> --8<---------------cut here---------------start------------->8---
>> >> -bash-5.1$ ./config.status --config
>> >> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
>> >>   --disable-werror --with-gmp=/opt/cfarm
>> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>> >>   --with-included-gettext --program-transform-name=s,y,y,
>> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
>> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
>> >>   --disable-intermodule --enable-checking=yes,types,extra
>> >>   --disable-coverage --enable-languages=c,c++
>> >>   --disable-build-format-warnings --disable-shared --disable-java
>> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
>> >>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
>> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
>> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
>> >> --8<---------------cut here---------------end--------------->8---
>> >>
>> >> I'm unsure how to tell what the produced binaries are w.r.t static or
>> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
>> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
>> >>
>> >
>> > An AIX shared library created by libtool will look like
>> > libfoo.a[libfoo.so.N], where N is the package major version number.
>> > Normally with one file.
>>
>> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
>> > with multiple object files.
>> >
>> > An AIX archive can contain a combination of shared objects and
>> > normal object files.
>> >
>> > AIX normally uses the convention shr.o or shr_64.o for the name
>> > of the shared object file.  Hint, hint, an AIX archive can contain
>> > both 32 bit and 64 bit object files or shared objects.
>> >
>> > I don't know why the gettext build system would create
>> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
>> > if --disable-shared was requested.  That clearly is using the
>> > naming of a libtool AIX shared object and failing due to
>> > the missing shared object.  Although in this case, the problem
>> > seems to be the shared library load path.  AIX uses LIBPATH,
>> > not LD_LIBRARY_PATH.
>>
>> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
>> libintl.a contains a bunch of objects, as I'd expect of a static
>> library:
>>
>> --8<---------------cut here---------------start------------->8---
>> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
>> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
>> bindtextdom.o
>> dcgettext.o
>> ...
>> --8<---------------cut here---------------end--------------->8---
>>
>>
>> > Also, for me, the out of tree path was
>> >
>> > gettext/gettext-runtime/intl/.libs
>> >
>> > Is your search path missing a level?
>>
>> No, the above is generated by the GCC build system and builds
>> gettext-runtime directly (per Brunos recommendation a while ago) as it
>> is replacing intl/ of similar functionality.
>>
>> I'm currently building GCC with libintl with the threads hack you
>> mentioned applied (as I got undefined references to the pthread
>> functions you discovered).  I suspect that, bar this issue (which, IIUC,
>> Bruno will fix in a new release?) the patch above will fix the issues
>> you've encountered on AIX (note that if you want to use gettext in-tree,
>> you'd still have to fetch gettext into the tree).
>>
>> Maybe we should provide a download-prerequisite-y script that skips
>> everything but GNU gettext, to retain same behavior?
>
> You could add --only-gettext as option to it?

Sure, that sounds good to me.

>>
>> Have a lovely day.
>> --
>> Arsen Arsenović


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-17  8:34                       ` Arsen Arsenović
@ 2023-11-17  8:50                         ` Richard Biener
  2023-11-17  8:56                           ` Arsen Arsenović
  2023-11-17 14:41                         ` David Edelsohn
  1 sibling, 1 reply; 38+ messages in thread
From: Richard Biener @ 2023-11-17  8:50 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: David Edelsohn, Bruno Haible, gcc-patches

On Fri, Nov 17, 2023 at 9:46 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:
> >
> > [snip]
> >> Sure, but my patch does insert --disable-shared:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> host_modules= { module= gettext; bootstrap=true; no_install=true;
> >>                 module_srcdir= "gettext/gettext-runtime";
> >>                 // We always build gettext with pic, because some packages
> >> (e.g. gdbserver)
> >>                 // need it in some configuratons, which is determined via
> >> nontrivial tests.
> >>                 // Always enabling pic seems to make sense for something
> >> tied to
> >>                 // user-facing output.
> >>                 extra_configure_flags='--disable-shared --disable-java
> >> --disable-csharp --with-pic';
> >>                 lib_path=intl/.libs; };
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >> ... and it is applied:
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> -bash-5.1$ ./config.status --config
> >> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
> >>   --disable-werror --with-gmp=/opt/cfarm
> >>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
> >>   --with-included-gettext --program-transform-name=s,y,y,
> >>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
> >>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
> >>   --disable-intermodule --enable-checking=yes,types,extra
> >>   --disable-coverage --enable-languages=c,c++
> >>   --disable-build-format-warnings --disable-shared --disable-java
> >>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
> >>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
> >>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
> >>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
> >> --8<---------------cut here---------------end--------------->8---
> >>
> >> I'm unsure how to tell what the produced binaries are w.r.t static or
> >> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
> >>
> >
> > An AIX shared library created by libtool will look like
> > libfoo.a[libfoo.so.N], where N is the package major version number.
> > Normally with one file.
>
> > An AIX static library will look like libfoo.a[a.o, b.o, c.o]
> > with multiple object files.
> >
> > An AIX archive can contain a combination of shared objects and
> > normal object files.
> >
> > AIX normally uses the convention shr.o or shr_64.o for the name
> > of the shared object file.  Hint, hint, an AIX archive can contain
> > both 32 bit and 64 bit object files or shared objects.
> >
> > I don't know why the gettext build system would create
> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
> > if --disable-shared was requested.  That clearly is using the
> > naming of a libtool AIX shared object and failing due to
> > the missing shared object.  Although in this case, the problem
> > seems to be the shared library load path.  AIX uses LIBPATH,
> > not LD_LIBRARY_PATH.
>
> It doesn't create libintl.a with a libintl.so.8 inside of it.  The
> libintl.a contains a bunch of objects, as I'd expect of a static
> library:
>
> --8<---------------cut here---------------start------------->8---
> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a
> bindtextdom.o
> dcgettext.o
> ...
> --8<---------------cut here---------------end--------------->8---
>
>
> > Also, for me, the out of tree path was
> >
> > gettext/gettext-runtime/intl/.libs
> >
> > Is your search path missing a level?
>
> No, the above is generated by the GCC build system and builds
> gettext-runtime directly (per Brunos recommendation a while ago) as it
> is replacing intl/ of similar functionality.
>
> I'm currently building GCC with libintl with the threads hack you
> mentioned applied (as I got undefined references to the pthread
> functions you discovered).  I suspect that, bar this issue (which, IIUC,
> Bruno will fix in a new release?) the patch above will fix the issues
> you've encountered on AIX (note that if you want to use gettext in-tree,
> you'd still have to fetch gettext into the tree).
>
> Maybe we should provide a download-prerequisite-y script that skips
> everything but GNU gettext, to retain same behavior?

You could add --only-gettext as option to it?

>
> Have a lovely day.
> --
> Arsen Arsenović

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 23:59                     ` David Edelsohn
@ 2023-11-17  8:34                       ` Arsen Arsenović
  2023-11-17  8:50                         ` Richard Biener
  2023-11-17 14:41                         ` David Edelsohn
  0 siblings, 2 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-17  8:34 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 4490 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>
> [snip]
>> Sure, but my patch does insert --disable-shared:
>>
>> --8<---------------cut here---------------start------------->8---
>> host_modules= { module= gettext; bootstrap=true; no_install=true;
>>                 module_srcdir= "gettext/gettext-runtime";
>>                 // We always build gettext with pic, because some packages
>> (e.g. gdbserver)
>>                 // need it in some configuratons, which is determined via
>> nontrivial tests.
>>                 // Always enabling pic seems to make sense for something
>> tied to
>>                 // user-facing output.
>>                 extra_configure_flags='--disable-shared --disable-java
>> --disable-csharp --with-pic';
>>                 lib_path=intl/.libs; };
>> --8<---------------cut here---------------end--------------->8---
>>
>> ... and it is applied:
>>
>> --8<---------------cut here---------------start------------->8---
>> -bash-5.1$ ./config.status --config
>> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
>>   --disable-werror --with-gmp=/opt/cfarm
>>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>>   --with-included-gettext --program-transform-name=s,y,y,
>>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
>>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
>>   --disable-intermodule --enable-checking=yes,types,extra
>>   --disable-coverage --enable-languages=c,c++
>>   --disable-build-format-warnings --disable-shared --disable-java
>>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
>>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
>>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
>>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
>> --8<---------------cut here---------------end--------------->8---
>>
>> I'm unsure how to tell what the produced binaries are w.r.t static or
>> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
>> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
>>
>
> An AIX shared library created by libtool will look like
> libfoo.a[libfoo.so.N], where N is the package major version number.
> Normally with one file.

> An AIX static library will look like libfoo.a[a.o, b.o, c.o]
> with multiple object files.
>
> An AIX archive can contain a combination of shared objects and
> normal object files.
>
> AIX normally uses the convention shr.o or shr_64.o for the name
> of the shared object file.  Hint, hint, an AIX archive can contain
> both 32 bit and 64 bit object files or shared objects.
>
> I don't know why the gettext build system would create
> /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
> if --disable-shared was requested.  That clearly is using the
> naming of a libtool AIX shared object and failing due to
> the missing shared object.  Although in this case, the problem
> seems to be the shared library load path.  AIX uses LIBPATH,
> not LD_LIBRARY_PATH.

It doesn't create libintl.a with a libintl.so.8 inside of it.  The
libintl.a contains a bunch of objects, as I'd expect of a static
library:

--8<---------------cut here---------------start------------->8---
-bash-5.1$ ar -t gettext/intl/.libs/libintl.a  | grep libintl
-bash-5.1$ ar -t gettext/intl/.libs/libintl.a    
bindtextdom.o
dcgettext.o
...
--8<---------------cut here---------------end--------------->8---


> Also, for me, the out of tree path was
>
> gettext/gettext-runtime/intl/.libs
>
> Is your search path missing a level?

No, the above is generated by the GCC build system and builds
gettext-runtime directly (per Brunos recommendation a while ago) as it
is replacing intl/ of similar functionality.

I'm currently building GCC with libintl with the threads hack you
mentioned applied (as I got undefined references to the pthread
functions you discovered).  I suspect that, bar this issue (which, IIUC,
Bruno will fix in a new release?) the patch above will fix the issues
you've encountered on AIX (note that if you want to use gettext in-tree,
you'd still have to fetch gettext into the tree).

Maybe we should provide a download-prerequisite-y script that skips
everything but GNU gettext, to retain same behavior?

Have a lovely day.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 22:32                   ` Arsen Arsenović
@ 2023-11-16 23:59                     ` David Edelsohn
  2023-11-17  8:34                       ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-16 23:59 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 10361 bytes --]

On Thu, Nov 16, 2023 at 5:52 PM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > On Thu, Nov 16, 2023 at 5:22 PM Arsen Arsenović <arsen@aarsen.me> wrote:
> >
> >>
> >> David Edelsohn <dje.gcc@gmail.com> writes:
> >>
> >> > Don't build with the dependent libraries in tree.  Don't build the
> >> > dependent libraries as shared libraries. The libraries are already
> built
> >> > and in /opt/cfarm, as mentioned in the Compile Farm wiki.
> >> >
> >> > AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
> >> > libraries *ARE* shared object files in archives.  Shared object
> >> versioning
> >> > is handled by multiple objects in the same archive.
> >>
> >> Hmm, I see.  I removed all the deps but gettext from the tree.
> >>
> >> This leaves gettext-runtime fulfilling the previous role of intl/.
> >>
> >> However, I'm confused about how this worked before, in that case, since,
> >> IIRC, intl also produced libraries and was also put into host exports.
> >>
> >> Leaving gettext in tree produces:
> >>
> >> Could not load program gawk:
> >>         Dependent module
> >> /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) could
> not be
> >> loaded.
> >>         Member libintl.so.8 is not found in archive
> >>
> >> I'll try to see why intl/ didn't cause the same issue soon.
> >>
> >> Thanks, have a lovely evening.
> >>
> >
> > The previous version of "intl" was built as a static library.  Configure
> in
> > the older package had the option --enable-host-shared,
> > which I did not use.  Based on the failure message, the in-tree gettext
> > seems to be built as a shared library.  If you explicitly
> > pass --disable-shared to the in-tree configure, you may get farther.  I'm
> > currently using --disable-shared --disable-threads.
> > As we have discussed, the current gettext will retain some references to
> > pthreads despite the configure option.
>
> Sure, but my patch does insert --disable-shared:
>
> --8<---------------cut here---------------start------------->8---
> host_modules= { module= gettext; bootstrap=true; no_install=true;
>                 module_srcdir= "gettext/gettext-runtime";
>                 // We always build gettext with pic, because some packages
> (e.g. gdbserver)
>                 // need it in some configuratons, which is determined via
> nontrivial tests.
>                 // Always enabling pic seems to make sense for something
> tied to
>                 // user-facing output.
>                 extra_configure_flags='--disable-shared --disable-java
> --disable-csharp --with-pic';
>                 lib_path=intl/.libs; };
> --8<---------------cut here---------------end--------------->8---
>
> ... and it is applied:
>
> --8<---------------cut here---------------start------------->8---
> -bash-5.1$ ./config.status --config
> --srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
>   --disable-werror --with-gmp=/opt/cfarm
>   --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>   --with-included-gettext --program-transform-name=s,y,y,
>   --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
>   --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
>   --disable-intermodule --enable-checking=yes,types,extra
>   --disable-coverage --enable-languages=c,c++
>   --disable-build-format-warnings --disable-shared --disable-java
>   --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
>   host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
>   CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
>   -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
> --8<---------------cut here---------------end--------------->8---
>
> I'm unsure how to tell what the produced binaries are w.r.t static or
> shared, but I only see .o files inside intl/.libs/libintl.a, while I see
> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)
>

An AIX shared library created by libtool will look like
libfoo.a[libfoo.so.N], where N is the package major version number.
Normally with one file.

An AIX static library will look like libfoo.a[a.o, b.o, c.o]
with multiple object files.

An AIX archive can contain a combination of shared objects and
normal object files.

AIX normally uses the convention shr.o or shr_64.o for the name
of the shared object file.  Hint, hint, an AIX archive can contain
both 32 bit and 64 bit object files or shared objects.

I don't know why the gettext build system would create
/home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8)
if --disable-shared was requested.  That clearly is using the
naming of a libtool AIX shared object and failing due to
the missing shared object.  Although in this case, the problem
seems to be the shared library load path.  AIX uses LIBPATH,
not LD_LIBRARY_PATH.

Also, for me, the out of tree path was

gettext/gettext-runtime/intl/.libs

Is your search path missing a level?

Thanks, David


>
> I do see that the build system adds intl to the LD_LIBRARY_PATH.
>
> I will be testing dropping lib_path from the module definition above.
> It might be superflous (I think it is only used for LD_LIBRARY_PATH, for
> when the libs built by the build system are shared - which they never
> are for in-tree gettext).  I'll take the shot to add --disable-threads,
> too, for this test.
>
>
> > Thanks, David
> >
> >
> >>
> >> > Thanks, David
> >> >
> >> >
> >> >
> >> > On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me>
> wrote:
> >> >
> >> >>
> >> >> Arsen Arsenović <arsen@aarsen.me> writes:
> >> >>
> >> >> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen
> Arsenović
> >> >> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created
> at
> >> >> 2023-11-16T19:47:16+0100 using EDDSA]]
> >> >> >
> >> >> > David Edelsohn <dje.gcc@gmail.com> writes:
> >> >> >
> >> >> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
> >> >> wrote:
> >> >> >>
> >> >> >>>
> >> >> >>> David Edelsohn <dje.gcc@gmail.com> writes:
> >> >> >>>
> >> >> >>> > GCC had been working on AIX with NLS, using
> >> >> "--with-included-gettext".
> >> >> >>> > --disable-nls gets past the breakage, but GCC does not build
> for
> >> me
> >> >> on
> >> >> >>> AIX
> >> >> >>> > with NLS enabled.
> >> >> >>>
> >> >> >>> That should still work with gettext 0.22+ extracted in-tree (it
> >> should
> >> >> >>> be fetched by download_prerequisites).
> >> >> >>>
> >> >> >>> > A change in dependencies for GCC should have been announced and
> >> more
> >> >> >>> widely
> >> >> >>> > socialized in the GCC development mailing list, not just GCC
> >> patches
> >> >> >>> > mailing list.
> >> >> >>> >
> >> >> >>> > I have tried both the AIX Open Source libiconv and libgettext
> >> >> package,
> >> >> >>> and
> >> >> >>> > the ones that I previously built.  Both fail because GCC
> configure
> >> >> >>> decides
> >> >> >>> > to disable NLS, despite being requested, while libcpp is
> >> satisfied,
> >> >> so
> >> >> >>> > tools in the gcc subdirectory don't link against libiconv and
> the
> >> >> build
> >> >> >>> > fails.  With the included gettext, I was able to rely on a
> >> >> >>> self-consistent
> >> >> >>> > solution.
> >> >> >>>
> >> >> >>> That is interesting.  They should be using the same checks.  I've
> >> >> >>> checked trunk and regenerated files on it, and saw no significant
> >> diff
> >> >> >>> (some whitespace changes only).  Could you post the config.log of
> >> both?
> >> >> >>>
> >> >> >>> I've never used AIX.  Can I reproduce this on one of the cfarm
> >> machines
> >> >> >>> to poke around?  I've tried cfarm119, but that one lacked git,
> and I
> >> >> >>> haven't poked around much further due to time constraints.
> >> >> >>>
> >> >> >>
> >> >> >> The AIX system in the Compile Farm has a complete complement of
> Open
> >> >> Source
> >> >> >> software installed.
> >> >> >>
> >> >> >> Please ensure that /opt/freeware/bin is in your path.  Also, the
> GCC
> >> >> Wiki
> >> >> >> Compile Farm page has build tips that include AIX
> >> >> >>
> >> >> >>
> >> >>
> >>
> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> >> >> >
> >> >> > Thanks, that got me further.
> >> >> >
> >> >> >> that recommended --with-included-gettext configuration option.
> >> >> >
> >> >> > This flag should still exist and operate the same if gettext is
> >> present
> >> >> > in tree.  I've cloned gcc and downloaded prerequisites (via
> >> >> > contrib/download_prerequisites) and I am trying to configure it
> now.
> >> >>
> >> >> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
> >> >> and added to library paths, further GCC processes fail to run:
> >> >>
> >> >> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
> >> >> conftest.c  >&5
> >> >> Could not load program
> >> >> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
> >> >>         Dependent module
> >> >> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be
> >> loaded.
> >> >>         Member libgmp.so.10 is not found in archive
> >> >>
> >> >> This seems odd.  I am not sure what compels the RTDL (?) to look up
> .sos
> >> >> in archives, or how it knows about these archives..  I suspect it's
> >> >> getting tripped by something in HOST_EXPORTS.
> >> >>
> >> >> >> Thanks, David
> >> >> >>
> >> >> >>
> >> >> >>>
> >> >> >>> TIA, sorry about the inconvenience.  Have a lovely day.
> >> >> >>>
> >> >> >>> > The current gettext-0.22.3 fails to build for me on AIX.
> >> >> >>> >
> >> >> >>> > libcpp configure believes that NLS functions on AIX, but gcc
> >> >> configure
> >> >> >>> > fails in its tests of gettext functionality, which leads to an
> >> >> >>> inconsistent
> >> >> >>> > configuration and build breakage.
> >> >> >>> >
> >> >> >>> > Thanks, David
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> Arsen Arsenović
> >> >> >>>
> >> >>
> >> >>
> >> >> --
> >> >> Arsen Arsenović
> >> >>
> >>
> >>
> >> --
> >> Arsen Arsenović
> >>
>
>
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 22:30                 ` David Edelsohn
@ 2023-11-16 22:32                   ` Arsen Arsenović
  2023-11-16 23:59                     ` David Edelsohn
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-16 22:32 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, Bruno Haible, gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 4105 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Thu, Nov 16, 2023 at 5:22 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > Don't build with the dependent libraries in tree.  Don't build the
>> > dependent libraries as shared libraries. The libraries are already built
>> > and in /opt/cfarm, as mentioned in the Compile Farm wiki.
>> >
>> > AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
>> > libraries *ARE* shared object files in archives.  Shared object
>> versioning
>> > is handled by multiple objects in the same archive.
>>
>> Hmm, I see.  I removed all the deps but gettext from the tree.
>>
>> This leaves gettext-runtime fulfilling the previous role of intl/.
>>
>> However, I'm confused about how this worked before, in that case, since,
>> IIRC, intl also produced libraries and was also put into host exports.
>>
>> Leaving gettext in tree produces:
>>
>> Could not load program gawk:
>>         Dependent module
>> /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) could not be
>> loaded.
>>         Member libintl.so.8 is not found in archive
>>
>> I'll try to see why intl/ didn't cause the same issue soon.
>>
>> Thanks, have a lovely evening.
>>
>
> The previous version of "intl" was built as a static library.  Configure in
> the older package had the option --enable-host-shared,
> which I did not use.  Based on the failure message, the in-tree gettext
> seems to be built as a shared library.  If you explicitly
> pass --disable-shared to the in-tree configure, you may get farther.  I'm
> currently using --disable-shared --disable-threads.
> As we have discussed, the current gettext will retain some references to
> pthreads despite the configure option.

Sure, but my patch does insert --disable-shared:

--8<---------------cut here---------------start------------->8---
host_modules= { module= gettext; bootstrap=true; no_install=true;
                module_srcdir= "gettext/gettext-runtime";
		// We always build gettext with pic, because some packages (e.g. gdbserver)
		// need it in some configuratons, which is determined via nontrivial tests.
		// Always enabling pic seems to make sense for something tied to
		// user-facing output.
                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
                lib_path=intl/.libs; };
--8<---------------cut here---------------end--------------->8---

... and it is applied:

--8<---------------cut here---------------start------------->8---
-bash-5.1$ ./config.status --config
--srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
  --disable-werror --with-gmp=/opt/cfarm
  --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
  --with-included-gettext --program-transform-name=s,y,y,
  --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
  --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
  --disable-intermodule --enable-checking=yes,types,extra
  --disable-coverage --enable-languages=c,c++
  --disable-build-format-warnings --disable-shared --disable-java
  --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
  host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
  CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
  -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-g
--8<---------------cut here---------------end--------------->8---

I'm unsure how to tell what the produced binaries are w.r.t static or
shared, but I only see .o files inside intl/.libs/libintl.a, while I see
a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?)

I do see that the build system adds intl to the LD_LIBRARY_PATH.

I will be testing dropping lib_path from the module definition above.
It might be superflous (I think it is only used for LD_LIBRARY_PATH, for
when the libs built by the build system are shared - which they never
are for in-tree gettext).  I'll take the shot to add --disable-threads,
too, for this test.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: drop gettext lib_path --]
[-- Type: text/x-patch, Size: 6259 bytes --]

From 4b75355d5ee9162a922a85517ef3c0a16931544d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Thu, 16 Nov 2023 23:50:30 +0100
Subject: [PATCH] disable threads, lib_path on gettext

---
 Makefile.def |  3 +--
 Makefile.in  | 27 +++++++++++----------------
 2 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 792f81447e1b..78414b4cd89c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -80,8 +80,7 @@ host_modules= { module= gettext; bootstrap=true; no_install=true;
 		// need it in some configuratons, which is determined via nontrivial tests.
 		// Always enabling pic seems to make sense for something tied to
 		// user-facing output.
-                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
-                lib_path=intl/.libs; };
+                extra_configure_flags='--disable-shared --disable-threads --disable-java --disable-csharp --with-pic'; };
 host_modules= { module= tcl;
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
diff --git a/Makefile.in b/Makefile.in
index b65ab4953bce..796717665eb7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -768,7 +768,7 @@ TARGET_LIB_PATH_libatomic = $$r/$(TARGET_SUBDIR)/libatomic/.libs:
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the host machine work.
-HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)$(HOST_LIB_PATH_gettext)
+HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)
 
 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
@@ -796,11 +796,6 @@ HOST_LIB_PATH_isl = \
   $$r/$(HOST_SUBDIR)/isl/.libs:$$r/$(HOST_SUBDIR)/prev-isl/.libs:
 @endif isl
 
-@if gettext
-HOST_LIB_PATH_gettext = \
-  $$r/$(HOST_SUBDIR)/gettext/intl/.libs:$$r/$(HOST_SUBDIR)/prev-gettext/intl/.libs:
-@endif gettext
-
 
 CXX_FOR_TARGET_FLAG_TO_PASS = \
 	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
@@ -19827,7 +19822,7 @@ configure-gettext:
 	  $$s/$$module_srcdir/configure \
 	  --srcdir=$${topdir}/$$module_srcdir \
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-	  --target=${target_alias} --disable-shared --disable-java --disable-csharp --with-pic \
+	  --target=${target_alias} --disable-shared --disable-threads --disable-java --disable-csharp --with-pic \
 	  || exit 1
 @endif gettext
 
@@ -19863,7 +19858,7 @@ configure-stage1-gettext:
 	  --target=${target_alias} \
 	   \
 	  $(STAGE1_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage2-gettext maybe-configure-stage2-gettext
@@ -19897,7 +19892,7 @@ configure-stage2-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE2_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage3-gettext maybe-configure-stage3-gettext
@@ -19931,7 +19926,7 @@ configure-stage3-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE3_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage4-gettext maybe-configure-stage4-gettext
@@ -19965,7 +19960,7 @@ configure-stage4-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE4_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageprofile-gettext maybe-configure-stageprofile-gettext
@@ -19999,7 +19994,7 @@ configure-stageprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stagetrain-gettext maybe-configure-stagetrain-gettext
@@ -20033,7 +20028,7 @@ configure-stagetrain-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEtrain_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stagefeedback-gettext maybe-configure-stagefeedback-gettext
@@ -20067,7 +20062,7 @@ configure-stagefeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEfeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautoprofile-gettext maybe-configure-stageautoprofile-gettext
@@ -20101,7 +20096,7 @@ configure-stageautoprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautoprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautofeedback-gettext maybe-configure-stageautofeedback-gettext
@@ -20135,7 +20130,7 @@ configure-stageautofeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautofeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 
-- 
2.42.1


[-- Attachment #1.3: Type: text/plain, Size: 4551 bytes --]


> Thanks, David
>
>
>>
>> > Thanks, David
>> >
>> >
>> >
>> > On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>> >
>> >>
>> >> Arsen Arsenović <arsen@aarsen.me> writes:
>> >>
>> >> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović
>> >> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at
>> >> 2023-11-16T19:47:16+0100 using EDDSA]]
>> >> >
>> >> > David Edelsohn <dje.gcc@gmail.com> writes:
>> >> >
>> >> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
>> >> wrote:
>> >> >>
>> >> >>>
>> >> >>> David Edelsohn <dje.gcc@gmail.com> writes:
>> >> >>>
>> >> >>> > GCC had been working on AIX with NLS, using
>> >> "--with-included-gettext".
>> >> >>> > --disable-nls gets past the breakage, but GCC does not build for
>> me
>> >> on
>> >> >>> AIX
>> >> >>> > with NLS enabled.
>> >> >>>
>> >> >>> That should still work with gettext 0.22+ extracted in-tree (it
>> should
>> >> >>> be fetched by download_prerequisites).
>> >> >>>
>> >> >>> > A change in dependencies for GCC should have been announced and
>> more
>> >> >>> widely
>> >> >>> > socialized in the GCC development mailing list, not just GCC
>> patches
>> >> >>> > mailing list.
>> >> >>> >
>> >> >>> > I have tried both the AIX Open Source libiconv and libgettext
>> >> package,
>> >> >>> and
>> >> >>> > the ones that I previously built.  Both fail because GCC configure
>> >> >>> decides
>> >> >>> > to disable NLS, despite being requested, while libcpp is
>> satisfied,
>> >> so
>> >> >>> > tools in the gcc subdirectory don't link against libiconv and the
>> >> build
>> >> >>> > fails.  With the included gettext, I was able to rely on a
>> >> >>> self-consistent
>> >> >>> > solution.
>> >> >>>
>> >> >>> That is interesting.  They should be using the same checks.  I've
>> >> >>> checked trunk and regenerated files on it, and saw no significant
>> diff
>> >> >>> (some whitespace changes only).  Could you post the config.log of
>> both?
>> >> >>>
>> >> >>> I've never used AIX.  Can I reproduce this on one of the cfarm
>> machines
>> >> >>> to poke around?  I've tried cfarm119, but that one lacked git, and I
>> >> >>> haven't poked around much further due to time constraints.
>> >> >>>
>> >> >>
>> >> >> The AIX system in the Compile Farm has a complete complement of Open
>> >> Source
>> >> >> software installed.
>> >> >>
>> >> >> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC
>> >> Wiki
>> >> >> Compile Farm page has build tips that include AIX
>> >> >>
>> >> >>
>> >>
>> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
>> >> >
>> >> > Thanks, that got me further.
>> >> >
>> >> >> that recommended --with-included-gettext configuration option.
>> >> >
>> >> > This flag should still exist and operate the same if gettext is
>> present
>> >> > in tree.  I've cloned gcc and downloaded prerequisites (via
>> >> > contrib/download_prerequisites) and I am trying to configure it now.
>> >>
>> >> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
>> >> and added to library paths, further GCC processes fail to run:
>> >>
>> >> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
>> >> conftest.c  >&5
>> >> Could not load program
>> >> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
>> >>         Dependent module
>> >> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be
>> loaded.
>> >>         Member libgmp.so.10 is not found in archive
>> >>
>> >> This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
>> >> in archives, or how it knows about these archives..  I suspect it's
>> >> getting tripped by something in HOST_EXPORTS.
>> >>
>> >> >> Thanks, David
>> >> >>
>> >> >>
>> >> >>>
>> >> >>> TIA, sorry about the inconvenience.  Have a lovely day.
>> >> >>>
>> >> >>> > The current gettext-0.22.3 fails to build for me on AIX.
>> >> >>> >
>> >> >>> > libcpp configure believes that NLS functions on AIX, but gcc
>> >> configure
>> >> >>> > fails in its tests of gettext functionality, which leads to an
>> >> >>> inconsistent
>> >> >>> > configuration and build breakage.
>> >> >>> >
>> >> >>> > Thanks, David
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Arsen Arsenović
>> >> >>>
>> >>
>> >>
>> >> --
>> >> Arsen Arsenović
>> >>
>>
>>
>> --
>> Arsen Arsenović
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 22:19               ` Arsen Arsenović
@ 2023-11-16 22:30                 ` David Edelsohn
  2023-11-16 22:32                   ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-16 22:30 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 6105 bytes --]

On Thu, Nov 16, 2023 at 5:22 PM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > Don't build with the dependent libraries in tree.  Don't build the
> > dependent libraries as shared libraries. The libraries are already built
> > and in /opt/cfarm, as mentioned in the Compile Farm wiki.
> >
> > AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
> > libraries *ARE* shared object files in archives.  Shared object
> versioning
> > is handled by multiple objects in the same archive.
>
> Hmm, I see.  I removed all the deps but gettext from the tree.
>
> This leaves gettext-runtime fulfilling the previous role of intl/.
>
> However, I'm confused about how this worked before, in that case, since,
> IIRC, intl also produced libraries and was also put into host exports.
>
> Leaving gettext in tree produces:
>
> Could not load program gawk:
>         Dependent module
> /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) could not be
> loaded.
>         Member libintl.so.8 is not found in archive
>
> I'll try to see why intl/ didn't cause the same issue soon.
>
> Thanks, have a lovely evening.
>

The previous version of "intl" was built as a static library.  Configure in
the older package had the option --enable-host-shared,
which I did not use.  Based on the failure message, the in-tree gettext
seems to be built as a shared library.  If you explicitly
pass --disable-shared to the in-tree configure, you may get farther.  I'm
currently using --disable-shared --disable-threads.
As we have discussed, the current gettext will retain some references to
pthreads despite the configure option.

Thanks, David


>
> > Thanks, David
> >
> >
> >
> > On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me> wrote:
> >
> >>
> >> Arsen Arsenović <arsen@aarsen.me> writes:
> >>
> >> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović
> >> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at
> >> 2023-11-16T19:47:16+0100 using EDDSA]]
> >> >
> >> > David Edelsohn <dje.gcc@gmail.com> writes:
> >> >
> >> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
> >> wrote:
> >> >>
> >> >>>
> >> >>> David Edelsohn <dje.gcc@gmail.com> writes:
> >> >>>
> >> >>> > GCC had been working on AIX with NLS, using
> >> "--with-included-gettext".
> >> >>> > --disable-nls gets past the breakage, but GCC does not build for
> me
> >> on
> >> >>> AIX
> >> >>> > with NLS enabled.
> >> >>>
> >> >>> That should still work with gettext 0.22+ extracted in-tree (it
> should
> >> >>> be fetched by download_prerequisites).
> >> >>>
> >> >>> > A change in dependencies for GCC should have been announced and
> more
> >> >>> widely
> >> >>> > socialized in the GCC development mailing list, not just GCC
> patches
> >> >>> > mailing list.
> >> >>> >
> >> >>> > I have tried both the AIX Open Source libiconv and libgettext
> >> package,
> >> >>> and
> >> >>> > the ones that I previously built.  Both fail because GCC configure
> >> >>> decides
> >> >>> > to disable NLS, despite being requested, while libcpp is
> satisfied,
> >> so
> >> >>> > tools in the gcc subdirectory don't link against libiconv and the
> >> build
> >> >>> > fails.  With the included gettext, I was able to rely on a
> >> >>> self-consistent
> >> >>> > solution.
> >> >>>
> >> >>> That is interesting.  They should be using the same checks.  I've
> >> >>> checked trunk and regenerated files on it, and saw no significant
> diff
> >> >>> (some whitespace changes only).  Could you post the config.log of
> both?
> >> >>>
> >> >>> I've never used AIX.  Can I reproduce this on one of the cfarm
> machines
> >> >>> to poke around?  I've tried cfarm119, but that one lacked git, and I
> >> >>> haven't poked around much further due to time constraints.
> >> >>>
> >> >>
> >> >> The AIX system in the Compile Farm has a complete complement of Open
> >> Source
> >> >> software installed.
> >> >>
> >> >> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC
> >> Wiki
> >> >> Compile Farm page has build tips that include AIX
> >> >>
> >> >>
> >>
> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> >> >
> >> > Thanks, that got me further.
> >> >
> >> >> that recommended --with-included-gettext configuration option.
> >> >
> >> > This flag should still exist and operate the same if gettext is
> present
> >> > in tree.  I've cloned gcc and downloaded prerequisites (via
> >> > contrib/download_prerequisites) and I am trying to configure it now.
> >>
> >> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
> >> and added to library paths, further GCC processes fail to run:
> >>
> >> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
> >> conftest.c  >&5
> >> Could not load program
> >> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
> >>         Dependent module
> >> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be
> loaded.
> >>         Member libgmp.so.10 is not found in archive
> >>
> >> This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
> >> in archives, or how it knows about these archives..  I suspect it's
> >> getting tripped by something in HOST_EXPORTS.
> >>
> >> >> Thanks, David
> >> >>
> >> >>
> >> >>>
> >> >>> TIA, sorry about the inconvenience.  Have a lovely day.
> >> >>>
> >> >>> > The current gettext-0.22.3 fails to build for me on AIX.
> >> >>> >
> >> >>> > libcpp configure believes that NLS functions on AIX, but gcc
> >> configure
> >> >>> > fails in its tests of gettext functionality, which leads to an
> >> >>> inconsistent
> >> >>> > configuration and build breakage.
> >> >>> >
> >> >>> > Thanks, David
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Arsen Arsenović
> >> >>>
> >>
> >>
> >> --
> >> Arsen Arsenović
> >>
>
>
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 21:40             ` David Edelsohn
@ 2023-11-16 22:19               ` Arsen Arsenović
  2023-11-16 22:30                 ` David Edelsohn
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-16 22:19 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 5164 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> Don't build with the dependent libraries in tree.  Don't build the
> dependent libraries as shared libraries. The libraries are already built
> and in /opt/cfarm, as mentioned in the Compile Farm wiki.
>
> AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
> libraries *ARE* shared object files in archives.  Shared object versioning
> is handled by multiple objects in the same archive.

Hmm, I see.  I removed all the deps but gettext from the tree.

This leaves gettext-runtime fulfilling the previous role of intl/.

However, I'm confused about how this worked before, in that case, since,
IIRC, intl also produced libraries and was also put into host exports.

Leaving gettext in tree produces:

Could not load program gawk:
        Dependent module /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) could not be loaded.
        Member libintl.so.8 is not found in archive 

I'll try to see why intl/ didn't cause the same issue soon.

Thanks, have a lovely evening.

> Thanks, David
>
>
>
> On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> Arsen Arsenović <arsen@aarsen.me> writes:
>>
>> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović
>> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at
>> 2023-11-16T19:47:16+0100 using EDDSA]]
>> >
>> > David Edelsohn <dje.gcc@gmail.com> writes:
>> >
>> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
>> wrote:
>> >>
>> >>>
>> >>> David Edelsohn <dje.gcc@gmail.com> writes:
>> >>>
>> >>> > GCC had been working on AIX with NLS, using
>> "--with-included-gettext".
>> >>> > --disable-nls gets past the breakage, but GCC does not build for me
>> on
>> >>> AIX
>> >>> > with NLS enabled.
>> >>>
>> >>> That should still work with gettext 0.22+ extracted in-tree (it should
>> >>> be fetched by download_prerequisites).
>> >>>
>> >>> > A change in dependencies for GCC should have been announced and more
>> >>> widely
>> >>> > socialized in the GCC development mailing list, not just GCC patches
>> >>> > mailing list.
>> >>> >
>> >>> > I have tried both the AIX Open Source libiconv and libgettext
>> package,
>> >>> and
>> >>> > the ones that I previously built.  Both fail because GCC configure
>> >>> decides
>> >>> > to disable NLS, despite being requested, while libcpp is satisfied,
>> so
>> >>> > tools in the gcc subdirectory don't link against libiconv and the
>> build
>> >>> > fails.  With the included gettext, I was able to rely on a
>> >>> self-consistent
>> >>> > solution.
>> >>>
>> >>> That is interesting.  They should be using the same checks.  I've
>> >>> checked trunk and regenerated files on it, and saw no significant diff
>> >>> (some whitespace changes only).  Could you post the config.log of both?
>> >>>
>> >>> I've never used AIX.  Can I reproduce this on one of the cfarm machines
>> >>> to poke around?  I've tried cfarm119, but that one lacked git, and I
>> >>> haven't poked around much further due to time constraints.
>> >>>
>> >>
>> >> The AIX system in the Compile Farm has a complete complement of Open
>> Source
>> >> software installed.
>> >>
>> >> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC
>> Wiki
>> >> Compile Farm page has build tips that include AIX
>> >>
>> >>
>> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
>> >
>> > Thanks, that got me further.
>> >
>> >> that recommended --with-included-gettext configuration option.
>> >
>> > This flag should still exist and operate the same if gettext is present
>> > in tree.  I've cloned gcc and downloaded prerequisites (via
>> > contrib/download_prerequisites) and I am trying to configure it now.
>>
>> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
>> and added to library paths, further GCC processes fail to run:
>>
>> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
>> conftest.c  >&5
>> Could not load program
>> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
>>         Dependent module
>> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be loaded.
>>         Member libgmp.so.10 is not found in archive
>>
>> This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
>> in archives, or how it knows about these archives..  I suspect it's
>> getting tripped by something in HOST_EXPORTS.
>>
>> >> Thanks, David
>> >>
>> >>
>> >>>
>> >>> TIA, sorry about the inconvenience.  Have a lovely day.
>> >>>
>> >>> > The current gettext-0.22.3 fails to build for me on AIX.
>> >>> >
>> >>> > libcpp configure believes that NLS functions on AIX, but gcc
>> configure
>> >>> > fails in its tests of gettext functionality, which leads to an
>> >>> inconsistent
>> >>> > configuration and build breakage.
>> >>> >
>> >>> > Thanks, David
>> >>>
>> >>>
>> >>> --
>> >>> Arsen Arsenović
>> >>>
>>
>>
>> --
>> Arsen Arsenović
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 21:11           ` Arsen Arsenović
@ 2023-11-16 21:40             ` David Edelsohn
  2023-11-16 22:19               ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-16 21:40 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 4343 bytes --]

Don't build with the dependent libraries in tree.  Don't build the
dependent libraries as shared libraries. The libraries are already built
and in /opt/cfarm, as mentioned in the Compile Farm wiki.

AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
libraries *ARE* shared object files in archives.  Shared object versioning
is handled by multiple objects in the same archive.

Thanks, David



On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> Arsen Arsenović <arsen@aarsen.me> writes:
>
> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović
> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at
> 2023-11-16T19:47:16+0100 using EDDSA]]
> >
> > David Edelsohn <dje.gcc@gmail.com> writes:
> >
> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
> wrote:
> >>
> >>>
> >>> David Edelsohn <dje.gcc@gmail.com> writes:
> >>>
> >>> > GCC had been working on AIX with NLS, using
> "--with-included-gettext".
> >>> > --disable-nls gets past the breakage, but GCC does not build for me
> on
> >>> AIX
> >>> > with NLS enabled.
> >>>
> >>> That should still work with gettext 0.22+ extracted in-tree (it should
> >>> be fetched by download_prerequisites).
> >>>
> >>> > A change in dependencies for GCC should have been announced and more
> >>> widely
> >>> > socialized in the GCC development mailing list, not just GCC patches
> >>> > mailing list.
> >>> >
> >>> > I have tried both the AIX Open Source libiconv and libgettext
> package,
> >>> and
> >>> > the ones that I previously built.  Both fail because GCC configure
> >>> decides
> >>> > to disable NLS, despite being requested, while libcpp is satisfied,
> so
> >>> > tools in the gcc subdirectory don't link against libiconv and the
> build
> >>> > fails.  With the included gettext, I was able to rely on a
> >>> self-consistent
> >>> > solution.
> >>>
> >>> That is interesting.  They should be using the same checks.  I've
> >>> checked trunk and regenerated files on it, and saw no significant diff
> >>> (some whitespace changes only).  Could you post the config.log of both?
> >>>
> >>> I've never used AIX.  Can I reproduce this on one of the cfarm machines
> >>> to poke around?  I've tried cfarm119, but that one lacked git, and I
> >>> haven't poked around much further due to time constraints.
> >>>
> >>
> >> The AIX system in the Compile Farm has a complete complement of Open
> Source
> >> software installed.
> >>
> >> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC
> Wiki
> >> Compile Farm page has build tips that include AIX
> >>
> >>
> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> >
> > Thanks, that got me further.
> >
> >> that recommended --with-included-gettext configuration option.
> >
> > This flag should still exist and operate the same if gettext is present
> > in tree.  I've cloned gcc and downloaded prerequisites (via
> > contrib/download_prerequisites) and I am trying to configure it now.
>
> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
> and added to library paths, further GCC processes fail to run:
>
> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
> conftest.c  >&5
> Could not load program
> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
>         Dependent module
> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be loaded.
>         Member libgmp.so.10 is not found in archive
>
> This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
> in archives, or how it knows about these archives..  I suspect it's
> getting tripped by something in HOST_EXPORTS.
>
> >> Thanks, David
> >>
> >>
> >>>
> >>> TIA, sorry about the inconvenience.  Have a lovely day.
> >>>
> >>> > The current gettext-0.22.3 fails to build for me on AIX.
> >>> >
> >>> > libcpp configure believes that NLS functions on AIX, but gcc
> configure
> >>> > fails in its tests of gettext functionality, which leads to an
> >>> inconsistent
> >>> > configuration and build breakage.
> >>> >
> >>> > Thanks, David
> >>>
> >>>
> >>> --
> >>> Arsen Arsenović
> >>>
>
>
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-16 18:33         ` Arsen Arsenović
@ 2023-11-16 21:11           ` Arsen Arsenović
  2023-11-16 21:40             ` David Edelsohn
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-16 21:11 UTC (permalink / raw)
  To: Arsen Arsenović
  Cc: David Edelsohn, Richard Biener, Bruno Haible, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3613 bytes --]


Arsen Arsenović <arsen@aarsen.me> writes:

> [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at 2023-11-16T19:47:16+0100 using EDDSA]]
>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
>> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>>
>>>
>>> David Edelsohn <dje.gcc@gmail.com> writes:
>>>
>>> > GCC had been working on AIX with NLS, using "--with-included-gettext".
>>> > --disable-nls gets past the breakage, but GCC does not build for me on
>>> AIX
>>> > with NLS enabled.
>>>
>>> That should still work with gettext 0.22+ extracted in-tree (it should
>>> be fetched by download_prerequisites).
>>>
>>> > A change in dependencies for GCC should have been announced and more
>>> widely
>>> > socialized in the GCC development mailing list, not just GCC patches
>>> > mailing list.
>>> >
>>> > I have tried both the AIX Open Source libiconv and libgettext package,
>>> and
>>> > the ones that I previously built.  Both fail because GCC configure
>>> decides
>>> > to disable NLS, despite being requested, while libcpp is satisfied, so
>>> > tools in the gcc subdirectory don't link against libiconv and the build
>>> > fails.  With the included gettext, I was able to rely on a
>>> self-consistent
>>> > solution.
>>>
>>> That is interesting.  They should be using the same checks.  I've
>>> checked trunk and regenerated files on it, and saw no significant diff
>>> (some whitespace changes only).  Could you post the config.log of both?
>>>
>>> I've never used AIX.  Can I reproduce this on one of the cfarm machines
>>> to poke around?  I've tried cfarm119, but that one lacked git, and I
>>> haven't poked around much further due to time constraints.
>>>
>>
>> The AIX system in the Compile Farm has a complete complement of Open Source
>> software installed.
>>
>> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC Wiki
>> Compile Farm page has build tips that include AIX
>>
>> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
>
> Thanks, that got me further.
>
>> that recommended --with-included-gettext configuration option.
>
> This flag should still exist and operate the same if gettext is present
> in tree.  I've cloned gcc and downloaded prerequisites (via
> contrib/download_prerequisites) and I am trying to configure it now.

The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
and added to library paths, further GCC processes fail to run:

configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc conftest.c  >&5
Could not load program /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
        Dependent module /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be loaded.
        Member libgmp.so.10 is not found in archive 

This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
in archives, or how it knows about these archives..  I suspect it's
getting tripped by something in HOST_EXPORTS.

>> Thanks, David
>>
>>
>>>
>>> TIA, sorry about the inconvenience.  Have a lovely day.
>>>
>>> > The current gettext-0.22.3 fails to build for me on AIX.
>>> >
>>> > libcpp configure believes that NLS functions on AIX, but gcc configure
>>> > fails in its tests of gettext functionality, which leads to an
>>> inconsistent
>>> > configuration and build breakage.
>>> >
>>> > Thanks, David
>>>
>>>
>>> --
>>> Arsen Arsenović
>>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15 15:51       ` Xi Ruoyao
@ 2023-11-16 18:48         ` Arsen Arsenović
  0 siblings, 0 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-16 18:48 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: David Edelsohn, Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]


Xi Ruoyao <xry111@xry111.site> writes:

> On Wed, 2023-11-15 at 15:14 +0100, Arsen Arsenović wrote:
>> That is interesting.  They should be using the same checks.  I've
>> checked trunk and regenerated files on it, and saw no significant diff
>> (some whitespace changes only).  Could you post the config.log of
>> both?
>
> You did not regenerate config.in.  But I've regenerated it in r14-5434
> anyway.
>
> The related changes:
>
> +/* Define to 1 if you have the Mac OS X function
> +   CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
> +#endif
> +
> +
> +/* Define to 1 if you have the Mac OS X function
> CFPreferencesCopyAppValue in
> +   the CoreFoundation framework. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_CFPREFERENCESCOPYAPPVALUE
> +#endif
>
> +/* Define if the GNU dcgettext() function is already present or preinstalled.
> +   */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_DCGETTEXT
> +#endif
>
> +/* Define if the GNU gettext() function is already present or preinstalled. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_GETTEXT
> +#endif
>
> I don't know if they are related to the issue on AIX though.

Ah, thanks for doing that.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15 17:19       ` David Edelsohn
@ 2023-11-16 18:33         ` Arsen Arsenović
  2023-11-16 21:11           ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-16 18:33 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 2649 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > GCC had been working on AIX with NLS, using "--with-included-gettext".
>> > --disable-nls gets past the breakage, but GCC does not build for me on
>> AIX
>> > with NLS enabled.
>>
>> That should still work with gettext 0.22+ extracted in-tree (it should
>> be fetched by download_prerequisites).
>>
>> > A change in dependencies for GCC should have been announced and more
>> widely
>> > socialized in the GCC development mailing list, not just GCC patches
>> > mailing list.
>> >
>> > I have tried both the AIX Open Source libiconv and libgettext package,
>> and
>> > the ones that I previously built.  Both fail because GCC configure
>> decides
>> > to disable NLS, despite being requested, while libcpp is satisfied, so
>> > tools in the gcc subdirectory don't link against libiconv and the build
>> > fails.  With the included gettext, I was able to rely on a
>> self-consistent
>> > solution.
>>
>> That is interesting.  They should be using the same checks.  I've
>> checked trunk and regenerated files on it, and saw no significant diff
>> (some whitespace changes only).  Could you post the config.log of both?
>>
>> I've never used AIX.  Can I reproduce this on one of the cfarm machines
>> to poke around?  I've tried cfarm119, but that one lacked git, and I
>> haven't poked around much further due to time constraints.
>>
>
> The AIX system in the Compile Farm has a complete complement of Open Source
> software installed.
>
> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC Wiki
> Compile Farm page has build tips that include AIX
>
> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines

Thanks, that got me further.

> that recommended --with-included-gettext configuration option.

This flag should still exist and operate the same if gettext is present
in tree.  I've cloned gcc and downloaded prerequisites (via
contrib/download_prerequisites) and I am trying to configure it now.

> Thanks, David
>
>
>>
>> TIA, sorry about the inconvenience.  Have a lovely day.
>>
>> > The current gettext-0.22.3 fails to build for me on AIX.
>> >
>> > libcpp configure believes that NLS functions on AIX, but gcc configure
>> > fails in its tests of gettext functionality, which leads to an
>> inconsistent
>> > configuration and build breakage.
>> >
>> > Thanks, David
>>
>>
>> --
>> Arsen Arsenović
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15 14:14     ` Arsen Arsenović
  2023-11-15 15:51       ` Xi Ruoyao
  2023-11-15 17:19       ` David Edelsohn
@ 2023-11-15 19:58       ` David Edelsohn
  2 siblings, 0 replies; 38+ messages in thread
From: David Edelsohn @ 2023-11-15 19:58 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 4976 bytes --]

On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > GCC had been working on AIX with NLS, using "--with-included-gettext".
> > --disable-nls gets past the breakage, but GCC does not build for me on
> AIX
> > with NLS enabled.
>
> That should still work with gettext 0.22+ extracted in-tree (it should
> be fetched by download_prerequisites).
>
> > A change in dependencies for GCC should have been announced and more
> widely
> > socialized in the GCC development mailing list, not just GCC patches
> > mailing list.
> >
> > I have tried both the AIX Open Source libiconv and libgettext package,
> and
> > the ones that I previously built.  Both fail because GCC configure
> decides
> > to disable NLS, despite being requested, while libcpp is satisfied, so
> > tools in the gcc subdirectory don't link against libiconv and the build
> > fails.  With the included gettext, I was able to rely on a
> self-consistent
> > solution.
>
> That is interesting.  They should be using the same checks.  I've
> checked trunk and regenerated files on it, and saw no significant diff
> (some whitespace changes only).  Could you post the config.log of both?
>

GCC configured with --with-libintl-prefix and --with-libiconv-prefix

libcpp/config.log:

configure:7610: checking for GNU gettext in libc

configure:7639: /nasfarm/edelsohn/install/GCC12/bin/gcc -std=gnu99 -o
conftest -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc conftest.c  >&5

conftest.c:71:10: fatal error: libintl.h: No such file or directory

   71 | #include <libintl.h>

      |          ^~~~~~~~~~~

configure:8318: checking for GNU gettext in libintl

configure:8355: /nasfarm/edelsohn/install/GCC12/bin/gcc -std=gnu99 -o
conftest -g -I/nasfarm/edelsohn/install/include  -static-libstdc++
-static-libgcc -Wl,-bbigtoc conftest.c  /nasfarm/edelsohn/install/lib/
libintl.a >&5

ld: 0711-317 ERROR: Undefined symbol: .libiconv_open

ld: 0711-317 ERROR: Undefined symbol: .libiconv_set_relocation_prefix

ld: 0711-317 ERROR: Undefined symbol: .libiconv_close

ld: 0711-317 ERROR: Undefined symbol: .libiconv

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.

collect2: error: ld returned 8 exit status

configure:8355: $? = 1

configure:8392: /nasfarm/edelsohn/install/GCC12/bin/gcc -std=gnu99 -o
conftest -g -I/nasfarm/edelsohn/install/include  -static-libstdc++
-static-libgcc -Wl,-bbigtoc conftest.c  /nasfarm/edelsohn/install/lib/
libintl.a /nasfarm/edelsohn/install/lib/libiconv.a >&5

configure:8392: $? = 0

configure:8405: result: yes

configure:8440: checking whether to use NLS

configure:8442: result: yes

configure:8445: checking where the gettext function comes from

configure:8456: result: external libintl

configure:8464: checking how to link with libintl

configure:8466: result: /nasfarm/edelsohn/install/lib/libintl.a
/nasfarm/edelsohn/install/lib/libiconv.a

configure:8525: checking whether NLS is requested

configure:8531: result: yes

gcc/config.log:

configure:14002: checking for GNU gettext in libc

configure:14031: /nasfarm/edelsohn/install/GCC12/bin/g++ -std=c++11 -o
conftest

-g    -static-libstdc++ -static-libgcc -Wl,-bbigtoc  conftest.cpp  >&5

conftest.cpp:196:10: fatal error: libintl.h: No such file or directory

  196 | #include <libintl.h>

      |          ^~~~~~~~~~~

configure:14710: checking for GNU gettext in libintl

configure:14747: /nasfarm/edelsohn/install/GCC12/bin/g++ -std=c++11 -o
conftest -g    -I/nasfarm/edelsohn/install/include -static-libstdc++
-static-libgcc -Wl,-bbigtoc  conftest.cpp  /nasfarm/edelsohn/install/lib/
libintl.a >&5

ld: 0711-317 ERROR: Undefined symbol: .libiconv_open

ld: 0711-317 ERROR: Undefined symbol: .libiconv_set_relocation_prefix

ld: 0711-317 ERROR: Undefined symbol: .libiconv_close

ld: 0711-317 ERROR: Undefined symbol: .libiconv

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.

collect2: error: ld returned 8 exit status

configure:14747: $? = 1

configure:14797: result: no

configure:14832: checking whether to use NLS

configure:14834: result: no

configure:14917: checking whether NLS is requested

configure:14920: result: no




> I've never used AIX.  Can I reproduce this on one of the cfarm machines
> to poke around?  I've tried cfarm119, but that one lacked git, and I
> haven't poked around much further due to time constraints.
>
> TIA, sorry about the inconvenience.  Have a lovely day.
>
> > The current gettext-0.22.3 fails to build for me on AIX.
> >
> > libcpp configure believes that NLS functions on AIX, but gcc configure
> > fails in its tests of gettext functionality, which leads to an
> inconsistent
> > configuration and build breakage.
> >
> > Thanks, David
>
>
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15 14:14     ` Arsen Arsenović
  2023-11-15 15:51       ` Xi Ruoyao
@ 2023-11-15 17:19       ` David Edelsohn
  2023-11-16 18:33         ` Arsen Arsenović
  2023-11-15 19:58       ` David Edelsohn
  2 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-15 17:19 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > GCC had been working on AIX with NLS, using "--with-included-gettext".
> > --disable-nls gets past the breakage, but GCC does not build for me on
> AIX
> > with NLS enabled.
>
> That should still work with gettext 0.22+ extracted in-tree (it should
> be fetched by download_prerequisites).
>
> > A change in dependencies for GCC should have been announced and more
> widely
> > socialized in the GCC development mailing list, not just GCC patches
> > mailing list.
> >
> > I have tried both the AIX Open Source libiconv and libgettext package,
> and
> > the ones that I previously built.  Both fail because GCC configure
> decides
> > to disable NLS, despite being requested, while libcpp is satisfied, so
> > tools in the gcc subdirectory don't link against libiconv and the build
> > fails.  With the included gettext, I was able to rely on a
> self-consistent
> > solution.
>
> That is interesting.  They should be using the same checks.  I've
> checked trunk and regenerated files on it, and saw no significant diff
> (some whitespace changes only).  Could you post the config.log of both?
>
> I've never used AIX.  Can I reproduce this on one of the cfarm machines
> to poke around?  I've tried cfarm119, but that one lacked git, and I
> haven't poked around much further due to time constraints.
>

The AIX system in the Compile Farm has a complete complement of Open Source
software installed.

Please ensure that /opt/freeware/bin is in your path.  Also, the GCC Wiki
Compile Farm page has build tips that include AIX

https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines

that recommended --with-included-gettext configuration option.

Thanks, David


>
> TIA, sorry about the inconvenience.  Have a lovely day.
>
> > The current gettext-0.22.3 fails to build for me on AIX.
> >
> > libcpp configure believes that NLS functions on AIX, but gcc configure
> > fails in its tests of gettext functionality, which leads to an
> inconsistent
> > configuration and build breakage.
> >
> > Thanks, David
>
>
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15 14:14     ` Arsen Arsenović
@ 2023-11-15 15:51       ` Xi Ruoyao
  2023-11-16 18:48         ` Arsen Arsenović
  2023-11-15 17:19       ` David Edelsohn
  2023-11-15 19:58       ` David Edelsohn
  2 siblings, 1 reply; 38+ messages in thread
From: Xi Ruoyao @ 2023-11-15 15:51 UTC (permalink / raw)
  To: Arsen Arsenovi�0�4, David Edelsohn
  Cc: Richard Biener, GCC Patches, Bruno Haible

On Wed, 2023-11-15 at 15:14 +0100, Arsen Arsenović wrote:
> That is interesting.  They should be using the same checks.  I've
> checked trunk and regenerated files on it, and saw no significant diff
> (some whitespace changes only).  Could you post the config.log of
> both?

You did not regenerate config.in.  But I've regenerated it in r14-5434
anyway.

The related changes:

+/* Define to 1 if you have the Mac OS X function
+   CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
+#endif
+
+
+/* Define to 1 if you have the Mac OS X function
CFPreferencesCopyAppValue in
+   the CoreFoundation framework. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+#endif

+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+#ifndef USED_FOR_TARGET
+#undef HAVE_DCGETTEXT
+#endif

+/* Define if the GNU gettext() function is already present or preinstalled. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GETTEXT
+#endif

I don't know if they are related to the issue on AIX though.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-15  1:49   ` David Edelsohn
@ 2023-11-15 14:14     ` Arsen Arsenović
  2023-11-15 15:51       ` Xi Ruoyao
                         ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-15 14:14 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> GCC had been working on AIX with NLS, using "--with-included-gettext".
> --disable-nls gets past the breakage, but GCC does not build for me on AIX
> with NLS enabled.

That should still work with gettext 0.22+ extracted in-tree (it should
be fetched by download_prerequisites).

> A change in dependencies for GCC should have been announced and more widely
> socialized in the GCC development mailing list, not just GCC patches
> mailing list.
>
> I have tried both the AIX Open Source libiconv and libgettext package, and
> the ones that I previously built.  Both fail because GCC configure decides
> to disable NLS, despite being requested, while libcpp is satisfied, so
> tools in the gcc subdirectory don't link against libiconv and the build
> fails.  With the included gettext, I was able to rely on a self-consistent
> solution.

That is interesting.  They should be using the same checks.  I've
checked trunk and regenerated files on it, and saw no significant diff
(some whitespace changes only).  Could you post the config.log of both?

I've never used AIX.  Can I reproduce this on one of the cfarm machines
to poke around?  I've tried cfarm119, but that one lacked git, and I
haven't poked around much further due to time constraints.

TIA, sorry about the inconvenience.  Have a lovely day.

> The current gettext-0.22.3 fails to build for me on AIX.
>
> libcpp configure believes that NLS functions on AIX, but gcc configure
> fails in its tests of gettext functionality, which leads to an inconsistent
> configuration and build breakage.
>
> Thanks, David


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-14 23:06 ` Arsen Arsenović
@ 2023-11-15  1:49   ` David Edelsohn
  2023-11-15 14:14     ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-15  1:49 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

On Tue, Nov 14, 2023 at 6:09 PM Arsen Arsenović <arsen@aarsen.me> wrote:

> Hi David,
>
> David Edelsohn <dje.gcc@gmail.com> writes:
>
> > Arsen,
> >
> > Unfortunately this broke bootstrap on AIX.
> >
> > I had not seen this series of patches.
>
> I've added Bruno to CC as the libintl maintainer, to keep him in the
> loop.  Could you provide some extra information w.r.t. the failure mode?
>
> I'll try to investigate ASAP.
>
> In the meanwhile, does disabling NLS etc work?
>
> Thanks in advance, have a lovely night.
>
> GCC had been working on AIX with NLS, using "--with-included-gettext".
--disable-nls gets past the breakage, but GCC does not build for me on AIX
with NLS enabled.

A change in dependencies for GCC should have been announced and more widely
socialized in the GCC development mailing list, not just GCC patches
mailing list.

I have tried both the AIX Open Source libiconv and libgettext package, and
the ones that I previously built.  Both fail because GCC configure decides
to disable NLS, despite being requested, while libcpp is satisfied, so
tools in the gcc subdirectory don't link against libiconv and the build
fails.  With the included gettext, I was able to rely on a self-consistent
solution.

The current gettext-0.22.3 fails to build for me on AIX.

libcpp configure believes that NLS functions on AIX, but gcc configure
fails in its tests of gettext functionality, which leads to an inconsistent
configuration and build breakage.

Thanks, David

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
  2023-11-14 20:37 David Edelsohn
@ 2023-11-14 23:06 ` Arsen Arsenović
  2023-11-15  1:49   ` David Edelsohn
  0 siblings, 1 reply; 38+ messages in thread
From: Arsen Arsenović @ 2023-11-14 23:06 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Richard Biener, GCC Patches, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

Hi David,

David Edelsohn <dje.gcc@gmail.com> writes:

> Arsen,
>
> Unfortunately this broke bootstrap on AIX.
>
> I had not seen this series of patches.

I've added Bruno to CC as the libintl maintainer, to keep him in the
loop.  Could you provide some extra information w.r.t. the failure mode?

I'll try to investigate ASAP.

In the meanwhile, does disabling NLS etc work?

Thanks in advance, have a lovely night.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
@ 2023-11-14 20:37 David Edelsohn
  2023-11-14 23:06 ` Arsen Arsenović
  0 siblings, 1 reply; 38+ messages in thread
From: David Edelsohn @ 2023-11-14 20:37 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Richard Biener, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Arsen,

Unfortunately this broke bootstrap on AIX.

I had not seen this series of patches.

David

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2023-11-21 20:58 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02  8:27 [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
2023-11-02  8:27 ` [PATCH v3 1/2] intl: remove, in favor of out-of-tree gettext Arsen Arsenović
2023-11-02  8:45 ` [PATCH v3 2/2] *: add modern gettext Arsen Arsenović
2023-11-10 10:37 ` [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Richard Biener
2023-11-14 20:37 David Edelsohn
2023-11-14 23:06 ` Arsen Arsenović
2023-11-15  1:49   ` David Edelsohn
2023-11-15 14:14     ` Arsen Arsenović
2023-11-15 15:51       ` Xi Ruoyao
2023-11-16 18:48         ` Arsen Arsenović
2023-11-15 17:19       ` David Edelsohn
2023-11-16 18:33         ` Arsen Arsenović
2023-11-16 21:11           ` Arsen Arsenović
2023-11-16 21:40             ` David Edelsohn
2023-11-16 22:19               ` Arsen Arsenović
2023-11-16 22:30                 ` David Edelsohn
2023-11-16 22:32                   ` Arsen Arsenović
2023-11-16 23:59                     ` David Edelsohn
2023-11-17  8:34                       ` Arsen Arsenović
2023-11-17  8:50                         ` Richard Biener
2023-11-17  8:56                           ` Arsen Arsenović
2023-11-17 14:41                         ` David Edelsohn
2023-11-17 15:16                           ` Arsen Arsenović
2023-11-17 16:07                             ` David Edelsohn
2023-11-18 18:10                               ` Arsen Arsenović
2023-11-19 21:55                               ` Bruno Haible
2023-11-19 23:00                                 ` Bruno Haible
2023-11-19 23:06                                   ` Andrew Pinski
2023-11-20  1:17                                 ` David Edelsohn
2023-11-20 21:18                                   ` Arsen Arsenović
2023-11-20 21:38                                     ` David Edelsohn
2023-11-21  0:44                                       ` Arsen Arsenović
2023-11-20 23:00                                     ` Bruno Haible
2023-11-21  0:45                                       ` Arsen Arsenović
2023-11-21 13:13                                         ` Arsen Arsenović
2023-11-21 16:28                                           ` David Edelsohn
2023-11-21 20:58                                           ` Eric Gallager
2023-11-15 19:58       ` David Edelsohn

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