public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/26832] New: Fix detection for embedded libpython.a with python3
@ 2020-11-02 15:15 romain.geissler at amadeus dot com
  2020-11-02 23:43 ` [Bug python/26832] " romain.geissler at amadeus dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: romain.geissler at amadeus dot com @ 2020-11-02 15:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26832

            Bug ID: 26832
           Summary: Fix detection for embedded libpython.a with python3
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: romain.geissler at amadeus dot com
  Target Milestone: ---

Hi,

I build gdb on Linux with a statically embedded libpython.a rather than the
recommanded .so way. It seems like the resulting gdb fails to load any module
using dynamic link, like for example "import math".

It's clear that the "problem" is the fact of using -rdynamic vs --dynamic-list.
Actually this "problem" was fixed a long time ago, and we can see in
configure.ac something like:

     AC_RUN_IFELSE(
       [AC_LANG_PROGRAM(
         [#include "Python.h"],
         [int err;
          Py_Initialize ();
          err = PyRun_SimpleString ("import itertools\n");
          Py_Finalize ();
          return err == 0 ? 0 : 1;])],
       [dynamic_list=true], [], [true])

to check whether python can import something without "-rdynamic". However with
python 3 (at least in my case it was python 3.9, but I could also check with
another python 3.4 that it was also the case) itertools seems to be a builtin,
so doesn't actually load any.so.

Do you think this "import itertools" shall be replaced by another module which
we know is a real dynamic python module on both python 2 and python 3 ? I
propose to replace it by "import ctypes" instead which seems to be a modules in
both major python releases.

Cheers,
Romain

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-05 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 15:15 [Bug python/26832] New: Fix detection for embedded libpython.a with python3 romain.geissler at amadeus dot com
2020-11-02 23:43 ` [Bug python/26832] " romain.geissler at amadeus dot com
2020-11-03  1:12 ` simark at simark dot ca
2020-11-06 18:02 ` cvs-commit at gcc dot gnu.org
2020-11-06 18:03 ` cvs-commit at gcc dot gnu.org
2020-12-05 13:00 ` romain.geissler at amadeus dot com

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).