From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id CC55E3858022 for ; Fri, 5 Mar 2021 00:07:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC55E3858022 Received: by mail-qt1-x831.google.com with SMTP id w1so442818qto.2 for ; Thu, 04 Mar 2021 16:07:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ExaUdFwvrLOHLWLZknuAvglzN2k3GrHoSugDX5/igOk=; b=uZJ5lNs7nvXDwkwC1jBKp+Ww9SIgVkP/A+xin8MVCA44V1TjdWI7liBBZLsiOSs8po enGz7j6Viy3vX8U3G7FZHUoxt3RkyCPqFmt6iBYpsSMMDCYZiqmxMVYhFgtZ3wcjq56r jK8CMvqD4AgOtseLwoP82r8RaaxWGTiDq+bF2orPHV3i4TtrN03dO0cVoWG3a4mQL/qq /JXgYrY7KO0ziy7EwjKLyjf3XGDrwTqz8QwD+XeXxLxsNC0F6f4NR7C2V5eAnFWMV1Y/ tx2jeaQUIOwOWRhSvoi9cA14BKOvLgIZ3u5zS3Iq70EgWRmGqYbm7YnHs9jHCigF5mLf C2fA== X-Gm-Message-State: AOAM533KFaC1+Q7y/6hKxqHfW/Dz39uQzYQeSymQdzWSGyh0i8RUDnBy DLKWg34oD7DRmcHgZVME8E/mUj8cpc7nFA== X-Google-Smtp-Source: ABdhPJyLGpMUKkhW5n0YImr80YOFGnc9fLxSIP1m0kvByvOAOFFW/wmVhPZnUM/qTKcgAw660sN3/A== X-Received: by 2002:ac8:578f:: with SMTP id v15mr6275932qta.172.1614902857186; Thu, 04 Mar 2021 16:07:37 -0800 (PST) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id p12sm802613qtw.27.2021.03.04.16.07.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Mar 2021 16:07:36 -0800 (PST) To: Peng Yu Cc: Florian Weimer , Peng Yu via Libc-help References: <87wnunnq3q.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Subject: Re: Directory structure of glibc and header files installed on Linux Message-ID: Date: Thu, 4 Mar 2021 21:07:33 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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: Fri, 05 Mar 2021 00:07:39 -0000 On 04/03/2021 19:37, Peng Yu 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. Sorry, but you will need to get used to some terminology and how toolchain work. You can either read the build-many-glibcs.py script and see how it accomplish the bootstrap you check with multiple online resources on how this is done (for instance on how crosstool-ng does it [1] or how Linux from Scratch work [2]). > >>> 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? I just gave you the simplest way on how to create a bootstrap compiler, did at least try and checked the results? > > 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. A sysroot is a folder which contains a minimal filesystem (especially libraries, the C library and header files). I just paste the *exactly* sequence of command using build-many-glibcs.py to create one using gcc targeting glibc. You will need to read build-many-glibcs.py [3] to check exactly on how it accomplish it, > >> (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. > > [1] https://crosstool-ng.github.io/docs/toolchain-construction/ [2] http://www.linuxfromscratch.org/ [3] https://sourceware.org/git/?p=glibc.git;a=blob;f=scripts/build-many-glibcs.py;h=580d25e8ee4b3ff5f99fb957e6e533035bcc4ebc;hb=HEAD