From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::602]) by sourceware.org (Postfix) with ESMTPS id F27013858022 for ; Thu, 4 Mar 2021 23:01:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F27013858022 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hi-angel@yandex.ru Received: from myt2-264a32256793.qloud-c.yandex.net (myt2-264a32256793.qloud-c.yandex.net [IPv6:2a02:6b8:c12:1a07:0:640:264a:3225]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 928B66682D98; Fri, 5 Mar 2021 02:01:09 +0300 (MSK) Received: from myt3-07a4bd8655f2.qloud-c.yandex.net (myt3-07a4bd8655f2.qloud-c.yandex.net [2a02:6b8:c12:693:0:640:7a4:bd86]) by myt2-264a32256793.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 5v1ZAaYgLk-19HS1Bum; Fri, 05 Mar 2021 02:01:09 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1614898869; bh=BMbNCSjak4oB/cyceeEtc8kxfp27nWvSuObvtDfJ++U=; h=In-Reply-To:Cc:To:From:Subject:Message-ID:References:Date; b=ZOPKGmhwshy1zBMnbCK2M1KMIAn/nSlSaa/mCFbw1kMNTOqkBzfGCwoiew6SBjYxx VjehZziQinqJwpA5bgIkQUVSSX2nl7+7KcNNGrnNA5UgNbNKaFO/0N0fMDzAJIiolB iTbAP1OmO2hRg7M5zlcoLuNHBwijnrWs3tiomwCQ= Authentication-Results: myt2-264a32256793.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt3-07a4bd8655f2.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 9BhH2xuqgK-18nSDt50; Fri, 05 Mar 2021 02:01:08 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Message-ID: <358ee421ee4a9bd37a62ef21aea0773efffa8024.camel@yandex.ru> Subject: Re: Directory structure of glibc and header files installed on Linux From: Konstantin Kharlamov To: Peng Yu , Adhemerval Zanella Cc: Florian Weimer , Peng Yu via Libc-help Date: Fri, 05 Mar 2021 02:01:03 +0300 In-Reply-To: References: <87wnunnq3q.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 23:01:15 -0000 On Thu, 2021-03-04 at 16:37 -0600, Peng Yu via Libc-help wrote: > Hi Adhemerval, > > > The usual process of installing the glibc is during either a work rebuild on > > a > > sysroot (like Linux From Scratch does) or within a sysroot (like > > build-many-glibcs.py > > does). > > These are too complicated at this moment. I do think that a verbal > explanation of the directory structure (target Linux as an example) is > more helpful. > > > > Do you have to build glibc before running build-many-glibcs.py? How to > > > run build-many-glibcs.py? It seems that it have options. I am not sure > > > what options I should use. Could you show me the complete command? > > > > The build-many-glibcs.py requires some tools, like a working gcc, python3, > > bison, and the other usual tools required to build gcc and glibc. The > > simplest > > way to use is: > > This also could be a problem due to the dependencies. Is there a > walkthrough with the exact set of commands based on a vanilla ubuntu > system? > > For example, you mentioned sysroot. I am not familiar with it. An > exact sequence of commands should be helpful as the goal here is not > to learn sysroot. > > > (1) glibc-git$ ./scripts/build-many-glibcs.py checkout > > /path/to/place/source/and/binaries > > (2) glibc-git$ ./scripts/build-many-glibcs.py host-libraries > > (3) glibc-git$ ./scripts/build-many-glibcs.py compilers x86_64-linux-gnu > > (4) glibc-git$ ./scripts/build-many-glibcs.py glibcs x86_64-linux-gnu > > > > The (1) will download the required source (binutils, linux, gcc, > > glibc, math libraries), (2) will > > build the math libraries used in gcc built, (3) will build a bootstrap > > compiler targetting > > x86_64-linux-gnu, and finally (4) will build a glibc using the > > bootstrap compiler built. FWIW, whenever I need to build a project I don't know how to build yet, I often look at how my distro does that. If it's something complicated (which seems to be the case with glibc), I use the configuration provided by my distro. You said you're using Ubuntu. I found that Ubuntu provides a way to build a package from source by using `apt source …` and then `dpkg-buildpackage …`, see: https://askubuntu.com/a/246721/266507 (unless I misunderstand something, the `dpkg-buildpackage` will probably run a script that in turn runs `configure`, `make`, etc, and at the end would package a deb file). Side note: apt will download sources for the version of glibc that is installed in your Ubuntu. Ubuntu is mostly known as a distro providing ancient software (except perhaps browsers), so the glibc you'll get will likely be very old. It may or may not be what you want. However, even if it's not what you want, you could just replace the sources that apt downloaded for you with the actual latest version of glibc, and make it build them.