home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3916 < prev    next >
Encoding:
Internet Message Format  |  1991-08-28  |  9.0 KB

  1. Xref: wupost comp.unix.xenix.sco:4106 alt.sources:3916
  2. Path: wupost!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!ukc!stl!robobar!ronald
  3. From: Steve.Bleazard@robobar.Co.Uk
  4. Newsgroups: comp.unix.xenix.sco,alt.sources
  5. Subject: Xenix Patch Kit for GAS 1.38.1/GCC 1.40/GDB 3.5 (part 1/4)
  6. Message-ID: <Xenix/gcc-1.40a.txt@robobar.co.uk>
  7. Date: 27 Aug 91 14:26:02 GMT
  8. Sender: ronald@robobar.co.uk (Ronald S H Khoo)
  9. Organization: Robobar Ltd., Perivale, Middx., ENGLAND.
  10. Lines: 219
  11. X-Md4-Signature: cf830922cf3330ce10c53d35cfd2f692
  12.  
  13. Archive-Name: Xenix/gcc-1.40a.txt
  14.  
  15. This is part 1 of a 4 part posting.
  16. This part contains only the README for this patch kit
  17. Please save it separately in a file called README.GCC
  18.  
  19. # @(#) $Id: README.GCC,v 1.2 1991/08/22 20:02:56 ronald Exp $
  20.  
  21. This README describes the port of GNU CC to SCO XENIX 386 from RoboBar Ltd.
  22. This port consists of patch kits to GCC 1.40, GAS 1.38.1 and GDB 3.5
  23. The port was done by Steve Bleazard <steve@robobar.co.uk> with assistance
  24. from Ronald Khoo <ronald@ibmpcug.co.uk> who wrote this README and packaged
  25. the kit.
  26.  
  27. Disclaimer:  RoboBar Ltd has no connection with the Santa Cruz Operation
  28.          whatsoever, other than being an indirect customer of theirs.
  29.          There is no warranty, nor claim of fitness for any purpose of
  30.          any program code you may happen to find in these files.
  31.          Various trademarks of Intel Corp,  Microsoft Corp, and the
  32.          Santa Cruz Operation, Inc. are mentioned in these files,
  33.          and are hereby acknowledged.
  34.  
  35. (C) Copyright 1991 RoboBar Ltd.  Permission is granted to redistribute
  36.     this article without any encumbrance, other than that this copyright
  37.     notice be retained, and that any modifications be clearly marked as such.
  38.  
  39. Overview:
  40.  
  41. This port works on SCO XENIX 386.  It has been tested on:
  42.     OS version: 2.3.4  with  Development System version 2.3.1b
  43. but we believe that it should be useable with some effort on versions
  44. 2.2 and later.
  45.  
  46. The object file format used is the native Microsoft/Intel OMF format,
  47.     so the GNU binutils are not used.  Therefore, this port is
  48.     compatible with third party SCO-compatible object libraries.
  49. The SCO Development System provides the system libraries and include files.
  50. The standard Microsoft assembler is not used -- instead the GNU assembler
  51.     was ported to produce OMF.
  52. A linker helper-program (provided by Christoph Badura <bad@flatlin.ka.sub.org>,
  53.     installed as /usr/local/lib/gcc-ld) helps gcc's -L -l options to work.
  54.     However, the standard XENIX /bin/ld does the real linking--it
  55.     is executed by Christoph's program.
  56. Symbolic debugging is supported for the accompanying port of GDB only.
  57.     SCO's sdb debugging format is not documented, and seems to change
  58.     from release to release, so we can't support it.
  59. The port of GDB was started from an sdb-based port by rdk386!ron (Ron Kuris)
  60.     Without his lead, this port would probably not exist.
  61. The GNU compiler system, as modified by these patches, serves as our
  62.     production compiler at RoboBar.  We believe it to be of
  63.     production quality, and in any case of much higher quality than
  64.     SCO XENIX's native Microsoft compiler system.
  65.  
  66. This README documents how to compile and install this GCC port from
  67. the patches alone.  You can skip some of the steps if you already
  68. have XENIX GCC binaries from earlier versions of this XENIX GCC port.
  69. If you are building from scratch, you can use the commands indicated
  70. by => in this README as a guide.  On *our* system, those commands
  71. were directly executed from this file via a script.  If your version
  72. of XENIX or the Development System is different from ours, you may
  73. have to hack a bit, though.
  74.  
  75. Note that parts of the procedure require you to be root, with a umask no
  76. more paranoid than 022.
  77.  
  78. What you need:
  79.  
  80.     SCO XENIX 386 Operating System
  81.     SCO XENIX 386 Development System
  82.     Larry Wall's "patch" program, version 2, patchlevel 12.
  83.         (from volume 7 of comp.sources.unix, or the GNU
  84.          enhanced one from prep.ai.mit.edu)
  85.     The standard GNU distributions of the compiler and assembler:
  86.         gcc-1.40.tar.Z and gas-1.38.1.tar.Z
  87.         (from prep.ai.mit.edu:/pub/gnu)
  88.     The three patches in this kit:
  89.         gcc-1.40.pch
  90.         gas-1.38.pch
  91.         gdb-3.5b.pch
  92.     A modicum of free disc space.  10 Mb is comfortable.  You can
  93.     do it with less, but the instructions here assume 10Mb free.
  94.  
  95.     Patience.  Lots of patience.  The patience of a saint.
  96.  
  97. What to do:
  98.  
  99.     First, ensure /usr/local/bin is in your PATH, and that
  100.     the "patch" program can be found in your path.
  101. =>    PATH=/usr/local/bin:/bin:/usr/bin export PATH
  102.  
  103.     Next, unpack the GNU distributions, and copy alloca.c from
  104.     the GCC directory into the GAS directory:
  105.  
  106. =>    zcat < gas-1.38.1.tar.Z | tar xf -
  107. =>    zcat < gcc-1.40.tar.Z | tar xf -
  108. =>    zcat < gdb-3.5.tar.Z | tar xf -
  109. =>    cp gcc-1.40/alloca.c gas-1.38/alloca.c
  110.  
  111.     Now, compile the GNU assembler with the standard compiler.
  112.         (Do not switch the optimiser on, as this will cause
  113.          incorrect code to be generated.  And "const" breaks it)
  114. =>    cd gas-1.38
  115. =>    patch < ../gas-1.38.pch
  116. =>    cc -c alloca.c
  117. =>    make ax386 G0="-Dconst= -DUSG -DWORKING_DOT_WORD" O1= LOADLIBES=alloca.o
  118.  
  119.     (Throughout this build, you will get plenty of warning messages
  120.      from the compiler.  At this stage, it is best to ignore them)
  121.  
  122.     Now, install the assembler as /usr/local/lib/gcc-as
  123.  
  124. =>    mkdir /usr/local ; mkdir /usr/local/lib ; mkdir /usr/local/bin
  125. =>    cp ax386 /usr/local/lib/gcc-as
  126.  
  127.     Now, you need to make minimal necessary changes to your
  128.     system include files and then build gcc itself.
  129.     You may have to modify fixmin.xenix depending on your version
  130.     of the Operating and Development systems.  Sigh.
  131.  
  132. =>    cd ../gcc-1.40
  133. =>    patch -p < ../gcc-1.40.pch
  134. =>    sh fixmin.xenix        # have to be root to do this!
  135. =>    sh config.gcc xenix386
  136.  
  137.     Compile gcc for the first time using the Microsoft compiler:
  138.  
  139. =>    make -f Makefile.msc -f Makefile msc ALLOCA=alloca.o CFLAGS=
  140.  
  141.     (This build may fail somewhere and core dump near the end when
  142.      it tries to build gnulib2.  Ignore it, it doesn't matter)
  143.  
  144.     Save this version of gcc, then make gcc with this saved version.
  145.  
  146. =>    make stage1
  147. =>    make CC=stage1/gcc CFLAGS=-Bstage1/    # cannot optimise yet
  148.  
  149.     Now we can build an optimised version of gcc.
  150.  
  151. =>    make stage2
  152. =>    rm -rf stage1    # regain some disc space if you're short of it.
  153. =>    make CC=stage2/gcc CFLAGS="-Bstage2/ -O"
  154.  
  155.     At this point, we have a correctly compiled version of gcc.
  156.     We now install it, then go and recompile gas with gcc
  157.  
  158. =>    make install INSTALL=cp
  159. =>    cd ../gas-1.38
  160. =>    rm -f *.o ax386
  161. =>    make ax386 G0="-O -DUSG -DWORKING_DOT_WORD" O1= LOADLIBES= CC=gcc
  162. =>    cp ax386 /usr/local/lib/gcc-as
  163. =>    rm -f /usr/local/bin/gas
  164. =>    ln /usr/local/lib/gcc-as /usr/local/bin/gas
  165.  
  166.     Finally, we compile gcc again, using a correctly built gas.
  167.  
  168. =>    cd ../gcc-1.40
  169. =>    make stage3
  170. =>    rm -rf stage2    # regain some disc space if you're short of it.
  171. =>    make CC=stage3/gcc CFLAGS="-Bstage3/ -O"
  172.  
  173.     In fact, if we're lucky, this version should be identical to
  174.     the previous version, and if it is, we're happy.  So let's check.
  175.  
  176. =>    for i in *.o ; do cmp -s $i stage3/$i || echo $i broke ; done
  177.  
  178.     (Hopefully none should break, if any do, you will have to iterate
  179.      through more stage builds of both gcc and gas until it no longer
  180.      breaks)
  181.  
  182.     Now, we install Christopher's ld helper program so that
  183.     gcc's -l and -L options will work:
  184.  
  185. =>    gcc -O -Iconfig xenixld.c -o gcc-ld
  186. =>    cp gcc-ld /usr/local/lib/gcc-ld
  187.  
  188.     Now, it's probably wise to undo the damage we did to /usr/include
  189.  
  190. =>    sh fixmin.xenix undo
  191.  
  192.     However, the include files are really not in a useable state.
  193.     You will have to hack them a lot, but the fix.h.xenix file contains
  194.     a few useful hints.  But *PLEASE* read it before you execute it,
  195.     as it may well need customising for your site.  In particular,
  196.     if you've done stuff like adding #ifdef _SIZE_T to your include files,
  197.     the script may not work anymore.  But the __M_I386__ hack in there
  198.     must be done, or else you won't be able to use gcc -ansi.
  199.  
  200. =>    sh fix.h.xenix
  201.  
  202.     I guess a debugger is useful to have so let's build that:
  203.  
  204. =>    cd ../dist-gdb
  205. =>    patch -p < ../gdb-3.5b.pch
  206. =>    sh config.gdb xenix386
  207.  
  208.     Depending on the version of your Development System libraries,
  209.     you may have to edit m-xenix386.h at this point to #define
  210.     the symbol PTRACE_ADDR_ARG_STRUCT.  This is necessary for version 2.2,
  211.     but not for 2.3 (the default).
  212.  
  213. =>    make CC=gcc GLOBAL_CFLAGS="-O -I. -traditional -DNO_PROTOTYPE"
  214. =>    mv gdb /usr/local/bin
  215.  
  216.     There's a helper module that's useful for use with GDB.
  217.     Read the source file gdbspace.asm for more info.
  218.     (/usr/lib/storel is part of your XENIX link kit).
  219. =>    /usr/lib/storel gdbspace.asm && mv gdbspace.o /usr/local/lib/libgdb.a
  220.  
  221.     Then it's probably time for a long beer.  Of course, Murphy's
  222.     Law states that your disc controller will probably die,
  223.     destroying your disc in the process just at this point ....
  224.  
  225. If you come across any XENIX-related GCC problems, please send mail to
  226. Steve Bleazard <steve@robobar.co.uk>  or  uunet!mcsun!ukc!robobar!steve
  227. -- 
  228. Steve.Bleazard@RoboBar.Co.Uk        | Phone:  +44 81 991 1142 x153
  229. Snr Software Engineer, Robobar Ltd. | Fax:    +44 81 998 8343 (G3)
  230. 22 Wadsworth Road, Perivale.        |
  231. Middx., UB6 7JD ENGLAND.            | ...!ukc!robobar!steve
  232.