Skip to contentSkip to conversation

populate_sdk_base.bbclass: fixes for multilib sdk

PATCH In review Robert Yang 3 participants 8 messages Aug 13, 2015 – Aug 17, 2015

lore
Share & tools
lore
#0 lore raw

cover populate_sdk_base.bbclass: fixes for multilib sdk

Fixed for multilib sdk:
MACHINE ?= "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

$ bitbake core-image-minimal -cpopulate_sdk 

Extrat the sdk, both environment-setup-core2-64-poky-linux and environment-setup-x86-pokymllib32-linux can compile hello.c after sourced.

This has fixed "bitbake core-image-minimal -cpopulate_sdk", but the sdk of "bitbake lib32-core-image-minimal -cpopulate_sdk" doesn't work, I'm not sure what is preferred, include both 32 and 64 bit sdk as "bitbake core-image-minimal -cpopulate_sdk" does or only 32bit ? What's your opinion, please ?

// Robert

The following changes since commit cb8d309ff0ea0ca11edc2aae75ddd869491cb330:

perf: fix build breakage on kernels after 4.1 (2015-08-12 11:31:01 -0700)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/sdk
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/sdk

Robert Yang (3):
toolchain-shar-extract.sh: add a space in the end populate_sdk_base.bbclass: help rpm to pull in multilib toolchain packagegroup-core-standalone-sdk-target: remove qemuwrapper-cross

 meta/classes/populate_sdk_base.bbclass             |   32 ++++++++++++++++++++
 meta/files/toolchain-shar-extract.sh               |    4 +--
 .../packagegroup-core-standalone-sdk-target.bb     |    1 -
 3 files changed, 34 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 toolchain-shar-extract.sh: add a space in the end

For a clear look when input.

[YOCTO #8089]

---
 meta/files/toolchain-shar-extract.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/files/toolchain-shar-extract.sh +2 -2
index 0a33ee8..3a50991 100644
@@ -92,11 +92,11 @@ fi
 
 if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then
 	echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
-	printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
+	printf "If you continue, existing files will be overwritten! Proceed[y/N]? "
 
 	default_answer="n"
 else
-	printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
+	printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]? "
 
 	default_answer="y"
 fi
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/3] toolchain-shar-extract.sh: add a space in the end

Nit pick on logs...

In the short log:
s/add a space in the end/
/Add a space after asking a question/

Quoted 1 line · Robert Yang

For a clear look when input.

This is a sentence fragment. It will read better if you repeat yourself:

Add a space at the end of a line when asking a question. This makes it easier to read.

../Randy

Quoted 27 lines

[YOCTO #8089]

---
  meta/files/toolchain-shar-extract.sh |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta/files/toolchain-shar-extract.sh +2 -2
index 0a33ee8..3a50991 100644
@@ -92,11 +92,11 @@ fi
 
  if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then
  	echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
-	printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
+	printf "If you continue, existing files will be overwritten! Proceed[y/N]? "
 
  	default_answer="n"
  else
-	printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
+	printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]? "
 
  	default_answer="y"
  fi
Signature · 2 lines
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350 | 350 Terry Fox Drive, Suite 200, Ottawa, ON, Canada, K2K 2W5
#3 lore raw

Re: [PATCH 1/3] toolchain-shar-extract.sh: add a space in the end

Quoted 6 lines · Randy MacLeod

Nit pick on logs...

In the short log:
s/add a space in the end/
/Add a space after asking a question/

Quoted 6 lines
Quoted 1 line · Robert Yang

For a clear look when input.

This is a sentence fragment. It will read better if you repeat yourself:

Add a space at the end of a line when asking a question. This makes it easier to read.

Thanks, I will update it.

// Robert

Quoted 35 lines

../Randy

Quoted 31 lines

[YOCTO #8089]

---
  meta/files/toolchain-shar-extract.sh |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta/files/toolchain-shar-extract.sh +0 -0
index 0a33ee8..3a50991 100644
@@ -92,11 +92,11 @@ fi
 
  if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then
      echo "The directory \"$target_sdk_dir\" already contains a SDK for this

architecture."

meta/files/toolchain-shar-extract.sh +1 -2
-    printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
+    printf "If you continue, existing files will be overwritten! Proceed[y/N]? "
 
      default_answer="n"
  else
-    printf "You are about to install the SDK to \"$target_sdk_dir\".

Proceed[Y/n]?"
+ printf "You are about to install the SDK to \"$target_sdk_dir\".
Proceed[Y/n]? "

default_answer="y"
fi

#4 lore raw

PATCH 2/3 populate_sdk_base.bbclass: help rpm to pull in multilib toolchain

In reply to Robert Yang

When configure multilib, "bitbake <image_bb> -c populate_sdk" should install all arch toolchains (for example, 32 and 64bit), but rpm not handle the multilib requires correctly, for example:
lib32-packagegroup-core-standalone-sdk-target requires lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, if we directly use something like IMAGE_INSTALL_append = " lib32-libc6", then it works well, so update TOOLCHAIN_TARGET_TASK to include the RDEPENDS packages will fix the issue.

[YOCTO #8089]

---
 meta/classes/populate_sdk_base.bbclass |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
meta/classes/populate_sdk_base.bbclass +32 -0
index a9e9bd7..c2491ea 100644
@@ -83,8 +83,40 @@ POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
 fakeroot python do_populate_sdk() {
     from oe.sdk import populate_sdk
     from oe.manifest import create_manifest, Manifest
+    import oe.packagedata
 
     pn = d.getVar('PN', True)
+    # Help rpm to pull in multilib requires since it may not pull in
+    # them correctly, for example,
+    # lib32-packagegroup-core-standalone-sdk-target requires
+    # lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, but
+    # directly use
+    # TOOLCHAIN_TARGET_TASK_append = " lib32-libc6" works well.
+    for pkg in (d.getVar('TOOLCHAIN_TARGET_TASK', True) or "").split():
+        sub_data = oe.packagedata.read_subpkgdata(pkg, d)
+        sub_rdep = sub_data.get("RDEPENDS_" + pkg)
+        if not sub_rdep:
+            continue
+        done = sub_rdep.split()
+        next = done
+        # Find all the rdepends on the dependency chain
+        while next:
+            new = []
+            for sub_pkg in next:
+                sub_data = oe.packagedata.read_subpkgdata(sub_pkg, d)
+                sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
+                if not sub_pkg_rdep:
+                    continue
+                for p in sub_pkg_rdep.split():
+                    if p in done:
+                        continue
+                    if not p.startswith('(') and \
+                            oe.packagedata.has_subpkgdata(p, d):
+                        # It's a new rdep
+                        done.append(p)
+                        new.append(p)
+            next = new
+        d.appendVar('TOOLCHAIN_TARGET_TASK', ' ' + " ".join(done))
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
 
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 2/3] populate_sdk_base.bbclass: help rpm to pull in multilib toolchain

Quoted 8 lines · Robert Yang

When configure multilib, "bitbake <image_bb> -c populate_sdk" should install all arch toolchains (for example, 32 and 64bit), but rpm not handle the multilib requires correctly, for example:
lib32-packagegroup-core-standalone-sdk-target requires lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, if we directly use something like IMAGE_INSTALL_append = " lib32-libc6", then it works well, so update TOOLCHAIN_TARGET_TASK to include the RDEPENDS packages will fix the issue.

Whilst I understand why you're doing this, its rather sad that as the rpm multilib code is broken, we have to hack the core sdk code like this to work around it.

Could/should we not put this into the rpm sdk backend instead?

I also can't help this is just a bandaid and that we'll likely find other ways this breaks in the future, its not a complete solution to the issue :/.

Cheers,

Richard

Quoted 55 lines

[YOCTO #8089]

---
 meta/classes/populate_sdk_base.bbclass |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
meta/classes/populate_sdk_base.bbclass +32 -0
index a9e9bd7..c2491ea 100644
@@ -83,8 +83,40 @@ POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
 fakeroot python do_populate_sdk() {
     from oe.sdk import populate_sdk
     from oe.manifest import create_manifest, Manifest
+    import oe.packagedata
 
     pn = d.getVar('PN', True)
+    # Help rpm to pull in multilib requires since it may not pull in
+    # them correctly, for example,
+    # lib32-packagegroup-core-standalone-sdk-target requires
+    # lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, but
+    # directly use
+    # TOOLCHAIN_TARGET_TASK_append = " lib32-libc6" works well.
+    for pkg in (d.getVar('TOOLCHAIN_TARGET_TASK', True) or "").split():
+        sub_data = oe.packagedata.read_subpkgdata(pkg, d)
+        sub_rdep = sub_data.get("RDEPENDS_" + pkg)
+        if not sub_rdep:
+            continue
+        done = sub_rdep.split()
+        next = done
+        # Find all the rdepends on the dependency chain
+        while next:
+            new = []
+            for sub_pkg in next:
+                sub_data = oe.packagedata.read_subpkgdata(sub_pkg, d)
+                sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
+                if not sub_pkg_rdep:
+                    continue
+                for p in sub_pkg_rdep.split():
+                    if p in done:
+                        continue
+                    if not p.startswith('(') and \
+                            oe.packagedata.has_subpkgdata(p, d):
+                        # It's a new rdep
+                        done.append(p)
+                        new.append(p)
+            next = new
+        d.appendVar('TOOLCHAIN_TARGET_TASK', ' ' + " ".join(done))
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
 
Signature · 1 line
1.7.9.5
#6 lore raw

Re: [PATCH 2/3] populate_sdk_base.bbclass: help rpm to pull in multilib toolchain

Quoted 10 lines · Richard Purdie
Quoted 8 lines · Robert Yang

When configure multilib, "bitbake <image_bb> -c populate_sdk" should install all arch toolchains (for example, 32 and 64bit), but rpm not handle the multilib requires correctly, for example:
lib32-packagegroup-core-standalone-sdk-target requires lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, if we directly use something like IMAGE_INSTALL_append = " lib32-libc6", then it works well, so update TOOLCHAIN_TARGET_TASK to include the RDEPENDS packages will fix the issue.

Quoted 5 lines

Whilst I understand why you're doing this, its rather sad that as the rpm multilib code is broken, we have to hack the core sdk code like this to work around it.

Could/should we not put this into the rpm sdk backend instead?

Sorry, I can't understand what did you mean, do you mean put this into rpm sdk backend such as meta/lib/oe/sdk.py ?

// Robert

Quoted 68 lines

I also can't help this is just a bandaid and that we'll likely find other ways this breaks in the future, its not a complete solution to the issue :/.

Cheers,

Richard

Quoted 55 lines

[YOCTO #8089]

---
  meta/classes/populate_sdk_base.bbclass |   32 ++++++++++++++++++++++++++++++++
  1 file changed, 32 insertions(+)
meta/classes/populate_sdk_base.bbclass +32 -1
index a9e9bd7..c2491ea 100644
@@ -83,8 +83,40 @@ POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
  fakeroot python do_populate_sdk() {
      from oe.sdk import populate_sdk
      from oe.manifest import create_manifest, Manifest
+    import oe.packagedata
 
      pn = d.getVar('PN', True)
+    # Help rpm to pull in multilib requires since it may not pull in
+    # them correctly, for example,
+    # lib32-packagegroup-core-standalone-sdk-target requires
+    # lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, but
+    # directly use
+    # TOOLCHAIN_TARGET_TASK_append = " lib32-libc6" works well.
+    for pkg in (d.getVar('TOOLCHAIN_TARGET_TASK', True) or "").split():
+        sub_data = oe.packagedata.read_subpkgdata(pkg, d)
+        sub_rdep = sub_data.get("RDEPENDS_" + pkg)
+        if not sub_rdep:
+            continue
+        done = sub_rdep.split()
+        next = done
+        # Find all the rdepends on the dependency chain
+        while next:
+            new = []
+            for sub_pkg in next:
+                sub_data = oe.packagedata.read_subpkgdata(sub_pkg, d)
+                sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
+                if not sub_pkg_rdep:
+                    continue
+                for p in sub_pkg_rdep.split():
+                    if p in done:
+                        continue
+                    if not p.startswith('(') and \
+                            oe.packagedata.has_subpkgdata(p, d):
+                        # It's a new rdep
+                        done.append(p)
+                        new.append(p)
+            next = new
+        d.appendVar('TOOLCHAIN_TARGET_TASK', ' ' + " ".join(done))
      runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
      runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
 
--

1.7.9.5

#7 lore raw

PATCH 3/3 packagegroup-core-standalone-sdk-target: remove qemuwrapper-cross

In reply to Robert Yang

Remove qemuwrapper-cross from RDEPENDS, install a cross pkg in sysroots isn't useful, if we really need run qemuwrapper in SDK, we should add it as nativesdk, and it has multilib conflicts when populate_ sdk:

error: file /usr/bin/crossscripts/qemuwrapper from install of qemuwrapper-cross-1.0-r0.lib32_x86 conflicts with file from package qemuwrapper-cross-1.0-r0.core2_64

[YOCTO #8089]

---
 .../packagegroup-core-standalone-sdk-target.bb     |    1 -
 1 file changed, 1 deletion(-)
meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb +0 -1
index 5d1ce97..37f5e43 100644
@@ -10,5 +10,4 @@ RDEPENDS_${PN} = "\
     libstdc++ \
     libstdc++-dev \
     ${LIBC_DEPENDENCIES} \
-    qemuwrapper-cross \
     "
Signature · 1 line
1.7.9.5