[PATCH 0/8 RFC] unbreak --with-included-gettext, and other configury stuff
Nick Alcock
nick.alcock@oracle.com
Mon Feb 8 11:16:27 GMT 2021
Most of this series serves one goal: fixing problems Stephen Casner reported
with a binutils built --with-included-gettext or built on a platform that
doesn't have a gettext in a system libintl or in libc. This has long been broken
in binutils.
Firstly, two commits from last year that allow intl/ to build on systems with
Bison 3 are missing. That's easy to fix, but even with that fixed we have other
problems. libctf would like to compile programs that use libctf.la in its
testsuite, without having to account for the fact that some of them might
include libintl symbols (i.e. it would like libctf.la to be complete, and
ideally libbfd.la too); but making these libraries complete is stymied by the
problem that you cannot link the built-in libintl symbols into shared libraries
on many platforms because it's not PIC. So we picize it, much as libiberty
already is. This then lets us fix gdbserver, which builds a preloaded shared
object and thus won't build without libintl if gettext isn't in libc.
That fixes the shared library case -- but then there's the problem Stephen
reported, which is that LIBINTL in intl/config.intl contains things like this:
LIBINTL='${top_builddir}/../libintl.a -liconv"
(sometimes without the -liconv part).
Linking with this doesn't work with static libraries on some platforms
(e.g. MacOS X) which build libintl.a *into* libctf.a or whatever other library,
and then fail to find symbols in it at build time because a .a file isn't an .o
file. The solution here is to rewrite that into
LIBINTL='-L${top_builddir}/.. -lintl -liconv"
which always works, static or shared, library or not.
The way LIBINTL is transformed is a bit gross: rather than trickle changes
through gettext.m4 (which is frankly painful to contemplate: gettext.m4 has so
many other users and is so complicated...) we just modify the sedding that's
already done in the in-tree intl/configure.ac to sed the thing a bit
differently.
Doing this also lets us rip out some system-dependent hardwired gunge around
whether libintl comes from libc or not and replace it with using the results of
the checks intl/configure has already done.
Nothing seems to break: I've built and tested both binutils-gdb and gcc plus the
two libintl patches with --enable-shared and --disable-shared and with and
without --with-included-gettext on systems with gettext in libc, with gettext in
a system libintl and with no gettext anywhere. Stephen has verified that MacOS X
(a system which had explicit system-dependent libintl gunge in
{bfd,opcodes,libctf}/configure.ac, all of which has gone away) gets further into
the build now (before failing in gdb for not-really-related reasons). Cygwin
(the other system with system-dependent gunge) has been able to have most of it
ripped out, and still builds as above.
Is this sort of thing acceptable? Probably for trunk only, unless people think
that the build failures on MacOS X merit backporting of this to the 2.36 release
branch.
(also in this series, some stuff not needing review: Tcl version checks for the
libctf testsuite and some small configury improvements to libctf.)
(All mails sent to binutils@sourceware.org: relevant subset Cc:ed to gdb and gcc
as well.)
Cc: gdb-patches@sourceware.org
Cc: gcc-patches@gnu.org
Jakub Jelinek (2): (sync from gcc)
intl: Allow building both with old bison and bison >= 3 [PR92008]
intl: Unbreak intl build with bison 3 when no regeneration is needed
[PR92008]
Nick Alcock (6):
intl: always picify
intl: turn LIBINTL into -L / -l form
bfd, opcodes, libctf: support --with-included-gettext
gdbserver: explicitly include gettext, etc in inprocess agent
libctf: require a Tcl capable of try/catch to run tests
libctf: add missing header in BFD ELF check
bfd/configure | 11 ++--
bfd/configure.ac | 11 ++--
gdbserver/Makefile.in | 2 +-
intl/Makefile.in | 16 ++++--
intl/aclocal.m4 | 1 +
intl/configure | 113 +++++++++++++++++++++++++++++++++++++++++-
intl/configure.ac | 30 ++++++++++-
intl/plural-config.h | 1 +
intl/plural-exp.h | 8 ++-
intl/plural.c | 62 +++++++++++++++--------
intl/plural.y | 27 +++++++++-
libctf/Makefile.am | 6 ++-
libctf/Makefile.in | 91 +++++++++++++++++++---------------
libctf/configure | 91 +++++++++++++++++++++++++++++++---
libctf/configure.ac | 27 +++++++---
opcodes/configure | 8 ++-
opcodes/configure.ac | 8 ++-
17 files changed, 413 insertions(+), 100 deletions(-)
create mode 100644 intl/plural-config.h
--
2.30.0.252.gc27e85e57d
More information about the Gcc-patches
mailing list