home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / help / 2122 < prev    next >
Encoding:
Text File  |  1992-09-14  |  4.0 KB  |  120 lines

  1. Path: sparky!uunet!stanford.edu!rutgers!mcdchg!serveme!gagme!greg
  2. From: greg@serveme.chi.il.us (Gregory Gulik)
  3. Newsgroups: gnu.gcc.help
  4. Subject: Re: Help with gcc-2.2.2 on ATT 3b2!!!!
  5. Message-ID: <1992Sep14.174211.2238@serveme.chi.il.us>
  6. Date: 14 Sep 92 17:42:11 GMT
  7. References: <2539.2ab25475@vger.nsu.edu>
  8. Organization: Gagme Public Access Unix, Chicago, Illinois
  9. Lines: 109
  10.  
  11. In article <2539.2ab25475@vger.nsu.edu> a_sudan@vger.nsu.edu writes:
  12. >Hi,
  13. >This is the 4th request so I hope to get some
  14. >response.  I am trying to build gcc-2.2.2 on an
  15. >ATT 3b2, SYSVr3.2.  The problem as I try to issue
  16. >make LANGUAGES=c I am recieving a too much defining
  17. >error in stmt.c . I know that there is a fix in the
  18. >Makefile but I can't handle this on my own.  So.....
  19. >someone out there if you can oblige me with this fix
  20. >I would greatly appreciate it.
  21. >
  22. >Also any other hints recommendations on building gcc and 
  23. >g++ would be appreciated.
  24.  
  25. The 3B2 FAQ I post to comp.sys.att monthly covers this subject.  Below
  26. is the relavent section:
  27.  
  28.  
  29. ------------------------------------------------------------------------------
  30. Subject: 12 How do I build GCC on the 3B2?
  31. ------------------------------------------------------------------------------
  32.  
  33. John L. Wehle ported GCC to the WE32000 series processor, and it
  34. first appeared in release 2.2 of GCC.
  35.  
  36. To build the GCC release on the 3B2, download the latest GCC
  37. distribution and allocate at least 35 MB of disk space to do the
  38. build.  Follow the directions in the INSTALL file.  The following
  39. are some notes that will make the install go smoother.
  40.  
  41. First of all, older versions of /lib/cpp are not capable of
  42. processing one of the source files.  I recommend building the
  43. distribution until the GNU cpp is done.  Then, temporarily replace
  44. your /lib/cpp with the GNU version, and add the following flag to
  45. CFLAGS:
  46.  
  47. CFLAGS = -U__STDC__
  48.  
  49. When stage1 is complete, you could remove the -U__STDC__ flag
  50. and restore your original cpp.
  51.  
  52. Basically, the steps are as follows:
  53.  
  54.     $ configure --target=we32k-att-sysv3
  55.     $ make LANGUAGES=c
  56.     $ make stage1
  57.     $ make LANGUAGES=c CC=stage1/gcc CFLAGS="-Bstage1/ -g"
  58.  
  59. [It is imporant to note that due to a bug in the AT&T compiler,
  60.  the optimizer doesn't get compiled correctly at this point.]
  61.  
  62.     $ make stage2
  63.     $ make CC=stage2/gcc CFLAGS="-Bstage2/ -g -O"
  64.  
  65. [Some people still have problems with the optimizer at this point.
  66.  If you do, just do not use the -O flag when compiling GCC.  The
  67.  symptom you will experience that tells you the -O flag should be
  68.  removed is the compilation of cccp.c will take a VERY long time.
  69.  Kill the compile and restart without the -O.]
  70.  
  71.     $ make stage3
  72.     $ make CC=stage3/gcc CFLAGS="-Bstage3/ -g -O"
  73.  
  74. To verify everything built correctly:
  75.  
  76.     $ for file in *.o; do
  77.     > tail +10c $file > foo1
  78.     > tail +10c stage3/$file > foo2
  79.     > cmp foo1 foo2 || echo $file
  80.     > done
  81.  
  82. Then, to install the distribution:
  83.  
  84.     $ make CC=stage3/gcc CFLAGS="-Bstage3/ -g -O" install
  85.  
  86. Good luck!
  87.  
  88. [These notes are a combination of my own experiences with building the
  89.  GCC compiler on a 3B2/400 and discussions with John Wehle, the author
  90.  of the port.]
  91.  
  92. NOTES:
  93.  
  94. The GCC binaries available on several anonymous FTP sites will not
  95. work with certain version of the standard C compiler.  It appears
  96. to be some sort of linker problem.
  97.  
  98. Speaking of linker problems, GCC will not work all that well with
  99. the standard C shared library -lc_s.  The workaround for this is
  100. to compile your program with GCC, but the link will fail.  When it
  101. does, use something like the following to do the link stage:
  102.  
  103. $ cc -O -L/usr/local/lib/gcc-lib/we32k-att-sysv/2.2.2 program.o \
  104.     -o program -lgcc -lc_s
  105.  
  106. This way, you will not only get fast binaries, but small ones as
  107. well.
  108.  
  109. You may need to raise your ULIMIT to compile the g++ compiler as
  110. the executable is larger than 1 MB.
  111.  
  112.  
  113. -greg
  114.  
  115. -- 
  116. Gregory A. Gulik                                 Call Gagme, a public access
  117.        greg@serveme.chi.il.us                    UNIX system at 312-282-8606
  118.    ||  gulik@rtsg.mot.com                        For information, drop a note
  119.                          to info@gagme.chi.il.us
  120.