From jylefort@brutele.be  Sat Oct 28 09:04:04 2006
Return-Path: <jylefort@brutele.be>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 827C016A47B
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Oct 2006 09:04:04 +0000 (UTC)
	(envelope-from jylefort@brutele.be)
Received: from mirapoint3.brutele.be (mirapoint3.brutele.be [212.68.199.148])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B293743D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Oct 2006 09:04:03 +0000 (GMT)
	(envelope-from jylefort@brutele.be)
Received: from host-212-68-244-81.brutele.be (host-212-68-244-81.brutele.be [212.68.244.81])
	by mirapoint3.brutele.be (MOS 3.7.5a-GA)
	with ESMTP id ABJ66908;
	Sat, 28 Oct 2006 11:04:01 +0200 (CEST)
Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2])
	by gateway.lefort.net (Postfix) with ESMTP id 321515620
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Oct 2006 11:04:01 +0200 (CEST)
Received: by jsite.lefort.net (Postfix, from userid 1000)
	id DE8B02C; Sat, 28 Oct 2006 11:04:00 +0200 (CEST)
Message-Id: <20061028090400.DE8B02C@jsite.lefort.net>
Date: Sat, 28 Oct 2006 11:04:00 +0200 (CEST)
From: Jean-Yves Lefort <jylefort@FreeBSD.org>
Reply-To: Jean-Yves Lefort <jylefort@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: do not let libtool link every single program against its complete library dependency tree
X-Send-Pr-Version: 3.113

>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:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 28 09:10:14 GMT 2006
>Closed-Date:    Tue Mar 27 19:18:21 GMT 2007
>Last-Modified:  Tue Mar 27 19:18:21 GMT 2007
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->ade 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Oct 29 02:23:14 UTC 2006 
Responsible-Changed-Why:  
bsd.autotools.mk is ade territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Tue Mar 27 09:19:48 UTC 2007 
State-Changed-Why:  
Proposed patch is fundamentally flawed: 

1. Solves a non-existent problem 
2. By including bsd.autotools.mk, increases full tree operations (such as 
make index) by a non-trivial amount of time 
3. Makes a change to a core directive (GNU_CONFIGURE) without any indication 
of testing for failures (patch was applied to a test build and resulted 
in considerable tree-wide failures) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: closed->open 
State-Changed-By: jylefort 
State-Changed-When: Tue Mar 27 09:39:45 UTC 2007 
State-Changed-Why:  
1 is wrong. If you do not like my patch, make one, but do not close this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Tue Mar 27 09:49:57 UTC 2007 
State-Changed-Why:  
Closed, with prejudice. 
Reassigned to portmgr. 
Submitter should continue any further discussions there. 


Responsible-Changed-From-To: ade->portmgr 
Responsible-Changed-By: ade 
Responsible-Changed-When: Tue Mar 27 09:49:57 UTC 2007 
Responsible-Changed-Why:  
Closed, with prejudice. 
Reassigned to portmgr. 
Submitter should continue any further discussions there. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: closed->open 
State-Changed-By: jylefort 
State-Changed-When: Tue Mar 27 09:53:41 UTC 2007 
State-Changed-Why:  
Why was it added to a test build if it solves a non-existent problem? That 
makes no sense. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Tue Mar 27 09:58:32 UTC 2007 
State-Changed-Why:  
Terminated. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
State-Changed-From-To: closed->open 
State-Changed-By: jylefort 
State-Changed-When: Tue Mar 27 10:03:42 UTC 2007 
State-Changed-Why:  
Why was it added to a test build if it solves a non-existent problem? That 
makes no sense. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 

From: Ade Lovett <ade@FreeBSD.org>
To: Jean-Yves Lefort <jylefort@FreeBSD.org>
Cc: Ade Lovett <ade@FreeBSD.org>,
 bug-followup@FreeBSD.org,
 portmgr@FreeBSD.org
Subject: Re: ports/104877: do not let libtool link every single program against its complete library dependency tree
Date: Tue, 27 Mar 2007 02:55:01 -0700

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 
 On Mar 27, 2007, at 09:44 , Jean-Yves Lefort wrote:
 
 > Synopsis: do not let libtool link every single program against its  
 > complete library dependency tree
 >
 > State-Changed-From-To: closed->open
 > State-Changed-By: jylefort
 > State-Changed-When: Tue Mar 27 09:39:45 UTC 2007
 > State-Changed-Why:
 > 1 is wrong. If you do not like my patch, make one, but do not close  
 > this PR.
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=10487
 
 Your patch is fundamentally flawed, as I have already explained  
 countless times.  I have reclosed the PR.  Do not attempt to re-open  
 it.  This is now portmgr territory, and I strongly suggest you leave  
 it that way.  Your continued approach to this PR is highly non- 
 optimal, and you should take stock of what you are trying to do,  
 particularly given your breach of inter-committer etiquette with your  
 recent commits.
 
 - -aDe
 
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (Darwin)
 
 iD8DBQFGCOn2pXS8U0IvffwRAtknAJwOD4plHdGfUDylmTWOBBU2PCgGjwCgjS2B
 V1OopmQquXhs2EgQiw1DAsA=
 =rV42
 -----END PGP SIGNATURE-----
State-Changed-From-To: open->closed 
State-Changed-By: erwin 
State-Changed-When: Tue Mar 27 19:17:30 UTC 2007 
State-Changed-Why:  
Portmgr trusts Ades judgement in this matter, so unless any 
technical argumentation to the contrary is presented, this 
patch is rejected. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104877 
>Unformatted:
