Subject: uucico + TCP/IP + resolver routines too large (#214) Index: usr.bin/uucp/Makefile,uucp.h 2.11BSD Description: Building 'uucico' for use with TCP networking fails if the resolver routines are used. Building with 'hosts files' leaves only 2kb of space in the text segment. Repeat-By: Define 'BSDTCP' in uucp.h. Build libc.a with the resolver routines (in libc/Makefile set HOSTLOOKUP=named). Make uucico - observe the 'too big' error from the linker. Fix: The main fix was to create an overlay design that minimizes the number of overlay switches. An overlaid uucico is only built if BSDTCP is defined in uucp.h. If an overlaid uucico is necessary the Makefile will extract several objects (the resolver routines and gethnamadr.o which contains gethostbyaddr) from libc.a and place them in an overlay. Since only one or two gethostbyaddr() calls are made (at startup time) during uucico's life there is minimal impact on performance during file transfers. At this time a bit of cleanup is also performed. There are several .c files which are not needed for several reasons: 1) there are system provided counterparts which should be used, 2) the files are not even mentioned in the Makefile, 3) are no longer needed, 4) all of the above. Cut where indicated and save to a file (/tmp/foo). Then: 1) sh /tmp/foo # extract the contents of the shar file 2) sh /tmp/rm.sh.214 # execute the cleanup shell script 3) patch -p0 < /tmp/patch.214.1 # update /VERSION 4) (this step is optional but recommended if you want TCP support included in uucico - DN11 support is removed since no one I know of has DN11s any longer) (You may wish to perform this step manually instead of using the included patch file) patch -p0 < /tmp/patch.214.2 # update the uucp.h file 5) cd /usr/src/usr.bin/uucp cp /tmp/Makefile.214 Makefile make make install make clean ==========================cut here===================== #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # /tmp/rm.sh.214 # /tmp/patch.214.1 # /tmp/patch.214.2 # /tmp/Makefile.214 # This archive created: Tue Dec 27 16:01:03 1994 export PATH; PATH=/bin:/usr/bin:$PATH if test -f '/tmp/rm.sh.214' then echo shar: "will not over-write existing file '/tmp/rm.sh.214'" else sed 's/^X//' << \SHAR_EOF > '/tmp/rm.sh.214' X#! /bin/sh Xrm -f /usr/src/usr.bin/uucp/Makefile Xrm -fr /usr/src/usr.bin/uucp/LIBNDIR Xrm -f /usr/src/usr.bin/uucp/index.c Xrm -f /usr/src/usr.bin/uucp/mkdir.c Xrm -f /usr/src/usr.bin/uucp/getwd.c Xrm -f /usr/src/usr.bin/uucp/strpbrk.c Xrm -f /usr/src/usr.bin/uucp/ioctl.c SHAR_EOF fi if test -f '/tmp/patch.214.1' then echo shar: "will not over-write existing file '/tmp/patch.214.1'" else sed 's/^X//' << \SHAR_EOF > '/tmp/patch.214.1' X*** /VERSION.old Mon Dec 26 18:17:21 1994 X--- /VERSION Tue Dec 27 15:58:35 1994 X*************** X*** 1,4 **** X! Current Patch Level: 213 X X 2.11 BSD X ============ X--- 1,4 ---- X! Current Patch Level: 214 X X 2.11 BSD X ============ SHAR_EOF fi if test -f '/tmp/patch.214.2' then echo shar: "will not over-write existing file '/tmp/patch.214.2'" else sed 's/^X//' << \SHAR_EOF > '/tmp/patch.214.2' X*** /usr/src/usr.bin/uucp/uucp.h.old Sat Jun 11 18:16:13 1994 X--- /usr/src/usr.bin/uucp/uucp.h Thu Dec 22 21:30:50 1994 X*************** X*** 1,4 **** X! /* uucp.h 5.11.2 94/6/11 */ X X #include X #include X--- 1,4 ---- X! /* uucp.h 5.11.3 94/12/22 */ X X #include X #include X*************** X*** 59,70 **** X * The complete list is in the condevs array in condevs.c X */ X /* #define ATT2224 /* AT&T 2224 */ X! /* #define BSDTCP /* 4.2bsd or 2.9bsd TCP/IP */ X /* #define CDS224 /* Concord Data Systems 2400 */ X /* #define DATAKIT /* ATT's datakit */ X /* #define DF02 /* Dec's DF02/DF03 */ X /* #define DF112 /* Dec's DF112 */ X! #define DN11 /* "standard" DEC dialer */ X #define HAYES /* Hayes' Smartmodem */ X /* #define HAYES2400 /* Hayes' 2400 baud Smartmodem */ X /* #define MICOM /* Micom Mux port */ X--- 59,70 ---- X * The complete list is in the condevs array in condevs.c X */ X /* #define ATT2224 /* AT&T 2224 */ X! #define BSDTCP /* 4.2bsd or 2.9bsd TCP/IP */ X /* #define CDS224 /* Concord Data Systems 2400 */ X /* #define DATAKIT /* ATT's datakit */ X /* #define DF02 /* Dec's DF02/DF03 */ X /* #define DF112 /* Dec's DF112 */ X! /* #define DN11 /* "standard" DEC dialer */ X #define HAYES /* Hayes' Smartmodem */ X /* #define HAYES2400 /* Hayes' 2400 baud Smartmodem */ X /* #define MICOM /* Micom Mux port */ SHAR_EOF fi if test -f '/tmp/Makefile.214' then echo shar: "will not over-write existing file '/tmp/Makefile.214'" else sed 's/^X//' << \SHAR_EOF > '/tmp/Makefile.214' X# Makefile 5.11.1 (2.11BSD GTE) 94/12/22 X# X# LIBS can be set to reference other object modules and libraries needed X# by uucico, such as -lunet (needed when UNET is defined). X# X# Common object files are assembled into a library {uulib.a} X# XALL= uucico uucp uux uuxqt uulog uuclean uuname uupoll uusnap \ X uuencode uudecode uusend uucpd uuq acucntrl X# Common object files placed in uulib.a XCOMMON= anlwrk.o anyread.o assert.o cfgets.o chkpth.o \ X cpmv.o expfile.o gename.o getargs.o getprm.o \ X getpwinfo.o gnamef.o gnxseq.o lastpart.o logent.o mailst.o \ X prefix.o setline.o subdir.o sysacct.o systat.o \ X ulockf.o uucpname.o versys.o xqt.o uucpdefs.o XSRCS= ${USRCS} ${OSRCS} ${LSRCS} XUSRCS= cico.c cntrl.c conn.c condevs.c gnsys.c pk0.c chksum.c pk1.c tio.c \ X fio.c gio.c imsg.c XOSRCS= uuclean.c uucp.c uulog.c uuname.c uupoll.c \ X uusend.c uusnap.c uux.c uuxqt.c uuq.c acucntrl.c XLSRCS= anlwrk.c anyread.c assert.c cfgets.c chkpth.c \ X cpmv.c expfile.c \ X gename.c getargs.c getprm.c getpwinfo.c \ X gnamef.c gnxseq.c \ X lastpart.c logent.c mailst.c prefix.c \ X setline.c subdir.c sysacct.c systat.c ulockf.c \ X uucpdefs.c uucpname.c versys.c xqt.c X# Objects extracted from libc.a when building an overlaid uucico XLIBOBJS= gethnamadr.o getsent.o getsbyname.o res_init.o res_send.o \ X res_query.o res_mkquery.o res_comp.o X XDESTDIR= X XOWNER= uucp XGROUP= daemon XCFLAGS= -O XLDFLAGS= XSEPFLAG= -i XLINTFLAGS= -chba XLIBS= XLIBDIR= ${DESTDIR}/usr/lib/uucp XBIN= ${DESTDIR}/usr/bin XETC= ${DESTDIR}/etc XPUBDIR= ${DESTDIR}/usr/spool/uucppublic XSPOOL= ${DESTDIR}/usr/spool/uucp XXQTDIR= ${SPOOL}/XTMP XCORRUPT= ${SPOOL}/CORRUPT XAUDIT= ${SPOOL}/AUDIT XLCK= ${SPOOL}/LCK XLOG= ${SPOOL}/LOG XSTST= ${SPOOL}/STST X# The six subdirs {not counting XTMP}. XHOSTNAME=`uuname -l | sed 's/\(.......\).*/\1/'` XSUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM. X Xall: ${ALL} X Xlint: ${SRCS} X lint ${LINTFLAGS} ${USRCS} ${LSRCS} X -for i in ${OSRCS} ; do \ X lint ${LINTFLAGS} $$i ${LSRCS} ;\ X done X Xprint: $(SRCS) X vgrind $? X vgrind -x index X touch print X Xuucp: uucp.o uulib.a X ${CC} -o uucp ${SEPFLAG} ${LDFLAGS} uucp.o uulib.a ${LIBS} X Xuux: uux.o uulib.a X ${CC} -o uux ${SEPFLAG} ${LDFLAGS} uux.o uulib.a ${LIBS} X Xuuxqt: uuxqt.o uulib.a X ${CC} -o uuxqt ${SEPFLAG} ${LDFLAGS} uuxqt.o uulib.a ${LIBS} X Xuucico: cico.o cntrl.o conn.o condevs.o gnsys.o pk0.o chksum.o pk1.o tio.o \ X fio.o gio.o imsg.o uulib.a aculib/aculib.a X -if egrep -s "^#define[ ]BSDTCP" uucp.h; then \ X ar x /lib/libc.a ${LIBOBJS}; \ X ${CC} -o uucico ${SEPFLAG} ${LDFLAGS} cico.o cntrl.o condevs.o \ X gnsys.o pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \ X uulib.a aculib/aculib.a \ X -Z ${LIBOBJS} \ X -Z conn.o \ X -Y ${LIBS} ; \ X else \ X ${CC} -o uucico ${SEPFLAG} ${LDFLAGS} cico.o cntrl.o conn.o condevs.o \ X gnsys.o pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \ X uulib.a aculib/aculib.a ${LIBS} ; \ X fi X Xuulog: uulog.o uulib.a X ${CC} -o uulog ${SEPFLAG} ${LDFLAGS} uulog.o uulib.a ${LIBS} X Xuuclean: uuclean.o uulib.a X ${CC} -o uuclean ${SEPFLAG} ${LDFLAGS} uuclean.o uulib.a ${LIBS} X Xuuname: uuname.o uulib.a X ${CC} -o uuname ${SEPFLAG} ${LDFLAGS} uuname.o uulib.a ${LIBS} X Xuupoll: uupoll.o uulib.a X ${CC} -o uupoll ${SEPFLAG} ${LDFLAGS} uupoll.o uulib.a ${LIBS} X Xuusnap: uusnap.o X ${CC} -o uusnap ${SEPFLAG} ${LDFLAGS} uusnap.o ${LIBS} X Xuuencode: uuencode.o X ${CC} -o uuencode ${SEPFLAG} ${LDFLAGS} uuencode.o ${LIBS} X Xuudecode: uudecode.o X ${CC} -o uudecode ${SEPFLAG} ${LDFLAGS} uudecode.o ${LIBS} X Xuusend: uusend.o X ${CC} -o uusend ${SEPFLAG} ${LDFLAGS} uusend.o uulib.a ${LIBS} X Xuucpd: uucpd.o uucp.h X ${CC} -o uucpd ${SEPFLAG} ${LDFLAGS} uucpd.o ${LIBS} X Xuuq: uuq.o uulib.a X ${CC} -o uuq ${SEPFLAG} ${LDFLAGS} uuq.o uulib.a ${LIBS} X Xacucntrl: acucntrl.o X ${CC} -o acucntrl ${SEPFLAG} ${LDFLAGS} acucntrl.o ${LIBS} X X# Note: mode 700 on ${LIBDIR} would be safer. X# Also, L.sys etc should be 600. X Xmkdirs: X -for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \ X ${AUDIT} ${LCK} ${LOG} ${STST} ; do \ X rm -f $$i ; mkdir $$i ; \ X chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \ X done X chmod 777 ${PUBDIR} ${LCK} X -cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\ X rm -f $$i ; mkdir $$i ; \ X chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \ X done X -cd ${SPOOL}; for i in ${SUBDIRS} ; do \ X mkdir $$i; \ X /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i; chmod 755 $$i; \ X done X Xuulib.a: ${COMMON} X rm -f $@ X ar cr $@ ${COMMON} X ranlib $@ X Xaculib/aculib.a: X cd aculib; make ${MFLAGS} "CFLAGS=${CFLAGS}" X Xinstall: ${ALL} X /etc/chown ${OWNER} ${LIBDIR} X chgrp ${GROUP} ${LIBDIR} X chmod 755 ${LIBDIR} X for i in uucico uuclean; do \ X install -s -m 6111 -o ${OWNER} -g ${GROUP} $$i ${LIBDIR} ;\ X done X for i in uucp uux uulog uuname uusnap uupoll uuq uusend; do \ X install -s -m 6111 -o ${OWNER} -g ${GROUP} $$i ${BIN} ;\ X done X rm -f ${BIN}/ruusend X ln ${BIN}/uusend ${BIN}/ruusend X install -s -m 6110 -o ${OWNER} -g ${GROUP} uuxqt ${LIBDIR} X install -s -m 6110 -o root -g ${GROUP} acucntrl ${LIBDIR} X install -s -m 500 -o uucp uucpd ${ETC} X @echo Dont forget to fork off /etc/uucpd in /etc/rc.local X @echo if you are not running /etc/inetd X install -s uuencode ${BIN} X install -s uudecode ${BIN} X Xclean: X rm -f *.o ${ALL} uulib.a X cd aculib; make ${MFLAGS} clean X Xdepend: X mkdep ${CFLAGS} *.c SHAR_EOF fi exit 0 # End of shell archive