summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc
AgeCommit message (Collapse)Author
2019-09-16glibc-testsuite: SkipRecipe if libc is not glibcNathan Rossi
To prevent issues with parsing or dependencies, limit this recipe to use only when the libc is glibc (and libc-locale is glibc-locale). (From OE-Core rev: 88849a0652f1a9cffd5c1b5caae2878b3a438273) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06binutils/glibc-testsuite: inherit nopackages to fix world buildsRichard Purdie
These recipes don't need to generate packages but did contain the packaging tasks which would be triggered by a world build. They showed warnings or errors. Simplest fix is to remove the unneeded tasks with the nopackages class. Also don't attempt stash_locales task (From OE-Core rev: a34420e1bdb9a695fe7abd3b26426d7ae6113349) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06glibc-testsuite: Create a recipe to implement glibc test suiteNathan Rossi
A recipe needs to be created for the test suite due to the dependency chain between libgcc -> glibc -> libgcc-initial, and the requirements of the test suite to have libgcc for compilation and execution. The glibc test suite does not use dejagnu like the gcc test suites do. Instead a test wrapper script is used along with the assumed dependency of having the same filesystem available on build host and target. For qemu linux-user the same filesystem is inherently available, for remote targets NFS is used. Separate test wrapper scripts are created for qemu linux-user or ssh targets, with the same TOOLCHAIN_TEST_* variables used for configuration. (From OE-Core rev: 6c4d581c35ebd51c4b080ac38175d93f0480f97d) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06Clean up remnants of glibc-initialNathan Rossi
Remove remnants of the glibc-initial recipe. (From OE-Core rev: 332b1e21db3e0cbeeb14f12dd6aeedb89b76d761) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-21cross-localedef-native: Add hardlink resolver from util-linuxJason Wessel
The hard link resolver that is built into localedef cannot be run in parallel. It will search sibling directories (which are be processed in parallel) and perform a creation of a .tmp file and remove the original and move the .tmp file in. The problem is that if a probe occurs a hard link can be requested to the file that is being removed. This will lead to a stray copy or potentially, on a loaded system cause race condition which pseudo cannot deal with, where it is left with a hard link request to a file that no longer exists. In this situation psuedo will inherit the permissions of what ever the target inode had to offer. In short, there are two problems: 1) You will be left with stray copies when using the hard link resolution that is built in while running in parallel with localedef. 2) When running under pseudo the possibility exists for uid/gid leakage when the source file is removed before the hard link can be completed. The solution is to call localedef with --no-hard-links and separately process the hardlinks at a later point. To do this requires the inclusion of the hardlink utility found in modern versions of util-linux. Most host systems do not have this, so it will be included with the cross-localedef binary. There are two patches here. The first imports the raw version of hardlink.c and a couple of header files directly from util-linux. The second patch applies the fix-ups to make it compile, along with a change to recipe to package the new binary. [YOCTO #11299] [YOCTO #12434] (From OE-Core rev: 57e2e498ffb675d274aa95b10c14bd81742d2761) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-07glibc-package.inc: Add linux-libc-headers-dev to glibc-devMark Hatle
Without linux-libc-headers-dev being added to the libc6-dev as a RDEPENDS, the system may fail to install the necessary libc headers. This can happen when NO_RECOMMENDATIONS = "1" is defined. During the 'testsdk' this results in failures that look like: fatal error: linux/errno.h: No such file or directory # include <linux/errno.h> ^~~~~~~~~~~~~~~ This also matches the behavior of musl, which does not suffer from this problem. (From OE-Core rev: ad31c908c8267166ce6cce9d5085ef2ac099a6c5) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-07glibc: Update to glibc 2.30Khem Raj
- Drop backported patches - Move common pieces between cross-localedef and glibc into a common file - Move latest checksums to glibc-common.inc and remove duplicates from glibc recipe - Detailed release notes [1] [1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html (From OE-Core rev: fe75808dca4bb56ac703d18ebbad4004678f69da) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-19glibc: CVE-2018-20796 is same as CVE-2019-9169Anuj Mittal
See: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34141 https://www.securityfocus.com/bid/107160 (From OE-Core rev: 7e90506534ed2a70680382cf28614f02fdb98409) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-17glibc: exclude child recipes from CVE scanningRoss Burton
As glibc will be scanned for CVEs, we don't need to scan glibc-locale, glibc-mtrace, and glibc-scripts which are all separate recipes for technical reasons. Exclude the recipes by setting CVE_PRODUCT in the recipe, instead of using the global whitelist. (From OE-Core rev: 1f9a963b9ff7ebe052ba54b9fcbdf7d09478dd17) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-15glibc-package.inc: Do not use bitbake variable syntax for shell variablesPeter Kjellerstedt
Using bitbake variable syntax (i.e., ${FOO}) for shell variables is bad practice. First of all it is confusing, but more importantly it can lead to weird problems if someone actually defines a bitbake variable with the same name as the shell variable. Also correct the indentation in stash_locale_cleanup(). (From OE-Core rev: 4e303063db731feae192314bab2ca16d26192dbb) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-10glibc / glibc-locale: Fix stash_locale determinism problemsJason Wessel
When using sstate, or performing an incremental build any change to the do_stash_locale() will cause a build failure because do_stash_locale() was destroying the results obtained from the do_install() with several mv operations. A recent change to do_stash_locale() for a different problem illustrated a number of build failures for users in the community. To fix the problem, do_stash_locale() must use copy operations instead of the mv operations. Because this is changed to a copy, the sysroot and package stage need to remove the files that would have been previously removed. The correct "fixup" code to deal with the removal already existed in the previous do_poststash_install_cleanup(). All that needed change was the path to where to remove the files from the sysroot and package stages. In order to force a re-compilation of glibc some unused white space was removed from do_compile() for glibc. I could not find any other way around this and we don't want to have all the community folks to have another iteration where they have to remove their tmp directories or purge some portion of the sstate. It also makes this change bisectable. If the change to the glibc is not included, it will fail with the following message: ===== | DEBUG: Executing shell function do_prep_locale_tree | tar: i18n: Cannot stat: No such file or directory | tar: Exiting with failure status due to previous errors | gzip: /poky/build/tmp/work/core2-64-poky-linux/glibc-locale/2.29-r0/locale-tree//usr/share/i18n/charmaps/*gz.gz: No such file or directory ===== After this one time change I tested changing only the do_stash_locale() function and it now works well because it is deterministically operating off the sstate data or a local build. (From OE-Core rev: fedc57a41a15bca1d96d14e25e2df0bb1eca904d) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-03glibc/glibc-locale: Fix do_stash_locale to work with usrmerge and multilibsJason Wessel
The do_stash_locale was not working consistently across the 4 build configurations and the multilib, usrmerge configuration would fail entirely with the obscure message: | DEBUG: Executing shell function do_prep_locale_tree | tar: i18n: Cannot stat: No such file or directory | tar: Exiting with failure status due to previous errors | gzip: /poky/build/tmp/work/core2-64-poky-linux/glibc-locale/2.29-r0/locale-tree//usr/share/i18n/charmaps/*gz.gz: No such file or directory | WARNING: /poky/build/tmp/work/core2-64-poky-linux/glibc-locale/2.29-r0/temp/run.do_prep_locale_tree.124690:1 exit 1 from 'gunzip $i' Here is the 4 build configurations without the patch applied: A) x86-64 no multilibs, no usrmerge find ./tmp/work/*/glibc/2.29-r0/stashed-locale -type f |grep -v nscd.service |wc -l 909 B) x86-64 no multilibs, usrmerge find ./tmp/work/*/glibc/2.29-r0/stashed-locale -type f |grep -v nscd.service |wc -l 909 C) x86-64 multilibs, no usrmerge find ./tmp/work/*/glibc/2.29-r0/stashed-locale -type f |grep -v nscd.service |wc -l 885 D) x86-64 multilibs, usrmerge find ./tmp/work/*/glibc/2.29-r0/stashed-locale -type f |grep -v nscd.service |wc -l 864 The issue here is that all the moves should be processed first, then a copy should be made of the lib directories, but only in the case they are different when using the usrmerge feature. Even though the build worked for the multilib configuration without usrmerge, the content was not the same. After applying the patch the same number of files are in all the configurations. The list of files was also diffed, after normalizing the directory names to ensure all the correct files were copied. Ultimately there are probably additional files that should be pruned from what is copied to the stated_locale, but the purpose of this patch is make it 100% consistent between the build types and fix the builds. (From OE-Core rev: 33c2e7b4944af22ca47b53d1f85d03426f169bb7) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-03glibc-locale: Fix build error with PACKAGE_NO_GCONV = "1"Jason Wessel
When the PACKAGE_NO_GCONV is set to 1 an empty directory is left behind from the do_install rule: ===== ERROR: glibc-locale-2.29-r0 do_package: QA Issue: glibc-locale: Files/directories were installed but not shipped in any package: /usr/lib /usr/lib/locale Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. glibc-locale: 2 installed and not shipped files. [installed-vs-shipped] ERROR: glibc-locale-2.29-r0 do_package: Fatal QA errors found, failing task. ===== The simple fix is to prune the empty directory. (From OE-Core rev: 4b3c5ec80e696fc2c7ce7ceba118095f9b8f6439) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-30glibc: Fix multilibs + usrmerge buildsJason Wessel
The build of glibc fails when you have multilibs enabled + the distro feature usrmerge. Here is an example configuration: === MACHINE = "qemux86-64" VIRTUAL-RUNTIME_init_manager = "systemd" DISTRO_FEATURES_append = " systemd " DISTRO_FEATURES_append += " usrmerge" require conf/multilib.conf MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "x86" === This will fail with the following error: NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks ERROR: glibc-2.28-r0 do_poststash_install_cleanup: Function failed: do_poststash_install_cleanup (log file is located at /poky/build/tmp/work/core2-64-poky-linux/glibc/2.28-r0/temp/log.do_poststash_install_cleanup.107893) ERROR: Logfile of failure stored in: /poky/build/tmp/work/core2-64-poky-linux/glibc/2.28-r0/temp/log.do_poststash_install_cleanup.107893 The fix is to not perform the rmdir check when using the multilib + usr/merge, namely: if [ "${libdir}" != "${exec_prefix}/lib" ] && [ "${root_prefix}/lib" != "${exec_prefix}/lib" ]; then This will evaluate as follows (collecting the output from bitbake -e glibc) * no multilibs no usrmerge if [ "/usr/lib" != "/usr/lib" ] && [ "/lib" != "/usr/lib" ]; then * no multilibs yes usrmerge if [ "/usr/lib" != "/usr/lib" ] && [ "/usr/lib" != "/usr/lib" ]; then * yes multilibs no usrmerge if [ "/usr/lib64" != "/usr/lib" ] && [ "/lib" != "/usr/lib" ]; then * yes multilibs yes user merge if [ "/usr/lib64" != "/usr/lib" ] && [ "/usr/lib" != "/usr/lib" ]; then (From OE-Core rev: c5640f8c8663c8f81125bf7c5bc2ef8e9fe55315) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-31glibc-locale: DEPEND on virtual/libcJoshua Watt
The restriction against glibc-locale depending on virtual/libc is removed now that libc-initial no longer exists. Adding the DEPENDS on virtual/libc fixes a race (and reproducibility issue) where the packages created by this recipe would have different runtime dependencies depending on if libc had generated its packages yet or not. (From OE-Core rev: 75539cb23073596a9f13446dd6f3921755d7fb53) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-26glibc: always use bfd linkerMartin Jansa
* Work around broken ld-2.29.so when gold is used causing qemu-arm to segfault during e.g. gobject-introspection or postinst at do_rootfs time, more details in: http://lists.openembedded.org/pipermail/openembedded-devel/2019-March/198937.html https://sourceware.org/bugzilla/show_bug.cgi?id=24148 https://sourceware.org/bugzilla/show_bug.cgi?id=10937 https://sourceware.org/bugzilla/show_bug.cgi?id=18103 (From OE-Core rev: ac64c3b96bdff0b61bb5247fcd2d7ef4be881c09) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-24glibc: fix CVE-2019-9169Ross Burton
(From OE-Core rev: 966213b3c99d428f2afba3ad3d88189669005eb6) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-18glibc: fix do_populate_sdk fail when multilib usedChangqing Li
fix below error: file /usr/include/bits/procfs-id.h conflicts between attempted installs of lib32-libc6-dev-2.29-r0.armv7vet2hf_vfp and libc6-dev-2.29-r0.aarch64 file /usr/include/bits/procfs.h conflicts between attempted installs of lib32-libc6-dev-2.29-r0.armv7vet2hf_vfp and libc6-dev-2.29-r0.aarch64 file /usr/include/bits/shmlba.h conflicts between attempted installs of lib32-libc6-dev-2.29-r0.armv7vet2hf_vfp and libc6-dev-2.29-r0.aarch64 (From OE-Core rev: 1e9120096da81171e9213b0b78df0aff7002de15) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06glibc: Drop upstream rejected patchesKhem Raj
These patches were applied, hoping that they will eventually be accepted upstream but they have been rejected, I think its best that they are dropped so we can avoid novel unintended behaviours that no other distros will be seeing (From OE-Core rev: 54550aa42378ce4b215bccbfd95e5e650b0d2efa) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-02glibc: Disable Werror when building with debug optionsKhem Raj
Since compiler does not optimize away a lot of stuff we end up with Werrors e.g. ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf': ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized] 114 | + (k * ln2_lo + c))) - f); | ~~~~~~~~~~~~^~~~ which otherwise wont happen, so lets build with warnings-as-errors disabled in debug mode given we disable werror, now we don't have to restrict user to compile without -O0 (From OE-Core rev: 9772eaafc1cb5957661d43e8f76c6f9b07b854dc) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28glibc: Move common bits to glibc-common.incKhem Raj
We have been duplicating few variables in glibc recipes which could actually be defined once, therefore move them to glibc-common.inc which is included by all glibc family of recipes (From OE-Core rev: 41093cb6c6d5edccebf41e62ed537779b1ee47bf) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28default-distrovars: Drop DISTRO_FEATURES_LIBCKhem Raj
After eglibc was merged into glibc, Kconfig support was also dropped so these libc features therefore are not effective anymore and can be removed (From OE-Core rev: c62b1cc06613a4cdddf53290e6203559f43fc62d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-26glibc: Install AArch64 loader link correctly for usrmerge+multilibMike Crowe
The AArch64 little-endian ABI requires that the dynamic loader is always available at /lib/ld-linux-aarch64.so.1. Similarly, the big-endian ABI requires that the dynamic loader is always available at /lib/ld-linux-aarch64_be.so.1. glibc-package.inc contains code that tries to ensure this, but unfortunately it is defeated by the combination of multilib and usrmerge because it does not take into account that /lib is the same as /usr/lib with usrmerge when it adds the loader path to libc_baselibs and when it attempts to show that /usr/lib is empty in do_poststash_install_cleanup. This results in the symlink not being included in the package and a build failure due to rmdir failing. Richard Purdie also suggested[1] that ${nonarch_base_libdir} should not be used as a synonym for /lib in this case. This hopefully-fixed version always sets ARCH_DYNAMIC_LOADER and then uses ${root_prefix}/lib/${ARCH_DYNAMIC_LOADER} to refer to the dynamic loader which works with both multilib and usrmerge. Since ARCH_DYNAMIC_LOADER is only non-empty if the symlink is required, the code to create it can move to do_install_append. Then do_poststash_install_cleanup needs to be taught that ${exec_prefix}/lib may not be empty if the dynamic loader symlink is there. It appears not to be possible to specify the name of the loader via a variable with an override, since the _aarch64 override is applied even for _aarch64-be, so I've set the loader name using ${TARGET_ARCH} instead. Build-tested and inspected core-image-minimal rootfs with: * AArch64 no multilib (real loader in correct place) MACHINE = "qemuarm64" * AArch64 multilib (symlink in correct place) MACHINE = "qemuarm64" MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "armv7at-neon" require conf/multilib.conf * AArch64 usrmerge (real loader in correct place) DISTRO_FEATURES += "usrmerge" MACHINE = "qemuarm64" * AArch64 multilib usrmerge (symlink in correct place) DISTRO_FEATURES += "usrmerge" MACHINE = "qemuarm64" MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "armv7at-neon" require conf/multilib.conf * big-endian versions of all of the above by also setting DEFAULTTUNE = "aarch64_be". (building glibc only.) * x86_64 (real loader in /lib as before)[2] MACHINE = "qemux86" * x86_64 multilib (real loader in /lib64 as before) MACHINE="qemux86-64" MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "x86" require conf/multilib.conf I also tested leaving an unwanted file in ${exec_prefix}/lib for do_poststash_install_cleanup to detect, and I believe the detection always worked correctly. [1] http://lists.openembedded.org/pipermail/openembedded-core/2018-November/276120.html (From OE-Core rev: a705c0782c863ee960d65b5109168a4587a0a7b7) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-26glibc: Remove ChangeLog diff from patchAlistair Francis
To avoid conflicts with other forks of glibc remove the diff from the ChangeLog. (From OE-Core rev: 695d79af1edcc76a01055b01922f0d106c8291ca) Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-20glibc: CVE-2019-7309Zhixiong Chi
Backport the CVE patch from the upstream commit 3f635fb43389b54f682fc9ed2acc0b2aaf4a923d (From OE-Core rev: 518be39ac82593c539144ac83acc459a45b7a81d) Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-08glibc-locale: Rewrite do_install using install utility instead of cpKhem Raj
This has been a constant source of trouble for build failures due to host-user-contaminated QA errors of sort ERROR: QA Issue: glibc-locale: /glibc-binary-localedata-ca-es+valencia/usr/lib/locale/ca_ES@valencia/LC_MONETARY is owned by uid 3004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated] So far we have tried to mould cp command into not carrying the build user permissions into install area but it is never entirely fixed since the issue keeps popping up in various scenes This patch replaces use of cp with install utility and specifies install mode for files explcitly (From OE-Core rev: 92fdb64ac9689b9cac8a1229b1928b50338969be) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-05glibc: Fix pthread_rwlock_try*lock stallsKhem Raj
Brings in a backport as described in https://sourceware.org/git/?p=glibc.git;a=commit;h=86013ef5cea322b8f4b9c22f230c22cce369e947 (From OE-Core rev: bcd5229c8045c3e0add0fc4f57ce9bfb5fc86328) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02glibc: Update to 2.29 releaseKhem Raj
(From OE-Core rev: 9d9e055192bf1c66f2131482e6239e9c844ad0f4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31glibc: systemd and sysvinit are not mutually exclusiveJonas Bonn
(From OE-Core rev: 0990d77d99a9ba81e21961f9633df10ccef4b1a4) Signed-off-by: Jonas Bonn <jonas@norrbonn.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-21musl,glibc,newlib: Drop redundant STAGINGCCKhem Raj
We do not have initial phase of bootstrapping toolchains anymore (From OE-Core rev: 75a2c15bbabf4df14631c822b20ce6d31098a5c8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26glibc: Enable --with-default-linkKhem Raj
This lets linker to use its internal linker script for shared objects Fixes with when gold is default linker (From OE-Core rev: 7bbc453ac2b8d63680855789948a145fc448017f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26recipes: Drop virtual/libc-for-gccRichard Purdie
We no longer have special "libc" for gcc so we can rely on plain virtual/libc and reduce the complexity in the dependencies. (From OE-Core rev: 122217b421f749b5fef52bea44ad6e04bc8f8d3a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26gcc: Drop gcc-cross-initial and use gcc-cross insteadRichard Purdie
We need a libgcc to build glibc. Tranditionally we therefore build a non-threaded and non-shared compiler (gcc-cross-initial), then use that to build libgcc-initial which is used to build glibc which we can then build gcc-cross and libgcc against. Firstly, we can drop the glibc dependency from gcc-cross, *if* we make two changes: a) specify the minimum glibc version to support in a configure option b) create a dummy limits.h file so that later when glibc creates one, the headers structure has support for it. We can do this with a simple empty file Once gcc-cross is libc independent, we can use it to build both libgcc-initial and then later libgcc. libgcc-initial is tricky as we need to imitate the non-threaded and non-shared case. We can do that by hacking the threading mode back to "single" even if gcc reports "posix" and disable libc presence for the libgcc-intial build. We have to create the dummy limits.h to avoid compiler errors from a missing header. glibc will fail to link with libgcc-initial due to a missing "exception handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need any exception handler, we can safely symlink to libgcc.a. With those changes, gcc-cross can be used in all places and we only need one build of gcc for each architecture. For some reason ifunc was being disabled on mips prior to these changes but afterwards became enabled but caused assertion failures. This is therefore disabled until we can debug that. (From OE-Core rev: 62b7308b8c4d2b439a15a4f7cbc6f823077bb0be) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26glibc: Remove site_config and glibc-initialRichard Purdie
The only reason we appear to need glibc-initial at this time is to support the site_config code. The site_config code compiles and therefore needs at least some level of working C library to link against. This isn't a good reason to keep the complexity of glibc-initial around so remove it, and the site_config support which then breaks. Performance benchmarks suggest the time spent just rerunning configure for site_config just about equals any performance benefit for OE-Core image builds excluding the time spent adding glibc-initial to the dependency chain. I'm not opposed to readding some other form of site_config support but it needs to be rethought. (From OE-Core rev: c5df105e7583e43da9b682f739bebaf873dcd2f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08glibc: improve reproducibility with multilibHongxu Jia
Multilib builds specify several loaders which will end up embedded in some binaries or script files. To support reproducible builds, we must ensure the loaders are always in deterministic order. [YOCTO #2655] [YOCTO #12478] [YOCTO #12480] (From OE-Core rev: 3f839c0cdfe253677ebee47838fe476a0939e0aa) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Improve the fix and rebase it to 2.28 Here is the log of lib32-glibc [log.do_compile] |Adjust ldd script |ldd "/lib64/ld-linux-x86-64.so.2 /lib/ld-linux.so.2 /lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2" -> "/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2" [log.do_compile] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05glibc-locale: fix installed-vs-shipped qa issueKai Kang
Variable PACKAGE_NO_GCONV is set in libc-package.bbclass when none of libc-charsets, libc-locales and libc-locale-code set in DISTRO_FEATURES. Then it causes installed-vs-shipped qa issue of glibc-locale: | ERROR: glibc-locale-2.28-r0 do_package: QA Issue: glibc-locale: | Files/directories were installed but not shipped in any package: | /usr/share/i18n | /usr/share/i18n/charmaps | /usr/share/i18n/locales | /usr/share/i18n/charmaps/CP737.gz | ... | /usr/share/i18n/locales/ru_RU | ... | /usr/lib64/gconv/gconv-modules | Please set FILES such that these items are packaged. Alternatively if they | are unneeded, avoid installing them or delete them within do_install. | glibc-locale: 843 installed and not shipped files. [installed-vs-shipped] So check PACKAGE_NO_GCONV during do_install and not copy those files if PACKAGE_NO_GCONV has been set. Simplify call of bb.utils.contains() in libc-package.bbclass as well. (From OE-Core rev: 39840ed10af559bbcc306b378baa4723921668f5) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-14locale: Allow usage of cross-localedef for ARCAlexey Brodkin
With this it's possible to build locale data for ARC and not do it instead on the first boot. (From OE-Core rev: f13c303491dc8850126ea14baedc7b63b7b5ecf4) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-09glibc: make ld-2.28.so reproducible on armMartin Hundebøll
Play the whack-a-mole game and add the .file directive to another assembly file that otherwise shows itself in ld-2.28.so debug file, which in turns alters the build-id of ld-2.28.so on target. (From OE-Core rev: 4cbf901b3a127ed039371e614946002d26d56997) Signed-off-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-14glibc: Do not use thumb1 ISA on armv6Khem Raj
This does not work and is unsupported so lets compile glibc in ARM mode always on armv6 SOCs Fixes [YOCTO #12929] (From OE-Core rev: de01490695c70ae29b4f2f82aecbffaf5667449e) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-04glibc: Fix glibc reproducibility issuesRichard Purdie
Currently for non-IA platforms, glibc is not reproducible as host system paths are being injected into target binaries. These spread through all target binaries on the system which link to the libc. Add a patch which injects .file directives into the assembly pieces and works around this issue until a better solution can be found. (From OE-Core rev: 4d6fd8178da75f9a1870db290bbe24de5af752c9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-04glibc: bump SRCREV to latest 2.28Martin Jansa
* drop one patch already applied in upstream * this is still only partial fix for issues with -O0 and the bigger issue might be detected in runtime as described in: https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F https://sourceware.org/bugzilla/show_bug.cgi?id=19444 and tested in glibc build: https://sourceware.org/git/?p=glibc.git;a=blob;f=include/libc-symbols.h;h=8b9273c13a19f2658105c7997267d9086adae716;hb=HEAD#l74 * restore the anonymous python to trigger fatal error when -O0 is used (but don't restore the notes for -O, -O1, -Os * git log --oneline 3c03baca37fdcb52c3881e653ca392bba7a99c2b..044c96f0d5595aeb0bb4e79355081c5a7f4faca5 | tee 044c96f0d5 Fix misreported errno on preadv2/pwritev2 (BZ#23579) 3a67c72c15 Fix stack overflow in tst-setcontext9 (bug 23717) 2339d6a55e i386: Use ENTRY and END in start.S [BZ #23606] 0ef2f4400c Fix strstr bug with huge needles (bug 23637) a55e109709 Fix tst-setcontext9 for optimized small stacks. 307d04334d misc: New test misc/tst-gethostid e7d22db29c Linux gethostid: Check for NULL value from gethostbyname_r [BZ #23679] 1fe2b9ca8a Fix segfault in maybe_script_execute. 0b79004569 regex: Add test tst-regcomp-truncated [BZ #23578] 58559f1443 regex: fix uninitialized memory access aa8a3e4cde pthread_cond_broadcast: Fix waiters-after-spinning case [BZ #23538] c87b5bab24 Improve ChangeLog message. 66fdfd57fe Regen RISC-V rvd ULPs b0aa03dfff RISC-V: Fix rounding save/restore bug. 2f498f3d14 nss_files: Fix file stream leak in aliases lookup [BZ #23521] bfcfa22589 nscd: Deallocate existing user names in file parser d05b05d157 error, error_at_line: Add missing va_end calls 4b25485f03 Linux: Rewrite __old_getdents64 [BZ #23497] 726e1554ce hurd: Avoid PLTs for __pthread_get/setspecific 7f11842e74 hurd: Add missing symbols for proper libc_get/setspecific * update 0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch based on review comments in upstream and extend it to cover PPC based on: http://lists.openembedded.org/pipermail/openembedded-core/2018-September/156258.html * update 0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch based on review comments in upstream * add 0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch with a fix for aarch64 build with -Os * build tested with qemuarm, qemuarm64, qemux86, qemux86-64, qemuppc, qemumips, qemumips64 with -O, -O1, -Os. (From OE-Core rev: f1f38df91975f9b53933c2d2fbdca291d1872d5f) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-27glibc-package.inc: correct intention for deleting /usr/lib as neededAwais Belal
In case the baselib is lib64 we would want to delete /usr/lib after removing the /usr/lib/locale dir and the implementation wanted to do that earlier as well but the fault was checking an already removed dir (/usr/lib/locale) before trying to remove /usr/lib as that check would always fail. Now we simply try to delete /usr/lib after deleting /usr/lib/locale to make sure it deletes cleanly and is empty at the time of deletion. (From OE-Core rev: 4dad1568f8f84ec9de4bf7235822f77a8ee6a413) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-21glibc: fix Segmentation fault in gethostid.cMingli Yu
Linux gethostid: Check for NULL value from gethostbyname_r [BZ #23679] A NULL value can happen with certain gethostbyname_r failures. Before this patch, there is a Segmentation fault as below: # /mybuild/hostid Segmentation fault # gdb /mybuild/hostid GNU gdb (GDB) 8.2 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-wrs-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /mybuild/hostid...done. (gdb) r Starting program: /mybuild/hostid Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f0330e in gethostid () at ../sysdeps/unix/sysv/linux/gethostid.c:125 125 memcpy (&in, hp->h_addr, (gdb) bt #0 0x00007ffff7f0330e in gethostid () at ../sysdeps/unix/sysv/linux/gethostid.c:125 #1 0x0000555555555159 in main () # cat /mybuild/hostid.c #include <stdio.h> #include <unistd.h> int main(int argc, char *argv[]) { long hostid; hostid = gethostid(); printf("the hostid is %ld\n", hostid); } (From OE-Core rev: 92c266fd9b1c4034a13bd5b102d1817df388a7b5) Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-20glibc: fix build with -OMartin Jansa
* tested for qemuarm, qemux86 with -O, -O0, -Os, with gcc * to build with -O0 I had to remove restriction from systemtap first (From OE-Core rev: be3d12c6b1003348f1dabec9d2253f22b42f0387) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-04glibc-locale: Enable riscv64 and riscv32 in BINARY_LOCALE_ARCHES supported ↵Khem Raj
architectures This support is there using cross-localedef but was not enabled, this caused the post-install for locales to be emitted which delays the boot significantly. emitted postints for locales contain exit 1 which is flagged now and was causing image generation to fail. (From OE-Core rev: c67298f3af9cbb8c7596e4fb20b652a8f2582add) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-23glibc-ld: Simplify/cleanup multilib handling to use library functionsRichard Purdie
We have library functions to handle multilib variables/datastores, lets use them so we have good common functions. (From OE-Core rev: 774219567987956fb7bbb50e64eb6cebef1efe5b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-23glibc: Improve ldd loader specificationRichard Purdie
Currently if a tune isn't specified in the table, the loader defaults for the architecture are used which may or may not match our path specification. This leads to general confusion. Change the code to use the linuxloader class which works of architecture, not tune. This still isn't perfect as n32/x32 aren't covered but its an improvement to listing all tunes here. (From OE-Core rev: 46a6da24b51426bedd9af8a2d63b2992b9d3fa5a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-19glibc: re-package for libnss-dbChen Qi
On other distros like ubuntu/centos, libnss-db usually provides: - The libraries - The Makefile to create database (in /var/db for centos, /var/lib/misc/ for ubuntu) - The makedb command (it's in glibc-common for centos7) What we had is: - The libraries are in glibc-extra-nss - The Makefile is removed - The makedb command is in glibc-utils (lack of dependency) So when glibc-extra-nss is installed but glibc-utils is not, we see error like: nscd[165]: 165 checking for monitored file `/var/db/group.db': No such file or directory nscd[165]: 165 checking for monitored file `/var/db/passwd.db': No such file or directory And there is not an easy way to create these databases. To fix the issue: - Re-package the libraries into libnss-db - Don't remove the Makefile and add it in libnss-db - Add RDEPENDS for libnss-db on glibc-utils - Provide a shell script, makedbs.sh, to generate the db files. This is to avoid dependency on 'make'. Notes: 1. For external toolchain, an extra package 'libnss-db' need to be provided If replacing glibc from core. 2. I've check the git history of nss/db-Makefile, the last two functionality fix is as below. - fix non-portable `echo -n` usage -- Date: Thu Aug 6 04:14:20 2015 -0400 - Fix db makefile rule for group.db -- Date: Fri Nov 11 14:43:36 2011 +0100 So I think this file is stable enough. And using makedbs.sh which is crafted according to that file is not likely to cause maintanence problem. (From OE-Core rev: 13cf502fce8956f95fdc8ac0c7a37d741223bcc9) Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-16glibc-initial: Add missing bison-native dependencyRichard Purdie
(From OE-Core rev: 11e7dc96e7bc9d1cbf1f3bd10caeb65190c41a2f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15glibc: Fix locale archive path patchRichard Purdie
The locale code uses the archive location in two places, ensure both are corrected to use the environment variable which avoids nasty build failures when archiving locales in images. (From OE-Core rev: 3ab1249a2ac92a0fcb008e92cc9ee272441408f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>