Bug 24469 - gdb: build for python3 on mingw fails due to api change
Summary: gdb: build for python3 on mingw fails due to api change
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 8.2
: P2 normal
Target Milestone: 9.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-19 21:03 UTC by Liviu Ionescu
Modified: 2020-01-04 19:41 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liviu Ionescu 2019-04-19 21:03:05 UTC
Python3 API no longer includes the functions refered in `python_run_simple_file()` and the build fails when compiling with `_WIN32` (mingw-w64 in my case).

I could not find a simple workaround, I guess the function needs to be rewritten.
Comment 1 Tom Tromey 2019-04-20 22:59:36 UTC
Could you post the exact error message, or perhaps try
building the gdb 8.3 release branch?  I think there
were some changes in this area but I don't recall exactly
what.
Comment 2 Liviu Ionescu 2019-04-21 05:10:45 UTC
The errors are like 'PyFile_FromString: symbol not found'.

Actually several such references are reported as missing. 

See the 'python_run_simple_file()' function in 'python.c', the 'else' part:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/python/python.c;hb=HEAD#l342


I used the headers from the 3.7.2 Python 3 distribution.

This is a known API incompatibility introduced by Python 3.
Comment 3 Hannes Domani 2020-01-03 23:03:10 UTC
(In reply to Liviu Ionescu from comment #0)
> Python3 API no longer includes the functions refered in
> `python_run_simple_file()` and the build fails when compiling with `_WIN32`
> (mingw-w64 in my case).
> 
> I could not find a simple workaround, I guess the function needs to be
> rewritten.

I think this was fixed with:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=272044897e178835f596c96740c5a1800ec6f9fb
Comment 4 Tom Tromey 2020-01-04 19:41:27 UTC
Thanks for pointing that out.
I'm going to close this.