*BSD News Article 4810


Return to BSD News archive

Xref: sserve comp.unix.bsd:4858 comp.unix.sysv386:23556
Newsgroups: comp.unix.bsd,comp.unix.sysv386
Path: sserve!manuel!munnari.oz.au!uunet!usc!sol.ctr.columbia.edu!destroyer!fmsrl7!lynx!umn.edu!kksys.com!quest!digibd!dellr4.digibd.com!rhealey
From: rhealey@dellr4.digibd.com (Rob Healey)
Subject: Re: gcc as primary SVR4 port compiler
Organization: DigiBoard Incorporated, Eden Prairie, MN
Date: Wed, 09 Sep 1992 21:52:42 GMT
Message-ID: <1992Sep09.215242.19348@digibd.com>
References: <PHR.92Aug15214245@soda.berkeley.edu> <YSDIBS4@taronga.com> <PCG.92Aug27152230@aberdb.aber.ac.uk>
Sender: @digibd.com
Lines: 67

In article <PCG.92Aug27152230@aberdb.aber.ac.uk>, pcg@aber.ac.uk (Piercarlo Grandi) writes:
|> Kelly> It would be a strange to build SVR4 with gcc.  Commodore probably
|> Kelly> started out with a Motorola development system running SVR4, and
|> Kelly> a big pile of sources.  They would have then hacked and
|> Kelly> cross-compiled a development environment that would run on the
|> Kelly> Amiga 2500 and 3000.
|> 
	Since I'm an ex beta tester and have an Amiga 2.1 SVR4 system at
	home I can fill in a few holes.

	1) AmigaUNIX is derived from the 3b2, yup you read that right,
	  SVR4.0 source. The 2.x versions are 100% gcc 1.41 compiled
	  minus some minor utils outside the kernel. gcc 1.40.1 was HEAVILY
	  hacked to generate ELF/DWARF assembler output. Alot of work
	  was adaptation of Ron Guillmette's(sp) m88k SVR4 gcc work.
	  AmigaUNIX DID use the AT&T m68k version 5 compiler but only
	  long enough to get a decent version of gcc functioning.

	2) They had a functioning SVR3.2 port from which the SVR4 port
	   was bootstrapped. Most of the Amiga specific code written for
	   SVR3.2 was easily moved over to the SVR4 port. 2.1 AmigaUNIX
	   has had all the kernel code, minus an ST506 hard drive driver,
	   converted to SVR4 standards.

	3) gcc 2.x can be used on AmigaUNIX but there are subtle differences
	   in the 2.x vs 1.4x gcc code generation that cause them to
	   not work when you mix and match, call stack frames are
	   slightly different I think. As long as the whole app is
	   compiled with the same compiler you should be OK. The system
	   librarys seem to link OK with either version.

	4) No Motorola specific SVR4 port was ever looked at, only the 3b2 code,
	   although the headers agree, more or less, to the m68k source
	   API. Since there were no other major SVR4 m68k ports at the
	   time no real effort was made to strictly conform to the m68k
	   ABI although it SHOULD pretty much work. The SVR3.2 compatability
	   stuff was left out as there was no SVR3.2 that could run on
	   the Amiga.

	   Offhand I would say that with the ELF/DWARF support in gcc 2.x
	   it SHOULD be possible to uses gcc as a primary compiler. There
	   are two patch files for 2.2.2 which allow gcc to handle
	   weak and pack pragmas on m68k SVR4 systems and to properly generate
	   16 and 32 bit pc relative code for dynamic librarys. The Intel
	   SVR4 code looks like it can already do this.

	5) The speed difference between AT&T m68k CGS compiled code and gcc
	   1.4 is AMAZING. Looking at the assembly output of gcc vs
	   /usr/ccs/bin/cc reveals that the version 5 m68k AT&T compiler
	   was written by somebody who SERIOUSLY lacked knowledge about the
	   m68k architecture, it is DAMN UGLY m68k code and wastes ALOT of
	   cycles for no good reason.
	   
	   gcc on the otherhand generates some VERY nice m68k code. If the
	   Atari people did port SVR4 I sincerly hope they used gcc and not
	   the AT&T compiler or their code will take a MAJOR performance hit...
	   AmigaUNIX easily sped up by at least 2x switching from AT&T to
	   gcc.

	   Only the AT&T assembler is still in use on AmigaUNIX and BOY does it
	   have some WEIRD quirks...

	   Overall, I'd say gcc 2.x would make a decent compiler for
	   SVR4 as long as your version has the support for pragmas,
	   pc relative code and the GOT/PLT stuff.

		-Rob