From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109344 invoked by alias); 21 Jan 2020 00:30:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 109287 invoked by uid 89); 21 Jan 2020 00:30:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,ENV_AND_HDR_SPF_MATCH,GARBLED_BODY,GIT_PATCH_0,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_JMF_BL,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Received:f1d4, HX-Received:sk:p203mr1 X-HELO: mail-oi1-f193.google.com Received: from mail-oi1-f193.google.com (HELO mail-oi1-f193.google.com) (209.85.167.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 00:30:28 +0000 Received: by mail-oi1-f193.google.com with SMTP id n16so984205oie.12 for ; Mon, 20 Jan 2020 16:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Tx0U5p12kbZ4X4VfNLjgo6oIxVyGbrRLkmoCJ32pLwA=; b=Ar8AeUhFKjuIwUtAvVZckiuhiwY5PsynaBStc+aIsdyLcOQ+YwOq8jlw2fnxeQuKBY 5fHWr/AW3iiCnSpLA+gFDZcAxYuaa2T97496u4A3zo9LnkdGaGrVATWJ2b4UMOmwEenl OclOfJ9Mqh3VFqrT59JbKv5nPDTaWQNYcjnf3EzDijXUuN2YNATbXZwzRPaJxvDzGhxK gNtbzZGTvg9RknOy0psNsIuRGwkhOQp3WPOsQ6oY5NEJVwGA1/xAw0C6wRXy7oBiMyGP qJ34XMcSYB8TW3JynpZxAO7Rf7unjVzwwWozMtTRZtCqlsJA58fEoBXBZohhcALsfQw6 5fcQ== MIME-Version: 1.0 References: In-Reply-To: From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Tue, 21 Jan 2020 01:31:00 -0000 Message-ID: Subject: Re: [PATCH] Modify python-config.py or replace it with official one to support python3 To: =?UTF-8?B?5YKF57un5pmX?= Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00617.txt.bz2 On Mon, Jan 20, 2020 at 8:05 AM =E5=82=85=E7=BB=A7=E6=99=97 wrote: > > The formal patch only works on OSX.And here is the patch to make the > crossbuild available. configure is a generated file. Please edit configure.ac instead, and run autoconf to regenerate configure. Make sure to use autoconf version 2.69. Christian > diff --git a/gdb/configure-origin b/gdb/configure > --- a/gdb/configure-origin > +++ b/gdb/configure > @@ -9858,21 +9858,21 @@ fi > # We have a python program to use, but it may be too old. > # Don't flag an error for --with-python=3Dauto (the default). > have_python_config=3Dyes > - python_includes=3D`${python_prog} ${srcdir}/python/python-config.py --i= ncludes` > + python_includes=3D`${python_prog}-config --includes` > if test $? !=3D 0; then > have_python_config=3Dfailed > if test "${with_python}" !=3D auto; then > as_fn_error "failure running python-config --includes" "$LINENO" 5 > fi > fi > - python_libs=3D`${python_prog} ${srcdir}/python/python-config.py --ldfla= gs` > + python_libs=3D`${python_prog}-config --ldflags` > if test $? !=3D 0; then > have_python_config=3Dfailed > if test "${with_python}" !=3D auto; then > as_fn_error "failure running python-config --ldflags" "$LINENO" 5 > fi > fi > - python_prefix=3D`${python_prog} ${srcdir}/python/python-config.py --exe= c-prefix` > + python_prefix=3D`${python_prog}-config --exec-prefix` > if test $? !=3D 0; then > have_python_config=3Dfailed > if test "${with_python}" !=3D auto; then > > > =E5=82=85=E7=BB=A7=E6=99=97 =E4=BA=8E2020=E5=B9=B41= =E6=9C=8820=E6=97=A5=E5=91=A8=E4=B8=80 =E4=B8=8B=E5=8D=888:02=E5=86=99=E9= =81=93=EF=BC=9A > > > > By default,gdb is compiled with python2 script support on OSX. However,= when compiled with arg "--with-python=3D/path/to/python3 " to support pytho= n3 ,some error occurred that seems python3 is not recognized. > > The reason is that the python-config.py is not the same as the official= one.BTW,this issue was once referred at 20 Dec 2012 mail :https://sourcewa= re.org/ml/gdb-patches/2012-12/msg00751.html. > > Somehow,It is not committed(maybe the maintainer forgot it due to the h= appy chrismas holiday). > > And here is my patch: > > > > index: b/gdb/python/python-config.py > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > --- a/gdb/python/python-config.py > > +++ b/gdb/python/python-config.py > > @@ -72,7 +72,7 @@ for opt in opt_flags: > > libs.insert(0, '-L' + getvar('LIBPL')) > > elif os.name =3D=3D 'nt': > > libs.insert(0, '-L' + sysconfig.PREFIX + '/libs') > > - if getvar('LINKFORSHARED') is not None: > > + if not getvar('PYTHONFRAMEWORK'): > > libs.extend(getvar('LINKFORSHARED').split()) > > print (to_unix_path(' '.join(libs)))