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: build cross gcc with taget, host and build all differnt


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


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