Skip to content

Add Newlib as a C library for baremetal

Alejandro Enedino Hernandez Samaniego openembedded-core 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3newlib: Adds newlib and libgloss recipesmeta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch meta/recipes-core/newlib/libgloss_3.0.0.bb +3 more+178 -00 replies
2/3insane.bbclass: Adds powerpc to elf headers machine dictionarymeta/classes/insane.bbclass+1 -00 replies
3/3tclibc-newlib: Adds a new TCLIBC variant to build with newlib as C librarymeta/classes/cross-canadian.bbclass meta/conf/distro/include/tclibc-newlib.inc meta/recipes-core/newlib/newlib_3.0.0.bb +1 more+56 -11 reply

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchManjukumar Matha
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [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 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

--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.