Hi ports --

When trying to bring up a new port, I encountered a strange build error. During configure, it attempts to discover the full path of the Python shared lib by doing sysconfig.get_config_vars('LIBPL','INSTSONAME') which it then passes the result of during linking. This seems like a foolish way to do it, but this is not about the merits of that sysconfig.

What happens is that linking fails because INSTSONAME is somehow wrong. Currently, the sysconfig line above returns:
/usr/local/lib/python2.7/config/libpython2.7.so.1.0
which of course should actually be
/usr/local/lib/python2.7/config/libpython2.7.so.0.0

The attached patch fixes the problem and fixes the INSTSONAME variable. However, I'm not sure it's the most elegant way of fixing the problem. I also don't know if a similar fix is needed for other versions of Python that we have, as I've only had time to check 2.7.

More details happily provided if needed.

As a final point: I've discussed this a bit with fgsch@ who agrees that my patch fixes the problem, but suggested I bring it to ports@ for more discussion.

~Brian

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/python/2.7/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- Makefile    23 Aug 2012 19:19:17 -0000      1.21
+++ Makefile    31 Mar 2013 05:29:09 -0000
@@ -3,6 +3,9 @@
 VERSION =              2.7
 PATCHLEVEL =           .3
 REVISION =             1
+# XXX: If you bump SHARED_LIBS, you must make sure it matches
+#      patches/patch-configure_in or else you will reintroduce
+#      the INSTSONAME bug.
 SHARED_LIBS =          python2.7 0.0
 VERSION_SPEC =         >=2.7,<2.8
 
Index: files/CHANGES.OpenBSD
===================================================================
RCS file: /cvs/ports/lang/python/2.7/files/CHANGES.OpenBSD,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 CHANGES.OpenBSD
--- files/CHANGES.OpenBSD       24 Apr 2011 09:31:44 -0000      1.1.1.1
+++ files/CHANGES.OpenBSD       31 Mar 2013 05:29:09 -0000
@@ -17,5 +17,7 @@ of changes made to this version of Pytho
 5.  Support for MIPS64 and MIPS64EL systems has been enabled for the
     _ctypes Module.
 
+6.  INSTSONAME was incorrect, configure.in was patched to fix it.
+
 These changes are available in the OpenBSD CVS repository
 <http://www.openbsd.org/anoncvs.html> in ports/lang/python.
Index: patches/patch-configure_in
===================================================================
RCS file: /cvs/ports/lang/python/2.7/patches/patch-configure_in,v
retrieving revision 1.8
diff -u -p -r1.8 patch-configure_in
--- patches/patch-configure_in  27 Apr 2012 08:18:59 -0000      1.8
+++ patches/patch-configure_in  31 Mar 2013 05:29:09 -0000
@@ -1,10 +1,24 @@
 $OpenBSD: patch-configure_in,v 1.8 2012/04/27 08:18:59 rpointel Exp $
 
 Wrong value of LDSHARED in sysconfig, cf http://bugs.python.org/issue10547
+Fix wrong value of INSTSONAME. SOVERSION defaults to 1.0 which leads to
+INSTSONAME being libpython2.7.so.1.0, which is incorrect.
+This breaks linking for ports that look for INSTSONAME in their configure
+stage.
 
---- configure.in.orig  Tue Apr 10 01:07:36 2012
-+++ configure.in       Fri Apr 13 07:45:44 2012
-@@ -2057,9 +2057,10 @@ AC_CHECK_LIB(dld, shl_load)     # Dynamic linking for 
HP-U
+--- configure.in.orig  Mon Apr  9 19:07:36 2012
++++ configure.in       Sat Mar 30 12:59:06 2013
+@@ -787,6 +787,9 @@ if test $enable_shared = "yes"; then
+             FreeBSD*)
+               SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
+               ;;
++            OpenBSD*)
++              SOVERSION=0.0
++              ;;
+         esac
+         INSTSONAME="$LDLIBRARY".$SOVERSION
+         ;;
+@@ -2057,9 +2060,10 @@ AC_CHECK_LIB(dld, shl_load)     # Dynamic linking for 
HP-U
  
  # only check for sem_init if thread support is requested
  if test "$with_threads" = "yes" -o -z "$with_threads"; then

Reply via email to