Skip to contentSkip to conversation

staging.bbclass: avoid staging native components for target sysroot

PATCH In review Chen Qi 1 participant 3 messages Aug 27, 2018 – Sep 6, 2018

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover staging.bbclass: avoid staging native components for target sysroot

*** BLURB HERE ***
The following changes since commit 87d3a9685dd9613e4f6718031d4ebd9344b01c47:

bitbake: parse/ast: ensure saved event handlers really do get restored (2018-08-24 07:53:14 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/staging-native
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/staging-native

Chen Qi (1):
staging.bbclass: avoid staging native components for target sysroot

 meta/classes/staging.bbclass | 3 +++
 1 file changed, 3 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 staging.bbclass: avoid staging native components for target sysroot

In the staging_populate_sysroot_dir function, components are staged by pkgarch matching. In case of x86-64 targets, it's possible that the native components are also matched, and thus are expectedly installed.

The negative effect is at least unnecessary installation, and in some cases is compilation error. For example, when using eSDK and we are trying to cross compile some project in lib32 environment, the compilation will fail.

---
 meta/classes/staging.bbclass | 3 +++
 1 file changed, 3 insertions(+)
meta/classes/staging.bbclass +3 -0
index 27b012e..1b9803a 100644
@@ -198,6 +198,9 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
             if manifest.endswith("-initial.populate_sysroot"):
                 # skip glibc-initial and libgcc-initial due to file overlap
                 continue
+            if not native and manifest.endswith("-native.populate_sysroot"):
+                # avoid native components to be installed into target sysroot
+                continue
             tmanifest = targetdir + "/" + os.path.basename(manifest)
             if os.path.exists(tmanifest):
                 continue
Signature · 1 line
1.9.1
author
#2 lore raw

ping

Quoted 28 lines · Chen Qi

In the staging_populate_sysroot_dir function, components are staged by pkgarch matching. In case of x86-64 targets, it's possible that the native components are also matched, and thus are expectedly installed.

The negative effect is at least unnecessary installation, and in some cases is compilation error. For example, when using eSDK and we are trying to cross compile some project in lib32 environment, the compilation will fail.

---
  meta/classes/staging.bbclass | 3 +++
  1 file changed, 3 insertions(+)
meta/classes/staging.bbclass +3 -0
index 27b012e..1b9803a 100644
@@ -198,6 +198,9 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
              if manifest.endswith("-initial.populate_sysroot"):
                  # skip glibc-initial and libgcc-initial due to file overlap
                  continue
+            if not native and manifest.endswith("-native.populate_sysroot"):
+                # avoid native components to be installed into target sysroot
+                continue
              tmanifest = targetdir + "/" + os.path.basename(manifest)
              if os.path.exists(tmanifest):
                  continue