ELF preparation step 2:

Move a.out libraries to /usr/lib/aout to make space for ELF libs.
Make rtld usr /usr/lib/aout as default library path.
Make ldconfig reject /usr/lib as an a.out library path.
Fix various Makefiles for LIBDIR!=/usr/lib breakage.

This will after a make world & reboot give a system that no
longer uses /usr/lib/*, infact one could remove all the old
libraries there, they are not used anymore.

We are getting close to an ELF make world, but I'll let this
all settle for a week or two...
This commit is contained in:
Søren Schmidt 1998-05-26 20:12:56 +00:00
parent bcd26b5b67
commit cabb97dcbf
16 changed files with 107 additions and 88 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: Makefile,v 1.179 1998/05/18 03:28:02 jb Exp $
# $Id: Makefile,v 1.180 1998/05/25 17:34:34 sos Exp $
#
# While porting to the another architecture include the bootstrap instead
# of the normal build.
@ -645,7 +645,8 @@ _libm= lib/msun
#
bootstrap-libraries:
.for _lib in ${_csu} gnu/usr.bin/cc/libgcc lib/libtermcap \
gnu/lib/libregex lib/libc lib/libcurses lib/libedit ${_libm} \
gnu/lib/libregex gnu/lib/libreadline lib/libc \
lib/libcrypt lib/libcurses lib/libedit ${_libm} \
lib/libmd lib/libutil lib/libz usr.bin/lex/lib
.if exists(${.CURDIR}/${_lib})
cd ${.CURDIR}/${_lib}; \

View File

@ -1,4 +1,4 @@
# $Id: BSD.usr.dist,v 1.111 1998/03/01 22:45:44 jdp Exp $
# $Id: BSD.usr.dist,v 1.112 1998/04/13 21:44:46 wosch Exp $
#
/set type=dir uname=bin gname=bin mode=0755
@ -14,6 +14,8 @@
include
..
lib
aout
..
compat
..
..

4
etc/rc
View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: rc,v 1.142 1997/12/27 19:46:53 steve Exp $
# $Id: rc,v 1.143 1998/01/08 17:08:22 joerg Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@ -226,7 +226,7 @@ fi
# Make shared lib searching a little faster. Leave /usr/lib first if you
# add your own entries or you may come to grief.
_LDC=/usr/lib
_LDC=/usr/lib/aout
for i in $ldconfig_paths; do
if test -d $i; then
_LDC="${_LDC} $i"

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: ldconfig.c,v 1.19 1997/07/11 14:45:41 jkh Exp $
* $Id: ldconfig.c,v 1.20 1997/08/22 04:42:12 peter Exp $
*/
#include <sys/param.h>
@ -146,7 +146,12 @@ char *argv[];
if (stat(argv[i], &stbuf) == -1) {
warn("%s", argv[i]);
rval = -1;
} else {
}
else if (!strcmp(argv[i], "/usr/lib")) {
warnx("WARNING! '%s' can not be used", argv[i]);
rval = -1;
}
else {
/*
* See if this is a directory-containing
* file instead of a directory

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: rtld.c,v 1.51 1997/12/05 02:06:37 jdp Exp $
* $Id: rtld.c,v 1.52 1998/02/06 16:46:46 jdp Exp $
*/
#include <sys/param.h>
@ -1965,7 +1965,7 @@ __dlsym(fd, sym)
{
if (fd == RTLD_NEXT) {
generror("RTLD_NEXT not supported by this version of"
" /usr/lib/crt0.o");
" crt0.o");
return NULL;
}
return __dlsym3(fd, sym, NULL);

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: shlib.c,v 1.18 1997/02/22 15:46:24 peter Exp $
*/
#include <sys/param.h>
@ -52,7 +52,7 @@
* Standard directories to search for files specified by -l.
*/
#ifndef STANDARD_SEARCH_DIRS
#define STANDARD_SEARCH_DIRS "/usr/lib"
#define STANDARD_SEARCH_DIRS "/usr/lib/aout"
#endif
/*

View File

@ -1,5 +1,5 @@
# from: @(#)Makefile 5.6 (Berkeley) 5/22/91
# $Id: Makefile,v 1.35 1998/02/09 06:05:07 jdp Exp $
# $Id: Makefile,v 1.36 1998/02/11 04:57:10 jdp Exp $
CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
OBJS= crt0.o c++rt0.o gcrt0.o scrt0.o sgcrt0.o
@ -35,7 +35,7 @@ sgcrt0.o: scrt0.o
realinstall:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
${DESTDIR}/usr/lib
${DESTDIR}/${LIBDIR}
depend: .depend

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: rtld.c,v 1.51 1997/12/05 02:06:37 jdp Exp $
* $Id: rtld.c,v 1.52 1998/02/06 16:46:46 jdp Exp $
*/
#include <sys/param.h>
@ -1965,7 +1965,7 @@ __dlsym(fd, sym)
{
if (fd == RTLD_NEXT) {
generror("RTLD_NEXT not supported by this version of"
" /usr/lib/crt0.o");
" crt0.o");
return NULL;
}
return __dlsym3(fd, sym, NULL);

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: shlib.c,v 1.18 1997/02/22 15:46:24 peter Exp $
*/
#include <sys/param.h>
@ -52,7 +52,7 @@
* Standard directories to search for files specified by -l.
*/
#ifndef STANDARD_SEARCH_DIRS
#define STANDARD_SEARCH_DIRS "/usr/lib"
#define STANDARD_SEARCH_DIRS "/usr/lib/aout"
#endif
/*

View File

@ -1,4 +1,7 @@
# $Id$
# $Id: Makefile.inc,v 1.4 1997/02/22 12:47:27 peter Exp $
# already set in bsd.kmod.mk
# KMODDIR= /lkm
CFLAGS+=-aout
LDFLAGS+=-aout

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: ldconfig.c,v 1.19 1997/07/11 14:45:41 jkh Exp $
* $Id: ldconfig.c,v 1.20 1997/08/22 04:42:12 peter Exp $
*/
#include <sys/param.h>
@ -146,7 +146,12 @@ char *argv[];
if (stat(argv[i], &stbuf) == -1) {
warn("%s", argv[i]);
rval = -1;
} else {
}
else if (!strcmp(argv[i], "/usr/lib")) {
warnx("WARNING! '%s' can not be used", argv[i]);
rval = -1;
}
else {
/*
* See if this is a directory-containing
* file instead of a directory

View File

@ -1,65 +1,65 @@
# $Id: bsd.libnames.mk,v 1.11 1998/05/15 09:30:12 bde Exp $
# $Id: bsd.libnames.mk,v 1.12 1998/05/15 09:34:48 bde Exp $
#
# The include file <bsd.libnames.mk> define library names.
# Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this
# file where necessary.
LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
LIBKZHEAD?= ${DESTDIR}/usr/lib/kzhead.o
LIBKZTAIL?= ${DESTDIR}/usr/lib/kztail.o
LIBCRT0?= ${DESTDIR}/${LIBDIR}/crt0.o
LIBKZHEAD?= ${DESTDIR}/${LIBDIR}/kzhead.o
LIBKZTAIL?= ${DESTDIR}/${LIBDIR}/kztail.o
LIBALIAS?= ${DESTDIR}/usr/lib/libalias.a
LIBC?= ${DESTDIR}/usr/lib/libc.a
LIBC_PIC= ${DESTDIR}/usr/lib/libc_pic.a
LIBCALENDAR?= ${DESTDIR}/usr/lib/libcalendar.a
LIBCOM_ERR= ${DESTDIR}/usr/lib/libcom_err.a
LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
LIBDES?= ${DESTDIR}/usr/lib/libdes.a # XXX doesn't exist
LIBDIALOG?= ${DESTDIR}/usr/lib/libdialog.a
LIBDISK?= ${DESTDIR}/usr/lib/libdisk.a
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
LIBF2C?= ${DESTDIR}/usr/lib/libf2c.a
LIBALIAS?= ${DESTDIR}/${LIBDIR}/libalias.a
LIBC?= ${DESTDIR}/${LIBDIR}/libc.a
LIBC_PIC= ${DESTDIR}/${LIBDIR}/libc_pic.a
LIBCALENDAR?= ${DESTDIR}/${LIBDIR}/libcalendar.a
LIBCOM_ERR= ${DESTDIR}/${LIBDIR}/libcom_err.a
LIBCOMPAT?= ${DESTDIR}/${LIBDIR}/libcompat.a
LIBCRYPT?= ${DESTDIR}/${LIBDIR}/libcrypt.a
LIBCURSES?= ${DESTDIR}/${LIBDIR}/libcurses.a
LIBDES?= ${DESTDIR}/${LIBDIR}/libdes.a # XXX doesn't exist
LIBDIALOG?= ${DESTDIR}/${LIBDIR}/libdialog.a
LIBDISK?= ${DESTDIR}/${LIBDIR}/libdisk.a
LIBEDIT?= ${DESTDIR}/${LIBDIR}/libedit.a
LIBF2C?= ${DESTDIR}/${LIBDIR}/libf2c.a
LIBFL?= "don't use LIBFL, use LIBL"
LIBFORMS?= ${DESTDIR}/usr/lib/libforms.a
LIBFTPIO?= ${DESTDIR}/usr/lib/libftpio.a
LIBGPLUSPLUS?= ${DESTDIR}/usr/lib/libg++.a
LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
LIBGCC_PIC?= ${DESTDIR}/usr/lib/libgcc_pic.a
LIBGMP?= ${DESTDIR}/usr/lib/libgmp.a
LIBGNUREGEX?= ${DESTDIR}/usr/lib/libgnuregex.a
LIBIPX?= ${DESTDIR}/usr/lib/libipx.a
LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a # XXX doesn't exist
LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a # XXX doesn't exist
LIBKEYCAP?= ${DESTDIR}/usr/lib/libkeycap.a
LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
LIBL?= ${DESTDIR}/usr/lib/libl.a
LIBFORMS?= ${DESTDIR}/${LIBDIR}/libforms.a
LIBFTPIO?= ${DESTDIR}/${LIBDIR}/libftpio.a
LIBGPLUSPLUS?= ${DESTDIR}/${LIBDIR}/libg++.a
LIBGCC?= ${DESTDIR}/${LIBDIR}/libgcc.a
LIBGCC_PIC?= ${DESTDIR}/${LIBDIR}/libgcc_pic.a
LIBGMP?= ${DESTDIR}/${LIBDIR}/libgmp.a
LIBGNUREGEX?= ${DESTDIR}/${LIBDIR}/libgnuregex.a
LIBIPX?= ${DESTDIR}/${LIBDIR}/libipx.a
LIBKDB?= ${DESTDIR}/${LIBDIR}/libkdb.a # XXX doesn't exist
LIBKRB?= ${DESTDIR}/${LIBDIR}/libkrb.a # XXX doesn't exist
LIBKEYCAP?= ${DESTDIR}/${LIBDIR}/libkeycap.a
LIBKVM?= ${DESTDIR}/${LIBDIR}/libkvm.a
LIBL?= ${DESTDIR}/${LIBDIR}/libl.a
LIBLN?= "don't use, LIBLN, use LIBL"
LIBM?= ${DESTDIR}/usr/lib/libm.a
LIBMD?= ${DESTDIR}/usr/lib/libmd.a
LIBMP?= ${DESTDIR}/usr/lib/libmp.a
LIBMYTINFO?= ${DESTDIR}/usr/lib/libmytinfo.a
LIBNCURSES?= ${DESTDIR}/usr/lib/libncurses.a
LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a
LIBOPIE?= ${DESTDIR}/usr/lib/libopie.a
LIBPC?= ${DESTDIR}/usr/lib/libpc.a # XXX doesn't exist
LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a # XXX doesn't exist
LIBREADLINE?= ${DESTDIR}/usr/lib/libreadline.a
LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a # XXX doesn't exist
LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
LIBM?= ${DESTDIR}/${LIBDIR}/libm.a
LIBMD?= ${DESTDIR}/${LIBDIR}/libmd.a
LIBMP?= ${DESTDIR}/${LIBDIR}/libmp.a
LIBMYTINFO?= ${DESTDIR}/${LIBDIR}/libmytinfo.a
LIBNCURSES?= ${DESTDIR}/${LIBDIR}/libncurses.a
LIBOBJC?= ${DESTDIR}/${LIBDIR}/libobjc.a
LIBOPIE?= ${DESTDIR}/${LIBDIR}/libopie.a
LIBPC?= ${DESTDIR}/${LIBDIR}/libpc.a # XXX doesn't exist
LIBPCAP?= ${DESTDIR}/${LIBDIR}/libpcap.a
LIBPLOT?= ${DESTDIR}/${LIBDIR}/libplot.a # XXX doesn't exist
LIBREADLINE?= ${DESTDIR}/${LIBDIR}/libreadline.a
LIBRESOLV?= ${DESTDIR}/${LIBDIR}/libresolv.a # XXX doesn't exist
LIBRPCSVC?= ${DESTDIR}/${LIBDIR}/librpcsvc.a
LIBSCRYPT?= "don't use LIBSCRYPT, use LIBCRYPT"
LIBSCSI?= ${DESTDIR}/usr/lib/libscsi.a
LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
LIBSS?= ${DESTDIR}/usr/lib/libss.a
LIBSTDCPLUSPLUS?= ${DESTDIR}/usr/lib/libstdc++.a
LIBTCL?= ${DESTDIR}/usr/lib/libtcl.a
LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
LIBSCSI?= ${DESTDIR}/${LIBDIR}/libscsi.a
LIBSKEY?= ${DESTDIR}/${LIBDIR}/libskey.a
LIBSS?= ${DESTDIR}/${LIBDIR}/libss.a
LIBSTDCPLUSPLUS?= ${DESTDIR}/${LIBDIR}/libstdc++.a
LIBTCL?= ${DESTDIR}/${LIBDIR}/libtcl.a
LIBTELNET?= ${DESTDIR}/${LIBDIR}/libtelnet.a
LIBTERMCAP?= ${DESTDIR}/${LIBDIR}/libtermcap.a
LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP"
LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
LIBXPG4?= ${DESTDIR}/usr/lib/libxpg4.a
LIBY?= ${DESTDIR}/usr/lib/liby.a
LIBZ?= ${DESTDIR}/usr/lib/libz.a
LIBUTIL?= ${DESTDIR}/${LIBDIR}/libutil.a
LIBXPG4?= ${DESTDIR}/${LIBDIR}/libxpg4.a
LIBY?= ${DESTDIR}/${LIBDIR}/liby.a
LIBZ?= ${DESTDIR}/${LIBDIR}/libz.a

View File

@ -1,4 +1,4 @@
# $Id: bsd.own.mk,v 1.12 1998/01/04 00:00:21 steve Exp $
# $Id: bsd.own.mk,v 1.13 1998/03/19 13:32:43 bde Exp $
#
# The include file <bsd.own.mk> set common variables for owner,
# group, mode, and directories. Defaults are in brackets.
@ -122,7 +122,11 @@ BINGRP?= bin
BINMODE?= 555
NOBINMODE?= 444
.if ${BINFORMAT} == aout
LIBDIR?= /usr/lib/aout
.else
LIBDIR?= /usr/lib
.endif
LIBCOMPATDIR?= /usr/lib/compat
LIBDATADIR?= /usr/libdata
LINTLIBDIR?= /usr/libdata/lint

View File

@ -1,6 +1,6 @@
# from BSDI Makefile,v 2.6 1996/04/08 20:06:40 bostic Exp
#
# $Id: Makefile,v 1.9 1997/12/16 16:36:43 bde Exp $
# $Id: Makefile,v 1.10 1998/03/21 12:51:44 bde Exp $
PROG= doscmd
SRCS= AsyncIO.c ParseBuffer.c bios.c callback.c cpu.c dos.c cmos.c config.c \
@ -23,7 +23,7 @@ DPADD= ${X11BASE}/lib/libX11.a
.else
CFLAGS+= -I. -DDISASSEMBLER -DNO_X
.endif
LDADD+= -lgcc -lc
LDADD+= -L${DESTDIR}/${LIBDIR} -lgcc -lc
DPADD+= ${LIBGCC} ${LIBC}
beforeinstall:
@ -34,7 +34,7 @@ beforeinstall:
doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC}
ld -e start -dc -dp ${LDFLAGS:M-static:S/-static/-Bstatic/} \
-o doscmd ${LIBCRT0} doscmd_loader.o -lgcc -lc
-o doscmd ${LIBCRT0} doscmd_loader.o -L${DESTDIR}/${LIBDIR} -lgcc -lc
# Bogusly generated dependency to get doscmd_loader.c looked at by mkdep.
.depend: doscmd_loader.c

View File

@ -17,13 +17,13 @@ install:
chown ${BINOWN} ${DESTDIR}/usr/bin/objformat
chgrp ${BINGRP} ${DESTDIR}/usr/bin/objformat
chmod ${BINMODE} ${DESTDIR}/usr/bin/objformat
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ar
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/as
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ld
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/nm
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ranlib
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/size
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/strings
ln -s ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/strip
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ar
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/as
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ld
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/nm
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/ranlib
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/size
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/strings
ln -sf ${DESTDIR}/usr/bin/objformat ${DESTDIR}/usr/bin/strip
.include <bsd.prog.mk>

View File

@ -1,8 +1,7 @@
BINDIR = /usr/sbin
FONTDIR = /usr/share/misc/pcvtfonts
LIBDIR = /usr/lib
LIBMODE = 644
MAN3EXT= 3
MAN5EXT= 5
MAN8EXT= 8
.include <bsd.own.mk>