[gnu.utils.bug] Bug in GNU make 3.27 under Ultrix 2.2

taylor@THINK.COM (02/20/89)

With the following Makefile, if I type:

	gmake -n -v getdate.out

[gmake is GNU make, version 3.27], then I get the following output:

	GNU Make version 3.27, by Richard Stallman and Roland McGrath.
	Copyright (C) 1988 Free Software Foundation, Inc.
	This is free software; see the source for copying conditions.
	There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
	PARTICULAR PURPOSE.

	gmake: *** Deleting file `getdate.c'
	Illegal instruction (core dumped).

So, I started deleting stuff to reduce the makefile to a smaller size
before mailing it.  And the problem went away at one point...  So,
here's the last version I had before the problem went away.  Stuff that
doesn't look like it would affect it, does.  Here's the Makefile:
[It's an edited version of the makefile for GNU tar.]
------------------------------------------
# Makefile for public domain tar program.
# @(#)Makefile 1.30	87/11/11

# Berserkeley version, cmtar
DEFS = -DBSD42 -DCMTAR -I../../h
LOCAL_SRC = getdate.y  rtape_lib.c
LOCAL_OBJ = getdate.$O rtape_lib.$O
LDFLAGS =
LIBS =
UCODE=5010
MACHINE=vax
PARISLIB=paris2-${UCODE}
CMLIBS = ../../lib.${UCODE}.${MACHINE}/fs.a -l$(PARISLIB)
SIMCMLIBS= ../../simulator_lib/fs.a -lparissim
LINT = lint
LINTFLAGS = -abchx
DEF_AR_FILE = \"/dev/rmt8\"
DEFBLOCKING = 20
O = o
CI=ci
CO=co
INCDIR=../../h
SRCDIR=../cmtar
VPATH=${SRCDIR}



CFLAGS = $(COPTS) $(ALLDEFS)
ALLDEFS = $(DEFS) \
	-DDEF_AR_FILE=$(DEF_AR_FILE) \
	-DDEFBLOCKING=$(DEFBLOCKING)
# next line for Debugging
COPTS = -g
# next line for Production
#COPTS = -O

# Add things here like getopt, readdir, etc that aren't in your
# standard libraries.  (E.g. MSDOS needs getopt, msd_dir.c, msd_dir.obj)
SUBSRC= cm_stubs.c
SUBOBJ=	cm_stubs.o

# Destination directory and installation program for make install
DESTDIR = /usr/local
INSTALL = cp
RM = rm -f

SRC1 =	tar.c create.c extract.c buffer.c getoldopt.c update.c
SRC2 =  version.c list.c names.c diffarch.c port.c wildmat.c
SRC3 =  $(LOCAL_SRC) $(SUBSRC)
#SRCS =	$(SRC1) $(SRC2) $(SRC3)
SRCS =	${SRCDIR}/tar.c ${SRCDIR}/create.c ${SRCDIR}/extract.c \
	${SRCDIR}/buffer.c ${SRCDIR}/getoldopt.c ${SRCDIR}/update.c \
	${SRCDIR}/version.c ${SRCDIR}/list.c ${SRCDIR}/names.c \
	${SRCDIR}/diffarch.c ${SRCDIR}/port.c ${SRCDIR}/wildmat.c \
	${SRCDIR}/getdate.y  ${SRCDIR}/rtape_lib.c ${SRCDIR}/cm_stubs.c
OBJ1 =	tar.$O create.$O extract.$O buffer.$O getoldopt.$O list.$O update.$O
OBJ2 =	version.$O names.$O diffarch.$O port.$O wildmat.$O
OBJ3 =  $(LOCAL_OBJ) $(SUBOBJ)
OBJS =	$(OBJ1) $(OBJ2) $(OBJ3)
# AUX =	README PORTING Makefile TODO tar.h port.h open3.h \
#	msd_dir.h msd_dir.c
AUX =   README COPYING Makefile tar.texinfo tar.h port.h open3.h rmt.h \
	msd_dir.h msd_dir.c rtape_server.c rtape_lib.c getdate.y

CFILES= ${SRCS}

default:	cmtar rmt

all:	cmtar rmt

tar:	$(OBJS)
	$(CC) $(LDFLAGS) -o tar $(COPTS) $(OBJS) $(LIBS)

cmtar:	$(OBJS) ../../lib.${UCODE}.${MACHINE}/fs.a
	$(CC) $(LDFLAGS) -o cmtar $(COPTS) $(OBJS) $(CMLIBS)

rmt:	rtape_server.c
	$(CC) $(CFLAGS) -o rmt ${SRCDIR}/rtape_server.c

# command is too long for Messy-Dos (128 char line length limit) so
# this kludge is used...
#	@echo $(OBJ1) + > command
#	@echo $(OBJ2) >> command
#	link @command, $@,,$(LIBS) /NOI;
#	@$(RM) command

install: all
	$(RM) $(DESTDIR)/bin/tar
	$(INSTALL) tar   $(DESTDIR)/bin/tar
	$(INSTALL) tar.texinfo $(DESTDIR)/man/tar.texinfo
	$(INSTALL) rmt /etc/rmt

lint:	$(SRCS)
	$(LINT) $(LINTFLAGS) $(ALLDEFS) $(SRCS)

clean:
	$(RM) errs $(OBJS) tar rmt

tar.shar: $(SRCS) $(AUX)
	shar >tar.shar1 $(AUX)
	shar >tar.shar2 $(SRC1)
	shar >tar.shar3 $(SRC2)

dist: tar.tar tar.tar.Z

tar.tar: $(SRCS) $(AUX)
	/bin/tar cf tar.tar $(AUX) $(SRCS)

tar.tar.Z: tar.tar
	compress < tar.tar > tar.tar.Z
#	/bin/tar cf - $(AUX) $(SRCS) | compress -v >tar.tar.Z

tar.zoo: $(SRCS) $(AUX)
	zoo a tar $(AUX) $(SRCS)

checkin:
	$(CI) $(RCSFLAGS) $(SRCS)

checkout:
	$(CO) $(RCSFLAGS) $(SRCS)

#$(OBJS): tar.h port.h

.DEFAULT:
	cd ${SRCDIR}; $(CO) $(RCSFLAGS) $@

.PHONY:	default all install clean checkin checkout depend lint mkdep

mkdep:
	../../etc/mkdep_cc ${CFLAGS} ${CFILES} ${SRCDIR}/rtape_server.c

depend:
	../../etc/mkdep_cc ${CFLAGS} ${CFILES} ${SRCDIR}/rtape_server.c

# kludge: mkdep_cc doesn't understand yacc files!!
# And make, on Ultrix, does the wrong thing when the dependency is in a 
# different directory.  On SunOS 4.0, it does the right thing!!
getdate.o:	${SRCDIR}/getdate.y
#	${YACC} ${YFLAGS} ${SRCDIR}/getdate.y
#	${CC} ${CFLAGS} -c y.tab.c
#	rm y.tab.c
#	mv y.tab.o getdate.o

# Anything added after the next line will go away...
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

buffer.o: ../cmtar/buffer.c ../cmtar/port.h ../cmtar/rmt.h ../cmtar/tar.h
buffer.o: /usr/include/errno.h /usr/include/sgtty.h /usr/include/signal.h
buffer.o: /usr/include/stdio.h /usr/include/sys/file.h /usr/include/sys/ioctl.h
buffer.o: /usr/include/sys/mtio.h /usr/include/sys/stat.h
buffer.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
buffer.o: /usr/include/sys/ttyio.h /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/buffer.c
cm_stubs.o: ../../h/cm_errno.h ../cmtar/cm_stubs.c
	${CC} ${CFLAGS} -c  ../cmtar/cm_stubs.c
create.o: ../../h/cm_compat.h ../../h/cm_dir.h ../../h/cm_file.h
create.o: ../../h/cm_fs.h ../../h/cm_param.h ../../h/cm_stat.h
create.o: ../cmtar/create.c ../cmtar/port.h ../cmtar/tar.h /usr/include/grp.h
create.o: /usr/include/pwd.h /usr/include/stdio.h /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/create.c
diffarch.o: ../../h/cm_compat.h ../../h/cm_errno.h ../../h/cm_file.h
diffarch.o: ../../h/cm_stat.h ../cmtar/diffarch.c ../cmtar/port.h
diffarch.o: ../cmtar/tar.h /usr/include/stdio.h /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/diffarch.c
extract.o: ../../h/cm_compat.h ../../h/cm_errno.h ../../h/cm_file.h
extract.o: ../../h/cm_stat.h ../cmtar/extract.c ../cmtar/port.h ../cmtar/tar.h
extract.o: /usr/include/stdio.h /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/extract.c
getdate.o: ../cmtar/getdate.y /usr/include/ctype.h /usr/include/sys/timeb.h
getdate.o: /usr/include/sys/types.h /usr/include/time.h
getoldopt.o: ../cmtar/getoldopt.c /usr/include/stdio.h
	${CC} ${CFLAGS} -c  ../cmtar/getoldopt.c
list.o: ../cmtar/list.c ../cmtar/port.h ../cmtar/tar.h /usr/include/ctype.h
list.o: /usr/include/stdio.h /usr/include/sys/file.h /usr/include/sys/stat.h
list.o: /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/list.c
names.o: ../cmtar/names.c ../cmtar/tar.h /usr/include/grp.h /usr/include/pwd.h
names.o: /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/names.c
port.o: ../../h/cm_compat.h ../../h/cm_errno.h ../../h/cm_file.h
port.o: ../../h/cm_stat.h ../cmtar/port.c ../cmtar/port.h ../cmtar/tar.h
port.o: /usr/include/ctype.h /usr/include/signal.h /usr/include/stdio.h
port.o: /usr/include/stdio.h /usr/include/sys/types.h /usr/include/varargs.h
	${CC} ${CFLAGS} -c  ../cmtar/port.c
rtape_lib.o: ../cmtar/rtape_lib.c /usr/include/errno.h /usr/include/setjmp.h
rtape_lib.o: /usr/include/sgtty.h /usr/include/signal.h /usr/include/stdio.h
rtape_lib.o: /usr/include/sys/ioctl.h /usr/include/sys/mtio.h
rtape_lib.o: /usr/include/sys/stat.h /usr/include/sys/ttychars.h
rtape_lib.o: /usr/include/sys/ttydev.h /usr/include/sys/ttyio.h
rtape_lib.o: /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/rtape_lib.c
rtape_server.o: ../cmtar/rtape_server.c /usr/include/errno.h
rtape_server.o: /usr/include/sgtty.h /usr/include/stdio.h
rtape_server.o: /usr/include/sys/ioctl.h /usr/include/sys/mtio.h
rtape_server.o: /usr/include/sys/socket.h /usr/include/sys/ttychars.h
rtape_server.o: /usr/include/sys/ttydev.h /usr/include/sys/ttyio.h
rtape_server.o: /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/rtape_server.c
tar.o: ../../h/cm_compat.h ../../h/cm_dir.h ../../h/cm_stat.h ../cmtar/tar.c
tar.o: ../cmtar/tar.h /usr/include/stdio.h /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/tar.c
update.o: ../../h/cm_compat.h ../../h/cm_errno.h ../../h/cm_file.h
update.o: ../../h/cm_stat.h ../cmtar/port.h ../cmtar/tar.h ../cmtar/update.c
update.o: /usr/include/grp.h /usr/include/pwd.h /usr/include/stdio.h
update.o: /usr/include/sys/types.h
	${CC} ${CFLAGS} -c  ../cmtar/update.c
version.o: ../cmtar/version.c
	${CC} ${CFLAGS} -c  ../cmtar/version.c
wildmat.o: ../cmtar/wildmat.c
	${CC} ${CFLAGS} -c  ../cmtar/wildmat.c

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
----------------------------------------
And here's what gdb has to say about it:

Script started on Mon Feb 20 02:12:03 1989
executing .cshrc
taylor@pozzo 51: gdb `which gmake` core
GDB 3.1, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /u8/taylor/bin.ULTRIX/gmake...done.
Type "help" for a list of commands.
(gdb) where
#0  0xb988 in kill (14007, 4)
#1  0x196e in fatal_error_signal (sig=4, 1, 2147471304, 6448) (commands.c line 832)
#2  0x7fffe47b in ?? (4, 1, 2147471304, 6448)
#3  0x7fffe470 in ?? ()
#4  0x2174 in rename_file (file=(struct file *) 0x2e104, name=(char *) 0x2b5a4 "../cmtar/getdate.y") (file.c line 124)
#5  0x6ac6 in f_mtime (file=(struct file *) 0x2e104) (remake.c line 585)
#6  0x62b1 in update_file_1 (file=(struct file *) 0x2e104, depth=3) (remake.c line 226)
#7  0x5e29 in update_file (file=(struct file *) 0x2e104, depth=3) (remake.c line 152)
#8  0x6795 in check_dep (file=(struct file *) 0x2e104, depth=2, this_mtime=-1, must_make_ptr=(int *) 0x7fffd140) (remake.c line 421)
#9  0x6803 in check_dep (file=(struct file *) 0x2e2c4, depth=1, this_mtime=-1, must_make_ptr=(int *) 0x7fffd140) (remake.c line 437)
#10 0x63d9 in update_file_1 (file=(struct file *) 0x17504, depth=0) (remake.c line 257)
#11 0x5e29 in update_file (file=(struct file *) 0x17504, depth=0) (remake.c line 152)
#12 0x5d3a in update_goal_chain (goals=(struct dep *) 0x11704, makefiles=0) (remake.c line 86)
#13 0x309e in main (argc=6, argv=(char **) 0x7fffde40, envp=(char **) 0x7fffde5c) (make.c line 711)
(gdb) frame 4
#4  0x2174 in rename_file (file=(struct file *) 0x2e104, name=(char *) 0x2b5a4 "../cmtar/getdate.y") (file.c line 124)
file.c: No such file or directory.
(gdb) print *file
$1 = {next = 0x0, name = 0x1f3a4 "getdate.y", deps = 0x0, cmds = 0x0, stem = 0x0, also_make = 0x0, update_status = -1, last_mtime = 0, prev = 0x0, command_state = cs_not_started, double_colon = 0 '\000', precious = 0 '\000', tried_implicit = 0 '\000', updating = 1 '\001', updated = 0 '\000', is_target = 0 '\000', cmd_target = 0 '\000', phony = 0 '\000', intermediate = 0 '\000', dontcare = 0 '\000'}
(gdb) frame 9
#9  0x6803 in check_dep (file=(struct file *) 0x2e2c4, depth=1, this_mtime=-1, must_make_ptr=(int *) 0x7fffd140) (remake.c line 437)
remake.c: No such file or directory.
(gdb) print *file
$2 = {next = 0x0, name = 0x33094 "getdate.c", deps = 0x2b664, cmds = 0x18444, stem = 0x33084 "getdate", also_make = 0x0, update_status = -1, last_mtime = 0, prev = 0x0, command_state = cs_not_started, double_colon = 0 '\000', precious = 0 '\000', tried_implicit = 1 '\001', updating = 1 '\001', updated = 0 '\000', is_target = 0 '\000', cmd_target = 0 '\000', phony = 0 '\000', intermediate = 1 '\001', dontcare = 0 '\000'}
(gdb) frame 10
#10 0x63d9 in update_file_1 (file=(struct file *) 0x17504, depth=0) (remake.c line 257)
remake.c: No such file or directory.
(gdb) print *file
$3 = {next = 0x0, name = 0x7fffdec8 "getdate.o", deps = 0x2b624, cmds = 0x11b64, stem = 0x330a4 "getdate", also_make = 0x0, update_status = -1, last_mtime = -1, prev = 0x0, command_state = cs_not_started, double_colon = 0 '\000', precious = 0 '\000', tried_implicit = 1 '\001', updating = 1 '\001', updated = 0 '\000', is_target = 1 '\001', cmd_target = 1 '\001', phony = 0 '\000', intermediate = 0 '\000', dontcare = 0 '\000'}
(gdb) frame 12
#12 0x5d3a in update_goal_chain (goals=(struct dep *) 0x11704, makefiles=0) (remake.c line 86)
remake.c: No such file or directory.
(gdb) print *goals
$4 = {next = 0x0, name = 0x0, file = 0x17504, changed = 0}
(gdb) quit
taylor@pozzo 52: