Patchwork [RFC] Fix libgcc nativesdk to install libgcc.a in good location for tools

login
register
mail settings
Submitter Matthew McClintock
Date Oct. 27, 2011, 3:07 a.m.
Message ID <1319684838-24527-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/13893/
State New, archived
Headers show

Comments

Matthew McClintock - Oct. 27, 2011, 3:07 a.m.
This fixes an issue where we cannot find -lgcc when linking. We
update the path to libgcc.a so the library can be installed
correctly

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
I really doubt this is the correct fix and I'm no expert but it's
here for comments. This fixes a real u-boot cross compile build
issue

The previous mv command was failing as the files did not exist
and I also rejiggered the packages since I was not sure if
gdb-cross-canadian-powerpc-dev was included in my tarball of
the toolchain

 meta/recipes-devtools/gcc/libgcc_4.6.bb |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
James Limbouris - Oct. 27, 2011, 3:40 a.m.
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Matthew McClintock
> Sent: Thursday, 27 October 2011 11:07 AM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [RFC] Fix libgcc nativesdk to install libgcc.a in good location
> for tools
> 
> This fixes an issue where we cannot find -lgcc when linking. We
> update the path to libgcc.a so the library can be installed
> correctly
> 
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> I really doubt this is the correct fix and I'm no expert but it's
> here for comments. This fixes a real u-boot cross compile build
> issue
> 
> The previous mv command was failing as the files did not exist
> and I also rejiggered the packages since I was not sure if
> gdb-cross-canadian-powerpc-dev was included in my tarball of
> the toolchain
> 
>  meta/recipes-devtools/gcc/libgcc_4.6.bb |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/gcc/libgcc_4.6.bb b/meta/recipes-
> devtools/gcc/libgcc_4.6.bb
> index 63a46ec..7f3ac55 100644
> --- a/meta/recipes-devtools/gcc/libgcc_4.6.bb
> +++ b/meta/recipes-devtools/gcc/libgcc_4.6.bb
> @@ -8,9 +8,8 @@ PACKAGES = "\
>    ${PN}-dev \
>    "
> 
> -FILES_${PN} = "${base_libdir}/libgcc*.so.*"
> +FILES_${PN} = "${base_libdir}/libgcc*"
>  FILES_${PN}-dev = " \
> -  ${base_libdir}/libgcc*.so \
>    ${libdir}/${TARGET_SYS}/${BINV}/crt* \
>    ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
> 
> @@ -29,9 +28,10 @@ do_install () {
>  	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
>  		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
>  	else
> -		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
> +		cp ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc*
> ${D}${base_libdir}
>  	fi
> 
> +
>  	chown -R root:root ${D}
>  	chmod +x ${D}${base_libdir}/libgcc_s.so.*
>  }
> --
> 1.7.6.1
> 

Is this perhaps related to the following issue: http://lists.linuxtogo.org/pipermail/openembedded-core/2011-October/011556.html ?
Some builds had trouble finding libgcc due to a sysroot misconfiguration, which has since been fixed in master.

James
McClintock Matthew-B29882 - Oct. 27, 2011, 4:20 a.m.
On Wed, Oct 26, 2011 at 10:40 PM, James Limbouris
<james@digitalmatter.com.au> wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org
>> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
>> Matthew McClintock
>> Sent: Thursday, 27 October 2011 11:07 AM
>> To: openembedded-core@lists.openembedded.org
>> Subject: [OE-core] [RFC] Fix libgcc nativesdk to install libgcc.a in good location
>> for tools
>>
>> This fixes an issue where we cannot find -lgcc when linking. We
>> update the path to libgcc.a so the library can be installed
>> correctly
>>
>> Signed-off-by: Matthew McClintock <msm@freescale.com>
>> ---
>> I really doubt this is the correct fix and I'm no expert but it's
>> here for comments. This fixes a real u-boot cross compile build
>> issue
>>
>> The previous mv command was failing as the files did not exist
>> and I also rejiggered the packages since I was not sure if
>> gdb-cross-canadian-powerpc-dev was included in my tarball of
>> the toolchain
>>
>>  meta/recipes-devtools/gcc/libgcc_4.6.bb |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/gcc/libgcc_4.6.bb b/meta/recipes-
>> devtools/gcc/libgcc_4.6.bb
>> index 63a46ec..7f3ac55 100644
>> --- a/meta/recipes-devtools/gcc/libgcc_4.6.bb
>> +++ b/meta/recipes-devtools/gcc/libgcc_4.6.bb
>> @@ -8,9 +8,8 @@ PACKAGES = "\
>>    ${PN}-dev \
>>    "
>>
>> -FILES_${PN} = "${base_libdir}/libgcc*.so.*"
>> +FILES_${PN} = "${base_libdir}/libgcc*"
>>  FILES_${PN}-dev = " \
>> -  ${base_libdir}/libgcc*.so \
>>    ${libdir}/${TARGET_SYS}/${BINV}/crt* \
>>    ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
>>
>> @@ -29,9 +28,10 @@ do_install () {
>>       if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
>>               mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
>>       else
>> -             mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
>> +             cp ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc*
>> ${D}${base_libdir}
>>       fi
>>
>> +
>>       chown -R root:root ${D}
>>       chmod +x ${D}${base_libdir}/libgcc_s.so.*
>>  }
>> --
>> 1.7.6.1
>>
>
> Is this perhaps related to the following issue: http://lists.linuxtogo.org/pipermail/openembedded-core/2011-October/011556.html ?
> Some builds had trouble finding libgcc due to a sysroot misconfiguration, which has since been fixed in master.

I  applied this patch first. It did not fix my toolchain.

The recipe above still is looking for this file
'${D}${libdir}/libgcc*' before my patch - when that folder does not
even exist and it's actually
'${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc*'. It's worth noting that
FILES_${PN} is referencing the path where a file actually exists,
which makes me wonder why they are different, esp. since these two
lines were added in the same patch.

-M

-M
Richard Purdie - Oct. 28, 2011, 9:03 a.m.
On Wed, 2011-10-26 at 22:07 -0500, Matthew McClintock wrote:
> This fixes an issue where we cannot find -lgcc when linking. We
> update the path to libgcc.a so the library can be installed
> correctly
> 
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> I really doubt this is the correct fix and I'm no expert but it's
> here for comments. This fixes a real u-boot cross compile build
> issue

This patch looks very very confused to me. Firstly your subject summary
talks about libgcc-nativesdk. This is the compiler used to generate
binaries for SDKMACHINE so I seriously doubt you're using nativesdk to
build uboot.

> The previous mv command was failing as the files did not exist
> and I also rejiggered the packages since I was not sure if
> gdb-cross-canadian-powerpc-dev was included in my tarball of
> the toolchain
> 
>  meta/recipes-devtools/gcc/libgcc_4.6.bb |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/gcc/libgcc_4.6.bb b/meta/recipes-devtools/gcc/libgcc_4.6.bb
> index 63a46ec..7f3ac55 100644
> --- a/meta/recipes-devtools/gcc/libgcc_4.6.bb
> +++ b/meta/recipes-devtools/gcc/libgcc_4.6.bb
> @@ -8,9 +8,8 @@ PACKAGES = "\
>    ${PN}-dev \
>    "
>  
> -FILES_${PN} = "${base_libdir}/libgcc*.so.*"
> +FILES_${PN} = "${base_libdir}/libgcc*"

This is changing the packging of libgcc too, not just libgcc-nativesdk.
It is not correct to be putting the dynamic linking symlinks in anything
but the -dev package so the above and the line below are therefore wrong
too.

>  FILES_${PN}-dev = " \
> -  ${base_libdir}/libgcc*.so \
>    ${libdir}/${TARGET_SYS}/${BINV}/crt* \
>    ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
>  
> @@ -29,9 +28,10 @@ do_install () {
>  	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
>  		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
>  	else
> -		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
> +		cp ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc* ${D}${base_libdir}
>  	fi

Equally, you're moving a static library from the -dev package into the
main package which is wrong, you only need that if you're doing
development.

Are you sure your problem is not that you didn't have the libgcc-dev
package installed?

Cheers,

Richard
McClintock Matthew-B29882 - Oct. 28, 2011, 7:35 p.m.
On Fri, Oct 28, 2011 at 4:03 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2011-10-26 at 22:07 -0500, Matthew McClintock wrote:
>> This fixes an issue where we cannot find -lgcc when linking. We
>> update the path to libgcc.a so the library can be installed
>> correctly
>>
>> Signed-off-by: Matthew McClintock <msm@freescale.com>
>> ---
>> I really doubt this is the correct fix and I'm no expert but it's
>> here for comments. This fixes a real u-boot cross compile build
>> issue
>
> This patch looks very very confused to me. Firstly your subject summary
> talks about libgcc-nativesdk. This is the compiler used to generate
> binaries for SDKMACHINE so I seriously doubt you're using nativesdk to
> build uboot.
>
>> The previous mv command was failing as the files did not exist
>> and I also rejiggered the packages since I was not sure if
>> gdb-cross-canadian-powerpc-dev was included in my tarball of
>> the toolchain
>>
>>  meta/recipes-devtools/gcc/libgcc_4.6.bb |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/gcc/libgcc_4.6.bb b/meta/recipes-devtools/gcc/libgcc_4.6.bb
>> index 63a46ec..7f3ac55 100644
>> --- a/meta/recipes-devtools/gcc/libgcc_4.6.bb
>> +++ b/meta/recipes-devtools/gcc/libgcc_4.6.bb
>> @@ -8,9 +8,8 @@ PACKAGES = "\
>>    ${PN}-dev \
>>    "
>>
>> -FILES_${PN} = "${base_libdir}/libgcc*.so.*"
>> +FILES_${PN} = "${base_libdir}/libgcc*"
>
> This is changing the packging of libgcc too, not just libgcc-nativesdk.
> It is not correct to be putting the dynamic linking symlinks in anything
> but the -dev package so the above and the line below are therefore wrong
> too.
>
>>  FILES_${PN}-dev = " \
>> -  ${base_libdir}/libgcc*.so \
>>    ${libdir}/${TARGET_SYS}/${BINV}/crt* \
>>    ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
>>
>> @@ -29,9 +28,10 @@ do_install () {
>>       if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
>>               mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
>>       else
>> -             mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
>> +             cp ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc* ${D}${base_libdir}
>>       fi
>
> Equally, you're moving a static library from the -dev package into the
> main package which is wrong, you only need that if you're doing
> development.
>
> Are you sure your problem is not that you didn't have the libgcc-dev
> package installed?

Yes, it turns out I was having some build issues with my environment.
I changed branches in the middle of a build inadvertently and it
screwed everything up.

After a clean build, the toolchain finds libgcc.a if I apply this
patch to the edison branch:

commit f8b94b106f93d33d6ca1a87ac14d710772d77c67
Author: Khem Raj <raj.khem@gmail.com>
Date:   Thu Oct 20 22:28:42 2011 -0700

    gcc-configure-sdk: Point sysroot to correct location

    (From OE-Core rev: c9883733fed9267b1a936c08500a4caf8dc52d3d)

    Signed-off-by: Khem Raj <raj.khem@gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Sorry for the noise. Please ignore this.

-M
McClintock Matthew-B29882 - Oct. 28, 2011, 7:36 p.m.
On Fri, Oct 28, 2011 at 4:03 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2011-10-26 at 22:07 -0500, Matthew McClintock wrote:
>> This fixes an issue where we cannot find -lgcc when linking. We
>> update the path to libgcc.a so the library can be installed
>> correctly
>>
>> Signed-off-by: Matthew McClintock <msm@freescale.com>
>> ---
>> I really doubt this is the correct fix and I'm no expert but it's
>> here for comments. This fixes a real u-boot cross compile build
>> issue
>
> This patch looks very very confused to me. Firstly your subject summary
> talks about libgcc-nativesdk. This is the compiler used to generate
> binaries for SDKMACHINE so I seriously doubt you're using nativesdk to
> build uboot.

Was referring to building a standalone u-boot with a toolchain
generated by poky.

-M

Patch

diff --git a/meta/recipes-devtools/gcc/libgcc_4.6.bb b/meta/recipes-devtools/gcc/libgcc_4.6.bb
index 63a46ec..7f3ac55 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.6.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.6.bb
@@ -8,9 +8,8 @@  PACKAGES = "\
   ${PN}-dev \
   "
 
-FILES_${PN} = "${base_libdir}/libgcc*.so.*"
+FILES_${PN} = "${base_libdir}/libgcc*"
 FILES_${PN}-dev = " \
-  ${base_libdir}/libgcc*.so \
   ${libdir}/${TARGET_SYS}/${BINV}/crt* \
   ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
 
@@ -29,9 +28,10 @@  do_install () {
 	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
 		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
 	else
-		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
+		cp ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc* ${D}${base_libdir}
 	fi
 
+
 	chown -R root:root ${D}
 	chmod +x ${D}${base_libdir}/libgcc_s.so.*
 }