public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* build cross gcc with taget, host and build all differnt
@ 2012-01-12 18:15 Markus Henschel
  2012-01-12 19:02 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Henschel @ 2012-01-12 18:15 UTC (permalink / raw)
  To: gcc-help

Hi, 

I'm trying to build a gcc on linux that runs on windows and builds binaries for freebsd. Basically I'm doing something like this:

--configure -target=i386-pc-freebsd -build=i686-pc-linux-gnu -host=i686-mingw32 ...

I omitted the other switches like -prefix, --with-sysroot and so on.

What I'm unsure about is if this scenario is supported in that way. I mean the build process runs on linux and uses an existing cross compiler to create a gcc that runs on windows. But in the process gcc has to create some libraries like libgcc or libstdc++. It cannot use itself for this because host and build systems are different. Is the gcc build so clever to automatically build another cross compiler that runs on linux and builds code for freebsd for that purpose or do I have to create it myself?

Thanks

Markus

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

* Re: build cross gcc with taget, host and build all differnt
  2012-01-12 18:15 build cross gcc with taget, host and build all differnt Markus Henschel
@ 2012-01-12 19:02 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2012-01-12 19:02 UTC (permalink / raw)
  To: Markus Henschel; +Cc: gcc-help

Markus Henschel <markus.henschel@yager.de> writes:

> I'm trying to build a gcc on linux that runs on windows and builds binaries for freebsd. Basically I'm doing something like this:
>
> --configure -target=i386-pc-freebsd -build=i686-pc-linux-gnu -host=i686-mingw32 ...
>
> I omitted the other switches like -prefix, --with-sysroot and so on.
>
> What I'm unsure about is if this scenario is supported in that way. I mean the build process runs on linux and uses an existing cross compiler to create a gcc that runs on windows. But in the process gcc has to create some libraries like libgcc or libstdc++. It cannot use itself for this because host and build systems are different. Is the gcc build so clever to automatically build another cross compiler that runs on linux and builds code for freebsd for that purpose or do I have to create it myself?

You have to start with two compilers.  One which is --target=i686-ming32
and one which is --target=i386-pc-freebsd.  Build and install those,
using the same --prefix option.  Then run your configure command above,
again with the same --prefix option, and everything should work.  (You
may have to put ${exec_prefix}/bin on your PATH for the final build, I'm
not sure).

In saying this I'm skipping over library issues, but since you mention
--with-sysroot I assume you're prepared to handle them.

Ian

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

end of thread, other threads:[~2012-01-12 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12 18:15 build cross gcc with taget, host and build all differnt Markus Henschel
2012-01-12 19:02 ` Ian Lance Taylor

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).