Commit Graph

24 Commits

Author SHA1 Message Date
Ming Liu 0ab2c6e82d crosssdk.bbclass: override TARGET_* flags
Some TARGET_* flags are being exported in bitbake.conf currently, so
they are impacting all the tasks of a crosssdk recipe even they are
not in use at all.

This can lead a lot of churn when the crosssdk sysroot are shared by
machines while they have defined different TARGET_* flags.

Fix it by overriding with BUILD_* flags.

(From OE-Core rev: 3facbe700a2f28a11620c4954686ed5d5e47a3d9)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-10 23:00:44 +01:00
Kristian Amlie 2313a77d84 sstate: Make SSTATE_SCAN_CMD vars configurable using weak defaults.
For this we move them out of the python section so they can be
overridden on a per-recipe basis.

The motivation for this change is that not all tool chains need the
path modifications provided by the command, and these will provide
alternative or empty commands. The Go compiler is such an example.

(From OE-Core rev: 7d2a2160336413736dd4640f5b84ba4d74bb00f5)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:01 +00:00
Richard Purdie 9107d6ca14 Switch to Recipe Specific Sysroots
This patch is comparatively large and invasive. It does only do one thing, switching the
system to build using recipe specific sysroots and where changes could be isolated from it,
that has been done.

With the current single sysroot approach, its possible for software to find things which
aren't in their dependencies. This leads to a determinism problem and is a growing issue in
several of the market segments where OE makes sense. The way to solve this problem for OE is
to have seperate sysroots for each recipe and these will only contain the dependencies for
that recipe.

Its worth noting that this is not task specific sysroots and that OE's dependencies do vary
enormously by task. This did result in some implementation challenges. There is nothing stopping
the implementation of task specific sysroots at some later point based on this work but
that as deemed a bridge too far right now.

Implementation details:

* Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in
  TMPDIR/sysroot-components/PACKAGE_ARCH/PN.

* WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files
  from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and
  RECIPE_SYSROOT_NATIVE.

* This construction is primarily done by a new do_prepare_recipe_sysroot task which runs
  before do_configure and consists of a call to the extend_recipe_sysroot function.

* Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native
  and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies
  for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot
  dependencies.

* We have to do a search/replace 'fixme' operation on the files installed into the sysroot to
  change hardcoded paths into the correct ones. We create a fixmepath file in the component
  directory which lists the files which need this operation.

* Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each
  time a new loader is added. These are handled by adding files in bindir with the name
  prefixed by "postinst-" and are run in each sysroot as its created if they're present.
  This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them.

* Since a recipe can have multiple tasks and these tasks can run against each other at the same
  time we have to have a lock when we perform write operations against the sysroot. We also have
  to maintain manifests of what we install against a task checksum of the dependency. If the
  checksum changes, we remove its files and then add the new ones.

* The autotools logic for filtering the view of m4 files is no longer needed (and was the model
  for the way extend_recipe_sysroot works).

* For autotools, we used to build a combined m4 macros directory which had both the native and
  target m4 files. We can no longer do this so we use the target sysroot as the default and add
  the native sysroot as an extra backup include path. If we don't do this, we'd have to build
  target pkg-config before we could built anything using pkg-config for example (ditto gettext).
  Such dependencies would be painful so we haven't required that.

* PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy
  for each machine. The paths therefore changed, the behaviour did not.

* The ccache class had to be reworked to function with rss.

* The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data
  does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal
  recipe name therefore remains a bad idea.

* The logic in insane needed tweaks to deal with the new path layout, as did the debug source
  file extraction code in package.bbclass.

* The logic in sstate.bbclass had to be rewritten since it previously only performed search and
  replace on extracted sstate and we now need this to happen even if the compiled path was
  "correct". This in theory could cause a mild performance issue but since the sysroot data
  was the main data that needed this and we'd have to do it there regardless with rss, I've opted
  just to change the way the class for everything. The built output used to build the sstate output
  is now retained and installed rather than deleted.

* The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold
  up against testing. This has been rewritten too. There are some assumptions made about paths, we
  save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is
  here works but is a little hardcoded and an area for future improvement.

* In order to work with eSDK we need a way to build something that looks like the old style sysroot.
  "bitbake build-sysroots" will construct such a sysroot based on everything in the components
  directory that matches the current MACHINE. It will allow transition of external tools and can
  built target or native variants or both. It also supports a clean task. I'd suggest not relying on
  this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have
  to have built that in a previous bitbake invocation.

* pseudo is run out of its components directory. This is fine as its statically linked.

* The hacks for wayland to see allarch dependencies in the multilib case are no longer needed
  and can be dropped.

* wic needed more extensive changes to work with rss and the fixes are in a separate commit series

* Various oe-selftest tweaks were needed since tests did assume the location to binaries and the
  combined sysroot in several cases.

* Most missing dependencies this work found have been sent out as separate patches as they were found
  but a few tweaks are still included here.

* A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib
  sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my
  hand. That implementation can probably be neater but this is on the list of things to cleanup later
  at this point.

In summary, the impact people will likely see after this change:

* Recipes may fail with missing dependencies, particularly native tools like gettext-native,
  glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors

* Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst

* There was a separate patch series dealing with roots postinst native dependency issues. Any postinst
  which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS.

There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest
and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean
we've found all the issues.

Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the
task logfiles, not the console so I've intentionally left this like that for now. We can turn it down
easily enough in due course.

(From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Maxin B. John a205c4ce1d bbclass: fix spelling mistakes
Fix some spelling mistakes in bbclass files

(From OE-Core rev: ed484c06f436eea62c5d0b1a2964f219f3e5cb61)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:27 +00:00
Richard Purdie 7095d8da4b crosssdk: Clear MACHINEOVERRIDES
Without this, things like arm* can make it into OVERRIDES when we're
building a compiler to build binaries for another architecture like
x86. This can can lead to build failures dependning on the
exact configuration and overrides.

For example:

MACHINE=imx53qsb bitbake gcc-crosssdk-initial-x86_64 -e | grep EXTRA_OECONF

was showing an armv7 configuration option to gcc.

(From OE-Core rev: 859ac3fdb75303f9f0b4bf1d8d83db0069f0a27b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-16 08:22:45 +01:00
Peter A. Bigot 14a2d1eaa1 sdk: change EXTRA_OECONF_FPU to EXTRA_OECONF_GCC_FLOAT
This variable is used to ensure the proper version of --with-float=FOO
is passed to gcc's configure script.  gcc also has a --with-fpu=FOO
option that means something different.  To avoid confusion, change the
names to be consistent.

(From OE-Core rev: c17d883fa99b6967d83c3796d22fc0c1dbe704e6)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:50 +01:00
Richard Purdie 6dff1bc80f cross/crosssdl/native/nativesdk: Fix do_packagedata stamps
If you build nativesdk for machine A, then change to B you will see sstate
manifest warnings for the packagedata files. The stamps are machine
specific and should not be, ditto for native.

This patch copies the populate-sysroot extra stamp entries to avoid
these warnings.

(From OE-Core rev: a64de25d6006ec6dd777d8f3820a48244dfbf62b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04 18:26:50 +01:00
Richard Purdie 50170617c6 bitbake.conf/classes/gcc: Don't hardcode -nativesdk
Hardcoding -nativesdk as the sdk package architecture is inflexible. We may have
multiple different target OS and we need a way to be able to separate them. Turning
this into a configurable value allows the flexibility we need to build different
SDKMACHINEs with different OS targets.

The commit should have no behaviour change, just makes things more configurable.

(From OE-Core rev: a2110e86b98d646e136de9ec6b8e668079b0d4f4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 16:20:12 +01:00
Richard Purdie 24b1fe929b gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian
The gettext handling of USE_NLS has become a bit tricky to understand, or
alter from the SDK context. This patch introduces a SDKUSE_NLS which can
be set to configure a given SDK/ADT to use NLS or not. This is independent
of the target system NLS usage.

The code in gettext.bbclass is therefore simplified and the classes
themselves now set USE_NLS to appropriate values. No NLS is used
for native, cross and crosssdk since it is never used there and
would just increase build time.

(From OE-Core rev: fe634d47449899f7424adb77ff5bc7ddf8a07a47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 16:20:11 +01:00
Richard Purdie 16e59f3ba7 crosssdk: Construct target_exec_prefix from prefix_nativesdk
${exec_prefix_nativesdk} doesn't exist so use prefix_nativesdk instead.
This resolves issues for code which attepts to use target_exec_prefix.

(From OE-Core rev: cd1ac8257ed2701cbe3802870183e8e1cd3b0418)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 16:20:11 +01:00
Richard Purdie e917c7b5a3 classes: Drop do_package stamp-extra-info
This was needed when do_package for target recipes was target specific
however since it now isn't we can remove these stale references.

(From OE-Core rev: 1c54d8c3639659bc8cf8fa2786a1aa9ed785b723)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-21 16:56:03 +00:00
Richard Purdie d71a35d4f6 crosssdk/nativesdk: Ensure EXTRA_OECONF_FPU is unset
If EXTRA_OECONF_FPU is left set, certain ARM variables related to hard-float
can get pulled in and trigger rebuilds of the crosssdk code. The best solution
is to simply force the variable to a known correct value for the SDK targets
currently supported in the same way as TARGET_FPU.

There is some slight rearrangement of the gcc code to ensure the variable is
always used to call the fpu function.

(From OE-Core rev: 410990445ada8cdcfaec4e6fa5791cee9a5b8983)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:57 +01:00
Richard Purdie 71b78f0483 classes: Add recipe class to overrides
We have currently no override to detect a recipe being build cross, crosssdk
or for target at times we can use virtclass-native and virtclass-nativesdk to
override stuff in recipes but we dont have way to modify a variables
based on recipe type always.

This patch adds in such an override and in particular makes a target override
class available.

With this change now we can say:

EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_class-native = "..."
EXTRA_OECONF_class-nativesdk = "..."
EXTRA_OECONF_class-crosssdk= "..."

Based of an original patch by Khem Raj

(From OE-Core rev: cf332fd9bf685f6d42b11c1f0c37b934c7f5bcbe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-30 11:37:22 +01:00
Lianhao Lu 3180dd2b14 crosssdk.bbclass: Set TUNE_PKGARCH to SDK_PKGARCH.
The TUNE_PKGARCH of crosssdk should be set to SDK_ARCH, not the one
from target machine's configuration.

Fixed bug [YOCTO #2206]

(From OE-Core rev: e809b6657c53616a82e73d2f20ec23bc50ccebc9)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-31 17:59:08 +01:00
Richard Purdie ea0b7440ec multilib.bbclass: Partially fix multlib image targets
This patch partially fixes problems when building multilib extended
images such as libXX-core-image-minimal. Its not a perfect/complete
solution but works much better than any previous code did.

[YOCTO #1496] (partial)
[YOCTO #1497] (partial)
[YOCTO #1498] (partial)

(From OE-Core rev: 00c38774ef0232cc2be924ed8e59220e7c452096)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:23:37 +01:00
Nitin A Kamble 17e8d8558d toolchain-scripts & other classes: add TARGET_LD_ARCH & TARGET_AS_ARCH vars
This is comming from x32 need to pass special parameters to ld & as.

(From OE-Core rev: 96931af89f9cc3056e413cff437a85eca85b3b75)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-05 17:15:59 +01:00
Richard Purdie 5aa96bd0ef bitbake.conf/classes: Variable cleanup
This patch removes the variables BASE_PACKAGE_ARCH, BASEPKG_HOST_SYS,
BASEPKG_TARGET_SYS and also removes the immediate assignments in
several core classes as these are no longer required.

This should make it clearer what some of the core variables do and
simplfy some overly complex and confusing class code.

(From OE-Core rev: d5521be2dcbaf213c140b0d12a4176380874426b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25 14:36:30 +01:00
Ilya Yanok 889551a570 native, nativesdk, crosssdk: reset TARGET_FPU
When building one of the native, nativesdk or crosssdk packages TARGET_*
variables' values are no longer related to the target we set via MACHINE
variable, they are now related to the BUILD (native) or SDK (nativesdk,
crosssdk) targets instead. We need to change TARGET_FPU variable
accordingly or some of the recipes (the ones that check for TARGET_FPU
value, most notably gcc and eglibc) might be confused.

It's probably cleaner not to reset TARGET_FPU but to change it to
something like ${BUILD_FPU} (for native) or ${SDK_FPU} (for crosssdk and
nativesdk) but as long as BUILD and SDK are x86 it's safe to just reset
TARGET_FPU.

(From OE-Core rev: 0d4ea5d7486dc35001582bef3ff6ebfad0606bda)

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-05 22:20:52 +01:00
Richard Purdie 6a0abfa82d crosssdk: Drop PACKAGES setting as its set in cross.bbclass already
Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
2011-01-26 12:06:52 +00:00
Dongxiao Xu 7f41f1a888 bitbake: machine specific sysroots implementation
This commit changes the sysroots path to be machine specific.

Changes includes:

1) STAGING_DIR_TARGET and STRAGING_DIR_HOST points to machine specific
paths.

2) task stamp files. Adding ${MACHINE} info into stamp files for
do_populate_sysroots and do_package tasks. Add a BB_STAMPTASK_BLACKLIST
to keep native, nativesdk, crosssdk, and cross-canadian stamp unchanged.

3) siteconfig path. Separate the site config path for different machines
to avoid one machine adopting the cache file of another machine.

4) sstate. Add machine name to sstate manifest file.
Change relocation code for sstate paths since sysroot is machine.
Keep native, nativesdk, crosssdk, and cross-canadian unchanged.

5) toolchain scripts. Change the environment path to point to machine
specific sysroots in toolchain scripts bbclass.

6) Relocate la files when populating to a different machine of the same
architecture.

7) Exclude STAGING_DIR_TARGET and STAGING_DIR_HOST parameter from sstate
siginfo since they contain ${MACHINE} information.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2011-01-25 12:25:46 +00:00
Richard Purdie 3b154ffbb6 crosssdk.bbclass: Ensure target layout variables are set correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-15 10:14:27 +01:00
Richard Purdie 3fbbc44cfd nativesdk/package_ipk.bbclass: Clean up sdk package architectures
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-17 22:25:25 +01:00
Richard Purdie c906f2bce4 crosssdk: Add crosssdk class with gcc and binutils recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-17 22:25:23 +01:00