Why are there multiple ucontext.h headers for the same architeture?

Lukasz Majewski lukma@denx.de
Mon Jan 20 15:34:00 GMT 2020


Hi Carlos,

> On Mon, Jan 20, 2020 at 4:44 AM Neven Sajko <nsajko@gmail.com> wrote:
> >
> > Hello,
> >
> > I was browsing through the Glibc source tree when I noticed a weird
> > thing: this two files are similar:
> >
> > sysdeps/unix/sysv/linux/arm/sys/ucontext.h
> > sysdeps/arm/sys/ucontext.h
> >
> > I am thinking that one may be for Linux and the other for Hurd?
> >
> > In what cases is the first header used/packaged/installed, and when
> > the other header?
> >
> > Also, it is strange that the files are not more similar, for
> > example, in one header the ARM registers are in an array, and in
> > the other they are struct fields. Why the difference? Could this
> > not be more unified?  
> 
> The glibc build system searches system dependency directories in a
> particular order and resolves them with a specific set of rules.

Sorry to jump in ... but this puzzles me from some time.

Is there any Makefile facility (other than standard --debug[=FLAGS]
switch) to facilitate debugging?

Or maybe there is any other way to inspect this?

> 
> This ordering and rules allows architectures to define their own
> copies of certain headers.
> 
> Where possible we try to refactor things to avoid duplicate headers,
> but it does happen sometimes.
> 
> You can see the sysdep ordering during the glibc build:
> 
> config_sysdirs='sysdeps/unix/sysv/linux/x86_64/64
> sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86
> sysdeps/x86/nptl sysdeps/unix/sysv/linux/wordsize-64
> sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl
> sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv
> sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64
> sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu
> sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86
> sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96
> sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64
> sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754
> sysdeps/generic'
> 
> Does that answer your questions?
> 
> Cheers,
> Carlos.




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-help/attachments/20200120/6c918081/attachment.sig>


More information about the Libc-help mailing list