[OE-core] [PATCH 0/3] Add Newlib as a C library for baremetal

Manjukumar Harthikote Matha MANJUKUM at xilinx.com
Fri May 25 03:48:09 UTC 2018



> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org
> [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf Of
> Alejandro Enedino Hernandez Samaniego
> Sent: Wednesday, May 23, 2018 4:09 PM
> To: openembedded-core at lists.openembedded.org
> Subject: [OE-core] [PATCH 0/3] Add Newlib as a C library for baremetal
> 
> Newlib is a widely used C library for embedded systems, its mainly used for
> resource constrained devices which run baremetal applications.
> 
> It provides basic C library functionality, and it is meant to be extended by design,
> it contains several stubs for core functions that can be later overriden with the
> symbols provided from another library at linking time.
> 
> Libgloss is the BSP part of the library which follows the same principle, where a
> BSP layer can override functionality or even application runtime depending on the
> processor architecture.
> 
> These patches add both the libgloss and newlib recipes, provide functionality to
> make them extendable by other libraries if required, and also create a new TCLIBC
> variant, which can now be set to newlib to build the toolchain for applications
> where its suitable.
> 
> Newlib is also usually used by vendors to provide embedded toolchains, which is
> interesting since, this enables OE to build such toolchains in a somewhat
> automated way.
> 
> These patches have been tested on my end in the following ways:
> 
> - meta-toolchain builds successfully on qemux86, qemux86-64, qemuarm,
> qemuarm64,
>   qemuppc, qemumips.
> - A helloworld application that lays in another layer was built for qemux86,
> qemux86-64
>   qemuarm, qemuarm64, qemuppc, qemumips, and it seems to have been built
> correctly.
> - The hardware that I have available is from Xilinx, where Xilinx already had a
>   baremetal application they ran on it, I was able to build the same application
>   with a recipe, that used the toolchain coming from these patches
> (TCLIBC=newlib).
>   I ran the application on hardware and confirmed that it was built and working
> correctly.
> - meta-toolchain builds successfully for the previously mentioned HW MACHINE
> as well.
> - I also have a meta-freertos (its a possibility) layer that builds a FreeRTOS
> application

Can we put out this layer on github for evaluation? 
Community member is interested in such a layer?

>   that runs on qemuarm, and instead of using the provided ARM Embedded
> Toolchain, I used
>   the one coming from these patches and was able to obtain the same result.
> - I built world for all the previously mentioned MACHINES (qemus and HW) just to
> make sure
>   that this did not affect other OE components, and it did not seem to be the case.
> 
> The following changes since commit
> 7897fb35a3420c2555ab59dfa438217ada4a9784:
> 
>   libnss-mdns: fix postinst and postrm (2018-05-22 13:13:33 +0100)
> 
> are available in the git repository at:
> 
>   git://push.yoctoproject.org/poky-contrib aehs29/newlib
> 
> Alejandro Enedino Hernandez Samaniego (3):
>   newlib: Adds newlib and libgloss recipes
>   insane.bbclass: Adds powerpc to elf headers machine dictionary
>   tclibc-newlib: Adds a new TCLIBC variant to build with newlib as C
>     library
> 
>  meta/classes/cross-canadian.bbclass                |  2 +-
>  meta/classes/insane.bbclass                        |  1 +
>  meta/conf/distro/include/tclibc-newlib.inc         | 47 ++++++++++++++++++
>  .../newlib/libgloss/fix-rs6000-crt0.patch          | 41 +++++++++++++++
>  .../libgloss/fix_makefile_include_arm_h.patch      | 30 +++++++++++
>  meta/recipes-core/newlib/libgloss_3.0.0.bb         | 32 ++++++++++++
>  meta/recipes-core/newlib/newlib.inc                | 58 ++++++++++++++++++++++
>  meta/recipes-core/newlib/newlib_3.0.0.bb           | 19 +++++++
>  meta/recipes-devtools/gcc/gcc-cross.inc            |  1 +
>  meta/recipes-devtools/gcc/libgcc-common.inc        |  5 ++
>  10 files changed, 235 insertions(+), 1 deletion(-)  create mode 100644
> meta/conf/distro/include/tclibc-newlib.inc
>  create mode 100644 meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch
>  create mode 100644 meta/recipes-
> core/newlib/libgloss/fix_makefile_include_arm_h.patch
>  create mode 100644 meta/recipes-core/newlib/libgloss_3.0.0.bb
>  create mode 100644 meta/recipes-core/newlib/newlib.inc
>  create mode 100644 meta/recipes-core/newlib/newlib_3.0.0.bb
> 

Acked-by : Manjukumar Matha <manjukumar.harthikote-matha at xilinx.com>

Thanks,
Manju



More information about the Openembedded-core mailing list