0

UPDATE: I got a copy of Debian 3.0r2 from http://ftp.ntct.edu.tw/Linux/ISO/Debian/3.0r2/ This contains gcc 2.95.4 which is perfect. Installed it in VirtualBox and everything is now right with the world. :)

ORIGINAL:

I'm trying to build a copy of gcc 2.95.3 for use on my machine, and I am having a really difficult time.

I purchased a book that I've been going through and it is from 2002. It wants me to compile many of the examples to see what assembly the C compiler comes up with. The book uses gcc 2.95.3. The gcc on my system is 4.x not to mention 64-bit, so the assembly is generates looks almost NOTHING like that of the examples in the book.

I've tried just about everything to make gcc 2.95.3 work on my machine. I've even installed older 32-bit Linux distros using VirtualBox, but cannot for the life of me get it to compile.

Currently, on my machine here's what I'm doing:

./configure --host=i386-amd-linux-gnu
make

And after it rolls around for a few minutes, it comes up with this:

make[2]: Entering directory `/home/twilson/Downloads/gcc-2.95.3/gcc/ch'
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include parse.c
parse.c: In function ‘require’:
parse.c:326: warning: format not a string literal and no format arguments
parse.c: In function ‘expect’:
parse.c:352: warning: format not a string literal and no format arguments
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include actions.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include except.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include grant.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include lang.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include tree.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include lex.c
gcc -c  -DIN_GCC   -g -O2     -I. -I.. -I. -I./.. -I./../config -I./../../include decl.c
decl.c: In function ‘start_struct’:
decl.c:4451: error: argument ‘code’ doesn’t match prototype
ch-tree.h:736: error: prototype declaration
make[2]: *** [decl.o] Error 1
make[2]: Leaving directory `/home/twilson/Downloads/gcc-2.95.3/gcc/ch'
make[1]: *** [cc1chill] Error 2
make[1]: Leaving directory `/home/twilson/Downloads/gcc-2.95.3/gcc'
make: *** [all-gcc] Error 2

It seems that no matter what I do it always errors out with one error or another. This is as close as I've been (I assume, since this is the longest the compilation ever ran without stopping).

I am not an expert with configure or make, or with older software. I was only doing web-related stuff for many years and I'm coming into this lower-level game late.

Has anyone tried to do this recently and succeeded or know why this is happening?

Thanks, Tom

1
  • Do you really want to see the assembler output?
    – Spaceghost
    Jan 27, 2011 at 2:50

2 Answers 2

1

With the right flags, gcc will emit assembler for a 32-bit system. Depending on the complexity of the code and your level of experience in reading assembler, there may not be much difference between the output from 2.95 and 4.x. Maybe it's worth considering if it saves you from having to patch together an old version of the compiler.

For example, the following will produce assembler code (in a .s file) for i386 CPUs:

gcc yourfile.c -S -arch i386 

If that doesn't do it for you then take a look at this page that lays out the steps you need to build gcc 2.95 on a 64-bit host. http://www.trevorpounds.com/blog/?p=111

0

Well, building such an old version will be hell, not to mention, very hard. I see several options:

  1. Use an older GCC to try and build the even older GCC. (Something like 3.4.5 would have more luck of working.

  2. Use the Ubuntu package for an older version of Ubuntu, say Dapper's GCC 2.95. If it doesn't install, just unpack it somewhere (should be quite straightforward, just be sure to install all dependencies in the same fashion. If this doesn't work, try a VM with an old linux install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.