From progen@free.fr  Tue Nov 11 10:51:09 2003
Return-Path: <progen@free.fr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E6F0816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Nov 2003 10:51:09 -0800 (PST)
Received: from postfix3-1.free.fr (postfix3-1.free.fr [213.228.0.44])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3FEB543F85
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Nov 2003 10:51:09 -0800 (PST)
	(envelope-from progen@free.fr)
Received: from progeny.zone.org (carnot-2-81-57-109-59.fbx.proxad.net [81.57.109.59])
	by postfix3-1.free.fr (Postfix) with ESMTP id 8B7D4C4923
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Nov 2003 19:51:08 +0100 (CET)
Received: by progeny.zone.org (Postfix, from userid 1001)
	id CB8CA55; Tue, 11 Nov 2003 19:49:25 +0100 (CET)
Message-Id: <20031111184925.CB8CA55@progeny.zone.org>
Date: Tue, 11 Nov 2003 19:49:25 +0100 (CET)
From: Shobaki sam. <progen@free.fr>
Reply-To: Shobaki sam. <progen@free.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: perl 5.8.2 portupgrade install error	
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         59186
>Category:       ports
>Synopsis:       perl 5.8.2 portupgrade install error
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    tobez
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 11 11:00:39 PST 2003
>Closed-Date:    Wed Nov 12 09:22:58 CET 2003
>Last-Modified:  Wed Nov 12 09:22:58 CET 2003
>Originator:     Shobaki sam.
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
none	
>Environment:
System: FreeBSD progeny.zone.org 4.9-STABLE FreeBSD 4.9-STABLE #3: Thu Nov 6 14:06:16 CET 2003 luna@progeny.zone.org:/usr/src/sys/compile/PROKE i386


>Description:

	when trying to compile perl 5.8.2 form ports, those errors occurs:

	------------------------------------------------------------------
	[...]
	Couldn't link /usr/local/bin/perl5.8.2 to /usr/local/bin/perl: No such file or directory 
  	/usr/local/bin/perl
	Couldn't copy /usr/local/bin/perl5.8.2 to /usr/local/bin/perl: No such file or directory
	[...]
	/usr/local/man/man1/s2p.1
	/usr/libexec/elf/strip: /usr/local/bin/perl: No such file or directory
	*** Error code 1

	Stop in /usr/ports/lang/perl5.8.
	*** Error code 1

	Stop in /usr/ports/lang/perl5.8.
	** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade13052.0 make reinstall
	egrep: /var/db/pkg/perl-5.8.1_2/+CONTENTS: No such file or directory
	--->  Restoring the old version
	[...]
	** Fix the installation problem and try again.
	[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 201 packages found 
	(-0 +1) . done]
	** The following packages were not installed or upgraded (*:skipped / !:failed)
        	! lang/perl5.8 (perl-5.8.1_2)   (install error)
	------------------------------------------------------------------

>How-To-Repeat:
	
	Do perl upgrade : portupgrade perl-5.8.1_2
>Fix:
	
	no known.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tobez 
Responsible-Changed-By: tobez 
Responsible-Changed-When: Tue Nov 11 20:09:55 CET 2003 
Responsible-Changed-Why:  
Working with the originator on this one. 

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

From: Anton Berezin <tobez@FreeBSD.org>
To: "Shobaki sam." <progen@free.fr>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/59186: perl 5.8.2 portupgrade install error
Date: Tue, 11 Nov 2003 21:46:31 +0100

 On Tue, Nov 11, 2003 at 07:49:25PM +0100, Shobaki sam. wrote:
 
 > 	when trying to compile perl 5.8.2 form ports, those errors occurs:
 > 
 > 	------------------------------------------------------------------
 > 	[...]
 > 	Couldn't link /usr/local/bin/perl5.8.2 to /usr/local/bin/perl: No such file or directory 
 >   	/usr/local/bin/perl
 > 	Couldn't copy /usr/local/bin/perl5.8.2 to /usr/local/bin/perl: No such file or directory
 > 	[...]
 > 	/usr/local/man/man1/s2p.1
 > 	/usr/libexec/elf/strip: /usr/local/bin/perl: No such file or directory
 > 	*** Error code 1
 
 I don't know what is the exact reason why portupgrade is not happy.  It
 might be a side effect of the _real_ problem.
 
 You gave me build logs I requested, and:
 
 On Tue, Nov 11, 2003 at 08:57:39PM +0100, Shobaki Sam. wrote:
 
 > Here are the files you asked for.
 
 [...]
 
 > LD_LIBRARY_PATH=/usr/ports/lang/perl5.8/work/perl-5.8.2:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/compat/linux/lib:/compat/linux/usr/lib:/compat/linux/usr/X11R6/lib cc -Wl,-E  -L/usr/local/lib -o miniperl  miniperlmain.o opmini.o -L. -lperl -lm -lcrypt -lutil -lc
 
 [...]
 
 > /usr/libexec/ld-elf.so.1: /usr/local/bin/perl: Undefined symbol "PL_exit_flags"
 > *** Error code 1
 
 This is your problem, I think.
 
 Here is what I get in my test jail:
 
 # unset LD_LIBRARY_PATH
 # /usr/local/bin/perl -v
 This is perl, v5.8.2 built for i386-freebsd
 [...]
 # LD_LIBRARY_PATH=/usr/lib ; export LD_LIBRARY_PATH
 # /usr/local/bin/perl -v
 /usr/libexec/ld-elf.so.1: /usr/local/bin/perl: Undefined symbol "PL_exit_flags"
 
 Explanation:
 
 Perl binary is compiled with "-Wl,-R/usr/local/lib/perl5/5.8.2/mach/CORE",
 so that it knows how to find its own (correct).  -Rdirectory is
 equivalent to -rpath directory in GNU ld, which incidentally is FreeBSD
 ld(1).  The funny thing is that the manual page for ld(1) says that
 -rpath takes precedence over LD_LIBRARY_PATH, but it looks like it is
 not really the case on FreeBSD 4.9.
 
 Indeed, looking at src/libexec/rtld-elf/rtld.c on a -stable system, we
 can see, near the find_library() function, the following comment:
 
  * The search order is:
  *   rpath in the referencing file
  *   LD_LIBRARY_PATH
  *   ldconfig hints
  *   /usr/lib
 
 Which follows by the following conflicting code:
 
     if ((pathname = search_library_path(name, ld_library_path)) != NULL ||
       (refobj != NULL &&
       (pathname = search_library_path(name, refobj->rpath)) != NULL) ||
       (pathname = search_library_path(name, gethints())) != NULL ||
       (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)
     return pathname;
 
 If you don't grok C:  this means that LD_LIBRARY_PATH is searched first,
 and it should not.
 
 Oh, by the way, -CURRENT has the same problem.
 
 So, either rtld or rtld's docs need to be fixed, but an obvious
 workaround for _your_ problem would be to unset LD_LIBRARY_PATH
 globally, or at _least_ remove /usr/lib from it.  It is not needed there
 anyway.
 
 Cheers,
 \Anton.
 -- 
 If I did know the future of Perl, and if I told you, you'd probably run
 away screaming.  -- Larry Wall

From: Anton Berezin <tobez@FreeBSD.org>
To: "Shobaki sam." <progen@free.fr>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/59186: perl 5.8.2 portupgrade install error
Date: Tue, 11 Nov 2003 21:59:37 +0100

 Ok, adding to that, the change of the search order was deliberate,
 please see PR/28191 , http://www.freebsd.org/cgi/query-pr.cgi?pr=28191.
 
 The documentation should be fixed.
 
 You should stop using LD_LIBRARY_PATH indiscriminately (for the same
 global effect with lower precedence just play with ldconfig at boot
 time).
 
 Cheers,
 \Anton.
 -- 
 If I did know the future of Perl, and if I told you, you'd probably run
 away screaming.  -- Larry Wall

From: Anton Berezin <tobez@FreeBSD.org>
To: "Shobaki sam." <progen@free.fr>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/59186: perl 5.8.2 portupgrade install error
Date: Wed, 12 Nov 2003 01:09:52 +0100

 After sorting out the LD_LIBRARY_PATH problem, it turned out that, if
 perl5.8.2 symlink already exists in ${PREFIX}/bin, the port fails to
 actually install the binary.
 
 I have committed a fix, please test it in your setup.
 
 \Anton.
 -- 
 If I did know the future of Perl, and if I told you, you'd probably run
 away screaming.  -- Larry Wall
State-Changed-From-To: open->closed 
State-Changed-By: tobez 
State-Changed-When: Wed Nov 12 09:22:08 CET 2003 
State-Changed-Why:  
The originator confirms that the latest commit has fixed the problem. 
Thanks for your report! 

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