From nobody@FreeBSD.org  Sat Sep 21 11:49:27 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 4ED04694
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Sep 2013 11:49:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 2238B2A89
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Sep 2013 11:49:27 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r8LBnQ16053982
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Sep 2013 11:49:26 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r8LBnQWm053923;
	Sat, 21 Sep 2013 11:49:26 GMT
	(envelope-from nobody)
Message-Id: <201309211149.r8LBnQWm053923@oldred.freebsd.org>
Date: Sat, 21 Sep 2013 11:49:26 GMT
From: Andrew Wilcox <AWilcox@Wilcox-Tech.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: devel/gdb fails to build when PYTHON option enabled
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: luca.pizzamiglio@gmail.com

>Number:         182280
>Category:       ports
>Synopsis:       devel/gdb fails to build when PYTHON option enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 21 11:50:00 UTC 2013
>Closed-Date:    Thu Oct 17 19:03:37 UTC 2013
>Last-Modified:  Thu Oct 17 19:03:37 UTC 2013
>Originator:     Andrew Wilcox
>Release:        10.0-ALPHA2
>Organization:
Wilcox Technologies
>Environment:
FreeBSD ind-web009.wilcox-tech.com 10.0-ALPHA2 FreeBSD 10.0-ALPHA2 #0 r255659: Wed Sep 18 02:56:32 UTC 2013     root@snap.freebsd.org:/snap/releng/10-amd64/tmp/obj/usr/src/sys/GENERIC  amd64
>Description:
Attempting to build gdb-7.6 on a server running 10.0-ALPHA2 with the PYTHON option enabled, I received the following error:


Configuring in ./gdb
< snip >
checking whether to use python... /usr/local/bin/python2.7
checking for python2.7... no
configure: error: no usable python found at /usr/local/bin/python2.7
gmake[3]: *** [configure-gdb] Error 1
gmake[3]: Leaving directory `/usr/ports/devel/gdb/work/gdb-7.6'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/ports/devel/gdb/work/gdb-7.6'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/gdb
*** Error code 1

Stop.



Upon further inspection to config.log, I found the following interesting nugget:


configure:7953: checking whether to use python
configure:7955: result: /usr/local/bin/python2.7
configure:8173: checking for python2.7
configure:8191: cc -o conftest -pipe -DRL_NO_COMPAT -g -g -std=gnu89   -I/usr/local/include/python2.7 -I/usr/local/include/python2.7
conftest.c -lncurses -lz -lm    -L/usr/local/lib/python2.7/config -lintl -lutil -lm -lpython2.7 -Wl,--export-dynamic >&5
/usr/bin/ld: cannot find -lintl
cc: error: linker command failed with exit code 1 (use -v to see invocation)
>How-To-Repeat:
# cd /usr/ports/devel/gdb
# make config
  -> Select [*] PYTHON
# make
>Fix:
Attached is a very, very crude patch that just blindly adds /usr/local/lib to gdb's python-config.py script, which does allow it to compile correctly.  Something more elegant is almost assuredly needed, but I'm not sure the best way to go about this.

Patch attached with submission follows:

*** gdb-7.6/gdb/python/python-config.old	Sat Sep 21 11:33:51 2013
--- gdb-7.6/gdb/python/python-config.py	Sat Sep 21 11:34:05 2013
***************
*** 72,77 ****
--- 72,78 ----
                      libs.insert(0, '-L' + getvar('LIBPL'))
                  elif os.name == 'nt':
                      libs.insert(0, '-L' + sysconfig.PREFIX + '/libs')
+                 libs.insert(0, '-L/usr/local/lib')
              if getvar('LINKFORSHARED') is not None:
                  libs.extend(getvar('LINKFORSHARED').split())
          print (to_unix_path(' '.join(libs)))



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Sep 21 11:50:09 UTC 2013 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182280 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: luca.pizzamiglio@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/182280: devel/gdb fails to build when PYTHON option enabled
Date: Sat, 21 Sep 2013 11:50:08 UT

 Maintainer of devel/gdb,
 
 Please note that PR ports/182280 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182280
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
To: Andrew Wilcox <AWilcox@Wilcox-Tech.com>,bug-followup@freebsd.org
Cc:  
Subject: Re: ports/182280: devel/gdb fails to build when PYTHON option enabled
Date: Tue, 24 Sep 2013 16:49:14 +0200

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
 Hi, thanks for the report!
 
 Unfortunately I'm not able to reproduce your error.
 I successfully build gdb with python option on a amd64 10.0-ALPHA2 and I
 had no further problem.
 I've also tried on redports using different configurations, it was
 always OK.
 Are you using some special python configuration or make.conf?
 The patch you're proposing is a workaround, but not a solution. I prefer
 to find the error and solve it.
 
 Could you try the gdb-7.6.1? (PR ports/181801, still open, but in
 testing) It solves also an installation issue (some installed file was
 not plisted)
 
 Best regards,
 Luca
 
 -----BEGIN PGP SIGNATURE-----
 Version: APG v1.0.8
 
 iQJLBAEBCAA1BQJSQaZqLhxMdWNhIFBpenphbWlnbGlvIDxsdWNhLnBpenphbWln
 bGlvQGdtYWlsLmNvbT4ACgkQ1r9Hhyzd6UXybg//eIJBi1z5s469SKJ/IPp9Af1L
 VHcbvduCyoJckLYIJmU/Km0L3HAYqPEJwkISeTSQqdNbiXz6EO+ZWCCaX5nknQpn
 Skyn36sbOTK012aaR5pGjfvFCHLB/YxCqaXOZX96IcJTQDmXlNjTMGBNIerEvyee
 KfTAxR9boP7Ouyu0U1KHZ461tDwn8X4iECQVtB501kwxCD4xPwLqDm4Mti1xGIrM
 2bY5JveIWbcw9lHRXRL0yjDozFVeIEb16qTCmfWik3X+Slqe0ibfw0GgvwbD1//Z
 GCB0TRHmQ8OOBWvHASqb/eYDHYKm/JovSFE59xPjGI86QADudfJz6Y+8FFD2s3NQ
 N4ezenv0AfnSIEHLcp1GHrityDNhbZ04Ss4xYzJvjqIT8sjJ58Gh0yxZYY+w6ERX
 YJYdVuyZIWWYn1GGUYGQRjPhQy/tYfqsoD1GTbek/7pPu6o5AHR+kVeqIYNtCM0d
 NwvWWkrCGHs5Ni2diACwcmtVLbnkzennzmoaVhfC1qPpK4jK3UsmTpPg+LTPuoGZ
 q/3pJl+ZPVIz3162YVNm+90ERDjDYYmItcaEljPOkOHfqtXu/873D/9cpcNKjlIy
 2F1bKXZC4bVdpkvP9cw4TXGiPIQzd4192dup/Ph55f0IWfSWt5gWdE+uKWhJlCjr
 E+qEyb9ukKkFgtLR26o=
 =3dIJ
 -----END PGP SIGNATURE-----
 

From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: Andrew Wilcox <AWilcox@Wilcox-Tech.com>, Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
Subject: Re: ports/182280: devel/gdb fails to build when PYTHON option enabled
Date: Sun, 13 Oct 2013 17:16:34 +0300

 The problem seems to come from the combination of PYTHON and
 BUNDLED_READLINE.
 
 If one chooses PORTS_READLINE instead, this is the command line the
 configure script uses to detect Python:
 
   configure:8173: checking for python2.7
   configure:8191: cc -o conftest -O2 -pipe -DRL_NO_COMPAT -fno-strict-aliasing -std=gnu89 -I/usr/local/include  -I/usr/local/include/python2.7 -I/usr/local/include/python2.7  -L/usr/local/lib -lreadline conftest.c -lz -lm    -L/usr/local/lib/python2.7/config -lintl -lutil -lm -lpython2.7 -Wl,--export-dynamic >&5
 
 On the other hand, if BUNDLED_READLINE is chosen, -L/usr/local/lib
 -lreadline is not passed and the linker cannot find libintl.so:
 
   configure:8173: checking for python2.7
   configure:8191: cc -o conftest -O2 -pipe -DRL_NO_COMPAT -fno-strict-aliasing -std=gnu89   -I/usr/local/include/python2.7 -I/usr/local/include/python2.7   conftest.c -lncurses -lz -lm    -L/usr/local/lib/python2.7/config -lintl -lutil -lm -lpython2.7 -Wl,--export-dynamic >&5

From: Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
To: Raphael Kubo da Costa <rakuco@FreeBSD.org>,bug-followup@FreeBSD.org
Cc: Andrew Wilcox <AWilcox@Wilcox-Tech.com>
Subject: Re: ports/182280: devel/gdb fails to build when PYTHON option enabled
Date: Thu, 17 Oct 2013 13:11:06 +0200

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA384
 
 I solved the issue and submitted the patch in the bigger PR
 ports/183048. Thanks for your help, it was really helpful!
 
 The new PR solves this problem and updates some other stuffs.
 Please, apply that PR and close this one.
 
 Thanks again for the help!
 
 
 On 10/13/13 16:16, Raphael Kubo da Costa wrote:
 > The problem seems to come from the combination of PYTHON and
 > BUNDLED_READLINE.
 >
 > If one chooses PORTS_READLINE instead, this is the command line the
 > configure script uses to detect Python:
 >
 >   configure:8173: checking for python2.7
 >   configure:8191: cc -o conftest -O2 -pipe -DRL_NO_COMPAT -fno-strict-aliasing -std=gnu89 -I/usr/local/include  -I/usr/local/include/python2.7 -I/usr/local/include/python2.7  -L/usr/local/lib -lreadline conftest.c -lz -lm    -L/usr/local/lib/python2.7/config -lintl -lutil -lm -lpython2.7 -Wl,--export-dynamic >&5
 >
 > On the other hand, if BUNDLED_READLINE is chosen, -L/usr/local/lib
 > -lreadline is not passed and the linker cannot find libintl.so:
 >
 >   configure:8173: checking for python2.7
 >   configure:8191: cc -o conftest -O2 -pipe -DRL_NO_COMPAT -fno-strict-aliasing -std=gnu89   -I/usr/local/include/python2.7 -I/usr/local/include/python2.7   conftest.c -lncurses -lz -lm    -L/usr/local/lib/python2.7/config -lintl -lutil -lm -lpython2.7 -Wl,--export-dynamic >&5
 >
 -----BEGIN PGP SIGNATURE-----
 Version: APG v1.0.8
 
 iQRLBAEBCQA1BQJSX8XILhxMdWNhIFBpenphbWlnbGlvIDxsdWNhLnBpenphbWln
 bGlvQGdtYWlsLmNvbT4ACgkQQdIlJz23K0kEJB//SiCfJDuJFRpprdmj5QUUjFmR
 UCiFs9/aqbSvvtWyR0awzKPR/7N0SDnYjYBmcRKiJHYmd3OL0kk+ruoutiQvtZlP
 Ca212bH0wlldJ5B4gkQ54ICgeMspykLXcyUgyJ5JW1dQ3FsvKGfBRpiStDla4Gs0
 8JL/slrTMYgU5FiewaHBvULMI4aMyxTGpE945ALytbbB462XbOWEX2DV4/ZePjZg
 TQOscIBiMt9LcVsSgFQeWavYYXQ2acH8ag4vSPJ/TaelankDogkGLDpSSI6Ji+GV
 1uoQfuS7YOXfvz/9ZxLyBQV+L1syTSjl3bgRBPZ1rHCJ05p2WczhchoYV5TK3q8W
 cSPiZ0K4TgJwq/tGbl2DyS/rDZqa5JZQMU07s7Ep94Er5zJHbfmoo2sRPChVk0bk
 hwfvycSL8Kvzsv5liCQyW8tpYZuDc5OtP0HV9mD6EdEfCTeu+sh0hqv088H+ZGvs
 zL3aQ1LRrjzFNxoKlq+97wtY5q33zwPUgcnVIhpZxER3hzwAZaJzxgi7fAh8yg7C
 WyAbt5OpSfJSrTNtd0nEkFnjlYydu2SX4ggkxewkMQjLkKsWkS0VjIdsiWudt2Vr
 q4hVEwW3Jg2lvbpwbPruDcY2SfOszJpOo/b1aW/KXosJhXEYqtbK5BLYglNsfWb8
 HdbVT+AfNdYiZmA5Pn/IQ67JGvfjQV+rLJRutCMEtiuA3+rWIkSMD1xlsE4y8QxB
 GayUDm6xVRRuaXDWUbQASDMKpKP8oWoxp4a7awmMkNUiZZVIUoIFdeDPuve1cbWc
 VM44eIHDMjbutl55ckT6GzBv2ZIIV6V5SMqh3YTrggPyhslpdChk7/Nmw+7YolEL
 CnTkFa7GkR+6jPUdlVMrkw/Ef+I4+TQwpiV2b6GBwhe6VqXasDaXn8cJ1aEMTAoC
 D0HSGXo0c4xHxCLqYNqVIt6RcSfTho/GKqTm/yq8N4tjqVmJ9WeoXZEN5R31fMvM
 NcBX+B+IBYDiymg/iPMxbCI5kPAI7zTrfHEvYIWe1GWrwg6UWZgIotcwxKXI+FYX
 eV9aiDn84EZ/53ui8ZfySNR3MfQcKhSfyyETlGoSgR5WbqBruxzPAs9I1sh9Gi7I
 qr2sG7Brz9Va1m2FRwjqbHWBRAPo0DmarymUm0VIhENPR2MfIsZABACrVmukj9C0
 ew1SHoE9dqVxfCNK4KZRZ8XF7cosiW/TFnDWh09rJxzTO0Dzncw4lJmcaTVSftHM
 OzO6kfoYwenHYp1qo4GQBmrUn/s7clESmrhIknUM2XUHqJOCNsvOVeV4PJV7aEzh
 1Ivz7djNZBqbIkbeuUv7qybWfdcXqRfFSflAOD+chtwJoII31rSSZkd5TS/EgQ==
 =/Jfa
 -----END PGP SIGNATURE-----
 
State-Changed-From-To: feedback->closed 
State-Changed-By: rakuco 
State-Changed-When: Thu Oct 17 19:03:36 UTC 2013 
State-Changed-Why:  
Fixed in r330660: http://svnweb.freebsd.org/changeset/ports/330660 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182280 
>Unformatted:
