Cross-compiling a MinGW GDB

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross-compiling a MinGW GDB

Eli Zaretskii
Does anyone build their MinGW GDB by cross-compiling it on GNU/Linux?
If so, could you please share your experience with specifying the
Python tree during the build, such that the built GDB will be able to
use Python features on the target Windows systems?

I'm asking because Kieth Marshall is trying to build a recent GDB this
way, to update the binaries offered by the MinGW site, and he bumps
into all kinds of annoying problems, see, for example, the discussion
starting here:

  https://osdn.net/projects/mingw/lists/archive/users/2020-July/000607.html

If someone could provide practical advice how to avoid these
annoyances, It would probably make Keith's job much more pleasant and
less time-consuming.

I always build GDB natively, so I never had to deal with any of these
problems.

TIA
Reply | Threaded
Open this post in threaded view
|

Re: Cross-compiling a MinGW GDB

Sourceware - gdb-patches mailing list
On Wed, Jul 22, 2020 at 11:51 AM Eli Zaretskii <[hidden email]> wrote:

>
> Does anyone build their MinGW GDB by cross-compiling it on GNU/Linux?
> If so, could you please share your experience with specifying the
> Python tree during the build, such that the built GDB will be able to
> use Python features on the target Windows systems?
>
> I'm asking because Kieth Marshall is trying to build a recent GDB this
> way, to update the binaries offered by the MinGW site, and he bumps
> into all kinds of annoying problems, see, for example, the discussion
> starting here:
>
>   https://osdn.net/projects/mingw/lists/archive/users/2020-July/000607.html
>
> If someone could provide practical advice how to avoid these
> annoyances, It would probably make Keith's job much more pleasant and
> less time-consuming.

I haven't done this myself but I am aware of two things:
- https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport
- The patch discussed at
https://sourceware.org/legacy-ml/gdb-patches/2012-12/msg00754.html
claims to improve cross-compiling with python (Debian used to carry
that patch, though they've since dropped it)

Christian
Reply | Threaded
Open this post in threaded view
|

Re: Cross-compiling a MinGW GDB

Keith Marshall-2
Thanks, Christian

On 22/07/2020 18:47, Christian Biesinger wrote:
> On Wed, Jul 22, 2020 at 11:51 AM Eli Zaretskii <[hidden email]> wrote:
>> Does anyone build their MinGW GDB by cross-compiling it on GNU/Linux?
>
> I haven't done this myself but I am aware of two things:
> - https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport

Basically, that mirrors the procedure which I have adopted; the
principle difference is that I have the Windows build of Python-2.7.18
installed in my default Wine prefix, so am able to run python.exe when
required by the gdb build system.  It yields

  python_includes='-IC:/Python27/include -IC:/Python27/include\r'
  python_libs='-LC:/Python27/libs -lpython27\r'
  python_prefix='C:/Python27\r'

That's almost usable, but the terminating '\r' characters, and the 'C:'
drive prefixes, are troublesome.  I've written a simple wrapper script,
which unconditionally strips the '\r' terminators, but I'm not sure if I
should unconditionally transform the 'C:' prefixes: certainly, it would
seem to be appropriate for python_includes, and for python_libs, but
perhaps not for python_prefix?

> - The patch discussed at
> https://sourceware.org/legacy-ml/gdb-patches/2012-12/msg00754.html
> claims to improve cross-compiling with python (Debian used to carry
> that patch, though they've since dropped it)

Sorry, but I really don't see how that would help in my situation.  It
looks for a $host specific python-config command (mingw32-python-config)
which I would need to write anyway, and it would perform no better than
running gdb's existing python-config.py via python.exe, with appropriate
transformations applied to the output.

--
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F


signature.asc (849 bytes) Download Attachment