From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24835 invoked by alias); 21 Dec 2007 18:30:17 -0000 Received: (qmail 24825 invoked by uid 22791); 21 Dec 2007 18:30:16 -0000 X-Spam-Check-By: sourceware.org Received: from mail.zeugmasystems.com (HELO zeugmasystems.com) (192.139.122.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Dec 2007 18:30:05 +0000 Received: from rocktron ([10.18.28.236]) by zeugmasystems.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 21 Dec 2007 10:30:02 -0800 Message-ID: <1106742C6EE944BC9D7488BFB2CC7E76@rocktron> From: "Kaz Kylheku" To: "NightStrike" Cc: "gcc-help" References: In-Reply-To: Subject: Re: More questions on sysroots Date: Fri, 21 Dec 2007 18:30:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00382.txt.bz2 "NightStrike" wrote: > When you say "the root of the target filesystem", do you mean that > it's the root of a directory structure containing target files that > will be used while creating the toolchain, or that it's the root of a > directory structure where the final toolchain, once built, will look > for target files? I'm guessing the answer is "both"..... The asnwer is both. For instance, suppose you're making a cross-compiled LInux system, and building a final user-space GCC which is integrated with the GNU C library. You would already have glibc built into the sysroot (as well, you'd of course spin it into a package to install on the target system). >> If we made that the sysroot, these would get mixed into the root. > > Is it absolutely *required* that the sysroot be a subdirectory of > prefix to make the final toolchain relocatable, or is this where > with-build-sysroot comes into play? More precisely, from http://gcc.gnu.org/install/configure.html: `` If the specified directory is a subdirectory of ${exec_prefix}, then it will be found relative to the GCC binaries if the installation tree is moved. '' I think where --with-build-sysroot comes into play is that it allows these target system materials (like glibc) to be pulled from somewhere other than the sysroot location during the building of the cross compiler. This provides some flexibility as to how to structure the cross compiler build process, in certain situations. I've built an entire Linux distro, including a cross toolchain that runs on a build systems /and/ a native toolchain that runs on the target, without ever needing to use --with-build-sysroot. It wouldn't be that helpful because as soon as the compiler is built with the glibc materials, I want to run it. And at that point, those materials must be in the sysroot location. But I can imagine some situations where you don't want to run the compiler that is built, but perhaps package it for someone else to run somewhere else. > Also, is there an option that's just plain "--sysroot"? Does that > have any meaning? Should it ever be used? That's not a build configuration option, but a run-time switch supported by the gcc front end to override the sysroot location. There is probably a situation in which this comes in handy, just not the normal case. I'm only guessing, but it's probably useful during the staging of gcc. If you have a partially built gcc which doesn't know anything about any sysroot, then --sysroot can tell it where to look.