Re: building native cross compiler

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

 



Michael Zintakis <michael.zintakis@xxxxxxxxxxxxxx> writes:

>>> /home/mz/gcc-test/gcc-build/./gcc/as: line 83: exec: : not found
>>>     
>>
>> You must build and install a cross-binutils with the same --target and
>> --prefix option before you configure and build gcc.
>>   
> I am a bit confused, I have to admit! It is true that I did use my own
> GCC compiler (on the host machine) to get the GCC2 built (skipping
> step one of the plan), so from what I gather from your response my
> host compiler needs to have all the binutils for the target platform
> installed as well, is that correct?

In order to build a cross-compiler (your GCC2) you must first build a
cross-binutils.

> Also, if I build GCC1 should I specify the different target platform I
> am interested in (ppc in my example) so that it could build its own
> binutils for that platform? Would that work?

No.

> Following from the "Building a cross compiler" section it tells me
> that by issuing "make" it "Builds target tools for use by the compiler
> such as binutils (bfd, binutils, gas, gprof, ld, and opcodes) if they
> have been individually linked or moved into the top level GCC source
> tree before configuring." - what does that mean exactly I am unclear?

This refers to a procedure which I do not recommend, as it will lead you
into even deeper complexities.  It is a way that experienced GCC
developers speed up the build.  You can copy the source directories
bfd/gas/ld/binutils from the binutils into your gcc directory, and then
build both the binutils and gcc at once, rather than doing separate
builds.  However, this only works if the shared directories such as
include and libiberty are exactly matched, which means in practice that
you need to be working with development sources rather than releases, or
you need to understand the code in sufficient detail to address the
conflicts which occur.

> The strange thing is that my host machine GCC already has i686 and
> x86_64 binutils installed (though as a "ready-made" package - I
> haven't compiled this from source so can't vouch for the correctness
> of these packages) and when I attempted to build GCC2 with
> "--target=i686-redhat-linux" it also failed! I know the host GCC on
> that machine works as I also do compilation for boh x86_64 and i686
> arches successfully. Maybe I am missing something else.

Read the FAQ entry I mentioned.

Ian


[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