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

See crosstool-NG 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: Resetting my make crosstool-ng bearings


On Wednesday 06 March 2013 Michael Powell wrote:
> Hello,
> 
> Learning this for the first time, it's a lot to digest and keep
> organized. Any insights are welcome.
> 
> I'd like to rebuild the crosstool-ng first, then rebuild the cross
> compiler, with the right options.
> 
> For the crosstool-ng itself (ct-ng), leave ./configure minimal as
> possible? Using --prefix=/opt/crosstool-ng? I think I left this fairly
> plain before, simply /opt, and things landed in /opt/bin (not well
> organized on my part).

Here's what I do:
 1- install crosstool-NG:
      cd crosstool-ng-version
      ./configure --prefix=/opt/ct-ng
      make
      make install
      cd ..
      rm -rf crosstool-ng-version
      export PATH="${PATH}:/opt/ct-ng/bin"

 2- chose a place to install the toolchains:
    - all my toolchains will each be in a sub-dir of: /opt/x-tools

 3- build each toolchain with the "prefix" set to: /opt/x-tools/${CT_TARGET}
    - CT_TARGET is the tuple of the toolchain. If you do not want to use
      the tuple in the install dir, then set the "prefix" to a constant, eg.:
        /opt/x-tool/toolchain-for-my-rpi
        /opt/x-tools/toolchain-for-my-router/test-1
        /opt/x-tools/toolchain-for-my-router/test-2
      and so on.
    - I recommend installing onoy *one* toolchain in each "prefix".

In crosstool-NG, the default "prefix" is ${HOME}/x-tools/${CT_TARGET}:

1a- we can not expect users to have write access to random place
1b- virtually all users have write access to their ${HOME}
    -> Install in a sub-dir of ${HOME} ; ~/x-tools seems like a nice
       place to be. ;-)

 2- using ${CT_TARGET} in the "prefix" ensures that only one toolchain
    will be installed in its prefix, at least each sample bundled with
    crosstool-NG will install in different "prefix".

> When we're talking about the cross compiler itself, configure for
> /opt/cross/PLATFORM/x-tools/bin/TARGET-% where PLATFORM is x86 (the
> build environment) and TARGET is arm. Both are Linux. Do I need to
> mention that anyway?

It's up to you to specify the host. If you use the toolchains only on
your machine, then there is no need. However, if you share (eg NFS)
the toolchains to different hosts (eg. Cygwin and Linux), then it
can be a good idea to have the host in the paths names. But I'd do
it the other way around, ie. set "prefix" to: /opt/cross/TARGET/PLATFORM
My reasoning being that the target is more important than the build machine.
Also, it is much more easy to package all the toolchains for a target if
they all are in the same tree structure.

Thus, you'd have, for example:
    /opt/cross/armv6-rpi-linux-gnueabi/cygwin/bin/armv6-rpi-linux-gnueabi-gcc
    /opt/cross/armv6-rpi-linux-gnueabi/linux-x86/bin/armv6-rpi-linux-gnueabi-gcc
    /opt/cross/mips-foo-linux-uclibc/cygwin/bin/mips-foo-linux-uclibc-gcc
    /opt/cross/mips-foo-linux-uclibc/linux-x86/bin/mips-foo-linux-uclibc-gcc

> The first go round, I ended up with something like,
> arm-unknown-linux-gnueabi-% for tool chain names. If I can or should
> further identify the unknown I'd like to. Like does that specify a
> part number or something?

This is called the tuple of the target. A tuple is a three- or four-part
description of the target, each part being separated by a hyphen. See a
nice and complete description there (although the given examples are a
bit out-dated):
    http://airs.com/ian/configure/configure_4.html

(I would pretty much appreciate adding such a description in ct-ng's
doc, too ;-) ).

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]