Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2013 11:49:26 GMT
From:      Andrew Wilcox <AWilcox@Wilcox-Tech.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/182280: devel/gdb fails to build when PYTHON option enabled
Message-ID:  <201309211149.r8LBnQWm053923@oldred.freebsd.org>
Resent-Message-ID: <201309211150.r8LBo0DS010325@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 21 11:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309211149.r8LBnQWm053923>