Subject: Re: NetBSD/i386 1.5.4_ALPHA build failure
To: Havard Eidnes <he@netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: port-i386
Date: 08/08/2002 20:13:43
--WYTEVAkct0FjGQmd
Content-Type: multipart/mixed; boundary="BXVAT5kNtrzKuDFl"
Content-Disposition: inline


--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

hi havard,

On Thu, Aug 08, 2002 at 10:29:09AM +0200, Havard Eidnes wrote:
>
> It would seem that your ioctl_compat.h is somehow messed up.  That
> file has not been touched on the netbsd-1-5 branch since 1.5.3 was
> cut.  Both in -current and on the netbsd-1-5 branch, line 20 of
> ioctl_compat.h is in the middle of the initial Berkeley copyright
> comment.

good guess. /altroot/usr/include/sys/ioctl_compat.h is identical with
the one in /usr/src/sys/sys/ioctl_compat.h at the start of the build
but is corrupted when /usr/src/usr.bin/talk is building.

i investigated further and i've found the place where it is overwritten.
it's in /usr/src/usr.bin/kdump/Makefile.ioctl-c :

  [/usr/src/usr.bin/kdump]# ls -l /altroot/usr/include/sys/ioctl_compat.h
  -r--r--r--  1 root  wheel  7090 Aug  8 19:51 /altroot/usr/include/sys/ioc=
tl_compat.h

  [/usr/src/usr.bin/kdump]# make DESTDIR=3D/altroot
  /bin/sh /usr/src/usr.bin/kdump/../kdump/mkioctls /altroot/usr/include/sys=
/ioctl.h  /altroot/usr/include/sys/ioctl_compat.h > ioctl.c
  In file included from /altroot/usr/include/sys/ioctl.h:92:
  /altroot/usr/include/sys/cdefs.h:190: #error "No function renaming possib=
le"
  cc -O2 -pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-ar=
ith -Wno-uninitialized -Werror   -I/usr/src/usr.bin/kdump/../ktrace -I/usr/=
src/usr.bin/kdump/../../sys -nostdinc -idirafter /altroot/usr/include -c io=
ctl.c
  cc  -static -o kdump -nostdlib -Wl,-rpath-link,/altroot/usr/lib /altroot/=
usr/lib/crt0.o /altroot/usr/lib/crtbegin.o kdump.o ioctl.o subr.o setemul.o=
  -L/altroot/usr/lib -lgcc -lc -lgcc /altroot/usr/lib/crtend.o

  [/usr/src/usr.bin/kdump]# ls -l /altroot/usr/include/sys/ioctl_compat.h
  -r--r--r--  1 root  wheel  9059 Aug  8 19:51 /altroot/usr/include/sys/ioc=
tl_compat.h

the first command seems to render corrupted ioctl_compat.h into
/altroot/usr/include/sys/ioctl_compat.h no idea why.. the corrupted
ioctl_compat.h is attached as well as mkioctls script.

is there any obvious thing i am overlooking or is this a bug?  should i
start with clean /usr/src checked out from anoncvs?  sources are
originally checked from netbsd-1-5 as 1.5.3_RC2 were tagged, updated to
1.5.3 and later to 1.5.4_ALPHA.


regards,

--=20
-- Lubomir Sedlacik <salo@Xtrmntr.org>   ASCII Ribbon campaign against  /"\=
 --
--                  <salo@silcnet.org>   e-mail in gratuitous HTML and  \ /=
 --
--                                       Microsoft proprietary formats   X =
 --
-- PGPkey: http://Xtrmntr.org/salo.pgp                                  / \=
 --
-- Key Fingerprint: 75B2 2B96 CD75 0385 1C49  39B8 8B08 C30E 54BC 7263     =
 --

--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ioctl_compat.h"
Content-Transfer-Encoding: quoted-printable

#define TTYDISC 0=20
#define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv)=20
#define DIOCRFORMAT _IOWR('d', 105, struct format_op)=20
#define DIOCSDINFO _IOW('d', 102, struct disklabel)=20
#define __KERNEL_SCCSID(_n, _s) =20
#define DIOCGPART _IOW('d', 104, struct partinfo)=20
#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf)=20
#define TIOCCBRK _IO('t', 122)=20
#define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq)=20
#define SIOCGIFASYNCMAP _IOWR('i', 124, struct ifreq)=20
#define __indr_reference(sym, alias) =20
#define TIOCSWINSZ _IOW('t', 103, struct winsize)=20
#define _SYS_IOCTL_H_ =20
#define ___STRING(x) __STRING(x)=20
#define TIOCCDTR _IO('t', 120)=20
#define TIOCEXT _IOW('t', 96, int)=20
#define SIOCADDRT _IOW('r', 10, struct ortentry)=20
#define IOC_IN (unsigned long)0x80000000=20
#define _SYS_CDEFS_H_ =20
#define __GNUC_PREREQ__(x, y) 0=20
#define FIOSETOWN _IOW('f', 124, int)=20
#define __SECTIONSTRING(_sec, _str) __asm__(".section " #_sec " ; .asciz \"=
" _str "\" ; .text")=20
#define _SYS_CDEFS_ELF_H_ =20
#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq)=20
#define DIOCKLABEL _IOW('d', 119, int)=20
#define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv)=20
#define __signed signed=20
#define TIOCGFLAGS _IOR('t', 93, int)=20
#define FIOASYNC _IOW('f', 125, int)=20
#define TIOCM_CAR 0100=20
#define DIOCSRETRIES _IOW('d', 108, int)=20
#define _C_LABEL(x) x=20
#define TIOCFLAG_MDMBUF 0x08=20
#define TIOCPKT _IOW('t', 112, int)=20
#define ODIOCEJECT _IO('d', 112)=20
#define SIOCADDMULTI _IOW('i', 49, struct ifreq)=20
#define TIOCCONS _IOW('t', 98, int)=20
#define SIOCGETSGCNT _IOWR('u', 52, struct sioc_sg_req)=20
#define TIOCSIG _IO('t', 95)=20
#define ___CONCAT(x, y) __CONCAT(x,y)=20
#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq)=20
#define _SYS_FILIO_H_ =20
#define TIOCPKT_NOSTOP 0x10=20
#define TIOCM_CTS 0040=20
#define __weak_alias(alias, sym) __asm__(".weak " #alias " ; " #alias " =3D=
 " #sym);=20
#define FIONREAD _IOR('f', 127, int)=20
#define __warn_references(sym, msg) __asm__(".section .gnu.warning." #sym "=
 ; .ascii \"" msg "\" ; .text");=20
#define TIOCSTI _IOW('t', 114, char)=20
#define TIOCM_DSR 0400=20
#define __NetBSD__ 1=20
#define TIOCREMOTE _IOW('t', 105, int)=20
#define TIOCM_DTR 0002=20
#define TIOCSCTTY _IO('t', 97)=20
#define SLIPDISC 4=20
#define FIOCLEX _IO('f', 1)=20
#define HDLCDISC 7=20
#define TIOCGETA _IOR('t', 19, struct termios)=20
#define __KPRINTF_ATTRIBUTE__ 1=20
#define TIOCGETD _IOR('t', 26, int)=20
#define TIOCSETAF _IOW('t', 22, struct termios)=20
#define TIOCPKT_STOP 0x04=20
#define __SCCSID2(_s) =20
#define DIOCGDINFO _IOR('d', 101, struct disklabel)=20
#define __predict_true(exp) ((exp) !=3D 0)=20
#define TIOCFLUSH _IOW('t', 16, int)=20
#define TIOCSETAW _IOW('t', 21, struct termios)=20
#define SIOCGIFADDR _IOWR('i', 33, struct ifreq)=20
#define TIOCPKT_FLUSHWRITE 0x02=20
#define TIOCGWINSZ _IOR('t', 104, struct winsize)=20
#define __volatile volatile=20
#define ___RENAME(x) __asm__(___STRING(_C_LABEL(x)))=20
#define SIOCSIFADDR _IOW('i', 12, struct ifreq)=20
#define __aconst =20
#define __extension__ =20
#define TIOCEXCL _IO('t', 13)=20
#define SIOCGETVIFCNT _IOWR('u', 51, struct sioc_vif_req)=20
#define _IO(g, n) _IOC(IOC_VOID,	(g), (n), 0)=20
#define FIOGETOWN _IOR('f', 123, int)=20
#define TIOCPKT_DATA 0x00=20
#define PTIOCFREEBSD _IOW('Z', 4, struct ioctl_pt)=20
#define TIOCM_RNG 0200=20
#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq)=20
#define SIOCDIFPHYADDR _IOW('i', 73, struct ifreq)=20
#define TIOCFLAG_CLOCAL 0x02=20
#define TIOCGSID _IOR('t', 99, int)=20
#define TIOCM_RTS 0004=20
#define DIOCEJECT _IOW('d', 112, int)=20
#define _SYS_TTYCOM_H_ =20
#define __P(protos) protos=20
#define IOC_VOID (unsigned long)0x20000000=20
#define _IOC(inout, group, num, len) (inout | ((len & IOCPARM_MASK) << 16) =
| ((group) << 8) | (num))=20
#define SIOCGIFMEDIA _IOWR('i', 54, struct ifmediareq)=20
#define _IOR(g, n, t) _IOC(IOC_OUT,	(g), (n), sizeof(t))=20
#define _IOW(g, n, t) _IOC(IOC_IN,	(g), (n), sizeof(t))=20
#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq)=20
#define TIOCMBIC _IOW('t', 107, int)=20
#define __KERNEL_COPYRIGHT(_n, _s) __SECTIONSTRING(.copyright, _s)=20
#define STRIPDISC 6=20
#define TIOCMBIS _IOW('t', 108, int)=20
#define TIOCGPGRP _IOR('t', 119, int)=20
#define __const const=20
#define TIOCFLAG_CDTRCTS 0x10=20
#define __STRING(x) #x=20
#define IOC_INOUT (IOC_IN|IOC_OUT)=20
#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq)=20
#define __pure =20
#define SIOCSIFMTU _IOW('i', 127, struct ifreq)=20
#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq)=20
#define TIOCUCNTL _IOW('t', 102, int)=20
#define TIOCMGET _IOR('t', 106, int)=20
#define SIOCSHIWAT _IOW('s',  0, int)=20
#define SIOCSLOWAT _IOW('s',  2, int)=20
#define SIOCGIFCONF _IOWR('i', 36, struct ifconf)=20
#define DIOCSSTEP _IOW('d', 107, int)=20
#define PTIOCULTRIX _IOW('Z', 6, struct ioctl_pt)=20
#define SIOCDIFADDR _IOW('i', 25, struct ifreq)=20
#define IOC_OUT (unsigned long)0x40000000=20
#define IOCPARM_MASK 0x1fff=20
#define SIOCATMARK _IOR('s',  7, int)=20
#define __attribute__(x) =20
#define i386 1=20
#define SIOCSIFMEDIA _IOWR('i', 53, struct ifreq)=20
#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq)=20
#define PTIOCSUNOS _IOW('Z', 1, struct ioctl_pt)=20
#define DIOCWFORMAT _IOWR('d', 106, struct format_op)=20
#define SIOCGIFALIAS _IOWR('i', 27, struct ifaliasreq)=20
#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)=20
#define __COPYRIGHT(_s) static const char copyright[] __attribute__((__unus=
ed__)) =3D _s=20
#define __CONCAT(x, y) x ## y=20
#define IOCPARM_MAX NBPG=20
#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq)=20
#define FIONBIO _IOW('f', 126, int)=20
#define PTIOCOSF1 _IOW('Z', 5, struct ioctl_pt)=20
#define __IDSTRING(_n, _s) __SECTIONSTRING(.ident,_s)=20
#define __kprintf_attribute__(a) __attribute__(a)=20
#define FIONCLEX _IO('f', 2)=20
#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq)=20
#define __BEGIN_DECLS =20
#define TIOCGSIZE TIOCGWINSZ=20
#define __weak_extern(sym) __asm__(".weak " #sym);=20
#define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval)=20
#define TIOCMSET _IOW('t', 109, int)=20
#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq)=20
#define TIOCSPGRP _IOW('t', 118, int)=20
#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq)=20
#define PTIOCWIN32 _IOW('Z', 7, struct ioctl_pt)=20
#define TIOCXMTFRAME _IOW('t', 68, struct mbuf *)=20
#define TIOCFLAG_SOFTCAR 0x01=20
#define DIOCLOCK _IOW('d', 113, int)=20
#define __dead =20
#define TIOCFLAG_CRTSCTS 0x04=20
#define __predict_false(exp) ((exp) !=3D 0)=20
#define TIOCNXCL _IO('t', 14)=20
#define SIOCGIFMTU _IOWR('i', 126, struct ifreq)=20
#define SIOCIFCREATE _IOW('i', 122, struct ifreq)=20
#define PPPDISC 5=20
#define SIOCGPGRP _IOR('s',  9, int)=20
#define _SYS_DKIO_H_ =20
#define SIOCGHIWAT _IOR('s',  1, int)=20
#define TIOCSBRK _IO('t', 123)=20
#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))=20
#define SIOCGLOWAT _IOR('s',  3, int)=20
#define SIOCDELRT _IOW('r', 11, struct ortentry)=20
#define TIOCM_CD TIOCM_CAR=20
#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)=20
#define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq)=20
#define TIOCSTART _IO('t', 110)=20
#define PTIOCLINUX _IOW('Z', 3, struct ioctl_pt)=20
#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq)=20
#define TIOCSETA _IOW('t', 20, struct termios)=20
#define TIOCSDTR _IO('t', 121)=20
#define TIOCSETD _IOW('t', 27, int)=20
#define TIOCM_LE 0001=20
#define __SCCSID(_s) =20
#define TIOCOUTQ _IOR('t', 115, int)=20
#define TIOCM_RI TIOCM_RNG=20
#define TIOCM_SR 0020=20
#define TIOCM_ST 0010=20
#define TIOCSSIZE TIOCSWINSZ=20
#define _MACHINE_CDEFS_H_ =20
#define SIOCALIFADDR _IOW('i', 28, struct if_laddrreq)=20
#define TIOCNOTTY _IO('t', 113)=20
#define DIOCSBAD _IOW('d', 110, struct dkbad)=20
#define _IOWR(g, n, t) _IOC(IOC_INOUT,	(g), (n), sizeof(t))=20
#define __ELF__ 1=20
#define TIOCRCVFRAME _IOW('t', 69, struct mbuf *)=20
#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq)=20
#define PTIOCSVR4 _IOW('Z', 2, struct ioctl_pt)=20
#define TIOCPKT_FLUSHREAD 0x01=20
#define SIOCDLIFADDR _IOW('i', 30, struct if_laddrreq)=20
#define DIOCWLABEL _IOW('d', 109, int)=20
#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq)=20
#define __RCSID(_s) __IDSTRING(rcsid,_s)=20
#define TIOCPKT_IOCTL 0x40=20
#define TIOCSFLAGS _IOW('t', 92, int)=20
#define TIOCPKT_DOSTOP 0x20=20
#define IOCGROUP(x) (((x) >> 8) & 0xff)=20
#define _SYS_SOCKIO_H_ =20
#define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq)=20
#define SIOCSIFGENERIC _IOW('i', 57, struct ifreq)=20
#define TIOCDRAIN _IO('t', 94)=20
#define SIOCIFGCLONERS _IOWR('i', 120, struct if_clonereq)=20
#define SIOCGLIFADDR _IOWR('i', 29, struct if_laddrreq)=20
#define __KERNEL_RCSID(_n, _s) __RCSID(_s)=20
#define TIOCSTAT _IOW('t', 101, int)=20
#define UIOCCMD(n) _IO('u', n)=20
#define TIOCPKT_START 0x08=20
#define __END_DECLS =20
#define DIOCWDINFO _IOW('d', 103, struct disklabel)=20
#define SIOCSPGRP _IOW('s',  8, int)=20
#define DIOCGDEFLABEL _IOR('d', 114, struct disklabel)=20
#define __inline =20
#define TABLDISC 3=20
#define SIOCGIFPDSTADDR _IOWR('i', 72, struct ifreq)=20
#define SIOCDELMULTI _IOW('i', 50, struct ifreq)=20
#define _SYS_IOCCOM_H_ =20
#define SIOCIFDESTROY _IOW('i', 121, struct ifreq)=20
#define TIOCSTOP _IO('t', 111)=20
#define DIOCCLRLABEL _IO('d', 115)=20
#define IOC_DIRMASK (unsigned long)0xe0000000=20
#define PTIOCNETBSD _IOW('Z', 0, struct ioctl_pt)=20
#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq)=20

--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=mkioctls
Content-Transfer-Encoding: quoted-printable

#!/bin/sh -
#	$NetBSD: mkioctls,v 1.9 1997/07/23 05:51:08 mikel Exp $
#
# Copyright (c) 1994
#	The Regents of the University of California.  All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the University of
#	California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@(#)mkioctls	8.2 (Berkeley) 4/28/95
#
cpp -nostdinc -idirafter $DESTDIR/usr/include -dM ${1+"$@"} | awk '
BEGIN {
	print "#include <sys/param.h>"
	print "#include <sys/socket.h>"
	print "#include <sys/socketvar.h>"
	print "#include <net/route.h>"
	print "#include <net/if.h>"
	print "#include <netinet/in.h>"
	print "#include <netinet/ip_mroute.h>"
	print "#include <sys/termios.h>"
	print "#define COMPAT_43"
	print "#include <sys/ioctl.h>"
	print ""
	print "char *ioctlname __P((long));"
	print ""
	print "char *"
	print "ioctlname(val)"
	print "\tlong val;"
	print "{"
	print ""
}

/^#[ 	]*define[ 	]*(TIO|FIO|SIO|OSIO)[A-Z]*[ 	]*_IO/ {
=09
	# find where the name starts
	for (i =3D 1; i <=3D NF; i++)
		if ($i ~ /define/)
			break;
	++i;
	#=20
	printf("\tif (val =3D=3D %s)\n\t\treturn (\"%s\");\n", $i, $i);

}
END {
	print "\n\treturn (NULL);"
	print "}"
}
'

--BXVAT5kNtrzKuDFl--

--WYTEVAkct0FjGQmd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (NetBSD)

iD8DBQE9UrTXiwjDDlS8cmMRAjHFAJ90689F70Z7qebcDAneDnzvWY2kJgCfay1d
zj0YQhoUc0swfir4J3nNWlc=
=Fa+5
-----END PGP SIGNATURE-----

--WYTEVAkct0FjGQmd--