public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Fw: help regarding native compiler building
       [not found] <1359555727.1001.YahooMailNeo@web161404.mail.bf1.yahoo.com>
@ 2013-01-30 15:24 ` Tango Nair
  2013-01-30 15:32   ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Tango Nair @ 2013-01-30 15:24 UTC (permalink / raw)
  To: gcc-help





hi all,

i have cross tool chain gcc4 for our target(MIPS like). 
how can i built native compiler using this cross tool chain?
any help is appreciated.

thanks in advance.


thanks & regards

tango

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fw: help regarding native compiler building
  2013-01-30 15:24 ` Fw: help regarding native compiler building Tango Nair
@ 2013-01-30 15:32   ` Ian Lance Taylor
  2013-01-30 15:47     ` Tango Nair
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2013-01-30 15:32 UTC (permalink / raw)
  To: Tango Nair; +Cc: gcc-help

On Wed, Jan 30, 2013 at 7:19 AM, Tango Nair <tangotst@yahoo.com> wrote:
>
> i have cross tool chain gcc4 for our target(MIPS like).
> how can i built native compiler using this cross tool chain?

Assuming you have a fully functioning cross tool chain, build GCC in
the usual way, but when you run configure pass --build, --host, and
--target options.  The --build option would be the system on which you
are doing the build, the host system of your cross tool chain.  The
--host and --target options should be the same, and should be the
target of your cross tool chain.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help regarding native compiler building
  2013-01-30 15:32   ` Ian Lance Taylor
@ 2013-01-30 15:47     ` Tango Nair
  2013-01-30 20:13       ` Ian Lance Taylor
  2013-01-31 11:54       ` Kai Ruottu
  0 siblings, 2 replies; 5+ messages in thread
From: Tango Nair @ 2013-01-30 15:47 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-help

thanks ian,

i tried the same way. as follows 

./configure --target=mips-unknown-linux --host=mips-unknown-linux --build=i686-pc-linux  --enable-languages=c

and exported the cross tool chain in the PATH

i could able to create the native compiler,  but it's not working on my target for simple functions such as below

int foo()
{
return 0;
}

it's giving "???bad rtl" as error.




----- Original Message -----
From: Ian Lance Taylor <iant@google.com>
To: Tango Nair <tangotst@yahoo.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Sent: Wednesday, January 30, 2013 8:54 PM
Subject: Re: Fw: help regarding native compiler building

On Wed, Jan 30, 2013 at 7:19 AM, Tango Nair <tangotst@yahoo.com> wrote:
>
> i have cross tool chain gcc4 for our target(MIPS like).
> how can i built native compiler using this cross tool chain?

Assuming you have a fully functioning cross tool chain, build GCC in
the usual way, but when you run configure pass --build, --host, and
--target options.  The --build option would be the system on which you
are doing the build, the host system of your cross tool chain.  The
--host and --target options should be the same, and should be the
target of your cross tool chain.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help regarding native compiler building
  2013-01-30 15:47     ` Tango Nair
@ 2013-01-30 20:13       ` Ian Lance Taylor
  2013-01-31 11:54       ` Kai Ruottu
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2013-01-30 20:13 UTC (permalink / raw)
  To: Tango Nair; +Cc: gcc-help

On Wed, Jan 30, 2013 at 7:32 AM, Tango Nair <tangotst@yahoo.com> wrote:
>
> i tried the same way. as follows
>
> ./configure --target=mips-unknown-linux --host=mips-unknown-linux --build=i686-pc-linux  --enable-languages=c
>
> and exported the cross tool chain in the PATH
>
> i could able to create the native compiler,  but it's not working on my target for simple functions such as below
>
> int foo()
> {
> return 0;
> }
>
> it's giving "???bad rtl" as error.

That doesn't look like a GCC error message.  I don't know what that might mean.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help regarding native compiler building
  2013-01-30 15:47     ` Tango Nair
  2013-01-30 20:13       ` Ian Lance Taylor
@ 2013-01-31 11:54       ` Kai Ruottu
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Ruottu @ 2013-01-31 11:54 UTC (permalink / raw)
  To: gcc-help

30.1.2013 17:32, Tango Nair kirjoitti:

> i tried the same way. as follows
>
> ./configure --target=mips-unknown-linux --host=mips-unknown-linux --build=i686-pc-linux  --enable-languages=c
>
> and exported the cross tool chain in the PATH
>
> i could able to create the native compiler,  but it's not working on my target for simple functions such as below
>
> int foo()
> {
> return 0;
> }
>
> it's giving "???bad rtl" as error.
>

Is it working in any way?  What will the simple tests like :
        gcc -v
        gcc --help
say?

What I have seen is that people usually don't know what a cross 
toolchain means,
or what it should do :-(   For instance what is the system it creates 
apps for, is it
some virtual "generic system". This is the case when one produces 
everything in
the cross toolchain oneself : binutils, GCC and even the C library for 
the target.
But the expectation is that the C library (runtimes) installed on the 
target is
identical with the one the cross toolchain has as its target C library. 
If one builds
the target C library oneself, it means that the target system didn't 
have it yet and
this was the reason to build it!  Otherwise the question is "Why on 
earth it was
rebuilt for the cross toolchain if the target system had it in the very 
beginning?"

So what else you did copy onto the target system besides the GCC 
binaries? What
about the C library headers, normally in '/usr/include', the libs in 
'/lib' and '/usr/lib'
in Linux?  Were these the same used in the cross toolchain? If so, they 
were once
copied onto the cross host to serve as the 'mips-unknown-linux' target C 
library
there.  Or were copied from the cross toolchain onto the 
'mips-unknown-linux'
target system...

In cases where the cross toolchain creates executables for "something 
else" than
the real target system, one should know what one does.  For instance when I
myself create executables for a CentOS 5.8 Linux/i386 system, I expect 
them to
work OK on my CentOS 6.3/x86_64 and Fedora 14/i686 systems which have
newer glibcs on them (as runtimes).  And of course if I cross compile a 
GCC for
the CentOS 5.8 host on my CentOS 6.3 system, I expect it working 
perfectly when
copied onto the CentOS 5.8 system.

Maybe simple "Hello World" apps have worked OK this far when crosscompiled
but GCC is a much more complicated application...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-30 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1359555727.1001.YahooMailNeo@web161404.mail.bf1.yahoo.com>
2013-01-30 15:24 ` Fw: help regarding native compiler building Tango Nair
2013-01-30 15:32   ` Ian Lance Taylor
2013-01-30 15:47     ` Tango Nair
2013-01-30 20:13       ` Ian Lance Taylor
2013-01-31 11:54       ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).