From ae5e33ddc48802af6288deacfee59bf5bf4b5223 Mon Sep 17 00:00:00 2001 From: Alejandro Enedino Hernandez Samaniego Date: Mon, 26 Mar 2018 17:20:25 -0700 Subject: newlib: Adds newlib and libgloss recipes Newlib is a C library that is intended to be used on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. Newlib provides a C library alternative that can run on baremetal, mainly for resource constrained devices. Libgloss is the BSP part of the C library, which can be easily modified to port for new hardware platforms. (From OE-Core rev: fe490ff829440b94124317759d856e2e2daf5047) Signed-off-by: Alejandro Enedino Hernandez Samaniego Signed-off-by: Richard Purdie --- .../newlib/libgloss/fix-rs6000-crt0.patch | 41 ++++++++++++++++++++++ .../libgloss/fix_makefile_include_arm_h.patch | 30 ++++++++++++++++ 2 files changed, 71 insertions(+) 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 (limited to 'meta/recipes-core/newlib/libgloss') diff --git a/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch b/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch new file mode 100644 index 0000000000..c220fb8437 --- /dev/null +++ b/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch @@ -0,0 +1,41 @@ +Upstream-Status: Inappropriate [OE-Specific] + +Make install tries to perform install for all variants, but some of them use the same +name for crt0 in specific, so performing all of them results in an error during +do_install, we simply modify the name of the objects so the installation can proceed +and leave it to the user to select which object files to use. + +Signed-off-by: Alejandro Enedino Hernandez Samaniego + +Index: newlib-3.0.0/libgloss/rs6000/Makefile.in +=================================================================== +--- newlib-3.0.0.orig/libgloss/rs6000/Makefile.in ++++ newlib-3.0.0/libgloss/rs6000/Makefile.in +@@ -358,7 +358,7 @@ install-sim: + set -e; for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done + + install-mvme: +- set -e; for x in ${MVME_CRT0} ${MVME_BSP} ${MVME_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done ++ set -e; for x in ${MVME_CRT0} ${MVME_BSP} ${MVME_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/mvme-$$x; done + + install-solaris: + set -e; for x in ${SOLARIS_CRT0} ${SOLARIS_BSP} ${SOLARIS_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done +@@ -367,15 +367,15 @@ install-linux: + set -e; for x in ${LINUX_CRT0} ${LINUX_BSP} ${LINUX_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done + + install-yellowknife: +- set -e; for x in ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done ++ set -e; for x in ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/yellowknife-$$x; done + set -e; for x in ${YELLOWKNIFE_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done + + install-ads: +- set -e; for x in ${ADS_CRT0} ${ADS_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done ++ set -e; for x in ${ADS_CRT0} ${ADS_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/ads-$$x; done + set -e; for x in ${ADS_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done + + install-mbx: +- set -e; for x in ${MBX_CRT0} ${MBX_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done ++ set -e; for x in ${MBX_CRT0} ${MBX_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/mbx-$$x; done + set -e; for x in ${MBX_SCRIPTS} ${MBX_SPECS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done + + install-xil: diff --git a/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch b/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch new file mode 100644 index 0000000000..7645be7314 --- /dev/null +++ b/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch @@ -0,0 +1,30 @@ +Upstream-Status: Inappropriate [OE-Specific] + +When trying to build libgloss for an arm target, the build system +complains about missing some include files: + +| fatal error: acle-compiat.h: No such file or directory +| #include "acle-compat.h" +| ^~~~~~~~~~~~~~~ +| compilation terminated. + +These include files come from the newlib source, but since we +are building libgloss separately from newlib, libgloss is unaware +of where they are, this patch fixes the INCLUDES so the build system +can find such files. + +Signed-off-by: Alejandro Enedino Hernandez Samaniego + +Index: newlib-3.0.0/libgloss/config/default.mh +=================================================================== +--- newlib-3.0.0.orig/libgloss/config/default.mh ++++ newlib-3.0.0/libgloss/config/default.mh +@@ -1,7 +1,7 @@ + NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi` + NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi` + +-INCLUDES = -I. -I$(srcdir)/.. ++INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../newlib/libc/machine/arm + # Note that when building the library, ${MULTILIB} is not the way multilib + # options are passed; they're passed in $(CFLAGS). + CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS} -- cgit v1.2.3-54-g00ecf