From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Peng Yu <pengyu.ut@gmail.com>
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: Thu, 4 Mar 2021 11:41:40 -0300 [thread overview]
Message-ID: <CAMXh4bW=kh5K3=fD1HqbXfRC8r4tmSjsCh6xGtV74CWLdSsA_w@mail.gmail.com> (raw)
In-Reply-To: <CABrM6wmkUu4HcvJ-WneZVFyBcOFpkavSjxFur=zVnpercyuigg@mail.gmail.com>
On Thu, Mar 4, 2021 at 11:20 AM Peng Yu via Libc-help
<libc-help@sourceware.org> wrote:
>
> I can see what files are in the ubuntu package libc6-dev. But that
> does not help with where they come from and what the structure of the
> glibc is. An explanation of the source tree would be helpful.
>
> On 3/4/21, Florian Weimer <fweimer@redhat.com> wrote:
> > * Peng Yu via Libc-help:
> >
> >> I'd like to know the complete list header files installed on Linux.
> >
> > The easiest way is to run build-many-glibcs.py and look at the install
> > trees. The answer varies from architecture to architecture.
The installed headers are defined by the rule 'headers' in the Makefile:
$ grep -w '\<headers\>.*:=' `find . -iname Makefile`
./dirent/Makefile:headers := dirent.h bits/dirent.h
bits/dirent_ext.h
./pwd/Makefile:headers := pwd.h
./math/Makefile:headers := math.h bits/mathcalls.h \
./resource/Makefile:headers := sys/resource.h bits/resource.h
sys/vlimit.h \
[...]
However each system can add extra installed headers with the
'sysdep_headers' rule:
grep -w '\<sysdep_headers\>' `find . -iname Makefile`
./sysdeps/aarch64/Makefile:sysdep_headers += sys/ifunc.h
./sysdeps/x86/Makefile:sysdep_headers += sys/platform/x86.h
./sysdeps/powerpc/Makefile:sysdep_headers += sys/platform/ppc.h
./sysdeps/mach/hurd/Makefile:sysdep_headers += nfs/nfs.h
[...]
And each architecture can still override the header using the sysdeps folders.
For instance, the sysdeps/unix/sysv/linux/Makefile add the
bits/struct_stat.h, and
some architectures override it:
$ find . -iname struct_stat.h
./sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
./sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
./sysdeps/unix/sysv/linux/alpha/bits/struct_stat.h
./sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
./sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
./sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
./sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
./sysdeps/unix/sysv/linux/ia64/bits/struct_stat.h
./sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
./sysdeps/unix/sysv/linux/bits/struct_stat.h
./sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
That's why the simplest solution is as Florian has put it to build a
glibc to the target you want to
inspect and check the installed headers.
next prev parent reply other threads:[~2021-03-04 14:41 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 [this message]
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
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='CAMXh4bW=kh5K3=fD1HqbXfRC8r4tmSjsCh6xGtV74CWLdSsA_w@mail.gmail.com' \
--to=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).