From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86242 invoked by alias); 29 May 2018 12:55:46 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 86209 invoked by uid 89); 29 May 2018 12:55:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=chose X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 May 2018 12:55:42 +0000 Received: by mail-wm0-f41.google.com with SMTP id x2-v6so32890466wmh.5 for ; Tue, 29 May 2018 05:55:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=lwNpVM5nv0cyTCgXBSe2KpOX1JmxzkK3EW9x1OsZZrE=; b=aCP1zfEPHvGKO1WT7cgMuMzxyH+JELQWByRDGW/z1KWCQoP63zWPEmLsBao12Q/8iJ PY5qaQXmDXADB14LCk0tcZ3YapELBMqqIwDspnbcWxZQQkE92VZXrM7vFFhmgNDVM+JE 9uRI1DU7gzptu29q9MfIg2ryYNmg8tgtytw5a1GPB+NsFN1bFG4EF7qQcBfVrkml7fRi tfDhbNUcSoZmV2EmqaIW11/SuH4WWYQsL5ugyKnKi8fZBWP2BHPFRml2zHWehNnUw9kR DC165UCFYi1Wd1bDpP9XzFNWkXMBeSP0oTIF1O2rbxSwezpOSV2d1ySlv963yUUjOlAY i4Nw== X-Gm-Message-State: ALKqPwfpyUi+WPSYZq+dx19RlMs6jgu+gxIBj632lGmSpJr5RRHdIdMl L/OiZmCSks19sOBJbLBwsxaDP4Fy580= X-Google-Smtp-Source: ADUXVKK4jekbvtZeN79a3D93iq6RrS/5TRPZjYqeJD3zn33RrcKYsh54mpOwICWLKDFY1w+xNePK3Q== X-Received: by 2002:a1c:d53:: with SMTP id 80-v6mr12797585wmn.138.1527598539630; Tue, 29 May 2018 05:55:39 -0700 (PDT) Received: from ?IPv6:2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4? ([2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4]) by smtp.gmail.com with ESMTPSA id b72-v6sm25835972wmf.2.2018.05.29.05.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 05:55:38 -0700 (PDT) Subject: Re: GDB fails to build with Python 3.7 To: Paul.Koning@dell.com Cc: gdb@sourceware.org References: <23b4af30-51fd-e39d-e5a4-c8256203b984@redhat.com> <236499F6-8C72-4BF4-804D-5D4D2CE87BA9@dell.com> From: Phil Muldoon Message-ID: Date: Tue, 29 May 2018 12:55:00 -0000 MIME-Version: 1.0 In-Reply-To: <236499F6-8C72-4BF4-804D-5D4D2CE87BA9@dell.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00029.txt.bz2 On 29/05/18 13:11, Paul.Koning@dell.com wrote: > > >> On May 29, 2018, at 7:37 AM, Phil Muldoon wrote: >> >> Currently GDB fails to build with Python 3.7 >> >> https://bugs.python.org/issue33470 >> >> This is because we use an internal Python API: >> >> #ifdef IS_PY3K >> gdb_module = PyModule_Create (&python_GdbModuleDef); >> /* Add _gdb module to the list of known built-in modules. */ >> _PyImport_FixupBuiltin (gdb_module, "_gdb"); >> #else >> gdb_module = Py_InitModule ("_gdb", python_GdbMethods); >> #endif >> >> (the _PyImport_FixupBuiltin in python.c). >> >> This internal API has been changed. According to the advice of the Python >> maintainers we should never have used it in the first place. I didn't >> add this (at least I don't think I did!), so I'm asking whomever >> authored that code to please change it to be 3.7 compatible. I'm not >> sure what the code achieves so I'm reluctant to touch it in case of >> breakages on platforms I don't have easily access to. > > That may be part of my original Python 3 support work. I'd have to > dig back in somewhat dusty memories to find the reason. Part of the > problem is that Python initialization is different in Python 3 and > the differences are (or were?) undocumented and not particularly obvious. > > I'll take a look. Right now I can't get configure to find Python at > all on my Mac -- "--with-python=/Library/Frameworks...." isn't doing it. > > paul > > BUILDSTDERR: ../../gdb/python/python.c:1853:45: error: too few arguments to function 'int _PyImport_FixupBuiltin(PyObject*, const char*, PyObject*)' Paul, Thanks! And gah, I forgot to add the developers comments: "This is a private API, gdb should not use it. I don't know why gdb chose to call a private function. To fix gdb, an #ifdef using PY_VERSION_HEX should be use to pass one more additional parameter to Python 3.7: "modules". This parameter can be found in interp->modules, where interp is the current interpreter. For example, use PyThreadState_Get()->interp to get the current interpreter." Cheers Phil