public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Michael Zintakis <michael.zintakis@googlemail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: building native cross compiler
Date: Mon, 14 Mar 2011 01:01:00 -0000	[thread overview]
Message-ID: <mcry64i4ism.fsf@google.com> (raw)
In-Reply-To: <4D7D666C.8010400@googlemail.com> (Michael Zintakis's message of	"Mon, 14 Mar 2011 00:50:52 +0000")

Michael Zintakis <michael.zintakis@googlemail.com> writes:

>> In order to build a cross-compiler (your GCC2) you must first build a
>> cross-binutils.
>>   
> Where do I get these as I did check the gcc web site, but could not
> find them anywhere (apologies for this daft request!)

http://sourceware.org/binutils/

>>> 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.
> Ah! This is exactly what I did with mpc and gmp packages - copied them
> into the main gcc source directory (gcc-test/gcc-4.5.2) as this is
> what was suggested in the building requirements section. Is that
> wrong?

That works fine with mpc and gmp, as they are independent of the gcc
source directories.  It leads to more trouble with the binutils, as the
binutils and gcc share some source directories.

>>   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.
>>   
> OK, if I get binutils and gcc sources I presume if I run diff on both
> directories for all 3 packages and they match then I am OK and I could
> then dump all sources in the main gcc source directory and issue make,
> is that right?

In principle, yes.

> I also presume that my 'bubble' error I described in one of my
> previous posts has something to do with the fact that I copied gmp and
> mpc sources to the main gcc source directory prior to starting the
> build or is that not the case (I am guessing here as I do not know
> what is causing it really)?

Putting gmp and mpc in your gcc source directory should work fine, that
is most likely not the issue here.

>>> 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.
>>   
> I did and it refers to the three libraries I have (although as sources
> in the GCC source directory) or have I missed something?

What do you see in the config.log file?

Ian

  reply	other threads:[~2011-03-14  1:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 14:56 Michael Zintakis
2011-03-11 16:00 ` Ian Lance Taylor
2011-03-11 16:56   ` Michael Zintakis
2011-03-11 18:57     ` Ian Lance Taylor
2011-03-11 20:47       ` Michael Zintakis
2011-03-11 21:21         ` Ian Lance Taylor
2011-03-11 23:44           ` Michael Zintakis
2011-03-12  0:06             ` Ian Lance Taylor
2011-03-13 14:23               ` Michael Zintakis
2011-03-13 18:45                 ` Ian Lance Taylor
2011-03-13 22:10                   ` Michael Zintakis
2011-03-14  0:34                     ` Ian Lance Taylor
2011-03-14  0:51                       ` Michael Zintakis
2011-03-14  1:01                         ` Ian Lance Taylor [this message]
2011-03-14  1:30                           ` Michael Zintakis
2011-03-14  1:39                             ` Ian Lance Taylor
2011-03-14  1:47                               ` Michael Zintakis
2011-03-14  1:55                                 ` Michael Zintakis
2011-03-14  2:01                                   ` Ian Lance Taylor
2011-03-14  2:08                                     ` Michael Zintakis
2011-03-14  3:48                                     ` Michael Zintakis
2011-03-14 15:26                                       ` Ian Lance Taylor
2011-03-14 15:49                                         ` Michael Zintakis
2011-03-14 16:00                                           ` Michael Zintakis
2011-03-14 16:25                                             ` Ian Lance Taylor
2011-03-14 16:34                                               ` Michael Zintakis
2011-03-14 16:02                                           ` Ian Lance Taylor
2011-03-14 16:31                                             ` Michael Zintakis
2011-03-14 17:23                                               ` Kai Ruottu
2011-03-14 18:03                                                 ` Michael Zintakis
2011-03-14 19:07                                                   ` Kai Ruottu
2011-03-14 19:25                                                     ` Michael Zintakis
2011-03-14 20:20                                               ` Ian Lance Taylor
2011-03-14 20:35                                                 ` Michael Zintakis
2011-03-14 21:12                                                   ` Ian Lance Taylor
2011-03-15  2:25                                                     ` Michael Zintakis
2011-03-15  4:23                                                       ` Ian Lance Taylor
2011-03-15  5:01                                                         ` Mick McCreath
2011-03-16 17:26                                                           ` Michael Zintakis
2011-03-20 15:48                                                           ` Michael Zintakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcry64i4ism.fsf@google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=michael.zintakis@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).