Commit Graph

146 Commits

Author SHA1 Message Date
Martin Jansa 5228b68cfe glibc-locale: add runtime dependency on glibc
* the libc.so.6 dependency is detected always:
  $ grep FILERDEPENDS BUILD-*/pkgdata/qemux86/runtime/localedef
  BUILD-bad/pkgdata/qemux86/runtime/localedef:FILERDEPENDSFLIST_localedef: /usr/bin/localedef
  BUILD-bad/pkgdata/qemux86/runtime/localedef:FILERDEPENDS_/usr/bin/localedef_localedef: libc.so.6(GLIBC_2.15) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.0) libc.so.6
  BUILD-ok/pkgdata/qemux86/runtime/localedef:FILERDEPENDSFLIST_localedef: /usr/bin/localedef
  BUILD-ok/pkgdata/qemux86/runtime/localedef:FILERDEPENDS_/usr/bin/localedef_localedef: libc.so.6(GLIBC_2.15) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.0) libc.so.6

* but in some builds the glibc dependency isn't built soon enough:
  $ diff -uNr BUILD-*/pkgdata/qemux86/runtime/localedef
  --- BUILD-bad/pkgdata/qemux86/runtime/localedef 2017-09-02 21:17:50.000000000 +0000
  +++ BUILD-ok/pkgdata/qemux86/runtime/localedef  2017-09-11 10:15:49.954381592 +0000
  @@ -6,6 +6,7 @@
   LICENSE: GPLv2 & LGPLv2.1
   DESCRIPTION_localedef: glibc: compile locale definition files
   SUMMARY: Locale data from glibc
  +RDEPENDS_localedef: glibc (>= 2.26)
   SECTION: base
   PKG_localedef: localedef
   FILES_localedef: /usr/bin/localedef
  and the build fails with QA issues:
  http://errors.yoctoproject.org/Errors/Details/155529/

  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.0), but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.15), but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.3), but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.2), but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.1), but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6, but no providers found in RDEPENDS_localedef? [file-rdeps]
  ERROR: QA run found fatal errors. Please consider fixing them.

* reproducible with Yocto 2.2 Morty as well, with slightly different
  error message:
  ERROR: glibc-locale-2.24-r0 do_package_qa: QA Issue: /usr/bin/localedef contained in package localedef requires libc.so.6(GLIBC_2.4), but no providers found in RDEPENDS_localedef? [file-rdeps]

* cherry-picked from master 2d2b4d7383c93174fe8eeb72440e81345df71295

(From OE-Core rev: eade33d548bd1a16f5397a44299ac809707efd60)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13 22:13:00 +01:00
Mikko Rapeli b7754933b7 glibc-common.inc: set CVE_PRODUCT to glibc
All recipes which include this .inc map to glibc NVD component.

(From OE-Core rev: 5e11fa22f0b9ee18878b49389603ddf5533cbbc4)

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 613a13725db4e05539974cc7c66584a287d7b4bd)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29 11:57:27 +01:00
Peter Kjellerstedt 439bb8cc71 bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components
The path to where to install and find the sysroot components is used
in many places. This warrants it to get its own variable.

(From OE-Core rev: 70a84b525470f72339568409daf84845904e4cab)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-11 16:55:59 +01:00
Richard Purdie 75001927cd glibc/gcc/libgcc-initial: Delete do_build tasks for -initial
We've had a lot of users running into RSS issues where -initial recipes
were being installed into sysroots alongside their counterparts and
causing overlapping files issues.

In general this was through do_build dependencies. Such dependencies are
bad in general and I'd encourage people to compare the taskgraphs with
using a more specific dependency like do_populate_sysroot, do_image_complete
or do_deploy as often the more specific dependency will result in a much
cleaner build.

Regardless, we don't want -initial dependencies getting in the way like
this and there are cases a do_build dependency could make sense.

Deleting the do_build task in these cases makes sense since this is not
a build "endpoint" we'd ever want a user to use, its a behind the scenes
piece of bootstrappping.

Unfortunately to make this work, we need a newer bitbake version which
has a bitbake bug fixed.

(From OE-Core rev: 04c053d42ab05f77b2d1ca93a0fabae44073d57e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-10 23:00:43 +01:00
Ming Liu 3468b4d96c glibc: fix nativesdk ldd RTLDLIST
Override RTLDLIST for nativesdk, or else ldd would fail to run on
SDK targets.

(From OE-Core rev: 3a1cce659156ef2654a55a6e3c6922fa2dc780e4)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05 23:22:13 +01:00
Richard Purdie 6897b33abe glibc-package: Allow 32 and 64 bit headers to exist on arm
With this change (combined with the previous linux-libc-header fix), a
combined sysroot for 32 and 64 bit arm works meaning our SDK works
correctly for that multilib setup.

(From OE-Core rev: 4690cd8e34fc23de10400cc1c178b2c73c7690c7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-31 10:10:29 +01:00
Jussi Kukkonen fada531cb2 glibc: Ensure ldconfig is packaged into glibc
If base_bindir=bindir, /usr/sbin/ldconfig gets packaged into glibc-utils instead
of glibc: Switch PACKAGES order to prevent this.

(From OE-Core rev: 2794b1cc12af051db404d46aea4db4c74e8e1fe3)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Alexander Kanavin d37f41d8db glibc: do the multilib_header magic also for bits/long-double.h
Otherwise it will cause conflicts in mutlilib setting, as it
varies from one machine to another.

(From OE-Core rev: a3b19882e2f50089c785b1e2591550356c12a175)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Andre McCurdy 2d1b0452ba bitbake.conf: replace USE_LDCONFIG with new "ldconfig" distro feature
USE_LDCONFIG could previously be set to 0 by distros which do not
require ldconfig or ld.so.conf on the target. Since more and more
recipes may need to respect that option, replace the ad-hoc variable
with a distro feature.

Distros which previously set:

  USE_LDCONFIG = "0"

Should now instead use:

  DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"

(From OE-Core rev: a905df2dd8f43a2febffa64a39b6e508510326a0)

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>
2017-03-04 23:18:19 +00:00
Khem Raj cf6c8a94a4 glibc: Update to 2.25 release
(From OE-Core rev: dc55d982aa3d35fa08749b817dbfd87e499d01ab)

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>
2017-02-15 20:06:41 -08:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Richard Purdie 7d08a1340f glibc-package: Avoid race sstate races with do_stash_locale
The change to make do_stash_locale an sstate task between do_install and
do_package has some unforeseen problems since the function deletes part of
${D} but may or may not run depending on whether the task is installed from
sstate.

This cleans up the current "pre packaging" function to be more deterministic
and result in the same set of files, whichever code path we end up reaching
that point by. Its not an ideal sitation but it should avoid the race
failures we've seen on some builds.

(From OE-Core rev: 2a60bba00da9c4e2b1a1ce30e509dba82cc6c94a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-09 10:52:03 +00:00
Richard Purdie 992d17c8e8 glibc: Separate locale files to their own sstate task
Putting the locale and script files into the sysroot for use by their
specific recipes used to be a simple way to share the files. With RSS,
we don't want to copy these into many different recipes so put these
files in their own sstate task.

(From OE-Core rev: c283f2532851e2a65e08fe7b3fd71c5d9abb70f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie 60662a2117 image/kernelsrc/packagegroups/recipes: Remove uneeded noexec tasks
We used to have issues removing tasks like do_fetch due to implications
for targets like world and universe. These have now been resolved.

Removing uneeded tasks has advantages compared to noexec since it means
that accidentally left in dependencies are no longer needed/processed
(e.g. do_patch depends on quilt-native).

This cleans up a number of cases which local analysis highlighted as
being unneeded leading to slightly cleaner task graphs.

(From OE-Core rev: 4e6ee37e09c60e83c0dfd844ba9cf8a07507f099)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Khem Raj 49fec741eb glibc: Upgrade to 2.25 snapshot
glibc 2.25 release is in freeze stage now

(From OE-Core rev: b72dbf70646e9dca0dbb5b22bc70d919e6eb8bdc)

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>
2017-01-23 12:05:22 +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
Paul Eggleton 32da05fa8f meta: use require instead of include when file should exist
If the file is expected to exist, then we should always be using require
so that if it doesn't we get an error rather than some other more
obscure failure later on.

(From OE-Core rev: 603ae6eb487489e65da69c68e532cb767ccc1fc2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +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
Kai Kang 40ae3ae8d1 glibc: fix CVE-2016-6323
Backport patch to fix CVE-2016-6323 of glibc. And remove the section of
file ChangeLog which can't be applied.

Ref:
https://sourceware.org/bugzilla/show_bug.cgi?id=20435

(From OE-Core rev: a3c2acee40c8875e311e03bff6906e7c93c491fc)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:12 +00:00
Zubair Lutfullah Kakakhel 2ce5582b03 glibc: Reduce duplication in MIPS variants
Reduce duplication in MIPS variants now that the MACHINEOVERRIDES
variable is defined

(From OE-Core rev: 5013504b8b406b47a66c84413cb7f8beb5c336c3)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:52 +00:00
Zubair Lutfullah Kakakhel 561e7e1a53 glibc: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

The loader is located at a new place for multiarch.
For more details, check https://wiki.debian.org/Multiarch
and https://sourceware.org/glibc/wiki/ABIList#mips

(From OE-Core rev: 502145553e2368525a4b327c64d2971dac58d85b)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01: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
Markus Lehtonen 72dc833d99 glibc-initial: use python3 instead of python (v2)
(From OE-Core rev: 6946a19fdc8853fbb02fd531b76d9d6d9a3febc3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Jérémy Rosen 059c5568a1 glibc: remove hard-coded reference to gcc -E
(From OE-Core rev: 2c0a72d4e7eafee225e702f4c91cd206bc05ec55)

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:07 +01:00
Jagadeesh Krishnanjanappa bf1954c700 glibc-scripts: add RDEPENDS on libsotruss package required by sotruss script
It solves below error observed on qemux86 target:
root@qemux86:~# sotruss ./hello
ERROR: ld.so: object '/usr/$LIB/audit/sotruss-lib.so' cannot be loaded as audit
interface: cannot open shared object file; ignored.
Hello World
root@qemux86:~#

With this change, we get:
root@qemux86:~# sotruss ./hello
          hello -> libc.so.6      :*__libc_start_main(0x8048300, 0x1,
0xbfc86274)
          hello -> libc.so.6      :*puts(0x804851c, 0xb74af000, 0x0)
Hello World
root@qemux86:~#

(From OE-Core rev: aa2d2161c5b41358f732e95199f0c066d4e2d77a)

Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 23:45:52 +01:00
Mark Hatle 63ac3520b4 glibc: Fix scope resolution in glibc to be breadth first.
The ELF specification indicates symbol resolution should be breadth first, not
depth first.

The dl-deps.c: dl_build_locale_scope function is processing in a depth first
mode.  This is causes certain symbols to be incorrectly reported when
LD_TRACE_PRELINKING=1 is enabled.

See glibc BZ #20488 for more information.

(From OE-Core rev: fb72263eaa94e64ddeee457b5b1bc999f0e647da)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:34 +01:00
Khem Raj e884ceeaa3 glibc: Switch to 2.24 release branch
glibc 2.24 is released now
https://www.sourceware.org/ml/libc-alpha/2016-08/msg00212.html

(From OE-Core rev: 01fe48252085284e2964f5dd52b8b5fa54ee10d3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Khem Raj 56aa9c8162 glibc: Update to 2.24 after hard-freeze
Drop upstreamed patch

(From OE-Core rev: 96f951af74dd8dcea1372249fb84c2c615a7bba3)

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>
2016-07-21 07:47:52 +01:00
Ross Burton 6494a59552 glibc: use the host locale archive in nativesdk builds
The nativesdk libc when used by buildtools has a hard requirement on supporting
a UTF-8 locale because Python 3 needs a UTF-8 locale.  However we currently only
ship the C locale, which means that Python attempts to lookup the user's locale
(for example, en_NZ.UTF-8) in the locale archive under it's prefix it fails and
falls back to C.  This the results in Python using ASCII instead of UTF-8 for
file encoding, and bitbake breaks.

Th obvious solution would be to ship all locales, but this would add
approximately 250MB to the size of the buildtools tarball (which is currently
around 30MB).  Generating a binary locale archive reduces this down to 100MB,
but this is still a drastic increase in footprint.  If we ship a subset of
locales in the tarball then there will be users whose locale isn't in the
tarball, and they'll have to change their locale to an "approved" one, which
isn't the best of messages to send to new users.

The alternative is to tell the nativesdk libc that the locale archive isn't
under it own prefix but is in fact at /usr/lib/locale/locale-archive, so the
buildtools libc uses the host locale archive. The locale archive format appears
to be at least fairly stable: our glibc 2.24 can read the locale archive
generated by glibc 2.17 (Centos 7).

[ YOCTO #9775 ]

(From OE-Core rev: 75321b6b0f2c0ac667b9350b387b01a188e195c8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:49 +01:00
Ross Burton a219424914 glibc: add more Imagination Meta relocation to elf.h
glibc master added the EM_METAG tag but didn't add the relocation defines.
However the kernel tooling only checks for EM_METAG when defining its own values
so scripts/recordmcount ends up using R_META_* symbols without their definition.

Whilst the kernel can and should be fixed, this breaks all users of recordmcount
so patch elf.h to add the values.

(From OE-Core rev: 61f73ae289bf8dfe72d5f4beaac966fb4ac8dc90)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-12 23:10:13 +01:00
Khem Raj ea439968b6 glibc: Upgrade to latest tip of master
- libc-package.bbclass: Do not use --old-style
  This option has been dropped from latest glibc

(From OE-Core rev: 78ab1e7cdedc6a73395af5d053b49cf081416732)

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>
2016-07-12 23:10:13 +01:00
Richard Purdie 0111181bbb nativesdk-glibc: Extend relocation support to locales
Currently locales are not found in a relocated buildtools-tarball
such as that used in eSDK. This breaks bitbake when used under python3.

This patch adds enough relocation magic to nativesdk-glibc so that
the binary locales can be found even in a relocated buildtools-tarball
and bitbake works successfully under python3. The eSDK also works
correctly after this change too.

(From OE-Core rev: faa1229ba848e7a4a90638a98d6c809065016a93)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:24:56 +01:00
Richard Purdie 6b3ac016d3 glibc-locale: Enable binary locale generation for nativesdk-glibc
python3 has much stricter locale requirements than previous versions.
If a locale isn't present, python3 reverts to ascii mode under which
bit
bake can't operate.

We therefore need working binary locales in things like uninative-tarball and buildtools-tarball. This patch enables binary locales for nativesdk-glibc.

(From OE-Core rev: 6993d18062bcc20713dd39399bd7cb3623853c75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:24:56 +01:00
Richard Purdie 3eb00d6597 glibc: Add missing patch hunk back
This hunk of patch went missing during the glibc upgrade to 2.24
and without it, uninative-tarball doesn't work properly. This adds
it back so we can spin a new version of uninative.

(From OE-Core rev: a76cbbd5633301dfcd29f18545e1e6f32e3b2448)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-18 23:17:19 +01:00
Tim Orling 531c354e7e glibc-initial.inc: fix py3 SyntaxError in cfgscript print()
Update so this works with python3.

(From OE-Core rev: 20190566db6d77ee0ccd799587db3dfa35e8029a)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-15 09:06:00 +01:00
Khem Raj 6d27c16ec0 glibc: Add recipes for 2.24 release
(From OE-Core rev: a0a10b4928c818c34fcd99e6a2bbb5db8cb60950)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:12 +01:00
Tristan Van Berkom 5f142040ba cross-localedef-native_2.22.bb: Use autotools configure
Use the autotools default configure commands and just tell autotools
where to run configure from.

This fixes the build when running on an aarch64 host, which the prebuilt
configure scripts with glibc 2.22 do not recognize.

(From OE-Core rev: 33d4c758a5d71435437dde74556d32404d91342f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:14 +01:00
Robert Yang ef163aba20 glibc: remove unused CVE patches
They were CEVs and should be already in the source after upgraded.

(From OE-Core rev: e8a5332d467434ee65e0f29927abb9c51b025aff)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 22:57:26 +01:00
Clemens Lang 3ece01215a ldconfig-native: Fix ELF flags on 64-bit binaries
Yocto's ldconfig-native was exported from an old version of glibc and
generates an ld.so.cache that is partially ignored by current versions
of glibc when loading libraries. This occurs for 64-bit binaries, where
glibc expects FLAG_ELF_LIBC6, but ldconfig-native only generates the
standard ELF flag. Fix this with an additional patch on top of the patch
for now.

You can verify this by applying the patch below to your target copy of
glibc and running

  LD_DEBUG=libs /lib64/ld-linux-x86-64.so.2 --list $anybinary

 --- ./elf/dl-cache.c.orig       2016-01-07 11:05:36.823447171 +0100
 +++ ./elf/dl-cache.c    2016-01-07 11:19:53.925878628 +0100
 @@ -106,6 +106,8 @@
                 if (_dl_cache_check_flags (flags)                             \
                     && _dl_cache_verify_ptr (lib->value))                     \
                   {                                                           \
 +                   if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))\
 +                       _dl_debug_printf ("  considering file %s\n", cache_data + lib->value); \
                     if (best == NULL || flags == GLRO(dl_correct_cache_id))   \
                       {                                                       \
                         HWCAP_CHECK;                                          \
 @@ -117,6 +119,9 @@
                              searching.  */                                   \
                           break;                                              \
                       }                                                       \
 +                 } else {                                                    \
 +                     if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))              \
 +                       _dl_debug_printf ("  ignoring file %s due to flags %x, expected %x\n", cache_data + lib->value, lib->flags, GLRO(dl_correct_cache_id)); \
                   }                                                           \
               }                                                               \
             while (++middle <= right);                                        \
 @@ -265,14 +270,23 @@

        /* Only accept hwcap if it's for the right platform.  */
  #define HWCAP_CHECK \
 -      if (lib->hwcap & hwcap_exclude)                                        \
 +      if (lib->hwcap & hwcap_exclude) {                                              \
 +       if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))            \
 +           _dl_debug_printf ("   hwcap mismatch %x vs. %x\n", lib->hwcap, hwcap_exclude); \
         continue;                                                             \
 -      if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))         \
 +      }                                                                              \
 +      if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) {       \
 +       if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))            \
 +           _dl_debug_printf ("   os version mismatch %x vs. %x\n", lib->osversion, GLRO(dl_osversion)); \
         continue;                                                             \
 +      }                                                                              \
        if (_DL_PLATFORMS_COUNT                                                \
           && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0                           \
 -         && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)                   \
 -       continue
 +         && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) {                 \
 +       if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))            \
 +           _dl_debug_printf ("   platform mismatch %x vs. %x\n", lib->hwcap & _DL_HWCAP_PLATFORM, platform); \
 +       continue;                                                             \
 +      }
        SEARCH_CACHE (cache_new);
      }
    else

This version of ldconfig-native should really be replaced with a version
matching the glibc source in use on the target platform.

(From OE-Core rev: bf9c1e6fa1c8eb86670383bad9b7c2e54bfe17f4)

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 13:18:06 +01:00
Richard Purdie 034618dbee glibc: Add relocation of GCONV_PATH
We're seeing various failures where nativesdk glibc can't find the gconv
modules. We've tried various workaround but this needs fixing 'properly'.
One significant problem is knowing when a binary would use this glibc
and hence when to set the path and when not to.

Add the default path to its own special section which the sdk
relocation script already knows how to handle and remap.

This significantly improves the usability of uninative.

(From OE-Core rev: d40cb4a359dbc5d762fabd996c29e468f5398dd9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 11:55:38 +00: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
Armin Kuster ef30119185 glibc: Security fix CVE-2015-7547
CVE-2015-7547: getaddrinfo() stack-based buffer overflow

(From OE-Core rev: 3f454361fc323119c2850aeb239171e40d085161)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:37:49 +00:00
Armin Kuster c834ebc2ac glibc: CVE-2015-8776
it was found that out-of-range time values passed to the strftime function may
cause it to crash, leading to a denial of service, or potentially disclosure
information.

(From OE-Core rev: cf747f0bbcd53af41a7f3981ac65c2b6b6e668f8)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:37:49 +00:00
Armin Kuster 842177a113 glibc: CVE-2015-9761
A stack overflow vulnerability was found in nan* functions that could cause
applications which process long strings with the nan function to crash or,
potentially, execute arbitrary code.

(From OE-Core rev: 2859c809ac59789d0e631b5386bdf78a5d5c4f4c)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:37:49 +00:00
Armin Kuster efa1ae5e45 glibc: CVE-2015-8779
A stack overflow vulnerability in the catopen function was found, causing
applications which pass long strings to the catopen function to crash or,
potentially execute arbitrary code.

(From OE-Core rev: e0f71f123147bf4f48cc90c7f26a50164ed4115e)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:37:49 +00:00
Armin Kuster aefe1fadfa glibc: CVE-2015-8777.patch
The process_envvars function in elf/rtld.c in the GNU C Library (aka glibc or
libc6) before 2.23 allows local users to bypass a pointer-guarding protection
mechanism via a zero value of the LD_POINTER_GUARD environment variable.

(From OE-Core rev: bc51411d2edda908cbef733066d78a986dfec0c0)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:37:49 +00:00
Armin Kuster 7226ce2830 glibc-locale: fix QA warning
WARNING: QA Issue: glibc-locale: /glibc-binary-localedata-sd-in/usr/lib/locale/sd_IN/LC_CTYPE is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]

fix type
(From OE-Core rev: d53a0d410ae2390528f1090a131cd3e16d7ebcc5)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-07 22:53:32 +00:00