Skip to contentSkip to conversation

kernel.bbclass: Add dependency on binutils

PATCH In review Mike Crowe 3 participants 7 messages May 20, 2013 – Jun 13, 2013

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/1 kernel.bbclass: Add dependency on binutils

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.)

---
 meta/classes/kernel.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index ffb0b11..38973db 100644
@@ -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"
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 8 lines · 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.)

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

Quoted 28 lines

---
meta/classes/kernel.bbclass | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +0 -0
index ffb0b11..38973db 100644
@@ -1,7 +1,7 @@

inherit linux-kernel-base module_strip kernel-module-split

PROVIDES += "virtual/kernel"

meta/classes/kernel.bbclass +1 -1
-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"
Signature · 7 lines
1.7.10.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
author
#2 lore raw
Quoted 6 lines · Khem Raj
Quoted 3 lines · Mike Crowe

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

Quoted 8 lines
Quoted 5 lines

(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.

#3 lore raw
In reply to Khem Raj
Quoted 5 lines · Khem Raj
Quoted 3 lines · Mike Crowe

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

Quoted 8 lines
Quoted 5 lines

(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

author
#4 lore raw
Quoted 12 lines · Richard Purdie
Quoted 11 lines · Khem Raj
Quoted 8 lines · 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.)

Quoted 4 lines
Quoted 2 lines

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:

meta/classes/sstate.bbclass +1 -1
index 1f85c54..be08a66 100644
@@ -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.

author
#5 lore raw

PATCH 1/1 sstate.bbclass: binutils-cross is not a safe dependency

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.

---
 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.

meta/classes/sstate.bbclass +1 -1
index 28dc312..0de62d8 100644
@@ -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):
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH] sstate.bbclass: binutils-cross is not a safe dependency

Quoted 12 lines · 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.

Quoted 8 lines
---
 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

Quoted 14 lines
meta/classes/sstate.bbclass +1 -1
index 28dc312..0de62d8 100644
@@ -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):