[PATCH 6/8] gdbserver: explicitly include gettext, etc in inprocess agent
Nick Alcock
nick.alcock@oracle.com
Mon Feb 8 20:51:24 GMT 2021
On 8 Feb 2021, Tom Tromey stated:
>>>>>> "Nick" == Nick Alcock via Binutils <binutils@sourceware.org> writes:
>
> Nick> The IPA uses gettext functionality, but does not link to $(LIBINTL), so
> Nick> fails to link when --with-included-gettext is specified.
>
> This seems strange to me.
>
> IIUC, IPA is intended to be a small library that is injected into the
> inferior. So, it seems to me that it should probably not use gettext.
CXXLD libinproctrace.so
/usr/bin/ld: ax-ipa.o: in function `ax_printf(unsigned long, unsigned long, char const*, int, unsigned long*) [clone .constprop.0]':
/home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/ax.cc:928: undefined reference to `libintl_gettext'
/usr/bin/ld: /home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/ax.cc:837: undefined reference to `libintl_gettext'
/usr/bin/ld: /home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/ax.cc:889: undefined reference to `libintl_gettext'
/usr/bin/ld: ax-ipa.o: in function `gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, unsigned long*)':
/home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/ax.cc:1334: undefined reference to `libintl_gettext'
/usr/bin/ld: gdbsupport/common-utils-ipa.o: in function `xstrvprintf(char const*, __va_list_tag*)':
/home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:57: undefined reference to `libintl_gettext'
/usr/bin/ld: gdbsupport/common-utils-ipa.o:/home/oranix/oracle/private/binutils-gdb/x86_64-loom/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:57: more undefined references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status
There are four translated errors in ax.cc... but if you fix those you
find more uses in ../gdbsupport/common-utils.cc and then that calls
gdb_assert which also translates the assertion string and this is
starting to feel like a tail-chasing nightmare where fixing it would do
significant damage to the translatability of GDB itself.
Maybe some sort of -include hackery that redefines _ to nothing would do
the trick, or something to unconditionally disable NLS and recompile
everything it calls upon out of gdbsupport similarly just for the IPA...
but I tried for a while and haven't succeeded yet.
More information about the Binutils
mailing list