Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2001 19:14:07 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Mark Peek <mark@whistle.com>
Cc:        Bruce Evans <bde@zeta.org.au>, Warner Losh <imp@harmony.village.org>, 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>
In-Reply-To: <p05100300b799a7ab0ef4@[207.76.207.129]>; from mark@whistle.com on Fri, Aug 10, 2001 at 08:38:21AM -0700
References:  <20010810110151.B7988@sunbay.com> <20010810235643.Y23367-100000@besplex.bde.org> <20010810173751.B60193@sunbay.com> <p05100300b799a7ab0ef4@[207.76.207.129]>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <http://people.freebsd.org/~mp/file.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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010810191407.A73485>