alsa-lib ld cannot find python

Jan Beich jbeich at
Wed Mar 4 22:26:26 UTC 2015

(restored ports@ in CC)

R0B_ROD <witchdoctor.mdf at> writes:

> --- ---
> /usr/bin/ld: cannot find -lpython2.7
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [] Error code 1

alsa-lib's configure relies on `python-config --ldflags` specifying both
the libraries and the path to them in order to link apps/libs against python.
It appears the latter depends on the options specified during build.

# lang/python27 built with NLS=off
$ python2.7-config --libs
-lpython2.7 -lutil -lm
$ python2.7-config --ldflags
-lpython2.7 -lutil -lm -Wl,--export-dynamic
$ pkg-config python-2.7 --libs
-L/usr/local/lib -lpython2.7

Ignoring NIH nature of python-config to fix try the following:

1/ download the attachment and put as lang/python27/files/patch-issue7352
2/ rebuild lang/python27
3/ build audio/alsa-lib
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 602 bytes
Desc: not available
URL: <>

More information about the freebsd-ports mailing list