Re: [PATCH] sys/tree.h: Removed

Chris Johns <[email protected]>
Newsgroups gmane.comp.lib.newlib
Organization https://www.rtems.org/
Message-ID <[email protected]>
On 21/6/2024 8:21 am, Joel Sherrill wrote:
> On Thu, Jun 20, 2024 at 4:13 AM Sebastian Huber
> <[email protected] <mailto:[email protected]>>
> wrote:
> 
>     On 18.06.24 22:25, Joel Sherrill wrote:
>     > This file was from a specific older FreeBSD version. There have been
>     > multiple changes to this file with FreeBSD 14 including breaking
>     > changes to the file.
> 
>     What kind of breaking changes did you observe in the FreeBSD 14 version
>     of <sys/tree.h>? I see no breaking API changes. FreeBSD changed the
>     implementation to use rank-balanced trees instead of red-black trees,
>     but this should not have resulted in API breaks (the ABI changed though).
> 
> This creates a conflict between the libc and rtems-libbsd versions. When 
> both are installed, the header installed by libbsd results in different code
> than the version RTEMS was compiled with. 
> 
> Using this internally in RTEMS, we opened ourselves to external changes 
> impacting the score implementation of rbtree.  This leaves us
> open to external changes having an impact on performance. 
> We should take on the preferred implementation inside the score of 
> RTEMS so we have control. We will end up having to do something
> with the file name and name space.
> 
> This actually violated a core development principle for RTEMS and
> we should have spotted this long ago. Everything in the score and
> "bottom" of RTEMS should not depend on libc. 
> 
> We need to control the implementation used internal to RTEMS.
> Realizing that it was not up date in newlib just triggered the realization
> that we should not have been using it.

This file is not referenced in newlib and so serves no direct purpose. We have a
MR in RTEMS to copy this file into the score renaming it to bsd-tree.h so there
is no clash. This means RTEMS's kernel will not depend on this file as it
currently does once the MR is merged.

I think newlib users should expect libc and libm interfaces and be free to bring
a sys/tree.h from the BSD of their choice into their code base. This file here
limits that and limits anyone who decides to use BSD sources such as networking.

Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.