public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: Add dependency on binutils
@ 2013-05-20 12:22 Mike Crowe
  2013-05-20 17:37 ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2013-05-20 12:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mike Crowe

Compiling the Linux kernel requires binutils; kernel.bbclass uses
INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.

(The lack of this dependency isn't always a problem because binutils
is required to build gcc-cross but if gcc-cross is reconstructed from
the sstate cache then gcc-cross's dependency on binutils-cross is
ignored due to being in the safe dependency list in
setscene_depvalid.)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Acked-by: Phil Blundell <philb@gnu.org>
---
 meta/classes/kernel.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ffb0b11..38973db 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -1,7 +1,7 @@
 inherit linux-kernel-base module_strip kernel-module-split
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross"
 
 # we include gcc above, we dont need virtual/libc
 INHIBIT_DEFAULT_DEPS = "1"
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel.bbclass: Add dependency on binutils
  2013-05-20 12:22 [PATCH] kernel.bbclass: Add dependency on binutils Mike Crowe
@ 2013-05-20 17:37 ` Khem Raj
  2013-05-20 20:29   ` Mike Crowe
  2013-05-20 22:25   ` Richard Purdie
  0 siblings, 2 replies; 7+ messages in thread
From: Khem Raj @ 2013-05-20 17:37 UTC (permalink / raw)
  To: Mike Crowe; +Cc: openembedded-core


On May 20, 2013, at 5:22 AM, Mike Crowe <mac@mcrowe.com> wrote:

> Compiling the Linux kernel requires binutils; kernel.bbclass uses
> INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.
> 
> (The lack of this dependency isn't always a problem because binutils
> is required to build gcc-cross but if gcc-cross is reconstructed from
> the sstate cache then gcc-cross's dependency on binutils-cross is
> ignored due to being in the safe dependency list in
> setscene_depvalid.)

what good is cross-gcc without cross-binutils. Could it be fixed in gcc recipes instead so
it pulls binutils-cross 

> 
> Signed-off-by: Mike Crowe <mac@mcrowe.com>
> Acked-by: Phil Blundell <philb@gnu.org>
> ---
> meta/classes/kernel.bbclass |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index ffb0b11..38973db 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -1,7 +1,7 @@
> inherit linux-kernel-base module_strip kernel-module-split
> 
> PROVIDES += "virtual/kernel"
> -DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross"
> +DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross"
> 
> # we include gcc above, we dont need virtual/libc
> INHIBIT_DEFAULT_DEPS = "1"
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel.bbclass: Add dependency on binutils
  2013-05-20 17:37 ` Khem Raj
@ 2013-05-20 20:29   ` Mike Crowe
  2013-05-20 22:25   ` Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Crowe @ 2013-05-20 20:29 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On Mon, May 20, 2013 at 10:37:08AM -0700, Khem Raj wrote:
> 
> On May 20, 2013, at 5:22 AM, Mike Crowe <mac@mcrowe.com> wrote:
> 
> > Compiling the Linux kernel requires binutils; kernel.bbclass uses
> > INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.
> > 
> > (The lack of this dependency isn't always a problem because binutils
> > is required to build gcc-cross but if gcc-cross is reconstructed from
> > the sstate cache then gcc-cross's dependency on binutils-cross is
> > ignored due to being in the safe dependency list in
> > setscene_depvalid.)
> 
> what good is cross-gcc without cross-binutils. Could it be fixed in gcc recipes instead so
> it pulls binutils-cross 

Perhaps it could do when considering requiring binutils to be an
implementation detail of gcc. Unfortunately sstate.bbclass doesn't honour
the dependency (presumably because other recipes that depend on binutils
directly don't wish to bring in all the binutils build dependencies
unnecessarily.) What is the best way to avoid this?

But, kernel compilation also requires the ability to call binutils directly
so it doesn't feel completely wrong for the kernel class to depend on
binutils directly too.

Mike.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel.bbclass: Add dependency on binutils
  2013-05-20 17:37 ` Khem Raj
  2013-05-20 20:29   ` Mike Crowe
@ 2013-05-20 22:25   ` Richard Purdie
  2013-05-21  8:41     ` Mike Crowe
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2013-05-20 22:25 UTC (permalink / raw)
  To: Khem Raj; +Cc: Mike Crowe, openembedded-core

On Mon, 2013-05-20 at 10:37 -0700, Khem Raj wrote:
> On May 20, 2013, at 5:22 AM, Mike Crowe <mac@mcrowe.com> wrote:
> 
> > Compiling the Linux kernel requires binutils; kernel.bbclass uses
> > INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.
> > 
> > (The lack of this dependency isn't always a problem because binutils
> > is required to build gcc-cross but if gcc-cross is reconstructed from
> > the sstate cache then gcc-cross's dependency on binutils-cross is
> > ignored due to being in the safe dependency list in
> > setscene_depvalid.)
> 
> what good is cross-gcc without cross-binutils. Could it be fixed in gcc recipes instead so
> it pulls binutils-cross 

This needs fixing in the logic in sstate.bbclass.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel.bbclass: Add dependency on binutils
  2013-05-20 22:25   ` Richard Purdie
@ 2013-05-21  8:41     ` Mike Crowe
  2013-06-13 14:06       ` [PATCH] sstate.bbclass: binutils-cross is not a safe dependency Mike Crowe
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2013-05-21  8:41 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core, Mike Crowe

On Mon, May 20, 2013 at 11:25:18PM +0100, Richard Purdie wrote:
> On Mon, 2013-05-20 at 10:37 -0700, Khem Raj wrote:
> > On May 20, 2013, at 5:22 AM, Mike Crowe <mac@mcrowe.com> wrote:
> > 
> > > Compiling the Linux kernel requires binutils; kernel.bbclass uses
> > > INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.
> > > 
> > > (The lack of this dependency isn't always a problem because binutils
> > > is required to build gcc-cross but if gcc-cross is reconstructed from
> > > the sstate cache then gcc-cross's dependency on binutils-cross is
> > > ignored due to being in the safe dependency list in
> > > setscene_depvalid.)
> > 
> > what good is cross-gcc without cross-binutils. Could it be fixed in gcc recipes instead so
> > it pulls binutils-cross 
> 
> This needs fixing in the logic in sstate.bbclass.

The most straightforward fix there (with thanks to Phil Blundell) is to
just remove binutils-cross from the safe dependency list:

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 1f85c54..be08a66 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -648,7 +648,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
     def isNativeCross(x):
         return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial")
     def isSafeDep(x):
-        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross", "gcc-cross-initial"]:
+        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "gcc-cross-initial"]:
             return True
         return False
     def isPostInstDep(x):

Is this the sort of fix you mean?

Thanks.

Mike.


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] sstate.bbclass: binutils-cross is not a safe dependency
  2013-05-21  8:41     ` Mike Crowe
@ 2013-06-13 14:06       ` Mike Crowe
  2013-06-13 15:00         ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2013-06-13 14:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mike Crowe

gcc always needs binutils in order to be useful. If binutils-cross is
considered to be a safe dependency then gcc-cross can be reconstructed into
the sysroot without binutils. Anyone who tries to use the compiler will end
up using the system binutils which is either a bad thing (relying on system
tools) or a very bad thing (it will be for the wrong architecture.)

In the absence of a better fix let's just stop binutils-cross being
considered a safe dependency. The downside of this is that any
reconstructing any other recipe that depends on binutils from the sstate
cache will also cause binutils to be reconstructed.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 meta/classes/sstate.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I tried and failed to come up with a better fix for this problem. This
fix at least means that everything will build using the correct
version of binutils even if slightly more files are reconstructed from
the sstate cache than would be desirable.


diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 28dc312..0de62d8 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -655,7 +655,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
     def isNativeCross(x):
         return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial")
     def isSafeDep(x):
-        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross", "gcc-cross-initial"]:
+        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "gcc-cross-initial"]:
             return True
         return False
     def isPostInstDep(x):
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate.bbclass: binutils-cross is not a safe dependency
  2013-06-13 14:06       ` [PATCH] sstate.bbclass: binutils-cross is not a safe dependency Mike Crowe
@ 2013-06-13 15:00         ` Richard Purdie
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2013-06-13 15:00 UTC (permalink / raw)
  To: Mike Crowe; +Cc: openembedded-core

On Thu, 2013-06-13 at 15:06 +0100, Mike Crowe wrote:
> gcc always needs binutils in order to be useful. If binutils-cross is
> considered to be a safe dependency then gcc-cross can be reconstructed into
> the sysroot without binutils. Anyone who tries to use the compiler will end
> up using the system binutils which is either a bad thing (relying on system
> tools) or a very bad thing (it will be for the wrong architecture.)
> 
> In the absence of a better fix let's just stop binutils-cross being
> considered a safe dependency. The downside of this is that any
> reconstructing any other recipe that depends on binutils from the sstate
> cache will also cause binutils to be reconstructed.
> 
> Signed-off-by: Mike Crowe <mac@mcrowe.com>
> ---
>  meta/classes/sstate.bbclass |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I tried and failed to come up with a better fix for this problem. This
> fix at least means that everything will build using the correct
> version of binutils even if slightly more files are reconstructed from
> the sstate cache than would be desirable.

The correct fix for this is to whitelist the gcc depending on binutils
case but leave this "safe" version in place.

Cheers,

Richard


> 
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index 28dc312..0de62d8 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -655,7 +655,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
>      def isNativeCross(x):
>          return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial")
>      def isSafeDep(x):
> -        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross", "gcc-cross-initial"]:
> +        if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "gcc-cross-initial"]:
>              return True
>          return False
>      def isPostInstDep(x):




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-13 15:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 12:22 [PATCH] kernel.bbclass: Add dependency on binutils Mike Crowe
2013-05-20 17:37 ` Khem Raj
2013-05-20 20:29   ` Mike Crowe
2013-05-20 22:25   ` Richard Purdie
2013-05-21  8:41     ` Mike Crowe
2013-06-13 14:06       ` [PATCH] sstate.bbclass: binutils-cross is not a safe dependency Mike Crowe
2013-06-13 15:00         ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox