dsr@luke.mitre.org (Douglas S. Rand) (08/29/90)
First you need to get the gas changes for COFF available on sequent.kent.edu via anon. ftp. You'll need to compile gcc with ASMFLAGS as "-C" to get the COFF output. Once you've compiled gas and gcc and are sure that is all running correct get g++-1.37.2 beta and libg++-1.37.2 from labrea.stanford.edu via anon ftp. The following context diffs are applied to g++. I do have one mistake in these -- the -C flag on as should have been in ASMFLAGS instead of hand editing many separate files. I hope this works for folks. I'm very thankful that g++ 1.37.2 actually runs collect and ld the way it is supposed to. diff -c g++/Makefile g++-1.37.2/Makefile *** g++/Makefile Fri Aug 24 13:27:55 1990 --- g++-1.37.2/Makefile Mon Aug 6 08:56:07 1990 *************** *** 32,39 **** # cplus-class.c cplus-search.c # This file depends on -DCADILLAC ! # cplus-cad.c ! CADILLAC_OBJS = cplus-cad.o ../cad/code/connection/libconn.a # Defining NDEBUG will cause assertion macros to do nothing. --- 32,39 ---- # cplus-class.c cplus-search.c # This file depends on -DCADILLAC ! # cplus-cadillac.c ! CADILLAC_OBJS = cplus-cadillac.o ../cadillac/code/connection/libconn.a # Defining NDEBUG will cause assertion macros to do nothing. *************** *** 41,47 **** # use `-dy'. # On COFF systems, use one of the definitions below. (see collect.c) ! COFFLAGS = -DUSE_COLLECT -DCOFF # COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF # On some BSD systems (like Vax, unlike Sun), there is no file --- 41,47 ---- # use `-dy'. # On COFF systems, use one of the definitions below. (see collect.c) ! # COFFLAGS = -DUSE_COLLECT -DCOFF # COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF # On some BSD systems (like Vax, unlike Sun), there is no file *************** *** 53,65 **** CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -DFIELD_XREF CC = gcc BISON = bison ! BISONFLAGS = -v -d AR = ar SHELL = /bin/sh # on sysV, define this as cp. ! INSTALL = cp # on sysV, define this as ln. ! LINK = ln # Compiler to use for compiling gnulib. # OLDCC should not be the GNU C compiler. --- 53,65 ---- CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -DFIELD_XREF CC = gcc BISON = bison ! BISONFLAGS = -v # -d AR = ar SHELL = /bin/sh # on sysV, define this as cp. ! INSTALL = install -c # on sysV, define this as ln. ! LINK = ln -s # Compiler to use for compiling gnulib. # OLDCC should not be the GNU C compiler. *************** *** 75,83 **** # uncomment the following line. But turncoats who claim officially # to support System V, but really try to be Berkeley (and thus # break with USG defined), may need to define this. ! USG_STDIO = -DUSG_STDIO ! prefix=/usr/local # Directory where sources are, from where we are. srcdir = . --- 75,83 ---- # uncomment the following line. But turncoats who claim officially # to support System V, but really try to be Berkeley (and thus # break with USG defined), may need to define this. ! # USG_STDIO = -DUSG_STDIO ! prefix=/tools2/gnu # Directory where sources are, from where we are. srcdir = . *************** *** 128,134 **** # But don't do that if compiling using GCC. # If your system has alloca() in /lib/libPW.a, un-comment the following line: ! CLIB= -lPW # If your system's malloc() routine fails for any reason (as it does on # certain versions of Genix), try getting the files --- 128,134 ---- # But don't do that if compiling using GCC. # If your system has alloca() in /lib/libPW.a, un-comment the following line: ! # CLIB= -lPW # If your system's malloc() routine fails for any reason (as it does on # certain versions of Genix), try getting the files *************** *** 209,217 **** # gnulib is not a target because a proper installation of GNU CC # will place it where g++ can find it. Same with cpp ! # all: crt1+.o g++ cc1plus ld++ g++filt # collect crt0+.o # On COFF systems, use the target below. ! all: g++ cc1plus collect # crt0+.o crt1+.o doc: $(srcdir)/cpp.info $(srcdir)/g++.info --- 209,217 ---- # gnulib is not a target because a proper installation of GNU CC # will place it where g++ can find it. Same with cpp ! all: crt1+.o g++ cc1plus ld++ g++filt # collect crt0+.o # On COFF systems, use the target below. ! # all: g++ cc1plus collect # crt0+.o crt1+.o doc: $(srcdir)/cpp.info $(srcdir)/g++.info *************** *** 284,290 **** ld++: ld.o cplus-dem.o $(CC) -o ld++ $(PROFILE) ld.o cplus-dem.o -lg -lc ! collect: collect.o config.h $(LIBDEPS) COLLECT_LIBS="-lld"; \ if cmp -s tm.h config/tm-encore.h; then \ COLLECT_OPTIONS='-DUMAX'; \ --- 284,290 ---- ld++: ld.o cplus-dem.o $(CC) -o ld++ $(PROFILE) ld.o cplus-dem.o -lg -lc ! collect: collect.c config.h $(LIBDEPS) COLLECT_LIBS="-lld"; \ if cmp -s tm.h config/tm-encore.h; then \ COLLECT_OPTIONS='-DUMAX'; \ *************** *** 291,297 **** else \ COLLECT_OPTIONS=''; \ fi; \ ! $(CC) -o collect collect.o $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) $< -lg -lc $$COLLECT_LIBS collect2: collect2.c config.h $(CC) -o collect2 collect2.c $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) -lc --- 291,297 ---- else \ COLLECT_OPTIONS=''; \ fi; \ ! $(CC) -o collect $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) $< -lg -lc $$COLLECT_LIBS collect2: collect2.c config.h $(CC) -o collect2 collect2.c $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) -lc *************** *** 332,341 **** mv crt1.o crt1+.o cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS) lastfile.o cplus-edsel.o ! $(CC) $(CFLAGS) $(LDFLAGS) -s -o cc1plus lastfile.o $(CPLUS_OBJS) cplus-edsel.o $(OBJS) $(LIBS) -lm ! cad-cc1plus: $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBDEPS) lastfile.o ! $(CC) $(CFLAGS) $(LDFLAGS) -o cad-cc1plus lastfile.o $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBS) cplus-decl.o : cplus-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \ cplus-parse.h cplus-decl.h stack.h rtl.h insn-flags.h --- 332,341 ---- mv crt1.o crt1+.o cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS) lastfile.o cplus-edsel.o ! $(CC) $(CFLAGS) $(LDFLAGS) -o cc1plus lastfile.o $(CPLUS_OBJS) cplus-edsel.o $(OBJS) $(LIBS) -lm ! cadillac-cc1plus: $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBDEPS) lastfile.o ! $(CC) $(CFLAGS) $(LDFLAGS) -o cadillac-cc1plus lastfile.o $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBS) cplus-decl.o : cplus-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \ cplus-parse.h cplus-decl.h stack.h rtl.h insn-flags.h *************** *** 354,363 **** cplus-ptree.o : cplus-ptree.c $(CONFIG_H) $(TREE_H) cplus-field.o : cplus-field.c $(CONFIG_H) $(TREE_H) ! cplus-cad.o : cplus-cad.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h ! $(CC) -c -DCADILLAC $(CFLAGS) $(INCLUDES) -I../cad/code/comp-dep -I../cad/code/connection $< ! cplus-edsel.o : cplus-cad.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h ! $(CC) -c $(CFLAGS) $(INCLUDES) -o cplus-edsel.o cplus-cad.c cplus-tab.o : $(srcdir)/cplus-tab.c $(CONFIG_H) $(CPLUS_TREE_H) \ cplus-parse.h flags.h input.h --- 354,363 ---- cplus-ptree.o : cplus-ptree.c $(CONFIG_H) $(TREE_H) cplus-field.o : cplus-field.c $(CONFIG_H) $(TREE_H) ! cplus-cadillac.o : cplus-cadillac.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h ! $(CC) -c -DCADILLAC $(CFLAGS) $(INCLUDES) -I../cadillac/code/comp-dep -I../cadillac/code/connection $< ! cplus-edsel.o : cplus-cadillac.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h ! $(CC) -c $(CFLAGS) $(INCLUDES) -o cplus-edsel.o cplus-cadillac.c cplus-tab.o : $(srcdir)/cplus-tab.c $(CONFIG_H) $(CPLUS_TREE_H) \ cplus-parse.h flags.h input.h diff -c g++/cplus-field.c g++-1.37.2/cplus-field.c *** g++/cplus-field.c Fri Aug 24 13:21:12 1990 --- g++-1.37.2/cplus-field.c Fri Jul 20 20:39:53 1990 *************** *** 16,22 **** #include <stdio.h> #include <ctype.h> ! #include <string.h> --- 16,22 ---- #include <stdio.h> #include <ctype.h> ! #include <strings.h> *************** *** 246,252 **** all_files = xf; if (wd_name == NULL) { ! getcwd(wdbuf,sizeof(wdbuf)); wd_name = SALLOC(wdbuf); }; --- 246,252 ---- all_files = xf; if (wd_name == NULL) { ! getwd(wdbuf); wd_name = SALLOC(wdbuf); }; *************** *** 890,901 **** { String s,t; ! s = strrchr(file,'/'); if (s == NULL) sprintf(xref_name,".%s.gxref",file); else { ++s; strcpy(xref_name,file); ! t = strrchr(xref_name,'/'); ++t; *t++ = '.'; strcpy(t,s); --- 890,901 ---- { String s,t; ! s = rindex(file,'/'); if (s == NULL) sprintf(xref_name,".%s.gxref",file); else { ++s; strcpy(xref_name,file); ! t = rindex(xref_name,'/'); ++t; *t++ = '.'; strcpy(t,s); diff -c g++/cplus-lex.c g++-1.37.2/cplus-lex.c *** g++/cplus-lex.c Fri Aug 24 13:12:33 1990 --- g++-1.37.2/cplus-lex.c Mon Aug 6 00:31:07 1990 *************** *** 38,44 **** #include "flags.h" #include "obstack.h" #include "assert.h" - #include "getpagesize.h" extern int errno; /* needed for VAX. */ extern jmp_buf toplevel; --- 38,43 ---- *************** *** 56,61 **** --- 55,66 ---- extern double atof (); + /* If you don't have strrchr, but instead have rindex, + add your machine to this list, and send mail to + tiemann@wheaties.ai.mit.edu. */ + #if defined(sequent) || defined(convex) + #define strrchr rindex + #endif extern char *strrchr (); /* This obstack is needed to hold text. It is not safe to use diff -c g++/gcc.c g++-1.37.2/gcc.c *** g++/gcc.c Fri Aug 24 14:35:52 1990 --- g++-1.37.2/gcc.c Mon Aug 6 00:33:47 1990 *************** *** 236,242 **** %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as -C %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}" --- 236,242 ---- %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}" *************** *** 259,265 **** %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as -C %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}" #else --- 259,265 ---- %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}" #else *************** *** 279,288 **** %{g} %{O} %{W*} %{w} %{pedantic} %{ansi} %{traditional}\ %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as -C %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"}, {".s", ! "%{!S:as -C %{R} %{j} %{J} %{h} %{d2} %a \ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"}, {".S", "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{i*} %{M*} %{trigraphs} \ --- 279,288 ---- %{g} %{O} %{W*} %{w} %{pedantic} %{ansi} %{traditional}\ %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p} %{xref}\ %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ ! %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"}, {".s", ! "%{!S:as %{R} %{j} %{J} %{h} %{d2} %a \ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"}, {".S", "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{i*} %{M*} %{trigraphs} \ *************** *** 290,296 **** %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\ %{Wcomment*} %{Wtrigraphs} %{Wall} %C\ %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\ ! %{!M*:%{!E:%{!S:as -C %{R} %{j} %{J} %{h} %{d2} %a \ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}"}, /* Mark end of table */ --- 290,296 ---- %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\ %{Wcomment*} %{Wtrigraphs} %{Wall} %C\ %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\ ! %{!M*:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a \ %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{!pipe:%g.s}\n }}}"}, /* Mark end of table */ *************** *** 302,308 **** requirements. */ char *collect_spec = "%{!c:%{!M*:%{!E:%{!S:collect -o %g.s %g.R\n\ ! as -C %g.s -o %g.O\n\ ld %{o*} %g.R %g.O\n\ }}}}"; --- 302,308 ---- requirements. */ char *collect_spec = "%{!c:%{!M*:%{!E:%{!S:collect -o %g.s %g.R\n\ ! as %g.s -o %g.O\n\ ld %{o*} %g.R %g.O\n\ }}}}"; diff -c g++/getpagesize.h g++-1.37.2/getpagesize.h *** g++/getpagesize.h Fri Aug 24 11:08:16 1990 --- g++-1.37.2/getpagesize.h Mon Oct 2 10:20:22 1989 *************** *** 1,5 **** - #undef HAVE_GETPAGESIZE - #ifdef BSD #ifndef BSD4_1 #define HAVE_GETPAGESIZE --- 1,3 ---- diff -c g++/toplev.c g++-1.37.2/toplev.c *** g++/toplev.c Fri Aug 24 13:17:39 1990 --- g++-1.37.2/toplev.c Mon Aug 6 00:37:27 1990 *************** *** 40,46 **** #include <unistd.h> #endif - #include "getpagesize.h" #ifdef USG #include <sys/fcntl.h> #undef FLOAT --- 40,45 ---- Douglas S. Rand Internet: <dsrand@mitre.org> Snail: MITRE, Burlington Road, Bedford, MA Disclaimer: MITRE might agree with me - then again... Amateur Radio: KC1KJ