Date: Tue, 5 Oct 1999 22:35:41 -0400 (EDT) From: Andrew Gallatin <gallatin@cs.duke.edu> To: current@freebsd.org Subject: installworld broken from R/O /usr/obj Message-ID: <14330.45971.639580.378954@grasshopper.cs.duke.edu>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14330.45971.639580.378954>