diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2014-08-14 13:03:36 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-15 18:21:50 +0100 |
commit | cb1ab746ddc4c53f6825f3a9598b21bc5bdb7ef5 (patch) | |
tree | ada85d5bd4611ef11afd4aad0ee15599214c7eee /meta/classes/base.bbclass | |
parent | c0a071e16ec04f485f06eece5b807e5afbe1c1f1 (diff) | |
download | poky-cb1ab746ddc4c53f6825f3a9598b21bc5bdb7ef5.tar.gz |
multilib_global.bbclass: PREFERRED_PROVIDERS for multilibs
The code in base.bbclass to spread PREFERRED_PROVIDERS values
to multilibs doesn't work for things which rely on TARGET_PREFIX,
such as virtual/${TARGET_PREFIX}gcc. This is because the expansion
of TARGET_PREFIX produces the wrong value if executed prior to
the assignment of TARGET_VENDOR_virtclass-multilib-libxx, which
will always happen since that assignment doesn't happen until recipe
parsing, but the PREFERRED_PROVIDERS expansion is happening
around ConfigParsed.
To solve this, we make a couple of changes. First, the creation
of the TARGET_VENDOR override values is moved into a new ConfigParsed
event handler in multilib_global. Second, the preferred_ml_updates()
function's code is moved into that function too. It seems safe to
assume that PREFERRED_PROVIDER values only need to be spread to
other multilibs when multilibs are in use.
I don't think this directly affects any use cases that don't involve
third-party or alternative toolchains.
(From OE-Core rev: 513f72274460e54fd35dda5ef70fa42ba2b284f8)
Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 2c007ab8a6..c0d61fe7aa 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -133,113 +133,6 @@ def pkgarch_mapping(d): | |||
133 | if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon": | 133 | if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon": |
134 | d.setVar("TUNE_PKGARCH", "armv7a") | 134 | d.setVar("TUNE_PKGARCH", "armv7a") |
135 | 135 | ||
136 | def preferred_ml_updates(d): | ||
137 | # If any PREFERRED_PROVIDER or PREFERRED_VERSION are set, | ||
138 | # we need to mirror these variables in the multilib case; | ||
139 | multilibs = d.getVar('MULTILIBS', True) or "" | ||
140 | if not multilibs: | ||
141 | return | ||
142 | |||
143 | prefixes = [] | ||
144 | for ext in multilibs.split(): | ||
145 | eext = ext.split(':') | ||
146 | if len(eext) > 1 and eext[0] == 'multilib': | ||
147 | prefixes.append(eext[1]) | ||
148 | |||
149 | versions = [] | ||
150 | providers = [] | ||
151 | for v in d.keys(): | ||
152 | if v.startswith("PREFERRED_VERSION_"): | ||
153 | versions.append(v) | ||
154 | if v.startswith("PREFERRED_PROVIDER_"): | ||
155 | providers.append(v) | ||
156 | |||
157 | for v in versions: | ||
158 | val = d.getVar(v, False) | ||
159 | pkg = v.replace("PREFERRED_VERSION_", "") | ||
160 | if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")): | ||
161 | continue | ||
162 | if '-cross-' in pkg and '${' in pkg: | ||
163 | for p in prefixes: | ||
164 | localdata = bb.data.createCopy(d) | ||
165 | override = ":virtclass-multilib-" + p | ||
166 | localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) | ||
167 | bb.data.update_data(localdata) | ||
168 | newname = localdata.expand(v).replace("PREFERRED_VERSION_", "PREFERRED_VERSION_" + p + '-') | ||
169 | if newname != v: | ||
170 | newval = localdata.expand(val) | ||
171 | d.setVar(newname, newval) | ||
172 | # Avoid future variable key expansion | ||
173 | vexp = d.expand(v) | ||
174 | if v != vexp and d.getVar(v, False): | ||
175 | d.renameVar(v, vexp) | ||
176 | continue | ||
177 | for p in prefixes: | ||
178 | newname = "PREFERRED_VERSION_" + p + "-" + pkg | ||
179 | if not d.getVar(newname, False): | ||
180 | d.setVar(newname, val) | ||
181 | |||
182 | for prov in providers: | ||
183 | val = d.getVar(prov, False) | ||
184 | pkg = prov.replace("PREFERRED_PROVIDER_", "") | ||
185 | if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")): | ||
186 | continue | ||
187 | if 'cross-canadian' in pkg: | ||
188 | for p in prefixes: | ||
189 | localdata = bb.data.createCopy(d) | ||
190 | override = ":virtclass-multilib-" + p | ||
191 | localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) | ||
192 | bb.data.update_data(localdata) | ||
193 | newname = localdata.expand(prov) | ||
194 | if newname != prov: | ||
195 | newval = localdata.expand(val) | ||
196 | d.setVar(newname, newval) | ||
197 | # Avoid future variable key expansion | ||
198 | provexp = d.expand(prov) | ||
199 | if prov != provexp and d.getVar(prov, False): | ||
200 | d.renameVar(prov, provexp) | ||
201 | continue | ||
202 | virt = "" | ||
203 | if pkg.startswith("virtual/"): | ||
204 | pkg = pkg.replace("virtual/", "") | ||
205 | virt = "virtual/" | ||
206 | for p in prefixes: | ||
207 | if pkg != "kernel": | ||
208 | newval = p + "-" + val | ||
209 | |||
210 | # implement variable keys | ||
211 | localdata = bb.data.createCopy(d) | ||
212 | override = ":virtclass-multilib-" + p | ||
213 | localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) | ||
214 | bb.data.update_data(localdata) | ||
215 | newname = localdata.expand(prov) | ||
216 | if newname != prov and not d.getVar(newname, False): | ||
217 | d.setVar(newname, localdata.expand(newval)) | ||
218 | |||
219 | # implement alternative multilib name | ||
220 | newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) | ||
221 | if not d.getVar(newname, False): | ||
222 | d.setVar(newname, newval) | ||
223 | # Avoid future variable key expansion | ||
224 | provexp = d.expand(prov) | ||
225 | if prov != provexp and d.getVar(prov, False): | ||
226 | d.renameVar(prov, provexp) | ||
227 | |||
228 | |||
229 | mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split() | ||
230 | extramp = [] | ||
231 | for p in mp: | ||
232 | if p.endswith("-native") or "-crosssdk-" in p or p.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in p: | ||
233 | continue | ||
234 | virt = "" | ||
235 | if p.startswith("virtual/"): | ||
236 | p = p.replace("virtual/", "") | ||
237 | virt = "virtual/" | ||
238 | for pref in prefixes: | ||
239 | extramp.append(virt + pref + "-" + p) | ||
240 | d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp)) | ||
241 | |||
242 | |||
243 | def get_layers_branch_rev(d): | 136 | def get_layers_branch_rev(d): |
244 | layers = (d.getVar("BBLAYERS", True) or "").split() | 137 | layers = (d.getVar("BBLAYERS", True) or "").split() |
245 | layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \ | 138 | layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \ |
@@ -290,7 +183,6 @@ python base_eventhandler() { | |||
290 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) | 183 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) |
291 | e.data.setVar('BB_VERSION', bb.__version__) | 184 | e.data.setVar('BB_VERSION', bb.__version__) |
292 | pkgarch_mapping(e.data) | 185 | pkgarch_mapping(e.data) |
293 | preferred_ml_updates(e.data) | ||
294 | oe.utils.features_backfill("DISTRO_FEATURES", e.data) | 186 | oe.utils.features_backfill("DISTRO_FEATURES", e.data) |
295 | oe.utils.features_backfill("MACHINE_FEATURES", e.data) | 187 | oe.utils.features_backfill("MACHINE_FEATURES", e.data) |
296 | 188 | ||