From: hlu@yoda.eecs.wsu.edu (Hongjiu Lu -- Graduate Student)
Newsgroups: alt.os.linux,comp.os.linux
Subject: gcc 2.1 beta is available
Date: 6 Apr 92 05:17:24 GMT
Organization: Washington State University
Originator: hlu@yoda.eecs.wsu.edu
Hi,
I am putting gcc 2.1 beta on headrest.woz.colorado.edu under
/pub/linux/gcc and banjo.concert.net under /pub/Linux/GCC. They should
be there in a few hours. Drew, could you please move 2.1lib.tar.Z,
2.1misc.tar.Z, libc-2.1.tar.Z and 2.1shared-A.tar.Z to /pub/linux/gcc?
Although gcc 2.1 is beta, it is quite stable. During the alpha testing
stage, we fixed lots of bugs. It should run well for most of you.
But I cannot guarantee it has no bugs. If you find any bug, please
send it to me at "hlu@eecs.wsu.edu" as well as the channel "GCC" on the
Linux mailing list.
THANKS TO ALL THE ALPHA TESTERS. You did a great job and help me a lot,
Without you guys, I cannot image how I could find all those bugs.
I am enclosing the FAQ for gcc 2.1. PLEASE DO READ IT. It may have the
answers for your questions. You must follow the instructions in the FAQ.
I also put a patch, 2.1kernel.tar.Z, for kernel to compile with
gcc 2.1. You have to apply Linus' second patch first. And another
package, 2.1ps.tar.Z, for ps is modified by me to gcc 2.1.
BTW, make sure tar and compress you have are working right. Some
problems for the previous gcc 2.1 seemed to be caused by bad
tar/compress.
H.J.
--
School of EECS Internet: hlu@eecs.wsu.edu
Washington State University BITNET: 60935893@WSUVM1.BITNET
Pullman, WA 99164 Phone: (509) 335-6470 (O)
USA (509) 334-6315 (H)
---------FAQ-------
QUESTION: Where is the gcc 2.1 beta?
ANSWER: It's on banjo.concert.net under /pub/Linux/GCC and
headrest.woz.colorado.edu under /pub/linux/?. You may find it on the
other sites. But I am not sure if they are up to date. There are two
files, 2.1lib.tar.Z and 2.1misc.tar.Z. Another file, binutils.tar.Z,
is not the part of gcc 2.1, but used by gcc 2.1. It contains all the
binary utilities you need to run gcc 2.1.
There may be also some files called 2.1shared-x.tar.Z. They have some
programs compiled in .a format. Please take a look at
/usr/shared/obj/README*
after unpack 2.1shared-A.tar.Z under /usr.
QUESTION: What are the contents of them?
ANSWER: 2.1lib.tar.Z contains cc1, cc1plus and cpp. 2.1misc.tar.Z
contains gcc 2.1 drivers, header files, libraries, manual pages and
installation instructions.
QUESTION: How do I install it?
ANSWER: First of all, backup the old compiler if you have one and
remove it from your hard drive. YOU MUST BE ABSOLUTELY SURE THERE IS NO
ANY OTHER C COMPILER ON YOUR SYSTEM INSTALLED. I heard too much stories
about it. By compiler, I mean the executables, libraries (crt0.o) and
header files. This gcc 2.1 will only work with the kernel above 0.95.
You may have to have 2 MB ram to run it and have some swap space
(> 4MB) since cc1 and cc1plus are about 1 MB. First do
cd /usr
tar xvpfvz xxxx/2.1misc.tar.Z
Then read FAQ in /usr/install/gcc2. After
cd /usr
tar xvpfvz xxxx/2.1lib.tar.Z
run the shell script "inst2.x". If you need binutils.tar.Z, do a
cd /usr
tar xvpfvz xxxx/binutils.tar.Z
Please check the file permission for all files you have unpacked. Maybe
I should write a shell script to do that.
QUESTION: How do I install a new release of gcc 2.1?
ANSWER: Depends on the nature of the new release, if the gcc itself is
changed, you have to install everything in 2.1lib.tar.Z and
2.1misc.tar.Z come with the new release. If just the libraries are
changed, you can just pick 2.1update.tar.Z and unpack it in /usr. Then
do
cd /usr
tar xvpfvz xxxx/2.1update.tar.Z
cd /usr/install/gcc2
update2.x
In both cases, it is recommended to relink all the shared executables.
If the gcc itself is changed, a new set of .a's may be released too.
QUESTION: What are the main differences with the old release?
ANSWER: Here are the features
1. gcc and g++ are in one.
2. ANSI and BSD 4.4 compatible stdio.
3. iostream for g++. It has
* Full implementation of ANSI C stdio.
* Full implementation of the streambuf layer of AT&T's
iostream library for C++.
* Full compatibility between stdio and streambufs.
and libg++.a 2.0.
4. Libc.a is almost new. Most of glibc.a 1.02 (nonnetwork stuffs) are
here.
a. ctype
b. grp
c. locale
d. malloc (libmcheck.a)
e. posix
f. pwd
g. stdlib
h. string
Some other functions are added.
b. cvt
b. drand48
c. getlogin (poeigl-1.2)
d. getpass (poeigl-1.2)
e. mkfifo (is that supported in kernel?)
f. regex (GNU)
g. curses (BSD)
h. swab
i. time (BSD, untested)
j. ufc
k. utmp stuffs (poeigl-1.2)
These old functions are not changed very much.
a. soft math (fmod is added)
b. math (some are new)
c. termcap
d. unistd
5. The shared libraries are here. To link with the static libraries,
add the -static flag to gcc.
QUESTION: Is stdio ANSI compatible?
ANSWER: Yes, please test it.
QUESTION: Is g++ in 2.1?
ANSWER: Yes. Use g++ to compile the C++ code. Libg++.a 2.0 is here.
One thing missing is curses. I will take a look if I have time. And
fix.o failed to compile.
QUESTION: What options can I use for gcc?
ANSWER: Read manual page, gcc.ps or gcc.man. -O3, -O4, -O5 or even
higher should work with 2.1. -O3 is said to be the best. Don't ask me
why. Try it yourself. 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.1.tar.Z.
QUESTION: How can I use gcc 2.1 to compile the kernel?
ANSWER: The kernel has to be compiled with the header files come with
it. I will ask Linus to make it easy for you. Please keep in mind,
kernel uses the different header files. Do not include any header files
from gcc 2.1. It can be done by using
cc -nostdinc -I....
QUESTION: Why does gcc say "foo.h not found" when compiling the
kernel and I am following the instruction above?
ANSWER: Not every source code under ./linux is kernel code. By kernel,
I mean those linked together and written to boot image. If there is a
file which is compiled to run under Linux, that is an application and
you should follow the instruction below.
QUESTION: How can I use gcc 2.1 to compile applications?
ANSWER: Any application has to be compiled with the header files come
with gcc 2.1. If you need some header files from the kernel sources,
do a
#include "/foo/src/linux/include/linux/bar.h"
It is strongly recommended to prototype all the library functions by
including the appropriate head files. At least, it will save you
trouble of malloc (0).
QUESTION: Why does a program compiled ok by gcc 2.1 and the new binary
utilities get an error from kernel saying something about binary file
format?
ANSWER: Linux has changed a.out.h. The new a.out.h is compatible with
the applications compiled with the old a.out.h. But if an application is
compiled with the new a.out.h, you have to use the new a.out.h. If you
get this error message, you should get the new a.out.h and old ld from
where you get this and use them to recompile the kernel.
QUESTION: Why does g++ complain?
ANSWER: You need "expr". It is in GNU shell utilities 1.6.
From: david@ods.com (David Engel)
Newsgroups: alt.os.linux,comp.os.linux
Subject: Re: gcc 2.1 beta is available
Date: 6 Apr 92 18:19:58 GMT
Organization: Optical Data Systems, Inc.
hlu@yoda.eecs.wsu.edu (Hongjiu Lu -- Graduate Student) writes:
: THANKS TO ALL THE ALPHA TESTERS. You did a great job and help me a lot,
: Without you guys, I cannot image how I could find all those bugs.
It took longer that I think any of us expected, but we now have one heck
of a compiler and library. Thanks H.J.
-David
--
David Engel Optical Data Systems, Inc.
david@ods.com 1101 E. Arapaho Road
(214) 234-6400 Richardson, TX 75081
From: hlu@luke.eecs.wsu.edu (Hongjiu Lu -- Graduate Student)
Newsgroups: alt.os.linux,comp.os.linux
Subject: IMPORTANT: gcc 2.1, libc.a 2.1a and Linux
Date: 6 Apr 92 21:15:00 GMT
Organization: Washington State University
Originator: hlu@luke.eecs.wsu.edu
Hi,
I heard there were some problems with binaries linked with my new ld.
That is caused by the new a.out.h introduced with Linus's second patch.
The new a.out.h is compatible with the old one, But not vice versa.
My new ld (binutils.tar.Z) uses the new a.out.h. The binaries
linked by it can only run under the kernel with Linus's second patch,
which has to be built by the old ld.
Any programs using the old a.out.h, e.g., gdb, will not recognize the
binaries linked by the new ld. You can either use the old ld or use
the new version compiled with the new a.out.h.
From Linus's second patch, we are moving to VFS. As a result, there
will be some changes in libc.a. That means next release of gcc 2.x and
libs will not run under the kernel below Linus's second patch to 0.95a.
I strongly recommend you move to 0.95a with Linus's second patch if you
haven't done so.
H.J.
From: hlu@luke.eecs.wsu.edu (Hongjiu Lu -- Graduate Student)
Newsgroups: alt.os.linux,comp.os.linux
Subject: FAQ: gcc 2.1 and kernel
Date: 7 Apr 92 20:14:20 GMT
Organization: Washington State University
Originator: hlu@luke.eecs.wsu.edu
Hi,
There seems some confusion about how to use gcc 2.1 to compile 0.95a
kernel with Linus's second patch. That may be my fault. Ok. Here is the
new FAQ for gcc 2.1. Please save it. THE ONE ON FTP SITES IS NOT SO
CLEAR AS THIS ONE.
H.J.
----------FAQ FOE GCC 2.1----
QUESTION: Where is the gcc 2.1 beta?
ANSWER: It's on banjo.concert.net under /pub/Linux/GCC and
headrest.woz.colorado.edu 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 two
files, 2.1lib.tar.Z and 2.1misc.tar.Z. Another file, binutils.tar.Z,
is not the part of gcc 2.1, but used by gcc 2.1. It contains all the
binary utilities you need to run gcc 2.1.
There may be also some files called 2.1shared-x.tar.Z. They have some
programs compiled in .a format. It has almost everything you want for
Linux. Please take a look at
/usr/shared/obj/README*
after unpack 2.1shared-A.tar.Z under /usr.
QUESTION: What are the contents of them?
ANSWER: 2.1lib.tar.Z contains cc1, cc1plus and cpp. 2.1misc.tar.Z
contains gcc 2.1 drivers, header files, libraries, manual pages and
installation instructions.
QUESTION: How do I install it?
ANSWER: First of all, backup the old compiler if you have one and
remove it from your hard drive. YOU MUST BE ABSOLUTELY SURE THERE IS NO
ANY OTHER C COMPILER ON YOUR SYSTEM INSTALLED. I have heard too many
stories about it. By compiler, I mean the executables, libraries
(crt0.o) and header files. This gcc 2.1 will only work with the kernel
above 0.95. You may have to have 2 MB ram to run it and have some swap
space (> 4MB) since cc1 and cc1plus are about 1 MB. First do
cd /usr
tar xvpfvz xxxx/2.1misc.tar.Z
Then read FAQ in /usr/install/gcc2. After
cd /usr
tar xvpfvz xxxx/2.1lib.tar.Z
run the shell script "inst2.x". If you need binutils.tar.Z, do a
cd /usr
tar xvpfvz xxxx/binutils.tar.Z
Please check the file permission for all files you have unpacked. Maybe
I should write a shell script to do that.
QUESTION: How do I install a new release of gcc 2.1?
ANSWER: Depends on the nature of the new release, if the gcc itself is
changed, you have to install everything in 2.1lib.tar.Z and
2.1misc.tar.Z come with the new release. If just the libraries are
changed, you can just pick 2.1update.tar.Z and unpack it in /usr. Then
do
cd /usr
tar xvpfvz xxxx/2.1update.tar.Z
cd /usr/install/gcc2
update2.x
In both cases, it is recommended to relink all the shared executables.
If the gcc itself is changed, a new set of .a's may be released too.
QUESTION: What are the main differences with the old release?
ANSWER: Here are the features
1. gcc and g++ are in one.
2. ANSI and BSD 4.4 compatible stdio.
3. iostream for g++. It has
* Full implementation of ANSI C stdio.
* Full implementation of the streambuf layer of AT&T's
iostream library for C++.
* Full compatibility between stdio and streambufs.
and libg++.a 2.0.
4. Libc.a is almost new. Most of glibc.a 1.02 (nonnetwork stuffs) are
here.
a. ctype
b. grp
c. locale
d. malloc (libmcheck.a)
e. posix
f. pwd
g. stdlib
h. string
Some other functions are added.
b. cvt
b. drand48
c. getlogin (poeigl-1.2)
d. getpass (poeigl-1.2)
e. mkfifo (is that supported in kernel?)
f. regex (GNU)
g. curses (BSD)
h. swab
i. time (BSD, untested)
j. ufc
k. utmp stuffs (poeigl-1.2)
These old functions are not changed very much.
a. soft math (fmod is added)
b. math (some are new)
c. termcap
d. unistd
5. The shared libraries are here. To link with the static libraries,
add the -static flag to gcc.
QUESTION: Is stdio ANSI compatible?
ANSWER: Yes, please test it.
QUESTION: Is g++ in 2.1?
ANSWER: Yes. Use g++ to compile the C++ code. Libg++.a 2.0 is here.
One thing missing is curses. I will take a look if I have time. And
fix.o failed to compile.
QUESTION: What options can I use for gcc?
ANSWER: Read manual page, gcc.ps or gcc.man. -O3, -O4, -O5 or even
higher should work with 2.1. -O3 is said to be the best. Don't ask me
why. Try it yourself. I was told you could manipulate those optimation
flags 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.1.tar.Z.
QUESTION: How can I use gcc 2.1 to compile the kernel?
ANSWER: The kernel has to be compiled with the header files come with
it. Please use my 2.1kernel.tar.Z and 2.1ps.tar.Z, which can be found
where you get gcc 2.1. The kernel uses its own header files. Do not
include any header files from gcc 2.1 while compiling the kernel.
QUESTION: Why does gcc say "foo.h not found" when compiling the
kernel and I am following the instructions above?
ANSWER: Not every source code under ./linux is kernel code. By kernel,
I mean those linked together and written to boot image. If there is a
file which is compiled to run under Linux, that is an application and
you should follow the instruction below. ./tools/build is one of them.
It should be compiled with gcc 2.1 header files. Please read my
2.1kernel.tar.Z.
QUESTION: How can I use gcc 2.1 to compile applications?
ANSWER: Any application has to be compiled with the header files come
with gcc 2.1. If you need some header files from the kernel sources,
do a
#include "/foo/src/linux/include/linux/bar.h"
It is strongly recommended to prototype all the library functions by
including the appropriate head files. At least, it will save you
trouble of malloc (0) (read stdlib.h).
QUESTION: Why does a program compiled ok by gcc 2.1 and the new binary
utilities get an error from kernel saying something about binary file
format or some weird things?
ANSWER: Linux has changed a.out.h. The new a.out.h in Linus' second
patch is compatible with the applications compiled with the old
a.out.h. But if an application is compiled with the new ld
(binutils.tar.Z) which uses the new a.out.h, you have to use the
kernel compiled with the new a.out.h. You have to recompile the kernel
with Linus' second patch applied and old ld. And then use new ld to
link the programs.
QUESTION: Why does g++ complain even die?
ANSWER: You need "expr", which is in GNU shell utilities 1.6, echo (?)
and sed.
From: hlu@yoda.eecs.wsu.edu (Hongjiu Lu -- Graduate Student)
Newsgroups: alt.os.linux,comp.os.linux
Subject: fixes for header files for gcc 2.1 and kernel
Date: 8 Apr 92 03:15:48 GMT
Organization: Washington State University
Originator: hlu@yoda.eecs.wsu.edu
Hi,
I was told that the header files of gcc 2.1 and kernel are quite
confusing. Here is my solution. I am enclosing a program, conv. That
program will ensure only one set of header files is needed for
compiling both applications and kernel.
Before you run it, you have to have gcc 2.1 beta, mv, mvdir, rm and
tar installed on your system.
Before you do anything, please backup gcc 2.1 and kernel sources. Here
goes.
Step 1: Apply Linus's second patch and then my 2.1kernel.tar.Z.
Step 2: Read conv and understand what it is doing. Then go to the
toplevel of kernel source tree and do
conv
Step 3: Edit the toplevel Makefile and add -DPRE_GCC_2 to CFLAGS.
You may also want to get rid of "-nostdinc -Ixxxx" stuff since
./include has been moved to /usr/include.
Step 4: Type
make
H.J.
--------conv----------
#!/bin/sh
# you have to run this script under ./linux
INCS="errno.h fcntl.h limits.h signal.h stdarg.h stddef.h \
termios.h time.h unistd.h utime.h"
# move ctype.h and string.h in kernel source, which are different from
# gcc 2.1 to ./linux.
mv ./include/ctype.h ./include/string.h ./include/linux
# make a new directory
mkdir ./include.old
# move duplicated header files to ./include.old
for h in $INCS
do
mv ./include/$h ./include.old
done
# move ./include/sys to ./include.old
mvdir ./include/sys ./include.old
# move those header files which don't exist in gcc 2.1 to /usr/include
tar cf - ./include | (cd /usr; tar xpf - )
# remove ./include
/bin/rm -rf ./include
# change
#include < ctype.h>
#include < string.h>
# to
#include < linux/ctype.h>
#include < linux/string.h>
#
DIRS="boot fs init kernel lib mm"
for d in $DIRS
do
for f in $d/*.c $d/*.h $d/*/*.c $d/*/*.h
do
sed 's,< ctype.h>,< linux/ctype.h>,' $f | sed 's,< string.h>,< linux/string.h>,' > 1
mv 1 $f
done
done
From: knapka@athena.cs.uga.edu (Joseph Knapka)
Newsgroups: comp.os.linux
Subject: gcc-2.1 header files
Date: 7 Apr 92 14:55:23 GMT
Organization: University of Georgia, Athens
H.J. asked me to forward this exchange to the newsgroup:
I said:
>> Kernel build of .95c went fine, but when compiling ps, I get
>> "undefined symbol __ctype referenced from text segment" while linking
>> ps.o. This is with very latest gcc-2.1, libraries, and binutils from
>> banjo. I linked xxx/src/linux/lib/ctype.o and got it to compile, and
>> (seems that) everything works. Did I do the right thing?
>>
>
H.J. said:
>No. Please get my 2.1ps.tar.Z, 2.1kernel.tar.Z and apply Linus's second
>patch first. When compile any application, do not use ANY header files
>from ./linux/include.
Joseph
P.S.: but I'd already applied .95c, 2.1kernel, and ps patches. Still
waiting for a reply...
From: hlu@phys1.physics.wsu.edu (Hongjiu Lu)
Newsgroups: comp.os.linux
Subject: Re: gcc-2.1 header files
Date: 9 Apr 92 18:54:02 GMT
Organization: Washington State University
In article <1992Apr7.145523.16329@athena.cs.uga.edu>, knapka@athena.cs.uga.edu (Joseph Knapka) writes:
|> H.J. asked me to forward this exchange to the newsgroup:
|>
|> I said:
|> >> Kernel build of .95c went fine, but when compiling ps, I get
|> >> "undefined symbol __ctype referenced from text segment" while linking
|> >> ps.o. This is with very latest gcc-2.1, libraries, and binutils from
|> >> banjo. I linked xxx/src/linux/lib/ctype.o and got it to compile, and
|> >> (seems that) everything works. Did I do the right thing?
|> >>
|> >
|>
|> H.J. said:
|> >No. Please get my 2.1ps.tar.Z, 2.1kernel.tar.Z and apply Linus's second
|> >patch first. When compile any application, do not use ANY header files
|> >from ./linux/include.
That is not totally right. Here again.
I am enclosing a program, conv. You run it under ./linux. That program
will ensure only one set of header files is needed for compiling appplications
and kernel.
Before you run it, you have to have gcc 2.1 beta, mv, cp and sed
installed on your system.
Before you do anything, please backup gcc 2.1 and kernel sources. Here
goes.
Step 1: Apply Linus's second patch and then my 2.1kernel.tar.Z.
Step 2: Read conv and understand what it is doing. Then go to the
toplevel of kernel source tree and do
conv
Step 3: Edit the toplevel Makefile and add -DPRE_GCC_2 to CFLAGS.
You have to get rid of "-nostdinc -Ixxxx" stuff since
./include has been moved to /usr/include.
Step 4: Type
make
If you have any problem, please let me know.
H.J.
------------CUT HERE------
#!/bin/sh
# you have to run this script under ./linux
INCS="a.out.h const.h asm linux"
# move ctype.h and string.h in kernel source, which are different from
# gcc 2.1 to ./include/linux.
mv ./include/ctype.h ./include/string.h ./include/linux
# copy those header files which don't exist in gcc 2.1 to /usr/include
for h in $INCS
do
cp -r ./include/$h /usr/include/$h
done
# move ./include to ./include.kernel
mv ./include ./include.kernel
# change
#include < ctype.h>
#include < string.h>
# to
#include < linux/ctype.h>
#include < linux/string.h>
#
DIRS="boot fs init kernel lib mm"
for d in $DIRS
do
for f in $d/*.c $d/*.h $d/*/*.c $d/*/*.h
do
if [ -f $f ]
then
sed 's,< ctype.h>,< linux/ctype.h>,' $f | sed 's,< string.h>,< linux/string.h>,' > 1
mv 1 $f
fi
done
done
|