diff mbox

[1/1] class/chrpath: Use correct chrpath cmd for all types of recipes

Message ID e818bef1723baeb352c45d91ef17e35ccbd7c44d.1386746840.git.christian.braunersorensen@prevas.dk
State Superseded
Delegated to: Esben Haabendal
Headers show

Commit Message

christian.braunersorensen@prevas.dk Dec. 11, 2013, 7:28 a.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

For sdk builds, native:chrpath would be attempted to use if the SDK_CPU
were identical to the build CPU. This fix ensures that the correct chrpath
cmd is used for all types of recipes.

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 classes/chrpath.oeclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Esben Haabendal Dec. 11, 2013, 10:40 a.m. UTC | #1
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> For sdk builds, native:chrpath would be attempted to use if the SDK_CPU
> were identical to the build CPU. This fix ensures that the correct chrpath
> cmd is used for all types of recipes.
>
> Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
> ---
>  classes/chrpath.oeclass | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/classes/chrpath.oeclass b/classes/chrpath.oeclass
> index 42c4a3e..9712c1d 100644
> --- a/classes/chrpath.oeclass
> +++ b/classes/chrpath.oeclass
> @@ -47,13 +47,13 @@ def do_chrpath(d):
>      filemagic.load()
>  
>      chrpath_cmd = {}
> -    for elf_type in ("BUILD", "HOST", "TARGET"):
> +    for elf_type in ("HOST", "TARGET", "BUILD"):
>          chrpath_cmd[elf_type] = (d.get("%s_ELF"%(elf_type)),
>                                   d.get("CHRPATH_%s"%(elf_type)))
> +    if chrpath_cmd["TARGET"][0] == chrpath_cmd["BUILD"][0]:
> +        del chrpath_cmd["BUILD"]
>      if chrpath_cmd["TARGET"][0] == chrpath_cmd["HOST"][0]:
>          del chrpath_cmd["TARGET"]
> -    if chrpath_cmd["HOST"][0] == chrpath_cmd["BUILD"][0]:
> -        del chrpath_cmd["HOST"]
>      for elf_type in chrpath_cmd:
>          if not chrpath_cmd[elf_type][0]:
>              del chrpath_cmd[elf_type]

Thanks.  As discussed, I have changed this somewhat, completely removing
the CHRPATH_BUILD from (ch)rpath.oeclass, and simplified the way that
CHRPATH_DEPENDS is specified. See
https://gitorious.org/oe-lite/esbens-core/commit/dc1bdf5160f5ba1d2f4f22c14dab6e7814ba948b

I also made a commit so that do_chrpath will actually fail if a similar
problem happens again.  See
https://gitorious.org/oe-lite/esbens-core/commit/3334441bc6bc984b5c510b46c61baf4e1212ac9e

I am rebuilding universe with these changes to see if it causes any
problems.


Someone: What did you do at work today?
Me: Not a lot.  I rebuilt the universe a couple of times, but it did not
    cause much trouble.

:)

/Esben
diff mbox

Patch

diff --git a/classes/chrpath.oeclass b/classes/chrpath.oeclass
index 42c4a3e..9712c1d 100644
--- a/classes/chrpath.oeclass
+++ b/classes/chrpath.oeclass
@@ -47,13 +47,13 @@  def do_chrpath(d):
     filemagic.load()
 
     chrpath_cmd = {}
-    for elf_type in ("BUILD", "HOST", "TARGET"):
+    for elf_type in ("HOST", "TARGET", "BUILD"):
         chrpath_cmd[elf_type] = (d.get("%s_ELF"%(elf_type)),
                                  d.get("CHRPATH_%s"%(elf_type)))
+    if chrpath_cmd["TARGET"][0] == chrpath_cmd["BUILD"][0]:
+        del chrpath_cmd["BUILD"]
     if chrpath_cmd["TARGET"][0] == chrpath_cmd["HOST"][0]:
         del chrpath_cmd["TARGET"]
-    if chrpath_cmd["HOST"][0] == chrpath_cmd["BUILD"][0]:
-        del chrpath_cmd["HOST"]
     for elf_type in chrpath_cmd:
         if not chrpath_cmd[elf_type][0]:
             del chrpath_cmd[elf_type]