public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: Peng Yu <pengyu.ut@gmail.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	Peng Yu via Libc-help <libc-help@sourceware.org>
Subject: Re: Directory structure of glibc and header files installed on Linux
Date: Fri, 05 Mar 2021 02:01:03 +0300	[thread overview]
Message-ID: <358ee421ee4a9bd37a62ef21aea0773efffa8024.camel@yandex.ru> (raw)
In-Reply-To: <CABrM6w=AbZie+vAYd5_ihT8ceJdMFj4f-B4RpM5EApa2JXVA7Q@mail.gmail.com>

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.


  reply	other threads:[~2021-03-04 23:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  2:37 Peng Yu
2021-03-04 10:57 ` Florian Weimer
2021-03-04 14:19   ` Peng Yu
2021-03-04 14:41     ` Adhemerval Zanella
2021-03-04 16:56       ` Peng Yu
2021-03-04 19:58         ` Adhemerval Zanella
2021-03-04 22:37           ` Peng Yu
2021-03-04 23:01             ` Konstantin Kharlamov [this message]
2021-03-05  2:38               ` Peng Yu
2021-03-05 11:19                 ` Adhemerval Zanella
2021-03-05  0:07             ` Adhemerval Zanella
2021-03-05  2:30               ` Peng Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=358ee421ee4a9bd37a62ef21aea0773efffa8024.camel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=pengyu.ut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).