summaryrefslogtreecommitdiffstats
path: root/meta/classes/multilib.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-06-26 20:59:34 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-27 12:20:36 +0100
commit8eb91205f6996b7e5106336442393157dc6746cf (patch)
tree36731353e5914ae61e0635480576237fed9df17b /meta/classes/multilib.bbclass
parente9147d16a2c1a5aacdba5b5a3d3bb054dd52dfb2 (diff)
downloadpoky-8eb91205f6996b7e5106336442393157dc6746cf.tar.gz
multilib.bbclass: Reduce ALTERNATIVE_PRIORITY for extended recipes
Fixed: MACHINE = "qemux86-64" require conf/multilib.conf MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "x86" $ bitbake core-image-minimal update-alternatives: libtool has multiple providers with the same priority, please check /path/to/rootfs/usr/lib/opkg/alternatives/libtool for details Both libtool and lib32-libtool have the same priority (as they're the same recipe), so update-alternatives won't deterministically pick a provider. This means you could end up with an image using a 32-bit pkgconfig and 64-bit libtool, for example. Make extended recipes reduce priority by 1 (or 2, 3 ... when there are multiple variants in MULTILIB_VARIANTS) to fix the problem. [YOCTO #13418] (From OE-Core rev: a2f53255ed7fb3657c470cd6a4452d883edd11cc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/multilib.bbclass')
-rw-r--r--meta/classes/multilib.bbclass47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 7750221f7d..d625bd527c 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -125,8 +125,55 @@ python __anonymous () {
125 clsextend.map_variable("USERADD_PACKAGES") 125 clsextend.map_variable("USERADD_PACKAGES")
126 clsextend.map_variable("SYSTEMD_PACKAGES") 126 clsextend.map_variable("SYSTEMD_PACKAGES")
127 clsextend.map_variable("UPDATERCPN") 127 clsextend.map_variable("UPDATERCPN")
128
129 reset_alternative_priority(d)
128} 130}
129 131
132def reset_alternative_priority(d):
133 if not bb.data.inherits_class('update-alternatives', d):
134 return
135
136 # There might be multiple multilibs at the same time, e.g., lib32 and
137 # lib64, each of them should have a different priority.
138 multilib_variants = d.getVar('MULTILIB_VARIANTS')
139 bbextendvariant = d.getVar('BBEXTENDVARIANT')
140 reset_gap = multilib_variants.split().index(bbextendvariant) + 1
141
142 # ALTERNATIVE_PRIORITY = priority
143 alt_priority_recipe = d.getVar('ALTERNATIVE_PRIORITY')
144 # Reset ALTERNATIVE_PRIORITY when found
145 if alt_priority_recipe:
146 reset_priority = int(alt_priority_recipe) - reset_gap
147 bb.debug(1, '%s: Setting ALTERNATIVE_PRIORITY to %s' % (d.getVar('PN'), reset_priority))
148 d.setVar('ALTERNATIVE_PRIORITY', reset_priority)
149
150 handled_pkgs = []
151 for pkg in (d.getVar('PACKAGES') or "").split():
152 # ALTERNATIVE_PRIORITY_pkg = priority
153 alt_priority_pkg = d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg)
154 # Reset ALTERNATIVE_PRIORITY_pkg when found
155 if alt_priority_pkg:
156 reset_priority = int(alt_priority_pkg) - reset_gap
157 if not pkg in handled_pkgs:
158 handled_pkgs.append(pkg)
159 bb.debug(1, '%s: Setting ALTERNATIVE_PRIORITY_%s to %s' % (pkg, pkg, reset_priority))
160 d.setVar('ALTERNATIVE_PRIORITY_%s' % pkg, reset_priority)
161
162 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
163 # ALTERNATIVE_PRIORITY_pkg[tool] = priority
164 alt_priority_pkg_name = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg, alt_name)
165 # ALTERNATIVE_PRIORITY[tool] = priority
166 alt_priority_name = d.getVarFlag('ALTERNATIVE_PRIORITY', alt_name)
167
168 if alt_priority_pkg_name:
169 reset_priority = int(alt_priority_pkg_name) - reset_gap
170 bb.debug(1, '%s: Setting ALTERNATIVE_PRIORITY_%s[%s] to %s' % (pkg, pkg, alt_name, reset_priority))
171 d.setVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg, alt_name, reset_priority)
172 elif alt_priority_name:
173 reset_priority = int(alt_priority_name) - reset_gap
174 bb.debug(1, '%s: Setting ALTERNATIVE_PRIORITY[%s] to %s' % (pkg, alt_name, reset_priority))
175 d.setVarFlag('ALTERNATIVE_PRIORITY', alt_name, reset_priority)
176
130PACKAGEFUNCS_append = " do_package_qa_multilib" 177PACKAGEFUNCS_append = " do_package_qa_multilib"
131 178
132python do_package_qa_multilib() { 179python do_package_qa_multilib() {