Patchwork [3/3] binutils: fix building on distros with matching binutils version

login
register
mail settings
Submitter Nitin A Kamble
Date Dec. 21, 2011, 7:27 p.m.
Message ID <16df1bc176ad96d8fbe36701a40314bdc5a487dc.1324495514.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/17383/
State Accepted
Commit be769d948a9c26d55d98fbf38fc0b109edb40c3f
Headers show

Comments

Nitin A Kamble - Dec. 21, 2011, 7:27 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

x86_64 opensuse 11.4 has bintuils version 2.21, and when
binutils_2.21 recipe is built for x86_64 target then, the invocation
of distro gcc fails with errors like this:

/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/as:
symbol lookup error: /usr/lib64/gcc/x86_64-suse-linux/4.5/..
make[2]: *** [sysinfo.o] Error 1

The issue rootcaused as incompatible LD_LIBRARY_PATH while running
the distro gcc.

As per Martin Jansa gentoo also sees similar issue with binutils 2.22
recipe.

This commit fixes the issue by clearing the LD_LIBRARY_PATH for
distro gcc (CC_FOR_BUILD)

This Fixes bug: [YOCTO #1833]

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 .../binutils/binutils-cross-canadian_2.22.bb       |    2 +-
 .../binutils/binutils-crosssdk_2.22.bb             |    2 +-
 meta/recipes-devtools/binutils/binutils.inc        |    2 +-
 meta/recipes-devtools/binutils/binutils_2.22.bb    |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Martin Jansa - Dec. 21, 2011, 10:41 p.m.
On Wed, Dec 21, 2011 at 11:27:14AM -0800, nitin.a.kamble@intel.com wrote:
> From: Nitin A Kamble <nitin.a.kamble@intel.com>
> 
> x86_64 opensuse 11.4 has bintuils version 2.21, and when
> binutils_2.21 recipe is built for x86_64 target then, the invocation
> of distro gcc fails with errors like this:
> 
> /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/as:
> symbol lookup error: /usr/lib64/gcc/x86_64-suse-linux/4.5/..
> make[2]: *** [sysinfo.o] Error 1
> 
> The issue rootcaused as incompatible LD_LIBRARY_PATH while running
> the distro gcc.
> 
> As per Martin Jansa gentoo also sees similar issue with binutils 2.22
> recipe.

I can confirm that with similar patch based on your fix for 2.21 in
poky-contrib/nitin/bugfix I was able to build binutils for qemux86-64
for first time without manual fix :).

Cheers,

> This commit fixes the issue by clearing the LD_LIBRARY_PATH for
> distro gcc (CC_FOR_BUILD)
> 
> This Fixes bug: [YOCTO #1833]
> 
> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
> ---
>  .../binutils/binutils-cross-canadian_2.22.bb       |    2 +-
>  .../binutils/binutils-crosssdk_2.22.bb             |    2 +-
>  meta/recipes-devtools/binutils/binutils.inc        |    2 +-
>  meta/recipes-devtools/binutils/binutils_2.22.bb    |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> index e91e7dc..a49aded 100644
> --- a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> +++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> @@ -1,3 +1,3 @@
>  require binutils_${PV}.bb
>  require binutils-cross-canadian.inc
> -PR = "r1"
> +PR = "r2"
> diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> index 21289cd..0e8b6e4 100644
> --- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> +++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> @@ -4,7 +4,7 @@ inherit crosssdk
>  
>  PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
>  
> -PR = "r1"
> +PR = "r2"
>  
>  do_configure_prepend () {
>  	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
> diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
> index 5cb2cc9..30a0416 100644
> --- a/meta/recipes-devtools/binutils/binutils.inc
> +++ b/meta/recipes-devtools/binutils/binutils.inc
> @@ -76,7 +76,7 @@ export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
>  export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
>  export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
>  
> -export CC_FOR_BUILD = "${BUILD_CC}"
> +export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
>  export CPP_FOR_BUILD = "${BUILD_CPP}"
>  export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
>  
> diff --git a/meta/recipes-devtools/binutils/binutils_2.22.bb b/meta/recipes-devtools/binutils/binutils_2.22.bb
> index f1e7e12..41a30ee 100644
> --- a/meta/recipes-devtools/binutils/binutils_2.22.bb
> +++ b/meta/recipes-devtools/binutils/binutils_2.22.bb
> @@ -1,6 +1,6 @@
>  require binutils.inc
>  
> -PR = "r1"
> +PR = "r2"
>  
>  LIC_FILES_CHKSUM="\
>      file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
> -- 
> 1.7.6.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Nitin A Kamble - Dec. 22, 2011, 4:27 p.m.
Martin,
  Thanks for the report.
Nitin
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Martin Jansa
> Sent: Wednesday, December 21, 2011 2:41 PM
> To: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [PATCH 3/3] binutils: fix building on distros
> with matching binutils version
> 
> On Wed, Dec 21, 2011 at 11:27:14AM -0800, nitin.a.kamble@intel.com
> wrote:
> > From: Nitin A Kamble <nitin.a.kamble@intel.com>
> >
> > x86_64 opensuse 11.4 has bintuils version 2.21, and when
> > binutils_2.21 recipe is built for x86_64 target then, the invocation
> > of distro gcc fails with errors like this:
> >
> > /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-
> linux/bin/as:
> > symbol lookup error: /usr/lib64/gcc/x86_64-suse-linux/4.5/..
> > make[2]: *** [sysinfo.o] Error 1
> >
> > The issue rootcaused as incompatible LD_LIBRARY_PATH while running
> the
> > distro gcc.
> >
> > As per Martin Jansa gentoo also sees similar issue with binutils 2.22
> > recipe.
> 
> I can confirm that with similar patch based on your fix for 2.21 in
> poky-contrib/nitin/bugfix I was able to build binutils for qemux86-64
> for first time without manual fix :).
> 
> Cheers,
> 
> > This commit fixes the issue by clearing the LD_LIBRARY_PATH for
> distro
> > gcc (CC_FOR_BUILD)
> >
> > This Fixes bug: [YOCTO #1833]
> >
> > Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
> > ---
> >  .../binutils/binutils-cross-canadian_2.22.bb       |    2 +-
> >  .../binutils/binutils-crosssdk_2.22.bb             |    2 +-
> >  meta/recipes-devtools/binutils/binutils.inc        |    2 +-
> >  meta/recipes-devtools/binutils/binutils_2.22.bb    |    2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git
> > a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> > b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> > index e91e7dc..a49aded 100644
> > --- a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> > +++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
> > @@ -1,3 +1,3 @@
> >  require binutils_${PV}.bb
> >  require binutils-cross-canadian.inc
> > -PR = "r1"
> > +PR = "r2"
> > diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> > b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> > index 21289cd..0e8b6e4 100644
> > --- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> > +++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
> > @@ -4,7 +4,7 @@ inherit crosssdk
> >
> >  PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
> >
> > -PR = "r1"
> > +PR = "r2"
> >
> >  do_configure_prepend () {
> >  	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib
> > ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#'
> > ${S}/ld/configure.tgt diff --git
> > a/meta/recipes-devtools/binutils/binutils.inc
> > b/meta/recipes-devtools/binutils/binutils.inc
> > index 5cb2cc9..30a0416 100644
> > --- a/meta/recipes-devtools/binutils/binutils.inc
> > +++ b/meta/recipes-devtools/binutils/binutils.inc
> > @@ -76,7 +76,7 @@ export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
> >  export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
> >  export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
> >
> > -export CC_FOR_BUILD = "${BUILD_CC}"
> > +export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
> >  export CPP_FOR_BUILD = "${BUILD_CPP}"
> >  export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
> >
> > diff --git a/meta/recipes-devtools/binutils/binutils_2.22.bb
> > b/meta/recipes-devtools/binutils/binutils_2.22.bb
> > index f1e7e12..41a30ee 100644
> > --- a/meta/recipes-devtools/binutils/binutils_2.22.bb
> > +++ b/meta/recipes-devtools/binutils/binutils_2.22.bb
> > @@ -1,6 +1,6 @@
> >  require binutils.inc
> >
> > -PR = "r1"
> > +PR = "r2"
> >
> >  LIC_FILES_CHKSUM="\
> >
> > file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
> > --
> > 1.7.6.4
> >
> >
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

Patch

diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
index e91e7dc..a49aded 100644
--- a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.22.bb
@@ -1,3 +1,3 @@ 
 require binutils_${PV}.bb
 require binutils-cross-canadian.inc
-PR = "r1"
+PR = "r2"
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
index 21289cd..0e8b6e4 100644
--- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
+++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
@@ -4,7 +4,7 @@  inherit crosssdk
 
 PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
 
-PR = "r1"
+PR = "r2"
 
 do_configure_prepend () {
 	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
index 5cb2cc9..30a0416 100644
--- a/meta/recipes-devtools/binutils/binutils.inc
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -76,7 +76,7 @@  export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
 export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
 export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
 
-export CC_FOR_BUILD = "${BUILD_CC}"
+export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
 export CPP_FOR_BUILD = "${BUILD_CPP}"
 export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
 
diff --git a/meta/recipes-devtools/binutils/binutils_2.22.bb b/meta/recipes-devtools/binutils/binutils_2.22.bb
index f1e7e12..41a30ee 100644
--- a/meta/recipes-devtools/binutils/binutils_2.22.bb
+++ b/meta/recipes-devtools/binutils/binutils_2.22.bb
@@ -1,6 +1,6 @@ 
 require binutils.inc
 
-PR = "r1"
+PR = "r2"
 
 LIC_FILES_CHKSUM="\
     file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\