[RTEMS Project] #4998: Add support for C11 Annex K Bounds Checking Functions

RTEMS trac trac at rtems.org
Thu Feb 29 23:04:50 UTC 2024


#4998: Add support for C11 Annex K Bounds Checking Functions
-------------------------------------------+---------------------
 Reporter:  Joel Sherrill                  |       Owner:  (none)
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:
Component:  tool/newlib                    |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  C11, SoC, newlib, medium, API  |  Blocked By:
 Blocking:                                 |
-------------------------------------------+---------------------
Changes (by Gedare Bloom):

 * keywords:  C11, SoC, newlib, medium => C11, SoC, newlib, medium, API


Old description:

> C11 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) Annex K
> defines a set of alternatives to many Standard C Library functions that
> perform bounds checking. It is desirable to support these in RTEMS.
>
> Since these functions are prototyped in standard C header files, it would
> be nice to have these merged into newlib and prototyped in the header
> files included there. Prototypes of Annex K functions need to be guarded
> by the _STDC_LIB_EXT1_ cpp define. That would be defined by OS in
> sys/features.h
>
> There is at least one implementation or possibly forks of one
> implementation based on there being multiple "safelibc" projects on
> github.com with permissive licenses. One of the first steps in this
> project is to determine which upstream project is the official version
> and should be the one used for the source. The following repositories as
> a minimum have been identified:
>
> * https://github.com/sbaresearch/slibc
> * https://github.com/rurban/safeclib
> * https://github.com/coruus/safeclib
>

> Since the goal is to have the code merged into newlib, there will need to
> be a list of files and git hash from the source repository so it is
> possible to easily track updates.
>
> Mentors: Joel Sherrill, Gedare Bloom, and possibly others

New description:

 == Description ==
 C11 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) Annex K
 defines a set of alternatives to many Standard C Library functions that
 perform bounds checking. It is desirable to support these in RTEMS.

 Since these functions are prototyped in standard C header files, it would
 be nice to have these merged into newlib and prototyped in the header
 files included there. Prototypes of Annex K functions need to be guarded
 by the _STDC_LIB_EXT1_ cpp define. That would be defined by OS in
 sys/features.h

 There is at least one implementation or possibly forks of one
 implementation based on there being multiple "safelibc" projects on
 github.com with permissive licenses. One of the first steps in this
 project is to determine which upstream project is the official version and
 should be the one used for the source. The following repositories as a
 minimum have been identified:

 * https://github.com/sbaresearch/slibc
 * https://github.com/rurban/safeclib
 * https://github.com/coruus/safeclib

 Since the goal is to have the code merged into newlib, there will need to
 be a list of files and git hash from the source repository so it is
 possible to easily track updates.

 == Mentors ==
 Mentors: Joel Sherrill, Gedare Bloom, and possibly others

 == Skills ==
 C, autoconf

 == Difficulty ==
 Moderate

--

--
Ticket URL: <http://devel.rtems.org/ticket/4998#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list