Subject: Re: Sharing /usr/src r/o among different architectures
To: None <apriebe@aip.de>
From: Bill Studenmund <skippy@macro.Stanford.EDU>
List: current-users
Date: 01/04/1999 16:48:58
On Sun, 3 Jan 1999 apr@spade.apc.aip.de wrote:

> Hi all,
> 
> I'm running NetBSD on two machines here. One is a Decstation 5000/200
> running the pmax port and serving as a server for /usr/src for another
> machine (running the i386 port). The i386 has /usr/src mounted via NFS
> (readonly!) on /usr/src. I wanted it readonly especially because I
> use two different machine architectures to avoid any side effects!
> 
> The mk.conf on the i386 side is:
> 
> #
> # apr's mk.conf
> #
> UPDATE=yes
> #
> BSDSRCDIR=/usr/src
> BSDOBJDIR=/var/obj
> OBJMACHINE=yes
> USR_OBJMACHINE=yes

These settings won't work very well on a r/o src tree. The problem is thst
OBJMACHINE makes the build system want to work in obj.${MACHINE}, so on
the i386, the system will want to make lots of obj.i386 links, which it
can't.

I'd suggest either not doing OBJMACHINE with BSDOBJDIR being the same on
both machines (so the symlinks point to the same places), or not worrying
about it. I have i386, mac68k, and (kinda) macppc living out of the same
source tree, without problem.

> #
> USE_EGCS=yes
> #
> EXPORTABLE_SYSTEM=yes
> #
> USE_RSAREF2=NO
> WARN=0
> 
> 
> I got the procedure more or less running, but there are some problems left.
> 
> One occurs during make includes in gnu/lib/libstdc++/config:
> 
> includes ===> gnu/lib/libstdc++/config
> rootme=/usr/src/gnu/lib/libstdc++/config CC="cc" CXX="c++" CONFIG_NM="nm"  /bin/sh /usr/src/gnu/lib/libstdc++/config/../../../dist/libio/gen-params LIB_VERSION=2.9.0 >_G_config.h
> cannot create _G_config.h: read-only file system
> *** Error code 2
> 
> Obviously it tries to write to the mounted /usr/src. Is this really the
> intended behaviour?

No. Is there an obj.i386 directory in usr/src/gnu/lib/libstdc++?

> Another story starts with make depend in gnu/lib/libg2c:
> 
> depend ===> libg2c
> ln -sf /usr/src/gnu/lib/libg2c/../../dist/libf2c/libF77/F77_aloc.c F77_aloc_F.c
> ln: F77_aloc_F.c: Read-only file system
> *** Error code 1

Shouldn't be a problem if you've done a make obj.

> The gnu subtree shows a lot more of these.
> 
> 
> A third thing is in libexec/ld.aout_so. During make depend it shows:
> 
> depend ===> libexec/ld.aout_so
> mkdep -a -fpic -fno-function-cse -DRTLD -DLIBC_SCCS -I/usr/src/libexec/ld.aout_s
> o/../../lib/libc/include -I/usr/src/libexec/ld.aout_so/arch/i386 -I/usr/src/libe
> xec/ld.aout_so /usr/src/libexec/ld.aout_so/arch/i386/mdprologue.S
> /usr/bin/mkdep: cannot create .depend: read-only file system
> mkdep -a -fpic -fno-function-cse -DRTLD -DLIBC_SCCS -I/usr/src/libexec/ld.aout_s
> o/../../lib/libc/include -I/usr/src/libexec/ld.aout_so/arch/i386 -I/usr/src/libe
> xec/ld.aout_so rtld.c malloc.c shlib.c /usr/src/libexec/ld.aout_so/arch/i386/md.
> c /usr/src/libexec/ld.aout_so/../../lib/libc/stdio/vfprintf.c
> /usr/bin/mkdep: cannot create .depend: read-only file system
> cannot open .depend: no such file
> *** Error code 2 (continuing)
> `depend' not remade because of errors.


Sounds like either missing obj.i386, or you have .depend files lying
around outside the obj.X directories.

> Others failing make depend in the "normal" tree are:
> 
> sbin/atactl
> sbin/raidctl
> sbin/wsconsctl
> sbin/ldconfig
> usr.bin/fgen
> 
> They seem to fall in two categories: one is a non-existant .depend, others
> are connected with lex/yacc.
> 
> Will this tell me that .depend is always IN /usr/src and that this is no
> problem for sharing /usr/src among different machine architectures?

Hmm. The .depend files should be in the obj directories. :-(

> BTW Is there a possibility to mount /usr/pkgsrc the same way  (readonly).
> By now it creates work.pmax and work.i386 WITHIN the pkgsrc tree.
> Are there any settings in mk.conf that can help?

I'm not sure.

Take care,

Bill