*BSD News Article 7165


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!sdd.hp.com!saimiri.primate.wisc.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!serval!hlu
From: hlu@eecs.wsu.edu (H.J. Lu)
Subject: Re: How suitable is gcc-2.2.2 for 386bsd?
Message-ID: <1992Oct28.201437.16640@serval.net.wsu.edu>
Sender: news@serval.net.wsu.edu (USENET News System)
Organization: School of EECS, Washington State University
References: <1992Oct23.222805.24970@klaava.Helsinki.FI> <1992Oct28.135008.29265@ntuix.ntu.ac.sg>
Date: Wed, 28 Oct 92 20:14:37 GMT
Lines: 70

In article <1992Oct28.135008.29265@ntuix.ntu.ac.sg>, eoahmad@ntuix.ntu.ac.sg (Othman Ahmad) writes:

[...]

|> I've used gcc-2.2.2 to compile all utilities and some ported software like 
|> bash, sc  but it failed for petdingo, 386bsd kernel, f2c .
|> 	gcc-1.39 works for all these cases. If you do not have gcc-1.39 ,
|> you'll not be able to have these software.

FYI, gcc 2.2.2/2.3 can compile Linux kernel and f2c.

|> 
|> gcc-2.2.2 uses a different syntax from gcc-1.39 and it is still very volatile.

I assume you are talking about `asm' syntax, not C syntax.

|> I support the idea that we wait until version 2.4.. before adopting it outright,
|> who knows FSF may change its syntax again.
|>  
|> : 
|> : The linux community has been using the newest gcc for quite a while
|> : (this includes actually testing out snapshots a few days after they are
|> : released etc), and compiler-generated problems have been very few
|> : (although there were quite a few library-related ones). 
|> : 
|> : But there *IS* at least a couple of reasons for trouble with gcc-2.2.2
|> : under 386bsd:
|> :  - math support.  gcc-2.2.2 generates many new 387-instructions relative
|> :    to 1.39, and the bsd386 math-emulation may not be up to it (and I'm
|> :    not putting it down: I wrote most of it, and I just recognize that
|> :    it's not a piece of art.  Linux no longer uses it).  This will only
|> :    get worse: gcc-2.3 will emit the fsin/fcos instructions directly.
|> :  - gcc-2.x generates the 386 string instructions, and doesn't put a 'cld'
|> :    before them, assuming that the direction flag is always cleared.  If
|> :    the kernel doesn't clear the direction flag at an interrupt or trap,
|> :    you'll get weird behaviour.  I don't think this is a problem for
|> :    386bsd, but I remember having problems with it under linux when
|> :    testing out a pre-release of gcc-2.0.  Easily fixed in any case. 
|> : 
|> : There should probably be no other major problems (although gcc-2.2.2 is
|> : a lot bigger than 1.39, so if you are tight on memory, 1.39 is much
|> : faster). 
|> : 

386bsd must use `asm' stuff a lot, which is changed in gcc 2.x. You just
have to read gcc manual to figure how to use it. Maybe read Linux kernel
code can help too.

|> 
|> gcc-2.2.2 is bigger than gcc-1.39 & g++, being about 6 Megabytes binary.

Under Linux, for alpha 2.3,

-rwxr-xr-x   1 hlu      other     803840 Oct 28 01:46 cc1
-rwxr-xr-x   1 hlu      other    1082368 Oct 28 02:31 cc1plus
-rwxr-xr-x   2 hlu      other      66560 Oct 27 23:58 cpp

|> gcc&g++ 1.39 occupy about 2 megabytes(?).
|> 

gcc 2.x produces much better code than 1.39.

|> --
|> Othman bin Ahmad, School of EEE,
|> Nanyang Technological University, Singapore 2263.
|> Internet Email: eoahmad@ntuix.ntu.ac.sg
|> Bitnet Email: eoahmad@ntuvax.bitnet
|> 

H.J.