This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compiling gcc 2.95.3 under ubuntu 10.04.2, x86_64


On 04/03/2012 06:12 PM, Roman Suvorov wrote:

> Here's the relevant bit from the website I referenced:
> ***
> GCC 2.95.x
> About half of the changes needed for GCC 3.0.x are also applicable here (e.g. Makefile fixes, lib32 fix-ups, spec flags, etc). Unfortunately, the other half are workarounds for compiler and glibc nuances that are fixed in later releases. One of the big changes needed is a workaround for the internal use of an _IO_MTSAFE_IO define. This define causes an error due to a missing header due to difference in glibc headers included with modern Linux distributions (see here and here for more info). Luckily, a straightforward workaround is to use glibc's generic stdio-lock.h header, which in my case needed to be pulled from the glibc 2.10.1 source to match my installed version. Additionally, another glibc fix is required due to an unnamed union declaration (see this bug) inside a pthread header which is not supported by GCC 2.95.x. To workaround the issue I pulled in the glibc 2.10.1 system dependent pthreadtypes.h header from the source and appended a variable name (e.g. __gcc_295!
 _workaroun
d__) to the unnamed union declaration. Build this version using the provided patch @ (gcc-v2.95.x.debian.x86_64.diff)
> and the following instructions:

Well, what do you know?  I just bootstrapped gcc 2.95.3 on Fedora 17
(i686 mock) with no changes at all.  The only problem I had was with
texinfo, where the in-tree version supplied with gcc didn't work, so
I deleted it and used Fedora's own.

"make install" produces a fully-functional gcc that you can use in a
x86_64 system:

zebedee:~ $ /usr/local/bin/gcc home/aph/hello.c -Wa,--32
/usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
zebedee:~ $ ./a.out
Hello, world!

The -Wa,--32 (which tells the native assembler to use 32-bit source) is
a pain, though.  I guess you'd want to fix that by installing an explicit.
i686-pc-linux-gnu-as and building gcc 2.95 with that.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]