From: H.J. Lu (hlu@yoda.eecs.wsu.edu)
Date: 06/30/92


From: hlu@yoda.eecs.wsu.edu (H.J. Lu)
Subject: The officail FAQ for gcc (Re: Problems with linux0.96bpl2)
Date: 30 Jun 1992 20:38:29 GMT


>In article <1992Jun30.161124.28705@serval.net.wsu.edu> hlu@yoda.eecs.wsu.edu (H.J. Lu) writes:
>
>>> I'm using linux-0.96bpl2 and compiled it with gcc-2.11c.
>>>
>>No one should compil linux-0.96bpl2 with gcc-2.11c.
>
>What should we be using? :-)

This is someone who missed it.

H.J.
=============
QUESTION: What compiler should I use for Linux?

ANSWER: You should only use the same version on banjo.concert.net
under /pub/Linux/GCC. If you want to use the testing release, first
join the GCC channel on the Linux mailing list, and then send a note to
hlu@eecs.wsu.edu. Don't use gcc older than the one on
banjo.concert.net.

QUESTION: Where is the latest official gcc 2.xx for Linux?

ANSWER: It's on banjo.concert.net under /pub/Linux/GCC, maybe also
fgb1.fgb.mw.tu-muenchen.de under pub/linux/GCC. You may find
it on the other sites. But I am not sure if they are up to date. There
are 3 files, 2.xxdb.tar.Z, 2.xxlib.tar.Z and 2.xxmisc.tar.Z. Another
file, binutils.tar.Z, is not the part of gcc 2.xx, but used by gcc
2.xx. It contains all the binary utilities you need to run gcc 2.xx.
You should read the release note to see if you should get the new
binutils.tar.Z.

QUESTION: What are the contents of them?

ANSWER: 2.xxdb.tar.Z contains cpp, libg.a and libc_p.a. 2.xxlib.tar.Z
contains cc1 and cc1plus. 2.xxmisc.tar.Z contains gcc 2.xx drivers,
header files, libraries, manual pages and installation instructions.

Another file, XXXXinc.tar.Z, where XXXX is the current version number
of Linux kernel, has all the header files to replace the header files
from kernel. YOU MUST INSTALL IT. Please read README for details.

QUESTION: Is it possible to have gcc 2.12d or above installed and also
compile X11 v1.0 stuff ?? (i.e. have gcc2.11c co-existing).

ANSWER: If your X11 requires gcc 2.11c, please read the following. If
your X11 requires gcc 2.2.2, just skip the following. You don't have to
do anything.

First, erase any old compilers you already have installed.
Basically, remove these directories:

/usr/{include,g++-include,install,shared}
/usr/lib/{gcc-lib,static,shared}.

Now unpack and re-install 2.11c. Don't forget to run inst2.x. If you
want to use the shared X libs compiled with gcc 2.11c, INSTALL IT NOW.

The directory structure of gcc is re-arranged starting from 2.12d (for
the better) so we need move things around in 2.11c.

In /usr/lib/gcc-lib/i386-linux/2.11c, rename all of the Lib*.a files to
lib*.a. Now create a new subdirectory called "shared" and copy all of
the files in /usr/lib/shared, including those X11 shared libs compile
with gcc 2.11c, to it. You can now remove /usr/{shared,install}
and /usr/lib/{static,shared}.

Make a new directory,

mkdir /usr/lib/gcc-lib/i386-linux/2.11c/include

Then move assert.h, float.h, limits.h, proto.h, stddef.h, stdarg.h,
varargs.h and va-*.h (if you have them.) to

/usr/lib/gcc-lib/i386-linux/2.11c/include

Those files are version-dependent. You have to put them there. Now
remove /usr/{include,g++-include}.

OK, now unpack and install the new version of gcc, 2.12d or above.
Also, reinstall /usr/include/X11 from X11R5 v1.0. Again, don't forget
to run inst2.x and fixfiles.

We're almost there now, we just need to tell gcc how to use the 2.11c
shared libs. Run 'gcc -V 2.11c -dumpspecs' and re-direct the output to
/usr/lib/gcc-lib/i386-linux/2.11c/specs. Now look at .../2.11c/specs.
You may need to edit it and change version number to 2.11c.

That's it. You should now be able to use 2.11c by specifying -V 2.11c.
If you don't specify either, you should get the new version by default.

QUESTION: How do I install it?

ANSWER: Do

cd /usr
tar xofz 2.xxmisc.tar.Z

and then read README in /usr/install/gcc2.

QUESTION: What are the main differences with the old release?

ANSWER: Do

cd /usr
tar xofz 2.xxmisc.tar.Z

and then read README in /usr/install/gcc2.

QUESTION: Is stdio ANSI compatible?

ANSWER: Yes, please test it.

QUESTION: Is g++ in 2.xx?

ANSWER: Yes.

QUESTION: What options can I use for gcc?

ANSWER: Read manual page, gcc.ps or gcc.man in /usr/install/gcc2. -O3,
-O4, -O5 or even higher should work with 2.xx. Try it yourself. I was
told you could manipulate those optimization flags (-fxxxxxxxx stuffs)
to get the best performance. Also -static tells gcc to use the static
libraries. The default is the shared libraries.

QUESTION: Where is the source code of the new libc.a?

ANSWER: The same place you find this file. It is called libc-2.xx.tar.Z.

QUESTION: Why does g++ complain, even die?

ANSWER: You need "expr", which is in GNU shell utilities 1.6, echo (?)
and sed.

QUESTION: How do I generate code for 486?

ANSWER: Add -m486 to CFLAGS.

QUESTION: I heard malloc (0) wouldn't work with Linux, what should I
do?

ANSWER: include <stdlib.h> and don't define NO_FIX_MALLOC.