This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: Tutorial


Francesco, All,

On Friday 21 January 2011 15:59:49 Francesco Turco wrote:
> > Installing the pass 1&  2 compilers in the final prefix is dubious. It
> > /might/ break in some cases, especially when doing a canadian-cross.
> Why? Where should I put it?

The core compiler is not the same as the final one. Especially, the files
that get installed by core compiler are different from the files instaleld
by the final compiler. Also the set of files may be different, (that is,
the core compiler instaling fiels not installed by the final compiler).

You do not want those files to be available in the final toolchain.

And as to where it should get installed: anywhere that is not the final
toolchain directory. A temporary place that you can get rid of later.

> Fixed. I chose not to use your explaination directly, but please, don't 
> take it personally :-)

No problem at all! :-) It was not perfect at all, as I wrote it directly in
the mail, with about no review.

I'll most probably rework it as well, and include that in the crosstool-NG
documentation, with a pointer to your tutorial as well, if you don't mind.
Really, you gave a kick in the anthill, thank you! ;-)

> Anyway, I put a link to it at the end of the tutorial.

:-)

> Also, I fixed other minor things.

While you are at it...

Maybe add the ordered list of steps to do. Although your introduction is
quite complete, a list such as the folowing is very nice to sumarise the
process:
 1 kernel headers
 2 C library headers
 3 GMP
 X ...
10 gcc pass 2

And I would rename "gcc pass 2" into "final gcc". When you upgrade to NPTL,
gccc pas 2 will be a completely different thing, while the final gcc will
still be (almost) the same. But that's nit-picking. ;-)

Binutils does not use GMP, MPFR and MPC. That the option
is present and recognised by the configure script is just hapenstance. gcc
and binutils share the same configure 'template', so the GMP, MPFR and MPC
options sneaked into binutils' configure. Just remove them from the configure
command line, they are not used.

Also, the sysroot is out-side the gcc prefix. This is not really wrong
per-se, but then the toolchain is not relocatable. If you want to move the
toolchain later into a different directory, gcc will get confused, and will
not find the sysroot. The sysroot ought to be in a sub-directory of the
gcc prefix.

In the introduction, you define some terms. That's very good. You define
the host and the target platforms (machines), but you missed the build
machine. The build machine is where the current code is actually built.
In the case of a cross-compiler, build == host != target. But if you get
build != host != target, then you get a canadian-cross. Here's a quick
table listing all conbinations:

build == host == target    native compiler
build == host != target    cross-compiler
build != host != target    canadian-cross compiler
build != host == target    cross-native compiler

In the third case, it does not matter if build == target or not.

Also, I would also state that, even if two platforms (machines) are the
same architecture, the same OS and the same C library, but the versions or
the configuration differ, then those two machines are not the same, and the
compiler running on one and generating code for the other is still a cross
compiler, not a native compiler.

For all the required packages (eg. GMP, MPFR... uClibc), I would point to
the main page of the associated project, or at least to the download page.

> I chose not to include PPL, CLooG-PPL and libelf as they are still not 
> strictly required and they complicate things a little bit. Please 
> remember that my tutorial is for newbies (as I am). Experts surely don't 
> need it for deploying a cross-compiler.

Yeah, right. That's pretty complete as it is. :-)

Nonetheless, as you said you would "add new things as soon as I learn them"
I'm only suggesting additions in order to enlighten you and your readers! ;-)

And documenting them for me at the same time! :-]

> The link for the tutorial has changed as I switched from Ubuntu to Debian:
> http://fturco.org/wiki/doku.php?id=debian:cross-compiler

Well, this is quite generic, and does not (should not!) depend on the host
distribution.

> That said, my tutorial is still not finished because my knowledge of 
> cross-compilers is limited. I'll add new things as soon as I learn them.

This is so far very good! :-)

One thing that may be of great use when doing cross-development is a debugger.
You have the cross-gdb (that runs on the host) and the gdbserver (that runs
on the target). Or you can have a native gdb that runs directly on the target.
Could be a very nice addition to your tutorial. :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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