From owner-freebsd-current Fri Aug 10 9:29:23 2001 Delivered-To: freebsd-current@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 1385837B405 for ; Fri, 10 Aug 2001 09:28:56 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f7AGE7k76034; Fri, 10 Aug 2001 19:14:07 +0300 (EEST) (envelope-from ru) Date: Fri, 10 Aug 2001 19:14:07 +0300 From: Ruslan Ermilov To: Mark Peek Cc: Bruce Evans , Warner Losh , current@FreeBSD.ORG Subject: Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file Message-ID: <20010810191407.A73485@sunbay.com> Mail-Followup-To: Mark Peek , Bruce Evans , Warner Losh , current@FreeBSD.ORG References: <20010810110151.B7988@sunbay.com> <20010810235643.Y23367-100000@besplex.bde.org> <20010810173751.B60193@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mark@whistle.com on Fri, Aug 10, 2001 at 08:38:21AM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Aug 10, 2001 at 08:38:21AM -0700, Mark Peek wrote: > At 5:37 PM +0300 8/10/01, Ruslan Ermilov wrote: > >1. This won't work for cross-platform installworld, since ./file > > is targetted for a different platform. (My version builds the > > xfile build-tool for the build platform and compiles .mgc files > > in ${.OBJDIR}.) > > I'm not sure I understand what you mean by "cross-platform" > installworld. Do you mean "build on a HOST platform and install on > TARGET", or "build on a HOST, install on HOST but using a TARGET > disk"? > I meant the latter here. > I believe the only scenario that is supportable is the former > and you should always run installworld on the TARGET platform. > Why? Both should be supported, but the latter is only possible if we don't "build" anything at "install" time, as with my patch. My solution works in both cases. Realize that PATH is set to ${STRICTTMPPATH}:${INSTALLTMP} during `installworld'. This means only tools built during `bootstrap-tools' stage (DESTDIR=${WORLDTMP}) of `buildworld' and (host) tools copied to ${INSTALLTMP} as the first step of `installworld'. Only these tools could be used during `installworld'. And this was designed to work for both scenarios of cross-platform `installworld'. There is no "file" listed here. Even manpages are compressed at "build" time. :-) > >2. .mgc files get wrong ownership and file modes. (My version > > installs them with correct ownership and modes.) > > That's a bug in file. However, it is easy to add a chown/chmod into > the Makefile install rules. > install(1) can do this atomically (-S) and non-intrusive (-C). You are not going to implement all of the install(1) functionality here, do you? > >3. usr.bin/file still needs to be bootstrapped, because -C is a > > new option. (My version doesn't need bootstrapping file, > > because it is only used as a `build-tool'.) > > Why? When is "file" run during the build process as a build tool? It > can be run during installworld with "./file -C ...". > Why? Because when you build 5.0 on 4.x ./file is linked to libc.so.5, which is not available on 4.x box. $ uname -r 4.3-STABLE $ ls /usr/lib/libc.so.* /usr/lib/libc.so.4 $ ls /CURRENT/usr/lib/libc.so.* /CURRENT/usr/lib/libc.so.5 $ ldd /usr/obj/CURRENT/usr/src/usr.bin/file/file /usr/obj/CURRENT/usr/src/usr.bin/file/file: libc.so.5 => not found (0x0) Look below for more details. > Let's get back to the original issue that occurred when you tried a > 4.X->5.0 upgrade: > > At 12:30 PM +0300 8/9/01, Ruslan Ermilov wrote: > >In the case of 4.x->5.0 upgrade, buildworld bombs with > > > >./file -C -m magic > >/usr/libexec/ld-elf.so.1: Shared object "libc.so.5" not found > >*** Error code 1 > > This is due to the Makefile running "./file" during the build > process. We have already agreed that this is bad and my patches have > moved it to the install phase (similar to running zic for timezone > file creation). > > Try my patch on the > 4.X->5.0 case and see if it fixes the problem you encountered. > > Mark > > Ahhh, accolades from my peers... :-) :-) > "Mark's patch is less hokey than mine." - jhb > "Mark Peek noticed the cross-building problem and sent a little less ugly fix" "Mark's patch doesn't work quite right." - ru Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message