From owner-freebsd-current Tue Oct 5 19:38:45 1999 Delivered-To: freebsd-current@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 00336156A4 for ; Tue, 5 Oct 1999 19:38:33 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.1/8.9.1) with ESMTP id WAA16879 for ; Tue, 5 Oct 1999 22:36:12 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.3/8.9.1) id WAA13641; Tue, 5 Oct 1999 22:35:42 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 5 Oct 1999 22:35:41 -0400 (EDT) To: current@freebsd.org Subject: installworld broken from R/O /usr/obj X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14330.45971.639580.378954@grasshopper.cs.duke.edu> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG W`hile installworld is being discussed, I wanted to get this out there: Since rev 1.13 of usr.bin/make/arch.c, I've been seing a problem with ELF archive libraries being rebuilt unnecessarily. I believe that this problem can be traced to the RANLIBMAG string being set to "/". The reason I care about this is that its causing perl's libsdbm.a to get rebuilt during an installworld. This is causing installworlds to fail for me from R/O /usr/obj partitions. When make does its initial open of the library, Arch_LibOODate() calls ArchStatMember with the member arg equal to RANLIBMAG (or "/"). This in turn calls ArchStatMember() with member="/". This calls ArchFindMember() with member="/". ArchFindMember() will then return NULL because the strrchr() on line 809 of arch.c causes the pointer to be advanced past the last "/" in the member path, which makes it NULL. I have a hackish fix for this which just looks at the length of RANLIBMAG & the length of member. If they are both 1 && are equal, it fails to advance member past the trailing /. This allows the RANLIBMAG string to be found & prevents an up-to-date lib from being rebuilt: Index: usr.bin/make/arch.c =================================================================== RCS file: /usr/project/ari_scratch2/freebsd-cvs/src/usr.bin/make/arch.c,v retrieving revision 1.14 diff -u -b -B -r1.14 arch.c --- arch.c 1999/09/11 13:08:00 1.14 +++ arch.c 1999/09/21 13:25:39 @@ -807,7 +807,9 @@ * the comparisons easier... */ cp = strrchr (member, '/'); - if (cp != (char *) NULL) { + if ((cp != (char *) NULL) && + !((strlen(member) == 1) && (strlen(RANLIBMAG) == 1) && + strncmp(member, RANLIBMAG, 1) == 0)){ member = cp + 1; } len = tlen = strlen (member); Anybody interested in comitting this? I passed it by the person who committed 1.13 of arch.c & was ignored. I don't know make well enough to feel comfortable committing this myself. Drew ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message