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: help needed for builing gcc tool-chain


On 11 February 2012 17:03, Prashant Batra (prbatra) wrote:
> Hi All,
>
> I am trying to build a 32 bit gcc/g++ ?tool-chain on a x86_64 bit Intel machine with, Red Hat Linux Enterprise -5 (2.6.18 kernel).
>
> Gcc version of my machine is -
> gcc -v
> Using built-in specs.
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
>
> I tried with the procedure mentioned on gnu wiki, ?also mentioned in LFS. But none of the attempts was successful.
>
> I? have some basic questions here :
>
> Changing the prefix to some custom location? other than /usr/src

I think the default is /usr/local/, not /usr/src

> should make all the tools installed in the custom location?

Yes

> I want to run the tool chain on this machine only, so my host and build systems are same, and I can omit them while configuring all my tools (binutils, gcc, glibc).
> Is this correct?

Yes.

> The target of all these tools while configuring should be i486-gnu-linux or I can omit this so that the gcc/g++ gets? compiled for x86_64 and when I need a 32 bit executable,
> I can use -m32 switch while compiling?

You can compile with -m32 to produce 32-bit output and you could add
-march=i486 to ensure it will not use any instructions not available
on an i486 processor.   But if you want a compiler that always
produces 32-bit output then yes, you could configure with
--target=i486-gnu-linux instead.

> Will 32 bit static and shared libraries be available in this case?

Yes.

> I want static libraries for both gcc and stdc++, is there any special flag that I should give/or not give to build these static libraries?

No, they're built by default.

> Can someone please point me in right directions, as I am doing this for the first time? Any links to the steps will be really helpful.

I already gave you http://gcc.gnu.org/wiki/InstallingGCC - if that
doesn't work you need to say how you configured and what errors you
get, it should work fine.  It will help if you stop creating a new
thread for every mail and reply to mail in an existing thread, so we
can see the thread history more easily.


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