Commit Graph

25 Commits

Author SHA1 Message Date
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
Yuanjie Huang f4607a1d6b glibc: Enable backtrace from abort on ARM
ARM stack frames for abort and raise were limited to the the actual
abort and raise call, such as:

Obtained 4 stack frames.
./test-app(print_trace+0x1c) [0x10a08]
./test-app() [0x10b3c]
/lib/libc.so.6(__default_sa_restorer+0) [0x4adae1e0]
/lib/libc.so.6(gsignal+0xa0) [0x4adacf74]

This is not terribly useful when trying to figure out what function
may have called called the abort, especially when using pthreads.

After the change the trace would now look like:

Obtained 8 stack frames.
./test-app(print_trace+0x1c) [0x10a08]
./test-app() [0x10b3c]
/lib/libc.so.6(__default_sa_restorer+0) [0x4befe1e0]
/lib/libc.so.6(gsignal+0xa0) [0x4befcf74]
/lib/libc.so.6(abort+0x134) [0x4befe358]
./test-app(dummy_function+0x50) [0x10adc]
./test-app(main+0xd4) [0x10c24]
/lib/libc.so.6(__libc_start_main+0x114) [0x4bee7a58]

(From OE-Core rev: 93bf8713d8e13c278543baea94fb8dad0cb80e49)

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:21 +00:00
Juro Bystricky cf882b6e3a SDK: Allow changing SDKMACHINE without wiping TMP folder
When changing SDKMACHINE, we may encounter an error forcing us to wipe the TMP folder.
Since only SDK_ARCH is captured in the PN of the crosssdk recipes, changes to SDK_OS
result in conflicts. Eventually we hit the error:

ERROR: ...: The recipe <...>  is trying to install files into a shared area when those files already exist.
The build has stopped as continuing in this scenario WILL break things

This patchset addresses the problem by SDK_SYS as the recipe name suffix instead
of SDK_ARCH.

[YOCTO #9281]

(From OE-Core rev: d2eccccb70e809d482c493922f23aef4409cfd82)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Andre McCurdy 77cfa2bcd7 glibc.inc: improve optimisation level sanity checking
- Avoid code duplication to handle -O, -O1 and -Os cases

- Consider the effective optimisation level only (avoids spurious
  warnings if multiple optimisation flags are present).

- Prefix warnings with PN instead of hardcoding "glibc" (avoids
  confusing warnings since the test is also applied to glibc-initial,
  nativesdk-glibc, nativesdk-glibc-initial, etc, and each could
  potentually have different optimisation flags).

(From OE-Core rev: 9d72015e3458c78a9f0d20ad3dc27c8a9bb1069c)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:02 +00:00
Khem Raj 91a1baaf57 glibc: Upgrade to 2.23
Drop kconfig and options-group support
Forward port cross-localedef support
Assume ssp support in libc when building gcc-initial

(From OE-Core rev: 9c3d461c4d54d684b38ec4c038a1c3c2fb9923f0)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-21 09:32:43 +00:00
Hongxu Jia e631be2bce glibc.inc: do not immediate expand SELECTED_OPTIMIZATION
We need to expand SELECTED_OPTIMIZATION later, so
do not immediate expansion, and do the work in
anonymous python function.

It is reasonable to give an error for -O0.

[YOCTO #7058]

(From OE-Core rev: 6fef0d528158e6317793b1ebfa26a7b5413c3e80)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31 13:29:48 +00:00
Roy Li 170b89d986 glibc: package nscd related files
install nscd related configuration file, startup files, and package them,
make nscd easy to startup

(From OE-Core rev: 6d8351ac26295d2e5a693169bd2df95b89cb32fe)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:16 +01:00
Khem Raj 625e0ec8b5 glibc: Consider adding -Wno-error in cases when not using -O2
glibc has recently turned on Werror globally which is good but then not
all option combos are well tested so there still remains cleanup needed
when not using -O2, so lets just disable Werror in such cases, until
fixed upstream

Change-Id: I2d491c360a15b0752c97ff77ee0faaeede6e8d2a
(From OE-Core rev: 52a90e8e592ddd228939e15d7fd0d69f3c1e816f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:34 +01:00
Robert Yang db18fed6f8 glibc: remove invalid ac_cv_path_KSH
There is no ac_cv_path_KSH in configure, can't find it
in config.log after remove, either.

(From OE-Core rev: 6b58670d8b8f2d1c1a7d5043652f48a364a0df5d)

(From OE-Core rev: f193559f5050ab11ec1ebe4ddf7744c502b4983a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:16 +01:00
Benjamin Esquivel db4f1420ce glibc: avoid configure stall by feeding prompt
Addresses a stall (by prompt) condition of the run.do_configure at when
executed directly from the workdir, like when using the devshell.

[YOCTO 7369]

(From OE-Core rev: deb06c96dccdbc6da0f301653e9781ce2fe8173d)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 23:56:06 +00:00
Peter Urbanec ecd052ebf9 glibc: Fix check for -Os.
The check is supposed to be for -Os, but it's actually testing -O0.

(From OE-Core rev: 32d01a341cac894617d47ab7ebe9485ec3c8ac92)

Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-02 22:06:01 +00:00
Khem Raj d6a2cf3cbe glibc: Help compile with -Os
When we modify to use -Os
-Werror doesnt go well with it, glibc needs to be
cleaned up for that but until then lets disable -Werror
when using -Os

Also updates the options group patch to work better with -Os.

(From OE-Core rev: 98e1dc574ef3be668d6a42232ad030d1af93c49f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 23:12:18 +00:00
Martin Jansa fe66853cde feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
* this means that recipes with ARM_INSTRUCTION_SET explicitly changed
  to arm will be built in feed without thumb suffix, the same does apply
  for workdir, e.g. after "bitbake glib-2.0" you can see:

  tmp-glibc/work/armv5e-oe-linux-gnueabi:
  glib-2.0  glibc  glibc-initial

  tmp-glibc/work/armv5te-oe-linux-gnueabi:
  acl              db              gdk-pixbuf     kmod  ....

  and

  tmp-glibc/deploy/ipk:
  all  armv5e  armv5te  qemuarm

* feed config should be ok, because all default DEFAULTTUNEs always
  include "arm" variants of all supported PACKAGE_ARCHs

* for more details see
  http://lists.openembedded.org/pipermail/openembedded-core/2014-April/091960.html
  the toolchain path issues were resolved in 1.8

* add ARM_INSTRUCTION_SET = "arm" to glibc-collateral.inc and comment in
  glibc.inc to fix glibc-locale and glibc-scripts build

(From OE-Core rev: 3e760031f91fb87c3e2f62b77a117eb41164f259)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:36 +00:00
Khem Raj a488fd5b61 glibc: Upgrade 2.20 -> 2.21
Drop CVE backports and ppc/fpu detection patch which is not needed anymore
Forward port eglibc option groups patch
Default to using glibc 2.21

Additional patches needed to appease -Werror option

Change-Id: I1873097cec8387ea9e8186a255122938fc28c976
(From OE-Core rev: 6617cc92076764d51f0190786f8d62b8c99ae984)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-20 10:26:12 +00:00
Khem Raj 54a3375a10 glibc: Migrate eglibc 2.19 -> glibc 2.20
- This is a big swoop change where we switch to using glibc
- option-groups are forward ported
- cross-localedef is extracted out from eglibc and hosted
  at github.com/kraj/localedef, its used for cross-localedef
  recipe
- Other non ported patches from eglibc are forward ported
  ppc8xx cache line workaround
  SH fpcr values
  dynamic resolver
  installing PIC archives is there but is not applied
  libc header bootstrap

- Delete eglibc recipes we moved back to using glibc now
- Fix ppc/e500 build

- Fix crypt module build when options are used
- Fix fnmatch build when options OPTION_EGLIBC_LOCALE_CODE is unset
  HAVE_MBSTATE_T and HAVE_MBSRTOWCS should be defined conditionally
  based upon OPTION_EGLIBC_LOCALE_CODE being set/unset
- Move the ports/ patches to relevant files now that ports is gone

(From OE-Core rev: 1027c535ea753e63d9ffe469a423e04467cf8940)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 18:02:21 +01:00
Phil Blundell 7dc2732b28 glibc: deleted
Glibc 2.10.1 is outdated now and eglibc seems to provide a superset of
its functionality.

(From OE-Core rev: 1d9866a2c4fe93202749a56c7ad89a3cbd07d9f8)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-01 14:16:55 +01:00
Nitin A Kamble 4a438bec75 glibc: fix false failure
do not just fail if grep does not match the locale name in the list

(From OE-Core rev: 6fdbd9129c602fd58179e5880e070c1ec7ea5540)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-13 12:15:45 +01:00
Richard Purdie 8511d1ec1b Drop PRIORITY variable
As discussed on the mailing list, this variable isn't useful and if wanted
would be better implemented by distros using pn-X overrides.

This patch executes:

find . -regex ".*\.\(bb\|inc\)$" | xargs sed -i '/^PRIORITY = ".*"$/d'

against the tree removing the referenced. Thanks to Phil Blundell for
the command.

(From OE-Core rev: d122343362669c683acc4af295971a62cbc823fc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01 23:27:29 +01:00
Richard Purdie c0e1272d15 gcc/libc: Change bootstrap to use an intermediate sysroot and hence no longer overwrite files
Based upon patches from Dexuan Cui <dexuan.cui@intel.com>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-25 12:25:45 +00:00
Dexuan Cui 34729e4f82 gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2011-01-25 10:59:18 +00:00
Koen Kooi 0e8f0f0a03 RDEPENDS, RRECOMMENDS -> RDPEPENDS_${PN}, RRECOMMENDS_${PN}
For these recipes the dependencies listed in RDEPENDS and RRECOMMENDS only apply to ${PN}

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-30 10:03:10 +00:00
Jeff Polk 2e9d981d76 autotools: enable siteconfig by default
eglibc glibc ncurses uclibc zlib: remove explicit siteconfig

Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
2010-09-10 12:57:16 +01:00
Jeff Polk f5389267b0 glibc: Add siteconfig cache generation
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
2010-09-03 10:50:02 +01:00
Richard Purdie 29d6678fd5 Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.

The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.

Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-27 15:29:45 +01:00