From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Mar 1 19:30:09 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BE1416A422 for ; Wed, 1 Mar 2006 19:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A550643D4C for ; Wed, 1 Mar 2006 19:30:06 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k21JU63i078484 for ; Wed, 1 Mar 2006 19:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k21JU6iq078482; Wed, 1 Mar 2006 19:30:06 GMT (envelope-from gnats) Resent-Date: Wed, 1 Mar 2006 19:30:06 GMT Resent-Message-Id: <200603011930.k21JU6iq078482@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jean-Yves Lefort Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3C1B16A420 for ; Wed, 1 Mar 2006 19:21:07 +0000 (GMT) (envelope-from jylefort@brutele.be) Received: from host-212-68-242-42.brutele.be (host-212-68-242-42.brutele.be [212.68.242.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CB0B43D46 for ; Wed, 1 Mar 2006 19:21:06 +0000 (GMT) (envelope-from jylefort@brutele.be) Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2]) by gateway.lefort.net (Postfix) with ESMTP id 5941155AF for ; Wed, 1 Mar 2006 20:21:05 +0100 (CET) Received: by jsite.lefort.net (Postfix, from userid 1000) id 15670C151; Wed, 1 Mar 2006 20:21:05 +0100 (CET) Message-Id: <20060301192105.15670C151@jsite.lefort.net> Date: Wed, 1 Mar 2006 20:21:05 +0100 (CET) From: Jean-Yves Lefort To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/93993: Fix libtool shared library versioning X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jean-Yves Lefort List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2006 19:30:09 -0000 >Number: 93993 >Category: ports >Synopsis: Fix libtool shared library versioning >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 01 19:30:06 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jean-Yves Lefort >Release: FreeBSD 6.0-RELEASE i386 >Organization: >Environment: System: FreeBSD jsite.lefort.net 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Sat Feb 11 20:20:04 CET 2006 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386 >Description: On FreeBSD, libtool incorrectly versions shared libraries. Major version numbers should only change when the ABI breaks, but because of this bug, they change when the maintainer of a software package bumps the "current" number (which is defined in the libtool manual as "the most recent interface number that this library implements"). To fix this problem, I propose the following strategy: 1) Apply the attached patch. 2) Issue a heads-up telling people to add FIX_LIBTOOL_VERSIONS=yes to their libtool-using ports the next time they update them. At the same time, allow (and encourage) committers to add FIX_LIBTOOL_VERSIONS (without maintainer approval) to libtool-using ports they encounter. 3) Once all ports have been fixed, unconditionally patch the libtool files, and obsolete the FIX_LIBTOOL_VERSIONS variable. >How-To-Repeat: >Fix: --- /usr/ports/Mk/bsd.autotools.mk Thu Feb 23 11:43:34 2006 +++ bsd.autotools.mk Wed Mar 1 19:40:25 2006 @@ -181,6 +181,14 @@ .if defined(AUTOTOOL_libtool) GNU_CONFIGURE?= YES AUTOTOOL_libtool_env= ${AUTOTOOL_libtool} + +. if defined(FIX_LIBTOOL_VERSIONS) +EXTERNAL_LIBTOOL?= ${WRKDIR}/.libtool-fixed +EXTERNAL_LTMAIN?= ${WRKDIR}/.ltmain.sh-fixed +. else +EXTERNAL_LIBTOOL?= ${LIBTOOL} +EXTERNAL_LTMAIN?= ${LTMAIN} +. endif .endif .if defined(AUTOTOOL_libtool_env) @@ -215,6 +223,14 @@ .endif +.if defined(FIX_LIBTOOL_VERSIONS) +. if defined(AUTOTOOL_libtool) +LIBTOOLVERFILES?= ${EXTERNAL_LIBTOOL} ${EXTERNAL_LTMAIN} +. else +LIBTOOLVERFILES?= ltmain.sh libtool +. endif +.endif + #--------------------------------------------------------------------------- # Environmental handling # Now that we've got our environments defined for autotools, add them @@ -311,15 +327,31 @@ .if !target(patch-autotools) patch-autotools:: . if defined(AUTOTOOL_libtool) +. if defined(FIX_LIBTOOL_VERSIONS) + @${CP} -pf ${LTMAIN} ${EXTERNAL_LTMAIN} + @${CP} -pf ${LIBTOOL} ${EXTERNAL_LIBTOOL} +. endif @(cd ${PATCH_WRKSRC}; \ for file in ${LIBTOOLFILES}; do \ ${CP} $$file $$file.tmp; \ - ${SED} -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${LTMAIN}^g" \ - -e '/^LIBTOOL=/s^\$$(top_builddir)/libtool^${LIBTOOL}^g' \ + ${SED} -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${EXTERNAL_LTMAIN}^g" \ + -e '/^LIBTOOL=/s^\$$(top_builddir)/libtool^${EXTERNAL_LIBTOOL}^g' \ $$file.tmp > $$file; \ ${RM} $$file.tmp; \ done); -. else +. endif +. if defined(FIX_LIBTOOL_VERSIONS) + @(cd ${PATCH_WRKSRC}; \ + for file in ${LIBTOOLVERFILES}; do \ + if [ -f $$file ]; then \ + ${REINPLACE_CMD} -e \ + '/freebsd-elf)/,/;;/ s|major="\.$$current"|major=.`expr $$current - $$age`|; \ + /freebsd-elf)/,/;;/ s|versuffix="\.$$current"|versuffix="$$major"|' \ + $$file; \ + fi; \ + done); +. endif +. if !defined(AUTOTOOL_libtool) && !defined(FIX_LIBTOOL_VERSIONS) @${DO_NADA} . endif .endif --- /usr/ports/Mk/bsd.port.mk Thu Feb 23 16:37:20 2006 +++ bsd.port.mk Wed Mar 1 19:34:28 2006 @@ -1816,7 +1816,7 @@ .include "${PORTSDIR}/Mk/bsd.apache.mk" .endif -.if defined(USE_AUTOTOOLS) +.if defined(USE_AUTOTOOLS) || defined(FIX_LIBTOOL_VERSIONS) .include "${PORTSDIR}/Mk/bsd.autotools.mk" .endif >Release-Note: >Audit-Trail: >Unformatted: