Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Oct 2006 11:04:00 +0200 (CEST)
From:      Jean-Yves Lefort <jylefort@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/104877: do not let libtool link every single program against its complete library dependency tree
Message-ID:  <20061028090400.DE8B02C@jsite.lefort.net>
Resent-Message-ID: <200610280910.k9S9AEwe015502@freefall.freebsd.org>

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

>Number:         104877
>Category:       ports
>Synopsis:       do not let libtool link every single program against its complete library dependency tree
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 28 09:10:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jean-Yves Lefort
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD jsite.lefort.net 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Tue Oct 24 19:03:08 CEST 2006 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386
>Description:
Our linker supports library dependencies: if library B is linked
against library A and program X is linked against library B, program X
does not need to be linked against library A.

Unfortunately, since .la files have been reintroduced, libtool happily
reads them and links every single program against its complete library
dependency tree.

This slows down the linking considerably (really annoying for
developers), and also creates a direct dependency between a library
down the tree and a leaf program (rebuild your whole system for any
library version bump, no matter how unexposed the library is with
regard to the program).

The attached patch fixes the problem.

Example result (diff of objdump -p) for deskutils/notification-daemon:

--- without-patch       Sat Oct 28 10:40:57 2006
+++ with-patch  Sat Oct 28 10:41:04 2006
@@ -6,8 +6,6 @@
   NEEDED      libORBit-2.so.0
   NEEDED      libgthread-2.0.so.0
   NEEDED      libwnck-1.so.18
-  NEEDED      libstartup-notification-1.so.0
-  NEEDED      libXRes.so.1
   NEEDED      libgtk-x11-2.0.so.0
   NEEDED      libgdk-x11-2.0.so.0
   NEEDED      libXrandr.so.2
@@ -19,12 +17,8 @@
   NEEDED      libXcursor.so.1
   NEEDED      libXfixes.so.3
   NEEDED      libcairo.so.2
-  NEEDED      libpng.so.5
-  NEEDED      libSM.so.6
-  NEEDED      libICE.so.6
   NEEDED      libpangoft2-1.0.so.0
   NEEDED      libfontconfig.so.1
-  NEEDED      libexpat.so.6
   NEEDED      libfreetype.so.9
   NEEDED      libz.so.3
   NEEDED      libpango-1.0.so.0
@@ -35,9 +29,7 @@
   NEEDED      libgobject-2.0.so.0
   NEEDED      libgmodule-2.0.so.0
   NEEDED      libglib-2.0.so.0
-  NEEDED      libicui18n.so.36
-  NEEDED      libpopt.so.0
-  NEEDED      libintl.so.6
   NEEDED      libiconv.so.3
+  NEEDED      libpopt.so.0
   NEEDED      libpthread.so.2
   NEEDED      libc.so.6


>How-To-Repeat:
	
>Fix:
--- bsd.autotools.mk.orig	Wed Jul  5 04:18:08 2006
+++ bsd.autotools.mk	Sat Oct 28 10:38:08 2006
@@ -207,14 +207,14 @@
 
 LIBTOOLFLAGS?=		# default to empty
 
+.endif
+
 . if defined(AUTOTOOL_autoconf)
 LIBTOOLFILES?=		aclocal.m4
 . else
 LIBTOOLFILES?=		configure
 . endif
 
-.endif
-
 #---------------------------------------------------------------------------
 # Environmental handling
 # Now that we've got our environments defined for autotools, add them
@@ -319,7 +319,12 @@
 			$$file.tmp > $$file; \
 		${RM} $$file.tmp; \
 	done);
-. else
-	@${DO_NADA}
 . endif
+	@(cd ${PATCH_WRKSRC}; \
+	for file in ${LIBTOOLFILES}; do \
+		${CP} $$file $$file.tmp; \
+		${SED} -Ee 's/(link_all_deplibs(_[a-zA-Z]+)?)=(unknown|yes)/\1=no/' \
+			$$file.tmp > $$file; \
+		${RM} $$file.tmp; \
+	done);
 .endif
--- bsd.port.mk.orig	Sat Sep 30 21:25:45 2006
+++ bsd.port.mk	Sat Oct 28 10:34:32 2006
@@ -2027,7 +2027,7 @@
 .include "${PORTSDIR}/Mk/bsd.apache.mk"
 .endif
 
-.if defined(USE_AUTOTOOLS)
+.if defined(USE_AUTOTOOLS) || defined(GNU_CONFIGURE)
 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
 .endif
 
>Release-Note:
>Audit-Trail:
>Unformatted:



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