Re: compiling gcc 2.95.3 under ubuntu 10.04.2, x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrew, this is great news! Could you provide exact instructions on how you got this to work though? As you can tell I'm pretty new to building from source, especially an old version of GCC.

I assumed you meant using "mock" (http://linux.die.net/man/1/mock) to aid in building and to emulate a 32-bit machine.
Version 0.97-3 of mock provided with Ubuntu 10's apt-get has a bug (https://bugs.launchpad.net/ubuntu/+source/mock/+bug/600564) and I used 1.1.22 instead, trying to build gcc using something like this:

mock -r fedora-17-i386 --resultdir=/path/to/home/dir/mock/ /path/to/home/dir/c32-gcc-2.95.3-lx.rpm

I got the rpm from http://www.rpmfind.net/linux/rpm2html/search.php?query=gcc&submit=Search+...&system=&arch=i386
Even this isn't working yet (I don't have root access to the server and mock for some reason refuses to run this without them), but am I on the right path at least?

Cheers,
Roman.

On 04-Apr-2012, at 9:17 , Andrew Haley wrote:

> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux