public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Claude Robitaille <claude-robitaille@hotmail.com>,
	"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Statically link libwinpthread-1.dll in gdbserver
Date: Mon, 2 May 2022 19:39:57 +0100	[thread overview]
Message-ID: <b2dd261a-cba8-2b35-0fc0-2c8da73dfb57@palves.net> (raw)
In-Reply-To: <DS7PR07MB7686655395B58AF21908E339F7C19@DS7PR07MB7686.namprd07.prod.outlook.com>

On 2022-05-02 18:54, Claude Robitaille wrote:
> This is what I get with make all-gdbserver
> 
>   CXX    alloc.o
> In file included from ../../binutils-gdb/gdbserver/../gdbsupport/common-defs.h:197,
>                  from ../../binutils-gdb/gdbserver/../gdb/alloc.c:37:
> ../../binutils-gdb/gdbserver/../gdbsupport/gdb_locale.h:27:11: fatal error: libintl.h: No such file or directory
>    27 | # include <libintl.h>
>       |           ^~~~~~~~~~~
> compilation terminated.
> 
> This is the complete configuration command line I was using
> 
> export CFLAGS=-static; export CXXFLAGS=-static; ../binutils-gdb/configure --enable-static --with-static-standard-libraries --disable-gdb --host=x86_64-w64-mingw32

Thanks.  I'm not setup to build gdb/gdbserver on mingw fully currently (Ubuntu 20.04's mingw gcc doesn't support
std::future), but I'm able to run that configure, and build alloc.o only, and I see the same:

$ make -C gdbserver alloc.o
make: Entering directory '/home/pedro/gdb/binutils-gdb/build-mingw-test/gdbserver'
  CXX    alloc.o
In file included from ../../src/gdbserver/../gdbsupport/common-defs.h:197,
                 from ../../src/gdbserver/../gdb/alloc.c:37:
../../src/gdbserver/../gdbsupport/gdb_locale.h:27:11: fatal error: libintl.h: No such file or directory
   27 | # include <libintl.h>
      |           ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:553: alloc.o] Error 1
make: Leaving directory '/home/pedro/gdb/binutils-gdb/build-mingw-test/gdbserver'


gdb_locale.h has:

 #ifdef ENABLE_NLS
 # include <libintl.h>
 # define _(String) gettext (String)
 # ifdef gettext_noop

so we should only include libint.h if ENABLE_NLS is defined.

I noticed that:

In build/intl/ I a fully built intl, including a intl/config.intl with the
expected values when using the in-tree intl:

 ...
 USE_NLS='yes'
 LIBINTL='-L${top_builddir}/../intl -lintl'
 LIBINTL_DEP='${top_builddir}/../intl/libintl.a'
 INCINTL='-I${top_builddir}/../intl'
 ...

however, gdbserver's Makefile ended up with the default/empty:

 # Where is the INTL library?  Typically in ../intl.
 INTL = 
 INTL_DEPS = 
 INTL_CFLAGS = 

Looking a bit deeper, I see I ended up with a mismatch between
gdbsupport and gdbserver, one thinks we're using intl, the other one doesn't:

 $ grep ENABLE_NLS gdbserver/config.h 
 /* #undef ENABLE_NLS */

 $ grep ENABLE_NLS gdbsupport/config.h 
 #define ENABLE_NLS 1

Sounds like that may be the problem.

      reply	other threads:[~2022-05-02 18:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 12:11 Claude Robitaille
2022-05-02 13:27 ` Pedro Alves
2022-05-02 13:33   ` Claude Robitaille
2022-05-02 13:37     ` Pedro Alves
2022-05-02 17:12       ` Claude Robitaille
2022-05-02 17:18         ` Pedro Alves
2022-05-02 17:54           ` Claude Robitaille
2022-05-02 18:39             ` Pedro Alves [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=b2dd261a-cba8-2b35-0fc0-2c8da73dfb57@palves.net \
    --to=pedro@palves.net \
    --cc=claude-robitaille@hotmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

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

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