Re: Building a cross-compiler

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

 



This set of scripts builds several things we use, including the gnu tool chain.

I tried writing it as a "make" file like thing, but that really didn't
work well.

So what it does is a fast compressed tar of the result of each step,
so you can start at or restart from any step. ie. You can make
mistakes faster, and hopefully converge on the right solution.

ie. You need buckets of disk space and a fast machine.

To fit all this into an email, I have excluded the source code tar
balls I use, anyway, you are probably using different ones.

Since you are probably using a different version of the tarballs than
I'm using, it's probably just best you d/load and move them into the
tarball directory your self.

You'll also have to tweak the include/BuildBlah.rb script to specify
the correct version.

If you're using a different version, you may well not need the patches.

For example the new_make_multiline_behaviour.patch copes with new
behaviour of gnu make when dealing with multiple line commands.

If you have an old version of make, you don't need it.

If you have a newer version of gcc, the patch has probably been applied.

GTC
|-- build_ecos
|-- build_nullmodem
|-- build_ruby
|-- build_tool_chain  <--- this is the script you're interested in.
|-- include
|   |-- BuildBinUtils.rb
|   |-- BuildEcos.rb
|   |-- BuildGcc.rb <-- This configures things for the right versions, options etc. Tweak here
|   |-- BuildGdb.rb <-- This configures things for the right versions, options etc. Tweak here
|   |-- BuildGnuToolChain.rb <-- This configures things for the right versions, options etc.
|   |-- BuildMachine.rb <-- this does the work
|   |-- Privilege.rb
|   |-- Utilities.rb
|   `-- WrapExecutables.rb <-- A bit weird, see body of email...
|-- patches <-- Patches go here
|   |-- ecos-cvs-1182121504.patch
|   |-- modra_binutils_fix.patch
|   `-- new_make_multiline_behaviour.patch
|-- result <-- Results end up as a tarball here
|-- tarballs <-- Src tar balls live here.
|-- test <-- Unit tests for the scripts live here.
|   |-- TC_AbstractBuildContext.rb
|   |-- TC_Action.rb
|   |-- TC_ActionConfigure.rb
|   |-- TC_ActionGet.rb
|   |-- TC_ActionLibraryPathWrapper.rb
|   |-- TC_ActionList.rb
|   |-- TC_ActionMake.rb
|   |-- TC_ActionMakeEcos.rb
|   |-- TC_ActionMakeLink.rb
|   |-- TC_ActionPatch.rb
|   |-- TC_ActionUnpack.rb
|   |-- TC_EcosContext.rb
|   |-- TC_GnuContext.rb
|   |-- TC_Stub.rb
|   |-- TC_WrapExecutables.rb
|   `-- TS_BuildToolChain.rb
`-- wrap_executable

5 directories, 33 files

The Wrap executable idea is a bit weird, perhaps I should back off
from that one...

I found the team evolved a diverse set of distributions and versions
of linux. And since gcc seems to _insist_ on being a dynamically
linked, not a statically linked executable these days.... It can be a
problem. A Big Problem.

You have to build on the _oldest_ platform (usually with the slowest
hardware too) in the team... and hope the rest have backward
compatible DLL's lying around!

Or you have to build afresh on _every_ distro / version used.

Or you force every on the team to the exact same distro / version.

Or you have do what I've done. Which is deliver _every_ dll used by
_every_ executable and replace every executable by a shell script that
loads the delivered dlls.

Have fun.  The license on this one GPL, since it has chunks of GPL'd
and copied from GPL'd code in it.


On Mon, 28 Jan 2008, Wenton L. Davis wrote:

John Carter wrote:

It's a _very_ dark art....
No kidding!!!!

Some hints:...

OK, this could very easily be the problem. I was assuming this was built as a part of the gcc build, but that does not appear to be the case. But if the compiler needs libc to build, and libc is built by compiling.... which came first, the chicken or the egg?

The libc headers are needed to build the compiler chicken which grows
up to compile the libc egg.

Well, I'm not real familiar with ruby (it's on my list of languages to look at), but I can't imagine it's so bizarre I can't glean a little info from it. If you would please, send me your scripts, and even if they don't work, they might give me some more ideas. Thanks!

http://www.ruby-doc.org/

is a very useful resource.

http://ruby-lang.org for the ruby source code.

(My script even builds ruby :-)


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter@xxxxxxxxxx
New Zealand

Attachment: GnuToolChainBuild.tbz
Description: Binary data


[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