Hi, I am trying to cross compile gdbserver. I am using this little script I did: #!/bin/bash #source in binutils-gdb mkdir gdbserver.build cd gdbserver.build ../binutils-gdb/gdbserver/configure --host=x86_64-w64-mingw32 make But I get this error at the beginning of make Makefile:110: ../gnulib/Makefile.gnulib.inc: No such file or directory make: *** No rule to make target '../gnulib/Makefile.gnulib.inc'. Stop. I did try different with different release but most of them don't even go that far; is gdbserver new in binutils-gdb? Is it supposed to be compilable?
Hi Claude, On Sun, Apr 17, 2022 at 03:35:52AM +0000, Claude Robitaille via Gdb wrote: > Hi, I am trying to cross compile gdbserver. > > I am using this little script I did: > > > #!/bin/bash > #source in binutils-gdb > > mkdir gdbserver.build > cd gdbserver.build > > ../binutils-gdb/gdbserver/configure --host=x86_64-w64-mingw32 > make > > > But I get this error at the beginning of make > > Makefile:110: ../gnulib/Makefile.gnulib.inc: No such file or directory > make: *** No rule to make target '../gnulib/Makefile.gnulib.inc'. Stop. > > I did try different with different release but most of them don't even go that far; is gdbserver new in binutils-gdb? Is it supposed to be compilable? You have to use the top level configure. Something along the lines: $ cd gdbserver.build $ ../binutils-gdb/configure --host=x86_64-w64-mingw32 $ make all-gdbserver $ make install-gdbserver DESTDIR=<whatever_makes_sense_for_you> You can find more details in gdbserver's README file [1]. Cheers, Shahab [1] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdbserver/README;hb=HEAD#l81
Making progress. But it is still not successful. I get this: make[1]: Entering directory '/mnt/data/sbox/tools/gdbserver.build/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> The include file exists and is here: gdbserver.build/intl/libintl.h An include directory is missing? PS I took the instruction that I implemented from this wiki page: https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver I guess it should be removed or amended to refer to the readme file. BuildingCrossGDBandGDBserver - GDB Wiki - sourceware.org<https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver> 1. Problem statement "I have a ARM GNU/Linux board, and I want to be able to debug programs running in it, from the comfort of my x86_64 GNU/Linux machine. sourceware.org ________________________________ From: Shahab Vahedi <shahab.vahedi@gmail.com> Sent: April 17, 2022 6:23 AM To: Claude Robitaille <claude-robitaille@hotmail.com> Cc: Gdb <gdb@sourceware.org> Subject: Re: Building gdbserver Hi Claude, On Sun, Apr 17, 2022 at 03:35:52AM +0000, Claude Robitaille via Gdb wrote: > Hi, I am trying to cross compile gdbserver. > > I am using this little script I did: > > > #!/bin/bash > #source in binutils-gdb > > mkdir gdbserver.build > cd gdbserver.build > > ../binutils-gdb/gdbserver/configure --host=x86_64-w64-mingw32 > make > > > But I get this error at the beginning of make > > Makefile:110: ../gnulib/Makefile.gnulib.inc: No such file or directory > make: *** No rule to make target '../gnulib/Makefile.gnulib.inc'. Stop. > > I did try different with different release but most of them don't even go that far; is gdbserver new in binutils-gdb? Is it supposed to be compilable? You have to use the top level configure. Something along the lines: $ cd gdbserver.build $ ../binutils-gdb/configure --host=x86_64-w64-mingw32 $ make all-gdbserver $ make install-gdbserver DESTDIR=<whatever_makes_sense_for_you> You can find more details in gdbserver's README file [1]. Cheers, Shahab [1] https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceware.org%2Fgit%2F%3Fp%3Dbinutils-gdb.git%3Ba%3Dblob%3Bf%3Dgdbserver%2FREADME%3Bhb%3DHEAD%23l81&data=04%7C01%7C%7Ca6fca4ea6eef4bd1957b08da205c5ada%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637857878273773854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=amHKGcOXi5MxTfRzIHT1OhOiN1rjYQPZcpUHBhAWuec%3D&reserved=0
On Sun, Apr 17, 2022 at 03:12:37PM +0000, Claude Robitaille wrote:
> I get this:
>
> make[1]: Entering directory '/mnt/data/sbox/tools/gdbserver.build/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>
Try adding "--disable-gdb" to the "configure" command.
Cheers,
Shahab
Same result.
________________________________
From: Shahab Vahedi <shahab.vahedi@gmail.com>
Sent: April 17, 2022 1:19 PM
To: Claude Robitaille <claude-robitaille@hotmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
On Sun, Apr 17, 2022 at 03:12:37PM +0000, Claude Robitaille wrote:
> I get this:
>
> make[1]: Entering directory '/mnt/data/sbox/tools/gdbserver.build/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>
Try adding "--disable-gdb" to the "configure" command.
Cheers,
Shahab
Doing a full make worked.
I guess that a needed path gets added to the include argument list in some other tool.
________________________________
From: Gdb <gdb-bounces+claude=cbcr.me@sourceware.org> on behalf of Claude Robitaille via Gdb <gdb@sourceware.org>
Sent: April 17, 2022 2:07 PM
To: Shahab Vahedi <shahab.vahedi@gmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
Same result.
________________________________
From: Shahab Vahedi <shahab.vahedi@gmail.com>
Sent: April 17, 2022 1:19 PM
To: Claude Robitaille <claude-robitaille@hotmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
On Sun, Apr 17, 2022 at 03:12:37PM +0000, Claude Robitaille wrote:
> I get this:
>
> make[1]: Entering directory '/mnt/data/sbox/tools/gdbserver.build/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>
Try adding "--disable-gdb" to the "configure" command.
Cheers,
Shahab
What is the best way to link gdbserver statically?
I now the following configure command line
../binutils-gdb/configure --disable-shared --enable-static --with-static-standard-libraries --disable-gdb --host=x86_64-w64-mingw32
But I still have a dependency on libwinpthread-1.dll (and the Windows system DLL, which are OK).
________________________________
From: Claude Robitaille <claude-robitaille@hotmail.com>
Sent: April 17, 2022 3:40 PM
To: Shahab Vahedi <shahab.vahedi@gmail.com>; Claude Robitaille <claude-robitaille@hotmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
Doing a full make worked.
I guess that a needed path gets added to the include argument list in some other tool.
________________________________
From: Gdb <gdb-bounces+claude=cbcr.me@sourceware.org> on behalf of Claude Robitaille via Gdb <gdb@sourceware.org>
Sent: April 17, 2022 2:07 PM
To: Shahab Vahedi <shahab.vahedi@gmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
Same result.
________________________________
From: Shahab Vahedi <shahab.vahedi@gmail.com>
Sent: April 17, 2022 1:19 PM
To: Claude Robitaille <claude-robitaille@hotmail.com>
Cc: Gdb <gdb@sourceware.org>
Subject: Re: Building gdbserver
On Sun, Apr 17, 2022 at 03:12:37PM +0000, Claude Robitaille wrote:
> I get this:
>
> make[1]: Entering directory '/mnt/data/sbox/tools/gdbserver.build/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>
Try adding "--disable-gdb" to the "configure" command.
Cheers,
Shahab
On 2022-04-17 16:12, Claude Robitaille via Gdb wrote:
>
> PS
> I took the instruction that I implemented from this wiki page: https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver
> I guess it should be removed or amended to refer to the readme file.
> BuildingCrossGDBandGDBserver - GDB Wiki - sourceware.org<https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver>
> 1. Problem statement "I have a ARM GNU/Linux board, and I want to be able to debug programs running in it, from the comfort of my x86_64 GNU/Linux machine.
> sourceware.org
Thanks for mentioning that this wiki page is what you were following.
This document had been written before gdbserver was moved to the top level, and we didn't remember to update that page.
The gdbserver sources used to live in src/gdb/gdbserver/ up until GDB 10.
I've updated the document now.
Pedro Alves