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: Building a static toolchain ?


On 2010-03-31 22:37, Trevor Woerner wrote:
Just out of curiosity... I keep thinking about this question off and
on and I just can't figure out what the advantage would be to having a
toolchain that doesn't use the build host's language libraries. So it
can be copied to and run from another machine (one which may be using
a different version of, say, glibc)?

Usually that is the goal, yes. Note the following fine points, however:


- glibc is always compiled with a 'minimum supported kernel version',
so even if you link your application statically with it, that does not
guarantee that the application runs on any lower kernel version.

- newer glibc versions are always compatible with older glibc versions
(on the same architecture, of course), but not the other way around.

So linking all toolchain executables completely static is really a tiny
bit overkill. :)  It is mostly enough to:

- build your toolchain on an "oldish" Linux distro (at least, one with
an oldish version of glibc), such as Debian Stable or Red Hat 5, or even
4, if you really want to go for lowest common denominator.

- make sure any extra dependencies, usually libgmp and/or libmpfr,
*are* statically linked into the toolchain executables, since not
everybody will have those as .so files on their system, or may have
different, incompatible versions.

--
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]