summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlejandro Hernandez Samaniego <aehs29@gmail.com>2019-06-04 10:57:58 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-06 00:40:07 +0100
commit5afd85f1d51c1b5ae14b9e7e82e1755804971f8c (patch)
tree4fddb1fb7269205adab916ebed275c4cb87b024c /meta
parent9929318619c212ea36332053fea4c7a7d9d6caa9 (diff)
downloadpoky-5afd85f1d51c1b5ae14b9e7e82e1755804971f8c.tar.gz
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 CC_FOR_BUILD). 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. e.g.: $ ${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. (From OE-Core rev: d00b32f4f961ceeb75e7a014209666c10cf3eb93) Signed-off-by: Alejandro Enedino Hernandez Samaniego <aehs29@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/newlib/newlib_3.1.0.bb3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/recipes-core/newlib/newlib_3.1.0.bb b/meta/recipes-core/newlib/newlib_3.1.0.bb
index db13724eb5..7ab5b2b94e 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
3PROVIDES += "virtual/libc virtual/libiconv virtual/libintl" 3PROVIDES += "virtual/libc virtual/libiconv virtual/libintl"
4 4
5do_configure() { 5do_configure() {
6 ${S}/configure ${EXTRA_OECONF} 6 export CC_FOR_TARGET="${CC}"
7 ${S}/configure ${EXTRA_OECONF}
7} 8}
8 9
9do_install_append() { 10do_install_append() {