[gnu.g++.bug] Success story w/g++ & libg++ along with helpful hints ...

rp@rpx.UUCP (Rich Patterson) (02/13/90)

[My purpose for this article is that others will validate these issues also
 and the updates will be rolled into the next release]

Hi,
	Here are some installation problems that I had with g++ and libg++.
After making the following changes, I was able to  successfully install and
run g++ 1.36.4 and libg++ 1.36.3 under 386 Unix System V release 3.0.
	I was able to build all of libg++.  The only tests that I was unable to
run successfully were test0 (incremental loading) and the Fix48() portion of
tFix24 (got a floating point exception - could be a bug on my 386).  The rest
of the tests ran successfully and checktests showed only a few differences
(such as the statistics on tRandom).  Here are the things I found that
needed to be changed:

G++:
	1. When running maketests, the link for the "config"
	   directory will fail.  System V will not allow you to link
	   the directory.  In order to get the config directory you
	   need to do a mkdir and then copy the config files from your
	   gcc/config directory.

	2. malloc.c requires the definition of bcopy.
	   If you end up using malloc.c that is with g++
	   then you will need to define bcopy inside malloc.c.
	   When malloc.c is compiled it doesn't read the config.h
	   file that has all those nice definitions.

	3. insn-codes.h is needed by expr.c.  The makefile will
	   stop at this point because insn-codes.h hasn't been
	   created by 'gencodes' yet.  What I did was copy it
	   from my gcc directory. Later it gets recreated, but
	   no harm is done.  I assume if you added the dependency
	   of insn-codes.h to expr.c, the header file would be created
	   automatically.

	4. cplus-dem.c needed a change for the include of memory.h or
	   the defines of strchr, etc.  What happened is that when built,
	   the define USG is not defined in the makefile so it trys to get
	   index. For System that was a problem, and ld++ dumped core
	   nicely.  Make sure you define USG, or better yet, since SYSV is
	   defined for g++, cplus-dem.c should be changed.

LIBG++:
	1. gnulib3.c - Make sure COFF_ENCAPSULATE is defined.  If not
	   gnulib checks for i386 and defines COFF which doesn't define
	   the magic __do_global_init (&__1xyzzy__).  [Yes, xyzzy is
	   magic not only in adventure but in libg++ as well!]

	2. stdio.h - For System V release 3.0, _flag is a char.
	   I made that change. (I didn't change the other fields from
	   char to unsigned char, currently I haven't had a problem)

	3. malloc.c - Yes malloc.c seems to crop up a lot!  In this one
	   fprintf is defined inside of malloc.c along with stdio.h.  I
	   ended up putting #ifdefs around it.

	4. g++-include/time.h - For System V, at least the version I have
	   time.h lives only in /usr/include, not in /usr/include/sys. So
	   I made the following mod:

	  + #ifndef	USG
	    #include "//usr/include/sys/time.h"
	  + #endif
	    #include "//usr/include/sys/times.h"
	    #include "//usr/include/time.h"

	5. math.h - For the 386, HUGE is defined at MAXFLOAT.

	6. values.h - I didn't have time to examine this file yet.

Commentary:
	One thing that is very important to do is USE THE COFF ENCAPSULATION
FEATURE!! I tried for 2 weeks, first with version 1.35.x and then another week
with version 1.36.x to do it without COFF encapsulation.  It didn't work !!!
The assembler output (even with FACIST_ASSEMBLER) was invalid for the AT&T
assembler.  Use COFF encapsulation!!  Obtain the binutils, GAS and go for it!

	If anyone has questions or comments feel free to contact me.  I'm
posting from my home machine now, so please respond to the following signature.
I hope we can continue to increase the stability and usability of the GNU
software. Thanks FSF.

Rich Patterson
rp@rpx
{pyramid,zycad}!rpx!rp

tiemann@teacake.ebay.sun.com (Michael Tiemann) (02/14/90)

Thanks for your comments!  I'll try to incorporate them into the
appropriate Makefiles, READMEs, and HINTS.

Michael