[gnu.g++.bug] Some comments and diffs about G++ 1.35.0- on m68k USG systems

jkp@SAUNA.HUT.FI (Jyrki Kuoppala) (05/15/89)

As g++ now appears to be running quite well on SVR2.2 systems (and
probably other USG-based systems, too) with minor changes, I'll post
my changes and ask if they work for most of USG users out there.

I think the easiest approach to get gcc and g++ running on an USG
system is to use gas and GNU binutils (linker, nm, strip etc.) and use
gdb to debug.  I have done this with Altos 3068 machines and now we
have most of the stuff running pretty smoothly.  Gcc, g++, gdb and ld
work well, libg++ still needs some work (mostly just bcopy, bzero
etc.) and emacs compiles with gcc with only some changes to unexec.c.

One problem is the 14-character filename length limitation.
Especially libg++ has many files with file names longer that 14
character and this causes a bit of extra work for us old USG system
users.

Here are the changes I had to make to g++:

I renamed cplus-parse.y to cplus-p.y to make things work right.
Changes had to be made in Makefile and cplus-lex.c.

I made some changes to the setvbuf stuff in cplus-lex.c.  I think now
changing the buffer size should work on all BSD and USG systems pretty
well, but please tell if it doesn't work for you.

Also, the temporary file name in ld++ ("C++.hacksXXXXXX") is too long;
the last digit gets truncated.  This might cause trouble with a
parallel make.  This bug is NOT fixed in the following diff.

Some comments about g++.texinfo:

- there are references to (internals)RTL etc.  The gcc documentation is
  not necessarily on a file called 'internals'; on our system it's 'gcc'.
- there is no mention of altos 3068
- perhaps it could be mentioned that tm-altos3068.h should be a pretty good
  starting point for USG m68k systems if you want to use all the GNU utilities
- there was a bug where '@end example' was only '@end'

Here is the context diff:

diff -cr src-g++/Makefile src-g++.a/Makefile
*** src-g++/Makefile	Sun May 14 00:03:27 1989
--- src-g++.a/Makefile	Sun May 14 21:29:04 1989
***************
*** 49,66 ****
  # If you are running GCC on an Apollo, you will need this:
  # CFLAGS = -g -O -M 3000 -U__STDC__ -DSHORT_ENUM_BUG
  
  
  # Variables that exist for you to override.
  
! CFLAGS = -g -DSOS -DESKIT -DNO_AUTO_OVERLOAD -O
  # CFLAGS = -g -O
! CC = ../gcc/gcc -B../gcc/
  BISON = bison
  BISONFLAGS = -v -d
  AR = ar
  SHELL = /bin/sh
  # on sysV, define this as cp.
! INSTALL = install -c
  MAKE = make
  
  # Compiler to use for compiling gnulib.
--- 49,71 ----
  # If you are running GCC on an Apollo, you will need this:
  # CFLAGS = -g -O -M 3000 -U__STDC__ -DSHORT_ENUM_BUG
  
+ # If you are using coff encapsulation, add -DCOFF_ENCAPSULATE to CFLAGS
+ # This is needed for symout.c.  Perhaps better would be to put
+ # #define COFF_ENCAPSULATE in tm-*.h
  
  # Variables that exist for you to override.
  
! CFLAGS = -g -DSOS -DESKIT -DNO_AUTO_OVERLOAD -DCOFF_ENCAPSULATE -O
  # CFLAGS = -g -O
! CC = gcc
! #CC = ../gcc/gcc -B../gcc/
  BISON = bison
  BISONFLAGS = -v -d
  AR = ar
  SHELL = /bin/sh
  # on sysV, define this as cp.
! INSTALL = cp
! #INSTALL = install -c
  MAKE = make
  
  # Compiler to use for compiling gnulib.
***************
*** 113,119 ****
  C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o
  
  # Language-specific object files for C++.
! CPLUS_OBJS = cplus-parse.tab.o cplus-decl.o cplus-typeck.o \
   cplus-lex.o cplus-class.o cplus-init.o \
   cplus-method.o cplus-cvt.o cplus-search.o cplus-ptree.o
  
--- 118,124 ----
  C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o
  
  # Language-specific object files for C++.
! CPLUS_OBJS = cplus-p.tab.o cplus-decl.o cplus-typeck.o \
   cplus-lex.o cplus-class.o cplus-init.o \
   cplus-method.o cplus-cvt.o cplus-search.o cplus-ptree.o
  
***************
*** 291,304 ****
  cplus-ptree.o : cplus-ptree.c $(CONFIG_H) $(TREE_H)
  new-cplus-method.o : new-cplus-method.c $(CONFIG_H) $(CPLUS_TREE_H)
  
! cplus-parse.tab.o : cplus-parse.tab.c $(CONFIG_H) $(CPLUS_TREE_H) cplus-parse.h flags.h
! 	$(CC) -c $(CFLAGS) -Iconfig -DPARSE_OUTPUT=\"$(PWD)/cplus-parse.output\" $<
  
! cplus-parse.tab.c : cplus-parse.y
  	@echo expect 41 shift/reduce conflicts and 4 reduce/reduce conflicts
! 	$(BISON) $(BISONFLAGS) cplus-parse.y
  
! cplus-lex.o : cplus-lex.c $(CONFIG_H) $(CPLUS_TREE_H) cplus-parse.h cplus-parse.tab.h
  rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
  
  # Language-independent files.
--- 296,309 ----
  cplus-ptree.o : cplus-ptree.c $(CONFIG_H) $(TREE_H)
  new-cplus-method.o : new-cplus-method.c $(CONFIG_H) $(CPLUS_TREE_H)
  
! cplus-p.tab.o : cplus-p.tab.c $(CONFIG_H) $(CPLUS_TREE_H) cplus-parse.h flags.h
! 	$(CC) -c $(CFLAGS) -Iconfig -DPARSE_OUTPUT=\"$(PWD)/cplus-p.output\" $<
  
! cplus-p.tab.c : cplus-p.y
  	@echo expect 41 shift/reduce conflicts and 4 reduce/reduce conflicts
! 	$(BISON) $(BISONFLAGS) cplus-p.y
  
! cplus-lex.o : cplus-lex.c $(CONFIG_H) $(CPLUS_TREE_H) cplus-parse.h cplus-p.tab.h
  rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
  
  # Language-independent files.
***************
*** 523,529 ****
  # Get rid of every file that's generated from some other file (except INSTALL).
  realclean: clean
  	-rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs
! 	-rm -f cplus-parse.tab.c cplus-parse.output cplus-parse.tab.h
  	-rm -f errs gnulib cexp.c TAGS tm-*+.h
  	-rm -f g++.info* g++.?? g++.??s g++.log g++.toc g++.*aux
  	-rm -f cccp cpp
--- 528,534 ----
  # Get rid of every file that's generated from some other file (except INSTALL).
  realclean: clean
  	-rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs
! 	-rm -f cplus-p.tab.c cplus-p.output cplus-p.tab.h
  	-rm -f errs gnulib cexp.c TAGS tm-*+.h
  	-rm -f g++.info* g++.?? g++.??s g++.log g++.toc g++.*aux
  	-rm -f cccp cpp
***************
*** 576,582 ****
  
  TAGS: force
  	mkdir temp
! 	-mv cplus-parse.tab.c cexp.c c-*.c temp
  	etags *.y *.h *.c
  	mv temp/* .
  	rmdir temp
--- 581,587 ----
  
  TAGS: force
  	mkdir temp
! 	-mv cplus-p.tab.c cexp.c c-*.c temp
  	etags *.y *.h *.c
  	mv temp/* .
  	rmdir temp
diff -cr src-g++/cplus-lex.c src-g++.a/cplus-lex.c
*** src-g++/cplus-lex.c	Sun May 14 07:04:02 1989
--- src-g++.a/cplus-lex.c	Sun May 14 15:41:54 1989
***************
*** 26,32 ****
  #include "config.h"
  #include "input.h"
  #include "tree.h"
! #include "cplus-parse.tab.h"
  #include "cplus-parse.h"
  #include "cplus-tree.h"
  #include "flags.h"
--- 26,32 ----
  #include "config.h"
  #include "input.h"
  #include "tree.h"
! #include "cplus-p.tab.h"
  #include "cplus-parse.h"
  #include "cplus-tree.h"
  #include "flags.h"
***************
*** 855,861 ****
        t = pending_inlines;
        pending_inlines = pending_inlines->next;
        finput = finput2;
! #if defined(i386) && !defined(sequent)
        finput2->_ptr = finput2->_base = t->buf;
        _bufend(finput2) = t->buf + t->len;
        finput2->_flag = _IOLBF | _IOREAD;
--- 855,861 ----
        t = pending_inlines;
        pending_inlines = pending_inlines->next;
        finput = finput2;
! #if defined(USG) && !defined(hp9000s300)
        finput2->_ptr = finput2->_base = t->buf;
        _bufend(finput2) = t->buf + t->len;
        finput2->_flag = _IOLBF | _IOREAD;
***************
*** 863,875 ****
        finput2->_cnt = t->len - 1;
  #else
  #ifndef hp9000s300
- #ifdef USG
-       setvbuf(finput2,t->buf,_IOFBF,t->len);
-       finput2->_cnt = t->len-1;
- #else
        setbuffer (finput2, t->buf, t->len);
        finput2->_cnt = finput2->_bufsiz - 1;
- #endif				/* USG */
  #else
        setvbuf(finput2,t->buf,_IOFBF,t->len);
        finput2->_cnt = t->len-1;
--- 863,870 ----
***************
*** 1712,1718 ****
  	      /* The buffer we used will be freed at the
  		 end of this function.  */
  	      pending_inlines = pending_inlines->next;
! #if defined(i386) && !defined(sequent)
  	      finput2->_ptr = finput2->_base = t->buf;
  	      _bufend(finput2) = t->buf + t->len;
  	      finput2->_flag = _IOFBF | _IOREAD;
--- 1707,1713 ----
  	      /* The buffer we used will be freed at the
  		 end of this function.  */
  	      pending_inlines = pending_inlines->next;
! #if defined(USG) && !defined(hp9000s300)
  	      finput2->_ptr = finput2->_base = t->buf;
  	      _bufend(finput2) = t->buf + t->len;
  	      finput2->_flag = _IOFBF | _IOREAD;
***************
*** 1719,1731 ****
  	      finput2->_cnt = t->len - 1;
  #else
  #ifndef hp9000s300
- #ifdef USG
-       	      setvbuf(finput2,t->buf,_IOFBF,t->len);
-        	      finput2->_cnt = t->len-1;
- #else
    	      setbuffer (finput2, t->buf, t->len);
    	      finput2->_cnt = finput2->_bufsiz - 1;
- #endif				/* USG */
  #else
        	      setvbuf(finput2,t->buf,_IOFBF,t->len);
         	      finput2->_cnt = t->len-1;
--- 1714,1721 ----
diff -cr src-g++/g++.texinfo src-g++.a/g++.texinfo
*** src-g++/g++.texinfo	Sun May 14 05:37:50 1989
--- src-g++.a/g++.texinfo	Sun May 14 21:22:41 1989
***************
*** 1799,1805 ****
  {
  #include <dusty.h>
  }
! @end
  
  However, life is not always so simple.  For example, the file
  @file{dusty.h} may include @file{shiny.h}, which has been recently
--- 1799,1805 ----
  {
  #include <dusty.h>
  }
! @end example
  
  However, life is not always so simple.  For example, the file
  @file{dusty.h} may include @file{shiny.h}, which has been recently


//Jyrki

Jyrki Kuoppala    Helsinki University of Technology, Finland.
Internet :        jkp@cs.hut.fi           [128.214.3.119]
BITNET :          tko-jk@finhut.bitnet    Gravity is a myth, the Earth sucks!