[oe-commits] [openembedded-core] 02/08: newlib: export CC_FOR_TARGET as CC

git at git.openembedded.org git at git.openembedded.org
Wed Jun 5 07:56:36 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e77739258a212f235e4ef0f0a5f8dd20ba2f87b9
Author: Alejandro Hernandez Samaniego <aehs29 at gmail.com>
AuthorDate: Tue Jun 4 10:57:58 2019 -0700

    newlib: export CC_FOR_TARGET as CC
    Newlibs Makefiles use a variable CC_FOR_TARGET to build
    libraries for the TARGET machine (as opposed to
    We pass CC on our compile function, which is normally
    use to build, although in this case, the configure
    script is trimming CC and using simply gcc for the target
    machine, basically taking out the TUNE variables we pass
    in CC as well, such as march, mfloat-abi and such.
    This causes errors when building applications since
    CC will try to use hard floating point for example
    whereas the libc.a from newlib will contain libraries
    built with the defaults which could be soft floating
    point for example.
    $ ${CC} test.c
    real-ld: error: test.out uses VFP register arguments,
    /usr/lib/libg.a(lib_a-stdio.o) does not.
    Analizing the object files we can see that one of them
    uses soft (library) and the other one uses hard
    floating point (program):
    $ readelf -A test.out | grep VFP
    Tag_ABI_VFP_args: VFP registers
    $ readelf -A usr/lib/libc.a | grep VFP
    Hence why the linker complains.
    Pass CC_FOR_TARGET with the contents of CC to override
    the trimming from the configure script and build newlib
    with the correct tune.
    Signed-off-by: Alejandro Enedino Hernandez Samaniego <aehs29 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/recipes-core/newlib/newlib_3.1.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/newlib/newlib_3.1.0.bb b/meta/recipes-core/newlib/newlib_3.1.0.bb
index db13724..7ab5b2b 100644
--- a/meta/recipes-core/newlib/newlib_3.1.0.bb
+++ b/meta/recipes-core/newlib/newlib_3.1.0.bb
@@ -3,7 +3,8 @@ require newlib.inc
 PROVIDES += "virtual/libc virtual/libiconv virtual/libintl"
 do_configure() {
-	${S}/configure ${EXTRA_OECONF}
+    export CC_FOR_TARGET="${CC}"
+    ${S}/configure ${EXTRA_OECONF}
 do_install_append() {

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list