From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9647 invoked by alias); 31 Mar 2010 20:50:25 -0000 Received: (qmail 9631 invoked by uid 22791); 31 Mar 2010 20:50:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,TW_BG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from tensor.andric.com (HELO tensor.andric.com) (87.251.56.140) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Mar 2010 20:50:19 +0000 Received: from [IPv6:2001:7b8:3a7:0:54ae:997c:26d6:73c5] (unknown [IPv6:2001:7b8:3a7:0:54ae:997c:26d6:73c5]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A69495C59; Wed, 31 Mar 2010 22:50:15 +0200 (CEST) Message-ID: <4BB3B590.3080102@andric.com> Date: Wed, 31 Mar 2010 20:50:00 -0000 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.2pre) Gecko/20100328 Lanikai/3.1b2pre MIME-Version: 1.0 To: Trevor Woerner CC: crossgcc@sourceware.org Subject: Re: Building a static toolchain ? References: <201003242043.51934.yann.morin.1998@anciens.enib.fr> <3530b0eb1003241304q5504a690sa1a64230e6687e3b@mail.gmail.com> <201003252324.12780.yann.morin.1998@anciens.enib.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00140.txt.bz2 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