From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96311 invoked by alias); 20 Jan 2020 14:05:34 -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 96297 invoked by uid 89); 20 Jan 2020 14:05:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-14.2 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GARBLED_BODY,GIT_PATCH_0,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy==a8=e4=b8, HX-Spam-Relays-External:209.85.208.66, 20201, 2020=e5=b9=b41=e6?= X-HELO: mail-ed1-f66.google.com Received: from mail-ed1-f66.google.com (HELO mail-ed1-f66.google.com) (209.85.208.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Jan 2020 14:05:23 +0000 Received: by mail-ed1-f66.google.com with SMTP id cy15so29595066edb.4 for ; Mon, 20 Jan 2020 06:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=f9ElEqSsGKZjaYHYvVNP22ZUvLvpE6leO/VYjWJMLgI=; b=LAImla3GJcXtRwBjtLvYSpSDDclfLmwUicfjvjf91s7v0ou7odBHNKY9KPA4eW4hP0 Z1jaumlzfE0jXch68FewJgPVf4+h5xKHraiJUOl+g939LqjuHihGj/F2OB9wIgNIlSUA z61UJm+YGjtrYZ+KaiITzsSuw16XFWDmAEmPJ5AmrJRn8qz3BFu6pRLxn8P4vj9arh0l ZdkqjAAMwCZV84LN0+7iqlHLvXPZLVuswkrP7hgzCPnuaatS2skW/8G7NpDnnHkXmw23 D2zLwJEFzJSxPpxrnbYr+8pyuG5TcMht0yiu7j7ZYH103hAMidh2RxrUIYv9+QhGCRp/ ALIw== MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?5YKF57un5pmX?= Date: Mon, 20 Jan 2020 15:05:00 -0000 Message-ID: Subject: Re: [PATCH] Modify python-config.py or replace it with official one to support python3 To: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2020-01/txt/msg00605.txt.bz2 The formal patch only works on OSX.And here is the patch to make the crossbuild available. 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 --inc= ludes` + 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 --ldflags` + 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 --exec-= 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,wh= en compiled with arg "--with-python=3D/path/to/python3 " to support python3= ,some error occurred that seems python3 is not recognized. > The reason is that the python-config.py is not the same as the official o= ne.BTW,this issue was once referred at 20 Dec 2012 mail :https://sourceware= .org/ml/gdb-patches/2012-12/msg00751.html. > Somehow,It is not committed(maybe the maintainer forgot it due to the hap= py 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)))