summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r--meta/recipes-core/glibc/cross-localedef-native_2.41.bb (renamed from meta/recipes-core/glibc/cross-localedef-native_2.33.bb)30
-rw-r--r--meta/recipes-core/glibc/glibc-common.inc16
-rw-r--r--meta/recipes-core/glibc/glibc-ld.inc2
-rw-r--r--meta/recipes-core/glibc/glibc-locale.inc51
-rw-r--r--meta/recipes-core/glibc/glibc-locale_2.41.bb (renamed from meta/recipes-core/glibc/glibc-locale_2.33.bb)0
-rw-r--r--meta/recipes-core/glibc/glibc-mtrace.inc4
-rw-r--r--meta/recipes-core/glibc/glibc-mtrace_2.41.bb (renamed from meta/recipes-core/glibc/glibc-mtrace_2.33.bb)0
-rw-r--r--meta/recipes-core/glibc/glibc-package.inc169
-rw-r--r--meta/recipes-core/glibc/glibc-scripts.inc4
-rw-r--r--meta/recipes-core/glibc/glibc-scripts_2.41.bb (renamed from meta/recipes-core/glibc/glibc-scripts_2.33.bb)0
-rw-r--r--meta/recipes-core/glibc/glibc-tests.inc (renamed from meta/recipes-core/glibc/glibc-testsuite_2.33.bb)35
-rw-r--r--meta/recipes-core/glibc/glibc-testsuite_2.41.bb36
-rw-r--r--meta/recipes-core/glibc/glibc-version.inc10
-rw-r--r--meta/recipes-core/glibc/glibc.inc16
-rw-r--r--meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch24
-rw-r--r--meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch2
-rw-r--r--meta/recipes-core/glibc/glibc/0001-stdlib-Add-single-threaded-fast-path-to-rand.patch47
-rw-r--r--meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch2
-rw-r--r--meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch30
-rw-r--r--meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch6
-rw-r--r--meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch47
-rw-r--r--meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch14
-rw-r--r--meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch22
-rw-r--r--meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch1581
-rw-r--r--meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch32
-rw-r--r--meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch205
-rw-r--r--meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch (renamed from meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch)142
-rw-r--r--meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch384
-rw-r--r--meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch (renamed from meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch)2
-rw-r--r--meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch (renamed from meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch)8
-rw-r--r--meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch (renamed from meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch)8
-rw-r--r--meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch33
-rw-r--r--meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch (renamed from meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch)104
-rw-r--r--meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch (renamed from meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch)10
-rw-r--r--meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch (renamed from meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch)6
-rw-r--r--meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch42
-rw-r--r--meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch79
-rw-r--r--meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch (renamed from meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch)45
-rw-r--r--meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch (renamed from meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch)20
-rw-r--r--meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch47
-rw-r--r--meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch27
-rw-r--r--meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch86
-rw-r--r--meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch32
-rw-r--r--meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch29
-rw-r--r--meta/recipes-core/glibc/glibc/0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch54
-rw-r--r--meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch53
-rw-r--r--meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch31
-rw-r--r--meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch53
-rw-r--r--meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch29
-rw-r--r--meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch75
-rw-r--r--meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch116
-rw-r--r--meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/check-test-wrapper11
-rw-r--r--meta/recipes-core/glibc/glibc/faccessat2-perm.patch31
-rw-r--r--meta/recipes-core/glibc/glibc_2.33.bb120
-rw-r--r--meta/recipes-core/glibc/glibc_2.41.bb142
-rw-r--r--meta/recipes-core/glibc/ldconfig-native-2.12.1/add-riscv-support.patch79
-rw-r--r--meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-handle-.dynstr-located-in-separate-segment.patch178
-rw-r--r--meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch2
-rw-r--r--meta/recipes-core/glibc/ldconfig-native_2.12.1.bb8
62 files changed, 1267 insertions, 3378 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.33.bb b/meta/recipes-core/glibc/cross-localedef-native_2.41.bb
index ec59c6ba10..95acb3fc56 100644
--- a/meta/recipes-core/glibc/cross-localedef-native_2.33.bb
+++ b/meta/recipes-core/glibc/cross-localedef-native_2.41.bb
@@ -1,9 +1,9 @@
1SUMMARY = "Cross locale generation tool for glibc" 1SUMMARY = "Cross locale generation tool for glibc"
2HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" 2HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
3SECTION = "libs" 3SECTION = "libs"
4LICENSE = "LGPL-2.1" 4LICENSE = "LGPL-2.1-only"
5 5
6LIC_FILES_CHKSUM = "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ 6LIC_FILES_CHKSUM = "file://LICENSES;md5=df6e0948b55669789c30764c5fd9bc41 \
7 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 7 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
8 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ 8 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
9 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" 9 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
@@ -20,27 +20,29 @@ inherit native
20FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:" 20FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
21 21
22SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ 22SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
23 git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \ 23 git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/localedef;protocol=https \
24 \ 24 \
25 file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ 25 file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \
26 file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ 26 file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \
27 \ 27 \
28 file://0016-timezone-re-written-tzselect-as-posix-sh.patch \ 28 file://0010-eglibc-Cross-building-and-testing-instructions.patch \
29 file://0017-Remove-bash-dependency-for-nscd-init-script.patch \ 29 file://0011-eglibc-Help-bootstrap-cross-toolchain.patch \
30 file://0018-eglibc-Cross-building-and-testing-instructions.patch \ 30 file://0012-eglibc-Resolve-__fpscr_values-on-SH4.patch \
31 file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \ 31 file://0013-eglibc-Forward-port-cross-locale-generation-support.patch \
32 file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \ 32 file://0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
33 file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \ 33 file://0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch \
34 file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \ 34 file://0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \
35 file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ 35 "
36"
37# Makes for a rather long rev (22 characters), but... 36# Makes for a rather long rev (22 characters), but...
38# 37#
39SRCREV_FORMAT = "glibc_localedef" 38SRCREV_FORMAT = "glibc_localedef"
40 39
41S = "${WORKDIR}/git"
42
43EXTRA_OECONF = "--with-glibc=${S}" 40EXTRA_OECONF = "--with-glibc=${S}"
41
42# We do not need bash to run tzselect script, the default is to use
43# bash but it can be configured by setting KSHELL Makefile variable
44EXTRA_OEMAKE += "KSHELL=/bin/sh"
45
44CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" 46CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
45 47
46do_install() { 48do_install() {
diff --git a/meta/recipes-core/glibc/glibc-common.inc b/meta/recipes-core/glibc/glibc-common.inc
index 41ff7e9a19..fb62a4af94 100644
--- a/meta/recipes-core/glibc/glibc-common.inc
+++ b/meta/recipes-core/glibc/glibc-common.inc
@@ -2,9 +2,9 @@ SUMMARY = "GLIBC (GNU C Library)"
2DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel." 2DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel."
3HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" 3HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
4SECTION = "libs" 4SECTION = "libs"
5LICENSE = "GPLv2 & LGPLv2.1" 5LICENSE = "GPL-2.0-only & LGPL-2.1-or-later"
6 6
7LIC_FILES_CHKSUM ?= "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ 7LIC_FILES_CHKSUM ?= "file://LICENSES;md5=df6e0948b55669789c30764c5fd9bc41 \
8 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 8 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
9 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ 9 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
10 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" 10 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
@@ -13,13 +13,15 @@ CVE_PRODUCT = "glibc"
13 13
14INHIBIT_DEFAULT_DEPS = "1" 14INHIBIT_DEFAULT_DEPS = "1"
15 15
16ARM_INSTRUCTION_SET_armv4 = "arm" 16ARM_INSTRUCTION_SET:armv4 = "arm"
17ARM_INSTRUCTION_SET_armv5 = "arm" 17ARM_INSTRUCTION_SET:armv5 = "arm"
18ARM_INSTRUCTION_SET_armv6 = "arm" 18ARM_INSTRUCTION_SET:armv6 = "arm"
19# 19#
20# We will skip parsing glibc when target system C library selection is not glibc 20# We will skip parsing glibc when target system C library selection is not glibc
21# this helps in easing out parsing for non-glibc system libraries 21# this helps in easing out parsing for non-glibc system libraries
22# 22#
23COMPATIBLE_HOST_libc-musl_class-target = "null" 23COMPATIBLE_HOST:libc-musl:class-target = "null"
24 24
25PV = "2.33" 25PV = "2.41+git"
26
27TOOLCHAIN = "gcc"
diff --git a/meta/recipes-core/glibc/glibc-ld.inc b/meta/recipes-core/glibc/glibc-ld.inc
index 041ffbb9cb..da8fcc430b 100644
--- a/meta/recipes-core/glibc/glibc-ld.inc
+++ b/meta/recipes-core/glibc/glibc-ld.inc
@@ -16,5 +16,5 @@ def glibc_dl_info(d):
16 16
17EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}" 17EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
18RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}" 18RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
19RTLDLIST_class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}" 19RTLDLIST:class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}"
20glibc_dl_info[vardepsexclude] = "OVERRIDES" 20glibc_dl_info[vardepsexclude] = "OVERRIDES"
diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc
index ef06389ff9..90248bbc0f 100644
--- a/meta/recipes-core/glibc/glibc-locale.inc
+++ b/meta/recipes-core/glibc/glibc-locale.inc
@@ -5,14 +5,9 @@ SUMMARY = "Locale data from glibc"
5BPN = "glibc" 5BPN = "glibc"
6LOCALEBASEPN = "${MLPREFIX}glibc" 6LOCALEBASEPN = "${MLPREFIX}glibc"
7 7
8# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy 8# Do not inhibit default deps, do_package requires binutils/gcc for
9# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so') 9# objcopy/gcc-nm and glibc-locale depends on virtual/libc directly.
10# ERROR: Function failed: split_and_strip_files 10INHIBIT_DEFAULT_DEPS = ""
11BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
12BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
13do_package[depends] += "${BINUTILSDEP}"
14
15DEPENDS += "virtual/libc"
16 11
17# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION 12# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
18# is set. The idea is to avoid running localedef on the target (at first boot) 13# is set. The idea is to avoid running localedef on the target (at first boot)
@@ -21,11 +16,11 @@ DEPENDS += "virtual/libc"
21 16
22# default to disabled 17# default to disabled
23ENABLE_BINARY_LOCALE_GENERATION ?= "0" 18ENABLE_BINARY_LOCALE_GENERATION ?= "0"
24ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "1" 19ENABLE_BINARY_LOCALE_GENERATION:pn-nativesdk-glibc-locale = "1"
25 20
26#enable locale generation on these arches 21#enable locale generation on these arches
27# BINARY_LOCALE_ARCHES is a space separated list of regular expressions 22# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
28BINARY_LOCALE_ARCHES ?= "arc arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64" 23BINARY_LOCALE_ARCHES ?= "arc arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64 loongarch64"
29 24
30# set "1" to use cross-localedef for locale generation 25# set "1" to use cross-localedef for locale generation
31# set "0" for qemu emulation of native localedef for locale generation 26# set "0" for qemu emulation of native localedef for locale generation
@@ -33,42 +28,45 @@ LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
33 28
34PROVIDES = "virtual/libc-locale" 29PROVIDES = "virtual/libc-locale"
35 30
36PACKAGES = "localedef ${PN}-dbg" 31PACKAGES = "localedef ${PN}-dbg ${LOCALEBASEPN}-locale-alias"
37 32
38PACKAGES_DYNAMIC = "^locale-base-.* \ 33PACKAGES_DYNAMIC = "^locale-base-.* \
39 ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ 34 ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
40 ^${MLPREFIX}glibc-gconv$" 35 ^${MLPREFIX}glibc-gconv$"
41 36
42# Create a glibc-binaries package 37# Create a glibc-binaries package
43ALLOW_EMPTY_${BPN}-binaries = "1" 38ALLOW_EMPTY:${BPN}-binaries = "1"
44PACKAGES += "${BPN}-binaries" 39PACKAGES += "${BPN}-binaries"
45RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}" 40RRECOMMENDS:${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary-") != -1])}"
46 41
47# Create a glibc-charmaps package 42# Create a glibc-charmaps package
48ALLOW_EMPTY_${BPN}-charmaps = "1" 43ALLOW_EMPTY:${BPN}-charmaps = "1"
49PACKAGES += "${BPN}-charmaps" 44PACKAGES += "${BPN}-charmaps"
50RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}" 45RRECOMMENDS:${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap-") != -1])}"
51 46
52# Create a glibc-gconvs package 47# Create a glibc-gconvs package
53ALLOW_EMPTY_${BPN}-gconvs = "1" 48ALLOW_EMPTY:${BPN}-gconvs = "1"
54PACKAGES += "${BPN}-gconvs" 49PACKAGES += "${BPN}-gconvs"
55RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}" 50RRECOMMENDS:${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv-") != -1])}"
56 51
57# Create a glibc-localedatas package 52# Create a glibc-localedatas package
58ALLOW_EMPTY_${BPN}-localedatas = "1" 53ALLOW_EMPTY:${BPN}-localedatas = "1"
59PACKAGES += "${BPN}-localedatas" 54PACKAGES += "${BPN}-localedatas"
60RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}" 55RRECOMMENDS:${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata-") != -1])}"
61 56
62DESCRIPTION_localedef = "glibc: compile locale definition files" 57DESCRIPTION:localedef = "glibc: compile locale definition files"
63 58
64# glibc-gconv is dynamically added into PACKAGES, thus 59# glibc-gconv is dynamically added into PACKAGES, thus
65# FILES_glibc-gconv will not be automatically extended in multilib. 60# FILES:glibc-gconv will not be automatically extended in multilib.
66# Explicitly add ${MLPREFIX} for FILES_glibc-gconv. 61# Explicitly add ${MLPREFIX} for FILES:glibc-gconv.
67FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*" 62FILES:${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
68FILES_localedef = "${bindir}/localedef" 63FILES:localedef = "${bindir}/localedef"
64FILES:${LOCALEBASEPN}-locale-alias = "${datadir}/locale/locale.alias"
69 65
70LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale" 66LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
71 67
68PSEUDO_INCLUDE_PATHS .= ",${WORKDIR}/locale-tree"
69
72copy_locale_files() { 70copy_locale_files() {
73 local dir=$1 mode=$2 71 local dir=$1 mode=$2
74 72
@@ -87,10 +85,9 @@ do_install() {
87 if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then 85 if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then
88 copy_locale_files ${libdir}/gconv 0755 86 copy_locale_files ${libdir}/gconv 0755
89 copy_locale_files ${datadir}/i18n 0644 87 copy_locale_files ${datadir}/i18n 0644
90 else
91 # Remove the libdir if it is empty when gconv is not copied
92 find ${D}${libdir} -type d -empty -delete
93 fi 88 fi
89 # Remove empty dirs in libdir when gconv or locales are not copied
90 find ${D}${libdir} -type d -empty -delete
94 copy_locale_files ${datadir}/locale 0644 91 copy_locale_files ${datadir}/locale 0644
95 install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED 92 install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED
96} 93}
diff --git a/meta/recipes-core/glibc/glibc-locale_2.33.bb b/meta/recipes-core/glibc/glibc-locale_2.41.bb
index f7702e0358..f7702e0358 100644
--- a/meta/recipes-core/glibc/glibc-locale_2.33.bb
+++ b/meta/recipes-core/glibc/glibc-locale_2.41.bb
diff --git a/meta/recipes-core/glibc/glibc-mtrace.inc b/meta/recipes-core/glibc/glibc-mtrace.inc
index ef9d60ec23..734a566562 100644
--- a/meta/recipes-core/glibc/glibc-mtrace.inc
+++ b/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -2,8 +2,8 @@ require glibc-collateral.inc
2 2
3SUMMARY = "mtrace utility provided by glibc" 3SUMMARY = "mtrace utility provided by glibc"
4DESCRIPTION = "mtrace utility provided by glibc" 4DESCRIPTION = "mtrace utility provided by glibc"
5RDEPENDS_${PN} = "perl" 5RDEPENDS:${PN} = "perl"
6RPROVIDES_${PN} = "libc-mtrace" 6RPROVIDES:${PN} = "libc-mtrace"
7 7
8SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts" 8SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
9 9
diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.33.bb b/meta/recipes-core/glibc/glibc-mtrace_2.41.bb
index 0b69bad46a..0b69bad46a 100644
--- a/meta/recipes-core/glibc/glibc-mtrace_2.33.bb
+++ b/meta/recipes-core/glibc/glibc-mtrace_2.41.bb
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 8d0cc8047f..21f2200d19 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -1,77 +1,78 @@
1INHIBIT_SYSROOT_STRIP = "1" 1INHIBIT_SYSROOT_STRIP = "1"
2 2
3PACKAGES = "${PN}-dbg catchsegv sln nscd ldconfig ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc" 3PACKAGES = "${PN}-dbg sln nscd ldconfig ldd ldso tzcode glibc-thread-db ${PN}-pic libmemusage malloc-debug libnss-db ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-src"
4 4
5# The ld.so in this glibc supports the GNU_HASH 5# The ld.so in this glibc supports the GNU_HASH
6RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)" 6RPROVIDES:${PN} = "eglibc rtld(GNU_HASH)"
7RPROVIDES_${PN}-utils = "eglibc-utils" 7RPROVIDES:${PN}-utils = "eglibc-utils"
8RPROVIDES_${PN}-mtrace = "eglibc-mtrace libc-mtrace" 8RPROVIDES:${PN}-mtrace = "eglibc-mtrace libc-mtrace"
9RPROVIDES_${PN}-pic = "eglibc-pic" 9RPROVIDES:${PN}-pic = "eglibc-pic"
10RPROVIDES_${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev" 10RPROVIDES:${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev"
11RPROVIDES_${PN}-staticdev = "eglibc-staticdev" 11RPROVIDES:${PN}-staticdev = "eglibc-staticdev"
12RPROVIDES_${PN}-doc = "eglibc-doc" 12RPROVIDES:${PN}-doc = "eglibc-doc"
13RPROVIDES_glibc-extra-nss = "eglibc-extra-nss" 13RPROVIDES:glibc-extra-nss = "eglibc-extra-nss"
14RPROVIDES_glibc-thread-db = "eglibc-thread-db" 14RPROVIDES:glibc-thread-db = "eglibc-thread-db"
15RPROVIDES_${PN}-pcprofile = "eglibc-pcprofile" 15RPROVIDES:${PN}-pcprofile = "eglibc-pcprofile"
16RPROVIDES_${PN}-dbg = "eglibc-dbg" 16RPROVIDES:${PN}-dbg = "eglibc-dbg"
17libc_baselibs = "${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/libmvec-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so" 17libc_baselibs = "${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/libmvec-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
18ARCH_DYNAMIC_LOADER = "" 18ARCH_DYNAMIC_LOADER = ""
19# The aarch64 ABI says the dynamic linker -must- be 19# The aarch64 ABI says the dynamic linker -must- be
20# /lib/ld-linux-aarch64{,_be}.so.1. With usrmerge, that may mean that 20# /lib/ld-linux-aarch64{,_be}.so.1. With usrmerge, that may mean that
21# we need to install it in /usr/lib. 21# we need to install it in /usr/lib.
22ARCH_DYNAMIC_LOADER_aarch64 = "ld-linux-${TARGET_ARCH}.so.1" 22ARCH_DYNAMIC_LOADER:aarch64 = "ld-linux-${TARGET_ARCH}.so.1"
23libc_baselibs_append = " ${@oe.utils.conditional('ARCH_DYNAMIC_LOADER', '', '', '${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}', d)}" 23libc_baselibs:append = " ${@oe.utils.conditional('ARCH_DYNAMIC_LOADER', '', '', '${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}', d)}"
24INSANE_SKIP_${PN}_append_aarch64 = " libdir" 24INSANE_SKIP:${PN}:append:aarch64 = " libdir"
25 25INSANE_SKIP:${PN}-dev += "staticdev"
26FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf" 26INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so libdir"
27RRECOMMENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}" 27
28FILES_ldconfig = "${base_sbindir}/ldconfig" 28FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf"
29FILES_ldd = "${bindir}/ldd" 29CONFFILES:${PN} = "${sysconfdir}/ld.so.conf"
30FILES_libsegfault = "${base_libdir}/libSegFault*" 30RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"
31FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" 31FILES:ldconfig = "${base_sbindir}/ldconfig"
32FILES_libmemusage = "${base_libdir}/libmemusage.so" 32FILES:ldd = "${bindir}/ldd"
33FILES_libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh" 33FILES:ldso = "${bindir}/${MLPREFIX}ld.so"
34RDEPENDS_libnss-db = "${PN}-utils" 34FILES:libmemusage = "${base_libdir}/libmemusage.so"
35FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" 35FILES:malloc-debug = "${base_libdir}/libc_malloc_debug.so.0"
36FILES_sln = "${base_sbindir}/sln" 36FILES:libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh"
37FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" 37RDEPENDS:libnss-db = "${PN}-utils"
38FILES_libsotruss = "${libdir}/audit/sotruss-lib.so" 38FILES:glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
39FILES:sln = "${base_sbindir}/sln"
40FILES:${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
41FILES:libsotruss = "${libdir}/audit/sotruss-lib.so"
39FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}" 42FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
40FILES_${PN}-dev += "${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal" 43FILES:${PN}-dev += "${libdir}/libpthread.a ${libdir}/libdl.a ${libdir}/libutil.a ${libdir}/libanl.a ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal ${libdir}/gcc/${TARGET_SYS}/*/finclude"
41RDEPENDS_${PN}-dev = "linux-libc-headers-dev" 44RDEPENDS:${PN}-dev = "linux-libc-headers-dev"
42FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a" 45FILES:${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
43FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \ 46FILES:nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_system_unitdir}/nscd* ${nonarch_libdir}/tmpfiles.d/nscd.conf \
44 ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd" 47 ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd"
45FILES_${PN}-mtrace = "${bindir}/mtrace" 48FILES:${PN}-mtrace = "${bindir}/mtrace"
46FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${sbindir}/zdump" 49FILES:tzcode = "${bindir}/tzselect ${sbindir}/zic ${bindir}/zdump"
47FILES_${PN}-utils = "${bindir}/* ${sbindir}/*" 50FILES:${PN}-utils = "${bindir}/* ${sbindir}/*"
48FILES_catchsegv = "${bindir}/catchsegv" 51FILES:${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
49RDEPENDS_catchsegv = "libsegfault" 52FILES:glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
50FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so" 53RPROVIDES:${PN}-dev += "libc-dev"
51FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so" 54RPROVIDES:${PN}-staticdev += "libc-staticdev"
52RPROVIDES_${PN}-dev += "libc-dev" 55
53RPROVIDES_${PN}-staticdev += "libc-staticdev" 56SUMMARY:sln = "The static ln"
54 57DESCRIPTION:sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
55SUMMARY_sln = "The static ln" 58SUMMARY:nscd = "Name service cache daemon"
56DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional." 59DESCRIPTION:nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services."
57SUMMARY_nscd = "Name service cache daemon" 60SUMMARY:glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
58DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services." 61DESCRIPTION:glibc-extra-nss = "glibc: nis, nisplus and hesiod search services."
59SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries" 62SUMMARY:ldd = "print shared library dependencies"
60DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services." 63DESCRIPTION:ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
61SUMMARY_ldd = "print shared library dependencies" 64SUMMARY:${PN}-utils = "Miscellaneous utilities provided by glibc"
62DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line." 65DESCRIPTION:${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, ..."
63SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc" 66DESCRIPTION:libsotruss = "Library to support sotruss which traces calls through PLTs"
64DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, ..." 67DESCRIPTION:tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
65DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
66DESCRIPTION_tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
67 68
68inherit multilib_header 69inherit multilib_header
69 70
70do_install() { 71do_install() {
71 oe_runmake install_root=${D} install 72 oe_runmake install_root=${D} install
72 install -Dm 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ld.so.conf 73 install -Dm 0644 ${UNPACKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ld.so.conf
73 install -d ${D}${localedir} 74 install -d ${D}${localedir}
74 make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED" 75 make -f ${UNPACKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED"
75 # get rid of some broken files... 76 # get rid of some broken files...
76 for i in ${GLIBC_BROKEN_LOCALES}; do 77 for i in ${GLIBC_BROKEN_LOCALES}; do
77 sed -i "/$i/d" ${WORKDIR}/SUPPORTED 78 sed -i "/$i/d" ${WORKDIR}/SUPPORTED
@@ -87,7 +88,7 @@ do_install() {
87 rmdir --ignore-fail-on-non-empty ${D}${libexecdir} 88 rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
88 fi 89 fi
89 90
90 oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h bits/endianness.h bits/struct_rwlock.h 91 oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h bits/endianness.h bits/struct_rwlock.h bits/math-vector.h bits/indirect-return.h
91 92
92 if [ -f ${D}${bindir}/mtrace ]; then 93 if [ -f ${D}${bindir}/mtrace ]; then
93 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace 94 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
@@ -101,12 +102,12 @@ do_install() {
101 install -d ${D}${localstatedir}/db/nscd 102 install -d ${D}${localstatedir}/db/nscd
102 install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd 103 install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
103 install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf 104 install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
104 install -m 0755 ${WORKDIR}/makedbs.sh ${D}${localstatedir}/db 105 install -m 0755 ${UNPACKDIR}/makedbs.sh ${D}${localstatedir}/db
105 sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd 106 sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
106 sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf 107 sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf
107 108
108 install -d ${D}${systemd_unitdir}/system 109 install -d ${D}${systemd_system_unitdir}
109 install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/ 110 install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_system_unitdir}/
110 111
111 # The dynamic loader will have been installed into 112 # The dynamic loader will have been installed into
112 # ${base_libdir}. However, if that isn't going to end up being 113 # ${base_libdir}. However, if that isn't going to end up being
@@ -118,6 +119,11 @@ do_install() {
118 ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \ 119 ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \
119 ${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER} 120 ${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}
120 fi 121 fi
122 ln -rs ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so
123 ln -rs ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so
124 if [ -n "${MLPREFIX}" ]; then
125 mv ${D}${bindir}/ld.so ${D}${bindir}/${MLPREFIX}ld.so
126 fi
121} 127}
122 128
123def get_libc_fpu_setting(bb, d): 129def get_libc_fpu_setting(bb, d):
@@ -125,11 +131,11 @@ def get_libc_fpu_setting(bb, d):
125 return "--without-fp" 131 return "--without-fp"
126 return "" 132 return ""
127 133
128do_install_append_class-target() { 134do_install:append:class-target() {
129 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 135 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
130 install -d ${D}${sysconfdir}/tmpfiles.d 136 install -d ${D}${nonarch_libdir}/tmpfiles.d
131 echo "d /run/nscd 755 root root -" \ 137 echo "d /run/nscd 755 root root -" \
132 > ${D}${sysconfdir}/tmpfiles.d/nscd.conf 138 > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf
133 fi 139 fi
134 140
135 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 141 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
@@ -139,15 +145,15 @@ do_install_append_class-target() {
139 fi 145 fi
140 146
141} 147}
142do_install_append_aarch64 () { 148do_install:append:aarch64 () {
143 do_install_armmultilib 149 do_install_armmultilib
144} 150}
145 151
146do_install_append_arm () { 152do_install:append:arm () {
147 do_install_armmultilib 153 do_install_armmultilib
148} 154}
149 155
150do_install_append_armeb () { 156do_install:append:armeb () {
151 do_install_armmultilib 157 do_install_armmultilib
152} 158}
153 159
@@ -156,13 +162,20 @@ do_install_armmultilib () {
156 oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h bits/pthreadtypes-arch.h bits/sem.h bits/semaphore.h bits/setjmp.h 162 oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h bits/pthreadtypes-arch.h bits/sem.h bits/semaphore.h bits/setjmp.h
157 oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h 163 oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h
158 oe_multilib_header bits/procfs-id.h bits/procfs.h bits/shmlba.h 164 oe_multilib_header bits/procfs-id.h bits/procfs.h bits/shmlba.h
159 oe_multilib_header bits/struct_stat.h 165 oe_multilib_header bits/struct_stat.h bits/pthread_stack_min.h
166 oe_multilib_header bits/dl_find_object.h bits/rseq.h bits/timesize.h
160 167
161 oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h 168 oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
162 169
163 oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h 170 oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
164} 171}
165 172
173do_install_armmultilib:append:class-target() {
174 gcc_version=$($CC -dumpversion)
175 mkdir -p ${D}${libdir}/gcc/${TARGET_SYS}/${gcc_version}/finclude
176 mv ${D}${includedir}/finclude/math-vector-fortran.h ${D}${libdir}/gcc/${TARGET_SYS}/${gcc_version}/finclude/
177 rmdir --ignore-fail-on-non-empty ${D}${includedir}/finclude
178}
166 179
167LOCALESTASH = "${WORKDIR}/stashed-locale" 180LOCALESTASH = "${WORKDIR}/stashed-locale"
168bashscripts = "mtrace sotruss xtrace" 181bashscripts = "mtrace sotruss xtrace"
@@ -252,35 +265,35 @@ stash_locale_package_cleanup() {
252 stash_locale_cleanup ${PKGD} 265 stash_locale_cleanup ${PKGD}
253} 266}
254 267
255python populate_packages_prepend () { 268python populate_packages:prepend () {
256 if d.getVar('DEBIAN_NAMES'): 269 if d.getVar('DEBIAN_NAMES'):
257 pkgs = d.getVar('PACKAGES').split() 270 pkgs = d.getVar('PACKAGES').split()
258 bpn = d.getVar('BPN') 271 bpn = d.getVar('BPN')
259 prefix = d.getVar('MLPREFIX') or "" 272 prefix = d.getVar('MLPREFIX') or ""
260 # Set the base package... 273 # Set the base package...
261 d.setVar('PKG_' + prefix + bpn, prefix + 'libc6') 274 d.setVar('PKG:' + prefix + bpn, prefix + 'libc6')
262 libcprefix = prefix + bpn + '-' 275 libcprefix = prefix + bpn + '-'
263 for p in pkgs: 276 for p in pkgs:
264 # And all the subpackages. 277 # And all the subpackages.
265 if p.startswith(libcprefix): 278 if p.startswith(libcprefix):
266 renamed = p.replace(bpn, 'libc6', 1) 279 renamed = p.replace(bpn, 'libc6', 1)
267 d.setVar('PKG_' + p, renamed) 280 d.setVar('PKG:' + p, renamed)
268 # For backward compatibility with old -dbg package 281 # For backward compatibility with old -dbg package
269 d.appendVar('RPROVIDES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') 282 d.appendVar('RPROVIDES:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
270 d.appendVar('RCONFLICTS_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') 283 d.appendVar('RCONFLICTS:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
271 d.appendVar('RREPLACES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') 284 d.appendVar('RREPLACES:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
272} 285}
273 286
274pkg_postinst_nscd () { 287pkg_postinst:nscd () {
275 if [ -z "$D" ]; then 288 if [ -z "$D" ]; then
276 if command -v systemd-tmpfiles >/dev/null; then 289 if command -v systemd-tmpfiles >/dev/null; then
277 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf 290 systemd-tmpfiles --create ${nonarch_libdir}/tmpfiles.d/nscd.conf
278 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then 291 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
279 ${sysconfdir}/init.d/populate-volatile.sh update 292 ${sysconfdir}/init.d/populate-volatile.sh update
280 fi 293 fi
281 fi 294 fi
282} 295}
283CONFFILES_nscd="${sysconfdir}/nscd.conf" 296CONFFILES:nscd = "${sysconfdir}/nscd.conf"
284 297
285SYSTEMD_PACKAGES = "nscd" 298SYSTEMD_PACKAGES = "nscd"
286SYSTEMD_SERVICE_nscd = "nscd.service" 299SYSTEMD_SERVICE:nscd = "nscd.service"
diff --git a/meta/recipes-core/glibc/glibc-scripts.inc b/meta/recipes-core/glibc/glibc-scripts.inc
index 14a14e4512..47216ae7d7 100644
--- a/meta/recipes-core/glibc/glibc-scripts.inc
+++ b/meta/recipes-core/glibc/glibc-scripts.inc
@@ -2,7 +2,7 @@ require glibc-collateral.inc
2 2
3SUMMARY = "utility scripts provided by glibc" 3SUMMARY = "utility scripts provided by glibc"
4DESCRIPTION = "utility scripts provided by glibc" 4DESCRIPTION = "utility scripts provided by glibc"
5RDEPENDS_${PN} = "bash glibc-mtrace" 5RDEPENDS:${PN} = "bash glibc-mtrace"
6 6
7SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts" 7SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
8 8
@@ -17,7 +17,7 @@ do_install() {
17 17
18# sotruss script requires sotruss-lib.so (given by libsotruss package), 18# sotruss script requires sotruss-lib.so (given by libsotruss package),
19# to produce trace of the library calls. 19# to produce trace of the library calls.
20RDEPENDS_${PN} += "libsotruss" 20RDEPENDS:${PN} += "libsotruss"
21 21
22# Don't scan for CVEs as glibc will be scanned 22# Don't scan for CVEs as glibc will be scanned
23CVE_PRODUCT = "" 23CVE_PRODUCT = ""
diff --git a/meta/recipes-core/glibc/glibc-scripts_2.33.bb b/meta/recipes-core/glibc/glibc-scripts_2.41.bb
index 5a89bd8022..5a89bd8022 100644
--- a/meta/recipes-core/glibc/glibc-scripts_2.33.bb
+++ b/meta/recipes-core/glibc/glibc-scripts_2.41.bb
diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.33.bb b/meta/recipes-core/glibc/glibc-tests.inc
index d887aeff79..a8fe160a54 100644
--- a/meta/recipes-core/glibc/glibc-testsuite_2.33.bb
+++ b/meta/recipes-core/glibc/glibc-tests.inc
@@ -1,12 +1,8 @@
1require glibc_${PV}.bb
2
3EXCLUDE_FROM_WORLD = "1" 1EXCLUDE_FROM_WORLD = "1"
4 2
5# handle PN differences 3# handle PN differences
6FILESEXTRAPATHS_prepend := "${THISDIR}/glibc:" 4FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
7 5
8# strip provides
9PROVIDES = ""
10# setup depends 6# setup depends
11INHIBIT_DEFAULT_DEPS = "" 7INHIBIT_DEFAULT_DEPS = ""
12 8
@@ -20,24 +16,10 @@ python () {
20DEPENDS += "glibc-locale libgcc gcc-runtime" 16DEPENDS += "glibc-locale libgcc gcc-runtime"
21 17
22# remove the initial depends 18# remove the initial depends
23DEPENDS_remove = "libgcc-initial" 19DEPENDS:remove = "libgcc-initial"
24
25inherit qemu
26
27SRC_URI += "file://check-test-wrapper"
28
29DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}"
30
31TOOLCHAIN_TEST_TARGET ??= "user"
32TOOLCHAIN_TEST_HOST ??= "localhost"
33TOOLCHAIN_TEST_HOST_USER ??= "root"
34TOOLCHAIN_TEST_HOST_PORT ??= "2222"
35 20
36do_check[dirs] += "${B}" 21do_check[dirs] += "${B}"
37do_check[nostamp] = "1"
38do_check () { 22do_check () {
39 chmod 0755 ${WORKDIR}/check-test-wrapper
40
41 # clean out previous test results 23 # clean out previous test results
42 oe_runmake tests-clean 24 oe_runmake tests-clean
43 # makefiles don't clean entirely (and also sometimes fails due to too many args) 25 # makefiles don't clean entirely (and also sometimes fails due to too many args)
@@ -46,18 +28,5 @@ do_check () {
46 find ${B}/catgets -name "*.cat" -delete 28 find ${B}/catgets -name "*.cat" -delete
47 find ${B}/conform -name "symlist-*" -delete 29 find ${B}/conform -name "symlist-*" -delete
48 [ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata 30 [ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata
49
50 oe_runmake -i \
51 QEMU_SYSROOT="${RECIPE_SYSROOT}" \
52 QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \
53 SSH_HOST="${TOOLCHAIN_TEST_HOST}" \
54 SSH_HOST_USER="${TOOLCHAIN_TEST_HOST_USER}" \
55 SSH_HOST_PORT="${TOOLCHAIN_TEST_HOST_PORT}" \
56 test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \
57 check
58} 31}
59addtask do_check after do_compile 32addtask do_check after do_compile
60
61inherit nopackages
62deltask do_stash_locale
63deltask do_install
diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.41.bb b/meta/recipes-core/glibc/glibc-testsuite_2.41.bb
new file mode 100644
index 0000000000..3a2764e40b
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-testsuite_2.41.bb
@@ -0,0 +1,36 @@
1require glibc_${PV}.bb
2require glibc-tests.inc
3
4inherit qemu
5
6SRC_URI += "file://check-test-wrapper"
7
8# strip provides
9PROVIDES = ""
10
11DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}"
12
13TOOLCHAIN_TEST_TARGET ??= "user"
14TOOLCHAIN_TEST_HOST ??= "localhost"
15TOOLCHAIN_TEST_HOST_USER ??= "root"
16TOOLCHAIN_TEST_HOST_PORT ??= "2222"
17
18do_check[nostamp] = "1"
19do_check[network] = "1"
20do_check:append () {
21 chmod 0755 ${UNPACKDIR}/check-test-wrapper
22
23 oe_runmake -i \
24 QEMU_SYSROOT="${RECIPE_SYSROOT}" \
25 QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \
26 SSH_HOST="${TOOLCHAIN_TEST_HOST}" \
27 SSH_HOST_USER="${TOOLCHAIN_TEST_HOST_USER}" \
28 SSH_HOST_PORT="${TOOLCHAIN_TEST_HOST_PORT}" \
29 test-wrapper="${UNPACKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \
30 check
31}
32
33inherit nopackages
34deltask do_stash_locale
35deltask do_install
36deltask do_populate_sysroot
diff --git a/meta/recipes-core/glibc/glibc-version.inc b/meta/recipes-core/glibc/glibc-version.inc
index 3a95173175..2d31131e03 100644
--- a/meta/recipes-core/glibc/glibc-version.inc
+++ b/meta/recipes-core/glibc/glibc-version.inc
@@ -1,8 +1,8 @@
1SRCBRANCH ?= "release/2.33/master" 1SRCBRANCH ?= "release/2.41/master"
2PV = "2.33" 2PV = "2.41+git"
3SRCREV_glibc ?= "9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3" 3SRCREV_glibc ?= "0c76c951620f9e12df2a89b2c684878b55bb6795"
4SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28" 4SRCREV_localedef ?= "fab74f31b3811df543e24b6de47efdf45b538abc"
5 5
6GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" 6GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git;protocol=https"
7 7
8UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)" 8UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 7d14306377..d8f20c87dd 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -1,7 +1,7 @@
1require glibc-common.inc 1require glibc-common.inc
2require glibc-ld.inc 2require glibc-ld.inc
3 3
4DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers" 4DEPENDS = "virtual/cross-cc virtual/cross-binutils libgcc-initial linux-libc-headers"
5 5
6PROVIDES = "virtual/libc" 6PROVIDES = "virtual/libc"
7PROVIDES += "virtual/libintl virtual/libiconv" 7PROVIDES += "virtual/libintl virtual/libiconv"
@@ -24,10 +24,10 @@ CACHED_CONFIGUREVARS += " \
24" 24"
25 25
26# ifunc doesn't appear to work on mips, casuses libbfd assertion failures 26# ifunc doesn't appear to work on mips, casuses libbfd assertion failures
27CACHED_CONFIGUREVARS_append_mipsarch = " libc_cv_ld_gnu_indirect_function=no" 27CACHED_CONFIGUREVARS:append:mipsarch = " libc_cv_ld_gnu_indirect_function=no"
28 28
29GLIBC_EXTRA_OECONF ?= "" 29GLIBC_EXTRA_OECONF ?= ""
30GLIBC_EXTRA_OECONF_class-nativesdk = "" 30GLIBC_EXTRA_OECONF:class-nativesdk = ""
31 31
32# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer 32# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
33# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE 33# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
@@ -41,12 +41,16 @@ PARALLEL_MAKE = ""
41# ensure make uses /bin/bash 41# ensure make uses /bin/bash
42EXTRA_OEMAKE += "SHELL=/bin/bash" 42EXTRA_OEMAKE += "SHELL=/bin/bash"
43 43
44do_configure_prepend() { 44# We do not need bash to run tzselect script, the default is to use
45 sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in 45# bash but it can be configured by setting KSHELL Makefile variable
46EXTRA_OEMAKE += "KSHELL=/bin/sh"
47
48do_configure:prepend() {
49 sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in
46} 50}
47 51
48# Enable backtrace from abort() 52# Enable backtrace from abort()
49do_configure_append_arm () { 53do_configure:append:arm () {
50 echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms 54 echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms
51 echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms 55 echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms
52} 56}
diff --git a/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch b/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch
new file mode 100644
index 0000000000..b42b186418
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch
@@ -0,0 +1,24 @@
1From 603e50d6b8ccadb32d59b0497f76629665c1794b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 16 Apr 2025 19:51:01 -0700
4Subject: [PATCH] Propagate -ffile-prefix-map from CFLAGS to ASFLAGS.
5
6Upstream-Status: Submitted [https://sourceware.org/pipermail/libc-alpha/2025-April/165969.html]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 Makeconfig | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/Makeconfig b/Makeconfig
13index e35c5cfe4e..7a19c731c6 100644
14--- a/Makeconfig
15+++ b/Makeconfig
16@@ -1172,7 +1172,7 @@ endif
17
18 # The assembler can generate debug information too.
19 ifndef ASFLAGS
20-ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
21+ASFLAGS := $(filter -g% -fdebug-prefix-map=% -ffile-prefix-map=%,$(CFLAGS))
22 endif
23 override ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
24
diff --git a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch b/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
index f96da83a9b..dbe3ce8c32 100644
--- a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
+++ b/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
@@ -1,4 +1,4 @@
1From d1f1671034a222417f9a829dcaa4f0c3d4f8954d Mon Sep 17 00:00:00 2001 1From cecd20fa2ff3ee2bd887b1d427088f32678cc04f Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com> 2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Sat, 7 Dec 2019 09:59:22 -0800 3Date: Sat, 7 Dec 2019 09:59:22 -0800
4Subject: [PATCH] localedef: Add hardlink resolver from util-linux 4Subject: [PATCH] localedef: Add hardlink resolver from util-linux
diff --git a/meta/recipes-core/glibc/glibc/0001-stdlib-Add-single-threaded-fast-path-to-rand.patch b/meta/recipes-core/glibc/glibc/0001-stdlib-Add-single-threaded-fast-path-to-rand.patch
new file mode 100644
index 0000000000..736fc51f38
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-stdlib-Add-single-threaded-fast-path-to-rand.patch
@@ -0,0 +1,47 @@
1From 4f54b0dfc16dbe0df86afccb90e447df5f7f571e Mon Sep 17 00:00:00 2001
2From: Wilco Dijkstra <wilco.dijkstra@arm.com>
3Date: Mon, 18 Mar 2024 15:18:20 +0000
4Subject: [PATCH] stdlib: Add single-threaded fast path to rand()
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Improve performance of rand() and __random() by adding a single-threaded
10fast path. Bench-random-lock shows about 5x speedup on Neoverse V1.
11
12Upstream-Status: Backport [be0cfd848d9ad7378800d6302bc11467cf2b514f]
13
14Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
15Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
16---
17 stdlib/random.c | 7 +++++++
18 1 file changed, 7 insertions(+)
19
20diff --git a/stdlib/random.c b/stdlib/random.c
21index 17cc61ba8f55..5d482a857065 100644
22--- a/stdlib/random.c
23+++ b/stdlib/random.c
24@@ -51,6 +51,7 @@
25 SUCH DAMAGE.*/
26
27 #include <libc-lock.h>
28+#include <sys/single_threaded.h>
29 #include <limits.h>
30 #include <stddef.h>
31 #include <stdlib.h>
32@@ -288,6 +289,12 @@ __random (void)
33 {
34 int32_t retval;
35
36+ if (SINGLE_THREAD_P)
37+ {
38+ (void) __random_r (&unsafe_state, &retval);
39+ return retval;
40+ }
41+
42 __libc_lock_lock (lock);
43
44 (void) __random_r (&unsafe_state, &retval);
45--
462.34.1
47
diff --git a/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch b/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
index 3dc4582f47..59d71a0d8b 100644
--- a/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
+++ b/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
@@ -1,4 +1,4 @@
1From 14d256e2db009f8bac9a265e8393d7ed25050df9 Mon Sep 17 00:00:00 2001 1From e31f032ae87ba38645c66dd7d2dfaa8606602e70 Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com> 2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Sat, 7 Dec 2019 10:01:37 -0800 3Date: Sat, 7 Dec 2019 10:01:37 -0800
4Subject: [PATCH] localedef: fix-ups hardlink to make it compile 4Subject: [PATCH] localedef: fix-ups hardlink to make it compile
diff --git a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
index c4718a106f..0f7db0d500 100644
--- a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
+++ b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -1,6 +1,6 @@
1From 32a4b8ae046fe4bb1b19f61378d079d44deaede7 Mon Sep 17 00:00:00 2001 1From f794ec18764a59ad45e242092e2ae6f5e3b19761 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:48:24 +0000 3Date: Sat, 3 Feb 2024 13:54:16 -0800
4Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well 4Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well
5 5
6Upstream-Status: Inappropriate [embedded specific] 6Upstream-Status: Inappropriate [embedded specific]
@@ -30,25 +30,25 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
30 1 file changed, 8 insertions(+), 8 deletions(-) 30 1 file changed, 8 insertions(+), 8 deletions(-)
31 31
32diff --git a/elf/dl-load.c b/elf/dl-load.c 32diff --git a/elf/dl-load.c b/elf/dl-load.c
33index 9e2089cfaa..ad01674027 100644 33index f905578a65..d4dd0fbc2a 100644
34--- a/elf/dl-load.c 34--- a/elf/dl-load.c
35+++ b/elf/dl-load.c 35+++ b/elf/dl-load.c
36@@ -2175,6 +2175,14 @@ _dl_map_object (struct link_map *loader, const char *name, 36@@ -2038,6 +2038,14 @@ _dl_map_object (struct link_map *loader, const char *name,
37 } 37 &loader->l_runpath_dirs, &realname, &fb, loader,
38 } 38 LA_SER_RUNPATH, &found_other_class);
39 39
40+ /* try the default path. */ 40+ /* Try the default path. */
41+ if (fd == -1 41+ if (fd == -1
42+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL 42+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
43+ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) 43+ || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
44+ && __rtld_search_dirs.dirs != (void *) -1) 44+ && __rtld_search_dirs.dirs != (void *) -1)
45+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &__rtld_search_dirs, 45+ fd = open_path (name, namelen, mode, &__rtld_search_dirs,
46+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); 46+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
47+ /* Finally try ld.so.cache */ 47+ /* Finally try ld.so.cache */
48 #ifdef USE_LDCONFIG 48 #ifdef USE_LDCONFIG
49 if (fd == -1 49 if (fd == -1
50 && (__glibc_likely ((mode & __RTLD_SECURE) == 0) 50 && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
51@@ -2233,14 +2241,6 @@ _dl_map_object (struct link_map *loader, const char *name, 51@@ -2096,14 +2104,6 @@ _dl_map_object (struct link_map *loader, const char *name,
52 } 52 }
53 #endif 53 #endif
54 54
diff --git a/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
index a8e625d24c..d9731a6fb7 100644
--- a/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
+++ b/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -1,4 +1,4 @@
1From aa8393bff257e4badfd208b88473ead175c69362 Mon Sep 17 00:00:00 2001 1From e8af7c91033875cfaf419c840d3283d71eb72d50 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:50:00 +0000 3Date: Wed, 18 Mar 2015 01:50:00 +0000
4Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK 4Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 1 file changed, 12 insertions(+) 21 1 file changed, 12 insertions(+)
22 22
23diff --git a/elf/dl-load.c b/elf/dl-load.c 23diff --git a/elf/dl-load.c b/elf/dl-load.c
24index ad01674027..f455207e79 100644 24index d4dd0fbc2a..0cd5221d6a 100644
25--- a/elf/dl-load.c 25--- a/elf/dl-load.c
26+++ b/elf/dl-load.c 26+++ b/elf/dl-load.c
27@@ -1871,7 +1871,19 @@ open_path (const char *name, size_t namelen, int mode, 27@@ -1749,7 +1749,19 @@ open_path (const char *name, size_t namelen, int mode,
28 given on the command line when rtld is run directly. */ 28 given on the command line when rtld is run directly. */
29 return -1; 29 return -1;
30 30
diff --git a/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
index 197caae921..0ee03c95d8 100644
--- a/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
+++ b/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -1,4 +1,4 @@
1From 3ea08e491a8494ff03e598b5e0fc2d8131e75da9 Mon Sep 17 00:00:00 2001 1From d7c4488ff48992631e14a53c27252790eaefe928 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:51:38 +0000 3Date: Wed, 18 Mar 2015 01:51:38 +0000
4Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths 4Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths
@@ -19,17 +19,17 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 elf/dl-load.c | 4 ++-- 19 elf/dl-load.c | 4 ++--
20 elf/dl-usage.c | 6 ++++-- 20 elf/dl-usage.c | 6 ++++--
21 elf/interp.c | 2 +- 21 elf/interp.c | 2 +-
22 elf/ldconfig.c | 3 +++ 22 elf/ldconfig.c | 2 ++
23 elf/rtld.c | 1 + 23 elf/rtld.c | 1 +
24 iconv/gconv_conf.c | 2 +- 24 iconv/gconv_conf.c | 2 +-
25 sysdeps/generic/dl-cache.h | 4 ---- 25 sysdeps/generic/dl-cache.h | 4 ----
26 8 files changed, 16 insertions(+), 10 deletions(-) 26 8 files changed, 15 insertions(+), 10 deletions(-)
27 27
28diff --git a/elf/dl-cache.c b/elf/dl-cache.c 28diff --git a/elf/dl-cache.c b/elf/dl-cache.c
29index 32f3bef5ea..71f3a82dc0 100644 29index 300aa1b6dd..6df873e08b 100644
30--- a/elf/dl-cache.c 30--- a/elf/dl-cache.c
31+++ b/elf/dl-cache.c 31+++ b/elf/dl-cache.c
32@@ -359,6 +359,10 @@ search_cache (const char *string_table, uint32_t string_table_size, 32@@ -336,6 +336,10 @@ search_cache (const char *string_table, uint32_t string_table_size,
33 return best; 33 return best;
34 } 34 }
35 35
@@ -41,10 +41,10 @@ index 32f3bef5ea..71f3a82dc0 100644
41 _dl_cache_libcmp (const char *p1, const char *p2) 41 _dl_cache_libcmp (const char *p1, const char *p2)
42 { 42 {
43diff --git a/elf/dl-load.c b/elf/dl-load.c 43diff --git a/elf/dl-load.c b/elf/dl-load.c
44index f455207e79..a144e24fcf 100644 44index 0cd5221d6a..9b9593f8d8 100644
45--- a/elf/dl-load.c 45--- a/elf/dl-load.c
46+++ b/elf/dl-load.c 46+++ b/elf/dl-load.c
47@@ -115,8 +115,8 @@ enum { ncapstr = 1, max_capstrlen = 0 }; 47@@ -107,8 +107,8 @@ enum { ncapstr = 1, max_capstrlen = 0 };
48 gen-trusted-dirs.awk. */ 48 gen-trusted-dirs.awk. */
49 #include "trusted-dirs.h" 49 #include "trusted-dirs.h"
50 50
@@ -56,7 +56,7 @@ index f455207e79..a144e24fcf 100644
56 SYSTEM_DIRS_LEN 56 SYSTEM_DIRS_LEN
57 }; 57 };
58diff --git a/elf/dl-usage.c b/elf/dl-usage.c 58diff --git a/elf/dl-usage.c b/elf/dl-usage.c
59index 6e26818bd7..f09e8b93e5 100644 59index c6d13ac2ee..1dac82102d 100644
60--- a/elf/dl-usage.c 60--- a/elf/dl-usage.c
61+++ b/elf/dl-usage.c 61+++ b/elf/dl-usage.c
62@@ -25,6 +25,8 @@ 62@@ -25,6 +25,8 @@
@@ -68,7 +68,7 @@ index 6e26818bd7..f09e8b93e5 100644
68 void 68 void
69 _dl_usage (const char *argv0, const char *wrong_option) 69 _dl_usage (const char *argv0, const char *wrong_option)
70 { 70 {
71@@ -244,7 +246,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ 71@@ -185,7 +187,7 @@ setting environment variables (which would be inherited by subprocesses).\n\
72 --list list all dependencies and how they are resolved\n\ 72 --list list all dependencies and how they are resolved\n\
73 --verify verify that given object really is a dynamically linked\n\ 73 --verify verify that given object really is a dynamically linked\n\
74 object we can handle\n\ 74 object we can handle\n\
@@ -77,7 +77,7 @@ index 6e26818bd7..f09e8b93e5 100644
77 --library-path PATH use given PATH instead of content of the environment\n\ 77 --library-path PATH use given PATH instead of content of the environment\n\
78 variable LD_LIBRARY_PATH\n\ 78 variable LD_LIBRARY_PATH\n\
79 --glibc-hwcaps-prepend LIST\n\ 79 --glibc-hwcaps-prepend LIST\n\
80@@ -266,7 +268,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ 80@@ -204,7 +206,7 @@ setting environment variables (which would be inherited by subprocesses).\n\
81 \n\ 81 \n\
82 This program interpreter self-identifies as: " RTLD "\n\ 82 This program interpreter self-identifies as: " RTLD "\n\
83 ", 83 ",
@@ -85,9 +85,9 @@ index 6e26818bd7..f09e8b93e5 100644
85+ argv0, LD_SO_CACHE); 85+ argv0, LD_SO_CACHE);
86 print_search_path_for_help (state); 86 print_search_path_for_help (state);
87 print_hwcaps_subdirectories (state); 87 print_hwcaps_subdirectories (state);
88 print_legacy_hwcap_directories (); 88 _exit (EXIT_SUCCESS);
89diff --git a/elf/interp.c b/elf/interp.c 89diff --git a/elf/interp.c b/elf/interp.c
90index 91966702ca..dc86c20e83 100644 90index cc49e13c86..394c1ce0c5 100644
91--- a/elf/interp.c 91--- a/elf/interp.c
92+++ b/elf/interp.c 92+++ b/elf/interp.c
93@@ -18,5 +18,5 @@ 93@@ -18,5 +18,5 @@
@@ -98,24 +98,23 @@ index 91966702ca..dc86c20e83 100644
98+const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) 98+const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
99 = RUNTIME_LINKER; 99 = RUNTIME_LINKER;
100diff --git a/elf/ldconfig.c b/elf/ldconfig.c 100diff --git a/elf/ldconfig.c b/elf/ldconfig.c
101index 28ed637a29..5d38a60c5d 100644 101index 1432187e9b..0654e02389 100644
102--- a/elf/ldconfig.c 102--- a/elf/ldconfig.c
103+++ b/elf/ldconfig.c 103+++ b/elf/ldconfig.c
104@@ -176,6 +176,9 @@ static struct argp argp = 104@@ -151,6 +151,8 @@ static struct argp argp =
105 options, parse_opt, NULL, doc, NULL, more_help, NULL 105 options, parse_opt, NULL, doc, NULL, more_help, NULL
106 }; 106 };
107 107
108+
109+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); 108+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
110+ 109+
111 /* Check if string corresponds to an important hardware capability or 110 /* Handle program arguments. */
112 a platform. */ 111 static error_t
113 static int 112 parse_opt (int key, char *arg, struct argp_state *state)
114diff --git a/elf/rtld.c b/elf/rtld.c 113diff --git a/elf/rtld.c b/elf/rtld.c
115index 596b6ac3d9..1ccd33f668 100644 114index f32058bba6..434ea6d0c5 100644
116--- a/elf/rtld.c 115--- a/elf/rtld.c
117+++ b/elf/rtld.c 116+++ b/elf/rtld.c
118@@ -185,6 +185,7 @@ dso_name_valid_for_suid (const char *p) 117@@ -190,6 +190,7 @@ dso_name_valid_for_suid (const char *p)
119 } 118 }
120 return *p != '\0'; 119 return *p != '\0';
121 } 120 }
@@ -124,11 +123,11 @@ index 596b6ac3d9..1ccd33f668 100644
124 static void 123 static void
125 audit_list_init (struct audit_list *list) 124 audit_list_init (struct audit_list *list)
126diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c 125diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
127index 682f949834..7eed87bc9d 100644 126index 41ab0768c9..7c48c2b328 100644
128--- a/iconv/gconv_conf.c 127--- a/iconv/gconv_conf.c
129+++ b/iconv/gconv_conf.c 128+++ b/iconv/gconv_conf.c
130@@ -36,7 +36,7 @@ 129@@ -35,7 +35,7 @@
131 130 #include <gconv_parseconfdir.h>
132 131
133 /* This is the default path where we look for module lists. */ 132 /* This is the default path where we look for module lists. */
134-static const char default_gconv_path[] = GCONV_PATH; 133-static const char default_gconv_path[] = GCONV_PATH;
@@ -137,7 +136,7 @@ index 682f949834..7eed87bc9d 100644
137 /* Type to represent search path. */ 136 /* Type to represent search path. */
138 struct path_elem 137 struct path_elem
139diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h 138diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
140index 964d50a486..94bf68ca9d 100644 139index 0ee6571315..792308c0ab 100644
141--- a/sysdeps/generic/dl-cache.h 140--- a/sysdeps/generic/dl-cache.h
142+++ b/sysdeps/generic/dl-cache.h 141+++ b/sysdeps/generic/dl-cache.h
143@@ -34,10 +34,6 @@ 142@@ -34,10 +34,6 @@
diff --git a/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
index 172ade8d97..597923e792 100644
--- a/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
+++ b/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -1,4 +1,4 @@
1From 19e3e45eb1838ee80af13c3d27fcff446773211e Mon Sep 17 00:00:00 2001 1From 9b408439eb042c4fc5cb33c8929dea419bf25b41 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 14:35:35 -0800 3Date: Thu, 31 Dec 2015 14:35:35 -0800
4Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 4Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86
@@ -13,14 +13,14 @@ Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14Signed-off-by: Khem Raj <raj.khem@gmail.com> 14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15--- 15---
16 sysdeps/x86/atomic-machine.h | 3 +-- 16 sysdeps/x86/atomic-machine.h | 7 +------
17 1 file changed, 1 insertion(+), 2 deletions(-) 17 1 file changed, 1 insertion(+), 6 deletions(-)
18 18
19diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h 19diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h
20index 695222e4fa..9d39bfdbd5 100644 20index 5452716d22..8c7408feb4 100644
21--- a/sysdeps/x86/atomic-machine.h 21--- a/sysdeps/x86/atomic-machine.h
22+++ b/sysdeps/x86/atomic-machine.h 22+++ b/sysdeps/x86/atomic-machine.h
23@@ -52,15 +52,14 @@ typedef uintmax_t uatomic_max_t; 23@@ -26,19 +26,14 @@
24 #define LOCK_PREFIX "lock;" 24 #define LOCK_PREFIX "lock;"
25 25
26 #define USE_ATOMIC_COMPILER_BUILTINS 1 26 #define USE_ATOMIC_COMPILER_BUILTINS 1
@@ -33,6 +33,10 @@ index 695222e4fa..9d39bfdbd5 100644
33 # define BR_CONSTRAINT "q" 33 # define BR_CONSTRAINT "q"
34 # define IBR_CONSTRAINT "iq" 34 # define IBR_CONSTRAINT "iq"
35 #else 35 #else
36-/* Since the Pentium, i386 CPUs have supported 64-bit atomics, but the
37- i386 psABI supplement provides only 4-byte alignment for uint64_t
38- inside structs, so it is currently not possible to use 64-bit
39- atomics on this platform. */
36-# define __HAVE_64B_ATOMICS 0 40-# define __HAVE_64B_ATOMICS 0
37 # define SP_REG "esp" 41 # define SP_REG "esp"
38 # define SEG_REG "gs" 42 # define SEG_REG "gs"
diff --git a/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch b/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
index 14697567c2..2886d461c8 100644
--- a/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
+++ b/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
@@ -1,4 +1,4 @@
1From 732d4f4954fe60718870048d0583a20a7a8a8540 Mon Sep 17 00:00:00 2001 1From 1a57ab6f7d602401396a18b0270498ff9228cf64 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:55:12 -0700 3Date: Fri, 3 Aug 2018 09:55:12 -0700
4Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales 4Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales
@@ -19,10 +19,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 4 files changed, 8 insertions(+), 7 deletions(-) 19 4 files changed, 8 insertions(+), 7 deletions(-)
20 20
21diff --git a/locale/findlocale.c b/locale/findlocale.c 21diff --git a/locale/findlocale.c b/locale/findlocale.c
22index ab09122b0c..f42cc75780 100644 22index e5e2bd3974..bdd9b79f83 100644
23--- a/locale/findlocale.c 23--- a/locale/findlocale.c
24+++ b/locale/findlocale.c 24+++ b/locale/findlocale.c
25@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = 25@@ -55,7 +55,7 @@ struct __locale_data *const _nl_C[] attribute_hidden =
26 which are somehow addressed. */ 26 which are somehow addressed. */
27 struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; 27 struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
28 28
@@ -31,7 +31,7 @@ index ab09122b0c..f42cc75780 100644
31 31
32 /* Checks if the name is actually present, that is, not NULL and not 32 /* Checks if the name is actually present, that is, not NULL and not
33 empty. */ 33 empty. */
34@@ -166,7 +166,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, 34@@ -165,7 +165,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
35 35
36 /* Nothing in the archive. Set the default path to search below. */ 36 /* Nothing in the archive. Set the default path to search below. */
37 locale_path = _nl_default_locale_path; 37 locale_path = _nl_default_locale_path;
@@ -41,7 +41,7 @@ index ab09122b0c..f42cc75780 100644
41 else 41 else
42 /* We really have to load some data. First see whether the name is 42 /* We really have to load some data. First see whether the name is
43diff --git a/locale/loadarchive.c b/locale/loadarchive.c 43diff --git a/locale/loadarchive.c b/locale/loadarchive.c
44index 4177fc8972..40247b1e68 100644 44index 058a467cde..af62f3c304 100644
45--- a/locale/loadarchive.c 45--- a/locale/loadarchive.c
46+++ b/locale/loadarchive.c 46+++ b/locale/loadarchive.c
47@@ -42,7 +42,7 @@ 47@@ -42,7 +42,7 @@
@@ -54,10 +54,10 @@ index 4177fc8972..40247b1e68 100644
54 /* Size of initial mapping window, optimal if large enough to 54 /* Size of initial mapping window, optimal if large enough to
55 cover the header plus the initial locale. */ 55 cover the header plus the initial locale. */
56diff --git a/locale/localeinfo.h b/locale/localeinfo.h 56diff --git a/locale/localeinfo.h b/locale/localeinfo.h
57index b3d4da0185..22f9dc1140 100644 57index ab1b5e5659..92aef8d58e 100644
58--- a/locale/localeinfo.h 58--- a/locale/localeinfo.h
59+++ b/locale/localeinfo.h 59+++ b/locale/localeinfo.h
60@@ -331,7 +331,7 @@ _nl_lookup_word (locale_t l, int category, int item) 60@@ -347,7 +347,7 @@ _nl_lookup_word (locale_t l, int category, int item)
61 } 61 }
62 62
63 /* Default search path if no LOCPATH environment variable. */ 63 /* Default search path if no LOCPATH environment variable. */
@@ -67,10 +67,10 @@ index b3d4da0185..22f9dc1140 100644
67 /* Load the locale data for CATEGORY from the file specified by *NAME. 67 /* Load the locale data for CATEGORY from the file specified by *NAME.
68 If *NAME is "", use environment variables as specified by POSIX, and 68 If *NAME is "", use environment variables as specified by POSIX, and
69diff --git a/locale/programs/locale.c b/locale/programs/locale.c 69diff --git a/locale/programs/locale.c b/locale/programs/locale.c
70index 575b208e82..5ec630c3a4 100644 70index 7e8832dc3b..7fa484f092 100644
71--- a/locale/programs/locale.c 71--- a/locale/programs/locale.c
72+++ b/locale/programs/locale.c 72+++ b/locale/programs/locale.c
73@@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b) 73@@ -631,6 +631,7 @@ nameentcmp (const void *a, const void *b)
74 ((const struct nameent *) b)->name); 74 ((const struct nameent *) b)->name);
75 } 75 }
76 76
@@ -78,7 +78,7 @@ index 575b208e82..5ec630c3a4 100644
78 78
79 static int 79 static int
80 write_archive_locales (void **all_datap, char *linebuf) 80 write_archive_locales (void **all_datap, char *linebuf)
81@@ -645,7 +646,7 @@ write_archive_locales (void **all_datap, char *linebuf) 81@@ -644,7 +645,7 @@ write_archive_locales (void **all_datap, char *linebuf)
82 int fd, ret = 0; 82 int fd, ret = 0;
83 uint32_t cnt; 83 uint32_t cnt;
84 84
@@ -87,7 +87,7 @@ index 575b208e82..5ec630c3a4 100644
87 if (fd < 0) 87 if (fd < 0)
88 return 0; 88 return 0;
89 89
90@@ -700,8 +701,8 @@ write_archive_locales (void **all_datap, char *linebuf) 90@@ -699,8 +700,8 @@ write_archive_locales (void **all_datap, char *linebuf)
91 if (cnt) 91 if (cnt)
92 putchar_unlocked ('\n'); 92 putchar_unlocked ('\n');
93 93
diff --git a/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
deleted file mode 100644
index 2162bf38c2..0000000000
--- a/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
+++ /dev/null
@@ -1,1581 +0,0 @@
1From 3d58330390a7d4f4ed32f4a9c25628af3e0dd5c1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:01:50 +0000
4Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation
5
6Upstream-Status: Pending
7Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 134 ++++++++++++++++++
11 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 101 +++++++++++++
12 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 134 ++++++++++++++++++
13 .../powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 101 +++++++++++++
14 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
15 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
16 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
17 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
18 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
19 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
20 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
21 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
22 .../linux/powerpc/powerpc32/603e/fpu/Implies | 1 +
23 .../powerpc/powerpc32/e300c3/fpu/Implies | 2 +
24 .../powerpc/powerpc32/e500mc/fpu/Implies | 1 +
25 .../linux/powerpc/powerpc32/e5500/fpu/Implies | 1 +
26 .../linux/powerpc/powerpc32/e6500/fpu/Implies | 1 +
27 .../linux/powerpc/powerpc64/e5500/fpu/Implies | 1 +
28 .../linux/powerpc/powerpc64/e6500/fpu/Implies | 1 +
29 19 files changed, 1418 insertions(+)
30 create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
31 create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
32 create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
33 create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
34 create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
35 create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
36 create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
37 create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
38 create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
39 create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
40 create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
41 create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
42 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
43 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
44 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
45 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
46 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
47 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
48 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
49
50diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
51new file mode 100644
52index 0000000000..71e516d1c8
53--- /dev/null
54+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
55@@ -0,0 +1,134 @@
56+/* Double-precision floating point square root.
57+ Copyright (C) 2010 Free Software Foundation, Inc.
58+ This file is part of the GNU C Library.
59+
60+ The GNU C Library is free software; you can redistribute it and/or
61+ modify it under the terms of the GNU Lesser General Public
62+ License as published by the Free Software Foundation; either
63+ version 2.1 of the License, or (at your option) any later version.
64+
65+ The GNU C Library is distributed in the hope that it will be useful,
66+ but WITHOUT ANY WARRANTY; without even the implied warranty of
67+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68+ Lesser General Public License for more details.
69+
70+ You should have received a copy of the GNU Lesser General Public
71+ License along with the GNU C Library; if not, write to the Free
72+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
73+ 02111-1307 USA. */
74+
75+#include <math.h>
76+#include <math_private.h>
77+#include <fenv_libc.h>
78+#include <inttypes.h>
79+
80+#include <sysdep.h>
81+#include <ldsodefs.h>
82+
83+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
84+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
85+static const float two108 = 3.245185536584267269e+32;
86+static const float twom54 = 5.551115123125782702e-17;
87+static const float half = 0.5;
88+
89+/* The method is based on the descriptions in:
90+
91+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
92+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
93+
94+ We find the actual square root and half of its reciprocal
95+ simultaneously. */
96+
97+#ifdef __STDC__
98+double
99+__ieee754_sqrt (double b)
100+#else
101+double
102+__ieee754_sqrt (b)
103+ double b;
104+#endif
105+{
106+ if (__builtin_expect (b > 0, 1))
107+ {
108+ double y, g, h, d, r;
109+ ieee_double_shape_type u;
110+
111+ if (__builtin_expect (b != a_inf.value, 1))
112+ {
113+ fenv_t fe;
114+
115+ fe = fegetenv_register ();
116+
117+ u.value = b;
118+
119+ relax_fenv_state ();
120+
121+ __asm__ ("frsqrte %[estimate], %[x]\n"
122+ : [estimate] "=f" (y) : [x] "f" (b));
123+
124+ /* Following Muller et al, page 168, equation 5.20.
125+
126+ h goes to 1/(2*sqrt(b))
127+ g goes to sqrt(b).
128+
129+ We need three iterations to get within 1ulp. */
130+
131+ /* Indicate that these can be performed prior to the branch. GCC
132+ insists on sinking them below the branch, however; it seems like
133+ they'd be better before the branch so that we can cover any latency
134+ from storing the argument and loading its high word. Oh well. */
135+
136+ g = b * y;
137+ h = 0.5 * y;
138+
139+ /* Handle small numbers by scaling. */
140+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
141+ return __ieee754_sqrt (b * two108) * twom54;
142+
143+#define FMADD(a_, c_, b_) \
144+ ({ double __r; \
145+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
146+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
147+ __r;})
148+#define FNMSUB(a_, c_, b_) \
149+ ({ double __r; \
150+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
151+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
152+ __r;})
153+
154+ r = FNMSUB (g, h, half);
155+ g = FMADD (g, r, g);
156+ h = FMADD (h, r, h);
157+
158+ r = FNMSUB (g, h, half);
159+ g = FMADD (g, r, g);
160+ h = FMADD (h, r, h);
161+
162+ r = FNMSUB (g, h, half);
163+ g = FMADD (g, r, g);
164+ h = FMADD (h, r, h);
165+
166+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
167+
168+ /* Final refinement. */
169+ d = FNMSUB (g, g, b);
170+
171+ fesetenv_register (fe);
172+ return FMADD (d, h, g);
173+ }
174+ }
175+ else if (b < 0)
176+ {
177+ /* For some reason, some PowerPC32 processors don't implement
178+ FE_INVALID_SQRT. */
179+#ifdef FE_INVALID_SQRT
180+ feraiseexcept (FE_INVALID_SQRT);
181+
182+ fenv_union_t u = { .fenv = fegetenv_register () };
183+ if ((u.l & FE_INVALID) == 0)
184+#endif
185+ feraiseexcept (FE_INVALID);
186+ b = a_nan.value;
187+ }
188+ return f_wash (b);
189+}
190diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
191new file mode 100644
192index 0000000000..26fa067abf
193--- /dev/null
194+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
195@@ -0,0 +1,101 @@
196+/* Single-precision floating point square root.
197+ Copyright (C) 2010 Free Software Foundation, Inc.
198+ This file is part of the GNU C Library.
199+
200+ The GNU C Library is free software; you can redistribute it and/or
201+ modify it under the terms of the GNU Lesser General Public
202+ License as published by the Free Software Foundation; either
203+ version 2.1 of the License, or (at your option) any later version.
204+
205+ The GNU C Library is distributed in the hope that it will be useful,
206+ but WITHOUT ANY WARRANTY; without even the implied warranty of
207+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
208+ Lesser General Public License for more details.
209+
210+ You should have received a copy of the GNU Lesser General Public
211+ License along with the GNU C Library; if not, write to the Free
212+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
213+ 02111-1307 USA. */
214+
215+#include <math.h>
216+#include <math_private.h>
217+#include <fenv_libc.h>
218+#include <inttypes.h>
219+
220+#include <sysdep.h>
221+#include <ldsodefs.h>
222+
223+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
224+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
225+static const float threehalf = 1.5;
226+
227+/* The method is based on the descriptions in:
228+
229+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
230+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
231+
232+ We find the reciprocal square root and use that to compute the actual
233+ square root. */
234+
235+#ifdef __STDC__
236+float
237+__ieee754_sqrtf (float b)
238+#else
239+float
240+__ieee754_sqrtf (b)
241+ float b;
242+#endif
243+{
244+ if (__builtin_expect (b > 0, 1))
245+ {
246+#define FMSUB(a_, c_, b_) \
247+ ({ double __r; \
248+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
249+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
250+ __r;})
251+#define FNMSUB(a_, c_, b_) \
252+ ({ double __r; \
253+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
254+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
255+ __r;})
256+
257+ if (__builtin_expect (b != a_inf.value, 1))
258+ {
259+ double y, x;
260+ fenv_t fe;
261+
262+ fe = fegetenv_register ();
263+
264+ relax_fenv_state ();
265+
266+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
267+ y = FMSUB (threehalf, b, b);
268+
269+ /* Initial estimate. */
270+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
271+
272+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
273+ x = x * FNMSUB (y, x * x, threehalf);
274+ x = x * FNMSUB (y, x * x, threehalf);
275+ x = x * FNMSUB (y, x * x, threehalf);
276+
277+ /* All done. */
278+ fesetenv_register (fe);
279+ return x * b;
280+ }
281+ }
282+ else if (b < 0)
283+ {
284+ /* For some reason, some PowerPC32 processors don't implement
285+ FE_INVALID_SQRT. */
286+#ifdef FE_INVALID_SQRT
287+ feraiseexcept (FE_INVALID_SQRT);
288+
289+ fenv_union_t u = { .fenv = fegetenv_register () };
290+ if ((u.l & FE_INVALID) == 0)
291+#endif
292+ feraiseexcept (FE_INVALID);
293+ b = a_nan.value;
294+ }
295+ return f_washf (b);
296+}
297diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
298new file mode 100644
299index 0000000000..71e516d1c8
300--- /dev/null
301+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
302@@ -0,0 +1,134 @@
303+/* Double-precision floating point square root.
304+ Copyright (C) 2010 Free Software Foundation, Inc.
305+ This file is part of the GNU C Library.
306+
307+ The GNU C Library is free software; you can redistribute it and/or
308+ modify it under the terms of the GNU Lesser General Public
309+ License as published by the Free Software Foundation; either
310+ version 2.1 of the License, or (at your option) any later version.
311+
312+ The GNU C Library is distributed in the hope that it will be useful,
313+ but WITHOUT ANY WARRANTY; without even the implied warranty of
314+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
315+ Lesser General Public License for more details.
316+
317+ You should have received a copy of the GNU Lesser General Public
318+ License along with the GNU C Library; if not, write to the Free
319+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
320+ 02111-1307 USA. */
321+
322+#include <math.h>
323+#include <math_private.h>
324+#include <fenv_libc.h>
325+#include <inttypes.h>
326+
327+#include <sysdep.h>
328+#include <ldsodefs.h>
329+
330+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
331+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
332+static const float two108 = 3.245185536584267269e+32;
333+static const float twom54 = 5.551115123125782702e-17;
334+static const float half = 0.5;
335+
336+/* The method is based on the descriptions in:
337+
338+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
339+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
340+
341+ We find the actual square root and half of its reciprocal
342+ simultaneously. */
343+
344+#ifdef __STDC__
345+double
346+__ieee754_sqrt (double b)
347+#else
348+double
349+__ieee754_sqrt (b)
350+ double b;
351+#endif
352+{
353+ if (__builtin_expect (b > 0, 1))
354+ {
355+ double y, g, h, d, r;
356+ ieee_double_shape_type u;
357+
358+ if (__builtin_expect (b != a_inf.value, 1))
359+ {
360+ fenv_t fe;
361+
362+ fe = fegetenv_register ();
363+
364+ u.value = b;
365+
366+ relax_fenv_state ();
367+
368+ __asm__ ("frsqrte %[estimate], %[x]\n"
369+ : [estimate] "=f" (y) : [x] "f" (b));
370+
371+ /* Following Muller et al, page 168, equation 5.20.
372+
373+ h goes to 1/(2*sqrt(b))
374+ g goes to sqrt(b).
375+
376+ We need three iterations to get within 1ulp. */
377+
378+ /* Indicate that these can be performed prior to the branch. GCC
379+ insists on sinking them below the branch, however; it seems like
380+ they'd be better before the branch so that we can cover any latency
381+ from storing the argument and loading its high word. Oh well. */
382+
383+ g = b * y;
384+ h = 0.5 * y;
385+
386+ /* Handle small numbers by scaling. */
387+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
388+ return __ieee754_sqrt (b * two108) * twom54;
389+
390+#define FMADD(a_, c_, b_) \
391+ ({ double __r; \
392+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
393+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
394+ __r;})
395+#define FNMSUB(a_, c_, b_) \
396+ ({ double __r; \
397+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
398+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
399+ __r;})
400+
401+ r = FNMSUB (g, h, half);
402+ g = FMADD (g, r, g);
403+ h = FMADD (h, r, h);
404+
405+ r = FNMSUB (g, h, half);
406+ g = FMADD (g, r, g);
407+ h = FMADD (h, r, h);
408+
409+ r = FNMSUB (g, h, half);
410+ g = FMADD (g, r, g);
411+ h = FMADD (h, r, h);
412+
413+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
414+
415+ /* Final refinement. */
416+ d = FNMSUB (g, g, b);
417+
418+ fesetenv_register (fe);
419+ return FMADD (d, h, g);
420+ }
421+ }
422+ else if (b < 0)
423+ {
424+ /* For some reason, some PowerPC32 processors don't implement
425+ FE_INVALID_SQRT. */
426+#ifdef FE_INVALID_SQRT
427+ feraiseexcept (FE_INVALID_SQRT);
428+
429+ fenv_union_t u = { .fenv = fegetenv_register () };
430+ if ((u.l & FE_INVALID) == 0)
431+#endif
432+ feraiseexcept (FE_INVALID);
433+ b = a_nan.value;
434+ }
435+ return f_wash (b);
436+}
437diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
438new file mode 100644
439index 0000000000..26fa067abf
440--- /dev/null
441+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
442@@ -0,0 +1,101 @@
443+/* Single-precision floating point square root.
444+ Copyright (C) 2010 Free Software Foundation, Inc.
445+ This file is part of the GNU C Library.
446+
447+ The GNU C Library is free software; you can redistribute it and/or
448+ modify it under the terms of the GNU Lesser General Public
449+ License as published by the Free Software Foundation; either
450+ version 2.1 of the License, or (at your option) any later version.
451+
452+ The GNU C Library is distributed in the hope that it will be useful,
453+ but WITHOUT ANY WARRANTY; without even the implied warranty of
454+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
455+ Lesser General Public License for more details.
456+
457+ You should have received a copy of the GNU Lesser General Public
458+ License along with the GNU C Library; if not, write to the Free
459+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
460+ 02111-1307 USA. */
461+
462+#include <math.h>
463+#include <math_private.h>
464+#include <fenv_libc.h>
465+#include <inttypes.h>
466+
467+#include <sysdep.h>
468+#include <ldsodefs.h>
469+
470+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
471+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
472+static const float threehalf = 1.5;
473+
474+/* The method is based on the descriptions in:
475+
476+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
477+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
478+
479+ We find the reciprocal square root and use that to compute the actual
480+ square root. */
481+
482+#ifdef __STDC__
483+float
484+__ieee754_sqrtf (float b)
485+#else
486+float
487+__ieee754_sqrtf (b)
488+ float b;
489+#endif
490+{
491+ if (__builtin_expect (b > 0, 1))
492+ {
493+#define FMSUB(a_, c_, b_) \
494+ ({ double __r; \
495+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
496+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
497+ __r;})
498+#define FNMSUB(a_, c_, b_) \
499+ ({ double __r; \
500+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
501+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
502+ __r;})
503+
504+ if (__builtin_expect (b != a_inf.value, 1))
505+ {
506+ double y, x;
507+ fenv_t fe;
508+
509+ fe = fegetenv_register ();
510+
511+ relax_fenv_state ();
512+
513+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
514+ y = FMSUB (threehalf, b, b);
515+
516+ /* Initial estimate. */
517+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
518+
519+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
520+ x = x * FNMSUB (y, x * x, threehalf);
521+ x = x * FNMSUB (y, x * x, threehalf);
522+ x = x * FNMSUB (y, x * x, threehalf);
523+
524+ /* All done. */
525+ fesetenv_register (fe);
526+ return x * b;
527+ }
528+ }
529+ else if (b < 0)
530+ {
531+ /* For some reason, some PowerPC32 processors don't implement
532+ FE_INVALID_SQRT. */
533+#ifdef FE_INVALID_SQRT
534+ feraiseexcept (FE_INVALID_SQRT);
535+
536+ fenv_union_t u = { .fenv = fegetenv_register () };
537+ if ((u.l & FE_INVALID) == 0)
538+#endif
539+ feraiseexcept (FE_INVALID);
540+ b = a_nan.value;
541+ }
542+ return f_washf (b);
543+}
544diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
545new file mode 100644
546index 0000000000..71e516d1c8
547--- /dev/null
548+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
549@@ -0,0 +1,134 @@
550+/* Double-precision floating point square root.
551+ Copyright (C) 2010 Free Software Foundation, Inc.
552+ This file is part of the GNU C Library.
553+
554+ The GNU C Library is free software; you can redistribute it and/or
555+ modify it under the terms of the GNU Lesser General Public
556+ License as published by the Free Software Foundation; either
557+ version 2.1 of the License, or (at your option) any later version.
558+
559+ The GNU C Library is distributed in the hope that it will be useful,
560+ but WITHOUT ANY WARRANTY; without even the implied warranty of
561+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
562+ Lesser General Public License for more details.
563+
564+ You should have received a copy of the GNU Lesser General Public
565+ License along with the GNU C Library; if not, write to the Free
566+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
567+ 02111-1307 USA. */
568+
569+#include <math.h>
570+#include <math_private.h>
571+#include <fenv_libc.h>
572+#include <inttypes.h>
573+
574+#include <sysdep.h>
575+#include <ldsodefs.h>
576+
577+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
578+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
579+static const float two108 = 3.245185536584267269e+32;
580+static const float twom54 = 5.551115123125782702e-17;
581+static const float half = 0.5;
582+
583+/* The method is based on the descriptions in:
584+
585+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
586+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
587+
588+ We find the actual square root and half of its reciprocal
589+ simultaneously. */
590+
591+#ifdef __STDC__
592+double
593+__ieee754_sqrt (double b)
594+#else
595+double
596+__ieee754_sqrt (b)
597+ double b;
598+#endif
599+{
600+ if (__builtin_expect (b > 0, 1))
601+ {
602+ double y, g, h, d, r;
603+ ieee_double_shape_type u;
604+
605+ if (__builtin_expect (b != a_inf.value, 1))
606+ {
607+ fenv_t fe;
608+
609+ fe = fegetenv_register ();
610+
611+ u.value = b;
612+
613+ relax_fenv_state ();
614+
615+ __asm__ ("frsqrte %[estimate], %[x]\n"
616+ : [estimate] "=f" (y) : [x] "f" (b));
617+
618+ /* Following Muller et al, page 168, equation 5.20.
619+
620+ h goes to 1/(2*sqrt(b))
621+ g goes to sqrt(b).
622+
623+ We need three iterations to get within 1ulp. */
624+
625+ /* Indicate that these can be performed prior to the branch. GCC
626+ insists on sinking them below the branch, however; it seems like
627+ they'd be better before the branch so that we can cover any latency
628+ from storing the argument and loading its high word. Oh well. */
629+
630+ g = b * y;
631+ h = 0.5 * y;
632+
633+ /* Handle small numbers by scaling. */
634+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
635+ return __ieee754_sqrt (b * two108) * twom54;
636+
637+#define FMADD(a_, c_, b_) \
638+ ({ double __r; \
639+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
640+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
641+ __r;})
642+#define FNMSUB(a_, c_, b_) \
643+ ({ double __r; \
644+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
645+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
646+ __r;})
647+
648+ r = FNMSUB (g, h, half);
649+ g = FMADD (g, r, g);
650+ h = FMADD (h, r, h);
651+
652+ r = FNMSUB (g, h, half);
653+ g = FMADD (g, r, g);
654+ h = FMADD (h, r, h);
655+
656+ r = FNMSUB (g, h, half);
657+ g = FMADD (g, r, g);
658+ h = FMADD (h, r, h);
659+
660+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
661+
662+ /* Final refinement. */
663+ d = FNMSUB (g, g, b);
664+
665+ fesetenv_register (fe);
666+ return FMADD (d, h, g);
667+ }
668+ }
669+ else if (b < 0)
670+ {
671+ /* For some reason, some PowerPC32 processors don't implement
672+ FE_INVALID_SQRT. */
673+#ifdef FE_INVALID_SQRT
674+ feraiseexcept (FE_INVALID_SQRT);
675+
676+ fenv_union_t u = { .fenv = fegetenv_register () };
677+ if ((u.l & FE_INVALID) == 0)
678+#endif
679+ feraiseexcept (FE_INVALID);
680+ b = a_nan.value;
681+ }
682+ return f_wash (b);
683+}
684diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
685new file mode 100644
686index 0000000000..26fa067abf
687--- /dev/null
688+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
689@@ -0,0 +1,101 @@
690+/* Single-precision floating point square root.
691+ Copyright (C) 2010 Free Software Foundation, Inc.
692+ This file is part of the GNU C Library.
693+
694+ The GNU C Library is free software; you can redistribute it and/or
695+ modify it under the terms of the GNU Lesser General Public
696+ License as published by the Free Software Foundation; either
697+ version 2.1 of the License, or (at your option) any later version.
698+
699+ The GNU C Library is distributed in the hope that it will be useful,
700+ but WITHOUT ANY WARRANTY; without even the implied warranty of
701+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
702+ Lesser General Public License for more details.
703+
704+ You should have received a copy of the GNU Lesser General Public
705+ License along with the GNU C Library; if not, write to the Free
706+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
707+ 02111-1307 USA. */
708+
709+#include <math.h>
710+#include <math_private.h>
711+#include <fenv_libc.h>
712+#include <inttypes.h>
713+
714+#include <sysdep.h>
715+#include <ldsodefs.h>
716+
717+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
718+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
719+static const float threehalf = 1.5;
720+
721+/* The method is based on the descriptions in:
722+
723+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
724+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
725+
726+ We find the reciprocal square root and use that to compute the actual
727+ square root. */
728+
729+#ifdef __STDC__
730+float
731+__ieee754_sqrtf (float b)
732+#else
733+float
734+__ieee754_sqrtf (b)
735+ float b;
736+#endif
737+{
738+ if (__builtin_expect (b > 0, 1))
739+ {
740+#define FMSUB(a_, c_, b_) \
741+ ({ double __r; \
742+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
743+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
744+ __r;})
745+#define FNMSUB(a_, c_, b_) \
746+ ({ double __r; \
747+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
748+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
749+ __r;})
750+
751+ if (__builtin_expect (b != a_inf.value, 1))
752+ {
753+ double y, x;
754+ fenv_t fe;
755+
756+ fe = fegetenv_register ();
757+
758+ relax_fenv_state ();
759+
760+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
761+ y = FMSUB (threehalf, b, b);
762+
763+ /* Initial estimate. */
764+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
765+
766+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
767+ x = x * FNMSUB (y, x * x, threehalf);
768+ x = x * FNMSUB (y, x * x, threehalf);
769+ x = x * FNMSUB (y, x * x, threehalf);
770+
771+ /* All done. */
772+ fesetenv_register (fe);
773+ return x * b;
774+ }
775+ }
776+ else if (b < 0)
777+ {
778+ /* For some reason, some PowerPC32 processors don't implement
779+ FE_INVALID_SQRT. */
780+#ifdef FE_INVALID_SQRT
781+ feraiseexcept (FE_INVALID_SQRT);
782+
783+ fenv_union_t u = { .fenv = fegetenv_register () };
784+ if ((u.l & FE_INVALID) == 0)
785+#endif
786+ feraiseexcept (FE_INVALID);
787+ b = a_nan.value;
788+ }
789+ return f_washf (b);
790+}
791diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
792new file mode 100644
793index 0000000000..71e516d1c8
794--- /dev/null
795+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
796@@ -0,0 +1,134 @@
797+/* Double-precision floating point square root.
798+ Copyright (C) 2010 Free Software Foundation, Inc.
799+ This file is part of the GNU C Library.
800+
801+ The GNU C Library is free software; you can redistribute it and/or
802+ modify it under the terms of the GNU Lesser General Public
803+ License as published by the Free Software Foundation; either
804+ version 2.1 of the License, or (at your option) any later version.
805+
806+ The GNU C Library is distributed in the hope that it will be useful,
807+ but WITHOUT ANY WARRANTY; without even the implied warranty of
808+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
809+ Lesser General Public License for more details.
810+
811+ You should have received a copy of the GNU Lesser General Public
812+ License along with the GNU C Library; if not, write to the Free
813+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
814+ 02111-1307 USA. */
815+
816+#include <math.h>
817+#include <math_private.h>
818+#include <fenv_libc.h>
819+#include <inttypes.h>
820+
821+#include <sysdep.h>
822+#include <ldsodefs.h>
823+
824+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
825+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
826+static const float two108 = 3.245185536584267269e+32;
827+static const float twom54 = 5.551115123125782702e-17;
828+static const float half = 0.5;
829+
830+/* The method is based on the descriptions in:
831+
832+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
833+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
834+
835+ We find the actual square root and half of its reciprocal
836+ simultaneously. */
837+
838+#ifdef __STDC__
839+double
840+__ieee754_sqrt (double b)
841+#else
842+double
843+__ieee754_sqrt (b)
844+ double b;
845+#endif
846+{
847+ if (__builtin_expect (b > 0, 1))
848+ {
849+ double y, g, h, d, r;
850+ ieee_double_shape_type u;
851+
852+ if (__builtin_expect (b != a_inf.value, 1))
853+ {
854+ fenv_t fe;
855+
856+ fe = fegetenv_register ();
857+
858+ u.value = b;
859+
860+ relax_fenv_state ();
861+
862+ __asm__ ("frsqrte %[estimate], %[x]\n"
863+ : [estimate] "=f" (y) : [x] "f" (b));
864+
865+ /* Following Muller et al, page 168, equation 5.20.
866+
867+ h goes to 1/(2*sqrt(b))
868+ g goes to sqrt(b).
869+
870+ We need three iterations to get within 1ulp. */
871+
872+ /* Indicate that these can be performed prior to the branch. GCC
873+ insists on sinking them below the branch, however; it seems like
874+ they'd be better before the branch so that we can cover any latency
875+ from storing the argument and loading its high word. Oh well. */
876+
877+ g = b * y;
878+ h = 0.5 * y;
879+
880+ /* Handle small numbers by scaling. */
881+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
882+ return __ieee754_sqrt (b * two108) * twom54;
883+
884+#define FMADD(a_, c_, b_) \
885+ ({ double __r; \
886+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
887+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
888+ __r;})
889+#define FNMSUB(a_, c_, b_) \
890+ ({ double __r; \
891+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
892+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
893+ __r;})
894+
895+ r = FNMSUB (g, h, half);
896+ g = FMADD (g, r, g);
897+ h = FMADD (h, r, h);
898+
899+ r = FNMSUB (g, h, half);
900+ g = FMADD (g, r, g);
901+ h = FMADD (h, r, h);
902+
903+ r = FNMSUB (g, h, half);
904+ g = FMADD (g, r, g);
905+ h = FMADD (h, r, h);
906+
907+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
908+
909+ /* Final refinement. */
910+ d = FNMSUB (g, g, b);
911+
912+ fesetenv_register (fe);
913+ return FMADD (d, h, g);
914+ }
915+ }
916+ else if (b < 0)
917+ {
918+ /* For some reason, some PowerPC32 processors don't implement
919+ FE_INVALID_SQRT. */
920+#ifdef FE_INVALID_SQRT
921+ feraiseexcept (FE_INVALID_SQRT);
922+
923+ fenv_union_t u = { .fenv = fegetenv_register () };
924+ if ((u.l & FE_INVALID) == 0)
925+#endif
926+ feraiseexcept (FE_INVALID);
927+ b = a_nan.value;
928+ }
929+ return f_wash (b);
930+}
931diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
932new file mode 100644
933index 0000000000..26fa067abf
934--- /dev/null
935+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
936@@ -0,0 +1,101 @@
937+/* Single-precision floating point square root.
938+ Copyright (C) 2010 Free Software Foundation, Inc.
939+ This file is part of the GNU C Library.
940+
941+ The GNU C Library is free software; you can redistribute it and/or
942+ modify it under the terms of the GNU Lesser General Public
943+ License as published by the Free Software Foundation; either
944+ version 2.1 of the License, or (at your option) any later version.
945+
946+ The GNU C Library is distributed in the hope that it will be useful,
947+ but WITHOUT ANY WARRANTY; without even the implied warranty of
948+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
949+ Lesser General Public License for more details.
950+
951+ You should have received a copy of the GNU Lesser General Public
952+ License along with the GNU C Library; if not, write to the Free
953+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
954+ 02111-1307 USA. */
955+
956+#include <math.h>
957+#include <math_private.h>
958+#include <fenv_libc.h>
959+#include <inttypes.h>
960+
961+#include <sysdep.h>
962+#include <ldsodefs.h>
963+
964+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
965+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
966+static const float threehalf = 1.5;
967+
968+/* The method is based on the descriptions in:
969+
970+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
971+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
972+
973+ We find the reciprocal square root and use that to compute the actual
974+ square root. */
975+
976+#ifdef __STDC__
977+float
978+__ieee754_sqrtf (float b)
979+#else
980+float
981+__ieee754_sqrtf (b)
982+ float b;
983+#endif
984+{
985+ if (__builtin_expect (b > 0, 1))
986+ {
987+#define FMSUB(a_, c_, b_) \
988+ ({ double __r; \
989+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
990+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
991+ __r;})
992+#define FNMSUB(a_, c_, b_) \
993+ ({ double __r; \
994+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
995+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
996+ __r;})
997+
998+ if (__builtin_expect (b != a_inf.value, 1))
999+ {
1000+ double y, x;
1001+ fenv_t fe;
1002+
1003+ fe = fegetenv_register ();
1004+
1005+ relax_fenv_state ();
1006+
1007+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1008+ y = FMSUB (threehalf, b, b);
1009+
1010+ /* Initial estimate. */
1011+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1012+
1013+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1014+ x = x * FNMSUB (y, x * x, threehalf);
1015+ x = x * FNMSUB (y, x * x, threehalf);
1016+ x = x * FNMSUB (y, x * x, threehalf);
1017+
1018+ /* All done. */
1019+ fesetenv_register (fe);
1020+ return x * b;
1021+ }
1022+ }
1023+ else if (b < 0)
1024+ {
1025+ /* For some reason, some PowerPC32 processors don't implement
1026+ FE_INVALID_SQRT. */
1027+#ifdef FE_INVALID_SQRT
1028+ feraiseexcept (FE_INVALID_SQRT);
1029+
1030+ fenv_union_t u = { .fenv = fegetenv_register () };
1031+ if ((u.l & FE_INVALID) == 0)
1032+#endif
1033+ feraiseexcept (FE_INVALID);
1034+ b = a_nan.value;
1035+ }
1036+ return f_washf (b);
1037+}
1038diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
1039new file mode 100644
1040index 0000000000..71e516d1c8
1041--- /dev/null
1042+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
1043@@ -0,0 +1,134 @@
1044+/* Double-precision floating point square root.
1045+ Copyright (C) 2010 Free Software Foundation, Inc.
1046+ This file is part of the GNU C Library.
1047+
1048+ The GNU C Library is free software; you can redistribute it and/or
1049+ modify it under the terms of the GNU Lesser General Public
1050+ License as published by the Free Software Foundation; either
1051+ version 2.1 of the License, or (at your option) any later version.
1052+
1053+ The GNU C Library is distributed in the hope that it will be useful,
1054+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1055+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1056+ Lesser General Public License for more details.
1057+
1058+ You should have received a copy of the GNU Lesser General Public
1059+ License along with the GNU C Library; if not, write to the Free
1060+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1061+ 02111-1307 USA. */
1062+
1063+#include <math.h>
1064+#include <math_private.h>
1065+#include <fenv_libc.h>
1066+#include <inttypes.h>
1067+
1068+#include <sysdep.h>
1069+#include <ldsodefs.h>
1070+
1071+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1072+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1073+static const float two108 = 3.245185536584267269e+32;
1074+static const float twom54 = 5.551115123125782702e-17;
1075+static const float half = 0.5;
1076+
1077+/* The method is based on the descriptions in:
1078+
1079+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1080+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1081+
1082+ We find the actual square root and half of its reciprocal
1083+ simultaneously. */
1084+
1085+#ifdef __STDC__
1086+double
1087+__ieee754_sqrt (double b)
1088+#else
1089+double
1090+__ieee754_sqrt (b)
1091+ double b;
1092+#endif
1093+{
1094+ if (__builtin_expect (b > 0, 1))
1095+ {
1096+ double y, g, h, d, r;
1097+ ieee_double_shape_type u;
1098+
1099+ if (__builtin_expect (b != a_inf.value, 1))
1100+ {
1101+ fenv_t fe;
1102+
1103+ fe = fegetenv_register ();
1104+
1105+ u.value = b;
1106+
1107+ relax_fenv_state ();
1108+
1109+ __asm__ ("frsqrte %[estimate], %[x]\n"
1110+ : [estimate] "=f" (y) : [x] "f" (b));
1111+
1112+ /* Following Muller et al, page 168, equation 5.20.
1113+
1114+ h goes to 1/(2*sqrt(b))
1115+ g goes to sqrt(b).
1116+
1117+ We need three iterations to get within 1ulp. */
1118+
1119+ /* Indicate that these can be performed prior to the branch. GCC
1120+ insists on sinking them below the branch, however; it seems like
1121+ they'd be better before the branch so that we can cover any latency
1122+ from storing the argument and loading its high word. Oh well. */
1123+
1124+ g = b * y;
1125+ h = 0.5 * y;
1126+
1127+ /* Handle small numbers by scaling. */
1128+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1129+ return __ieee754_sqrt (b * two108) * twom54;
1130+
1131+#define FMADD(a_, c_, b_) \
1132+ ({ double __r; \
1133+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1134+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1135+ __r;})
1136+#define FNMSUB(a_, c_, b_) \
1137+ ({ double __r; \
1138+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1139+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1140+ __r;})
1141+
1142+ r = FNMSUB (g, h, half);
1143+ g = FMADD (g, r, g);
1144+ h = FMADD (h, r, h);
1145+
1146+ r = FNMSUB (g, h, half);
1147+ g = FMADD (g, r, g);
1148+ h = FMADD (h, r, h);
1149+
1150+ r = FNMSUB (g, h, half);
1151+ g = FMADD (g, r, g);
1152+ h = FMADD (h, r, h);
1153+
1154+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1155+
1156+ /* Final refinement. */
1157+ d = FNMSUB (g, g, b);
1158+
1159+ fesetenv_register (fe);
1160+ return FMADD (d, h, g);
1161+ }
1162+ }
1163+ else if (b < 0)
1164+ {
1165+ /* For some reason, some PowerPC32 processors don't implement
1166+ FE_INVALID_SQRT. */
1167+#ifdef FE_INVALID_SQRT
1168+ feraiseexcept (FE_INVALID_SQRT);
1169+
1170+ fenv_union_t u = { .fenv = fegetenv_register () };
1171+ if ((u.l & FE_INVALID) == 0)
1172+#endif
1173+ feraiseexcept (FE_INVALID);
1174+ b = a_nan.value;
1175+ }
1176+ return f_wash (b);
1177+}
1178diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1179new file mode 100644
1180index 0000000000..26fa067abf
1181--- /dev/null
1182+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1183@@ -0,0 +1,101 @@
1184+/* Single-precision floating point square root.
1185+ Copyright (C) 2010 Free Software Foundation, Inc.
1186+ This file is part of the GNU C Library.
1187+
1188+ The GNU C Library is free software; you can redistribute it and/or
1189+ modify it under the terms of the GNU Lesser General Public
1190+ License as published by the Free Software Foundation; either
1191+ version 2.1 of the License, or (at your option) any later version.
1192+
1193+ The GNU C Library is distributed in the hope that it will be useful,
1194+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1195+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1196+ Lesser General Public License for more details.
1197+
1198+ You should have received a copy of the GNU Lesser General Public
1199+ License along with the GNU C Library; if not, write to the Free
1200+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1201+ 02111-1307 USA. */
1202+
1203+#include <math.h>
1204+#include <math_private.h>
1205+#include <fenv_libc.h>
1206+#include <inttypes.h>
1207+
1208+#include <sysdep.h>
1209+#include <ldsodefs.h>
1210+
1211+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1212+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1213+static const float threehalf = 1.5;
1214+
1215+/* The method is based on the descriptions in:
1216+
1217+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1218+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1219+
1220+ We find the reciprocal square root and use that to compute the actual
1221+ square root. */
1222+
1223+#ifdef __STDC__
1224+float
1225+__ieee754_sqrtf (float b)
1226+#else
1227+float
1228+__ieee754_sqrtf (b)
1229+ float b;
1230+#endif
1231+{
1232+ if (__builtin_expect (b > 0, 1))
1233+ {
1234+#define FMSUB(a_, c_, b_) \
1235+ ({ double __r; \
1236+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1237+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1238+ __r;})
1239+#define FNMSUB(a_, c_, b_) \
1240+ ({ double __r; \
1241+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1242+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1243+ __r;})
1244+
1245+ if (__builtin_expect (b != a_inf.value, 1))
1246+ {
1247+ double y, x;
1248+ fenv_t fe;
1249+
1250+ fe = fegetenv_register ();
1251+
1252+ relax_fenv_state ();
1253+
1254+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1255+ y = FMSUB (threehalf, b, b);
1256+
1257+ /* Initial estimate. */
1258+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1259+
1260+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1261+ x = x * FNMSUB (y, x * x, threehalf);
1262+ x = x * FNMSUB (y, x * x, threehalf);
1263+ x = x * FNMSUB (y, x * x, threehalf);
1264+
1265+ /* All done. */
1266+ fesetenv_register (fe);
1267+ return x * b;
1268+ }
1269+ }
1270+ else if (b < 0)
1271+ {
1272+ /* For some reason, some PowerPC32 processors don't implement
1273+ FE_INVALID_SQRT. */
1274+#ifdef FE_INVALID_SQRT
1275+ feraiseexcept (FE_INVALID_SQRT);
1276+
1277+ fenv_union_t u = { .fenv = fegetenv_register () };
1278+ if ((u.l & FE_INVALID) == 0)
1279+#endif
1280+ feraiseexcept (FE_INVALID);
1281+ b = a_nan.value;
1282+ }
1283+ return f_washf (b);
1284+}
1285diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1286new file mode 100644
1287index 0000000000..71e516d1c8
1288--- /dev/null
1289+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1290@@ -0,0 +1,134 @@
1291+/* Double-precision floating point square root.
1292+ Copyright (C) 2010 Free Software Foundation, Inc.
1293+ This file is part of the GNU C Library.
1294+
1295+ The GNU C Library is free software; you can redistribute it and/or
1296+ modify it under the terms of the GNU Lesser General Public
1297+ License as published by the Free Software Foundation; either
1298+ version 2.1 of the License, or (at your option) any later version.
1299+
1300+ The GNU C Library is distributed in the hope that it will be useful,
1301+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1302+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1303+ Lesser General Public License for more details.
1304+
1305+ You should have received a copy of the GNU Lesser General Public
1306+ License along with the GNU C Library; if not, write to the Free
1307+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1308+ 02111-1307 USA. */
1309+
1310+#include <math.h>
1311+#include <math_private.h>
1312+#include <fenv_libc.h>
1313+#include <inttypes.h>
1314+
1315+#include <sysdep.h>
1316+#include <ldsodefs.h>
1317+
1318+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1319+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1320+static const float two108 = 3.245185536584267269e+32;
1321+static const float twom54 = 5.551115123125782702e-17;
1322+static const float half = 0.5;
1323+
1324+/* The method is based on the descriptions in:
1325+
1326+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1327+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1328+
1329+ We find the actual square root and half of its reciprocal
1330+ simultaneously. */
1331+
1332+#ifdef __STDC__
1333+double
1334+__ieee754_sqrt (double b)
1335+#else
1336+double
1337+__ieee754_sqrt (b)
1338+ double b;
1339+#endif
1340+{
1341+ if (__builtin_expect (b > 0, 1))
1342+ {
1343+ double y, g, h, d, r;
1344+ ieee_double_shape_type u;
1345+
1346+ if (__builtin_expect (b != a_inf.value, 1))
1347+ {
1348+ fenv_t fe;
1349+
1350+ fe = fegetenv_register ();
1351+
1352+ u.value = b;
1353+
1354+ relax_fenv_state ();
1355+
1356+ __asm__ ("frsqrte %[estimate], %[x]\n"
1357+ : [estimate] "=f" (y) : [x] "f" (b));
1358+
1359+ /* Following Muller et al, page 168, equation 5.20.
1360+
1361+ h goes to 1/(2*sqrt(b))
1362+ g goes to sqrt(b).
1363+
1364+ We need three iterations to get within 1ulp. */
1365+
1366+ /* Indicate that these can be performed prior to the branch. GCC
1367+ insists on sinking them below the branch, however; it seems like
1368+ they'd be better before the branch so that we can cover any latency
1369+ from storing the argument and loading its high word. Oh well. */
1370+
1371+ g = b * y;
1372+ h = 0.5 * y;
1373+
1374+ /* Handle small numbers by scaling. */
1375+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1376+ return __ieee754_sqrt (b * two108) * twom54;
1377+
1378+#define FMADD(a_, c_, b_) \
1379+ ({ double __r; \
1380+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1381+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1382+ __r;})
1383+#define FNMSUB(a_, c_, b_) \
1384+ ({ double __r; \
1385+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1386+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1387+ __r;})
1388+
1389+ r = FNMSUB (g, h, half);
1390+ g = FMADD (g, r, g);
1391+ h = FMADD (h, r, h);
1392+
1393+ r = FNMSUB (g, h, half);
1394+ g = FMADD (g, r, g);
1395+ h = FMADD (h, r, h);
1396+
1397+ r = FNMSUB (g, h, half);
1398+ g = FMADD (g, r, g);
1399+ h = FMADD (h, r, h);
1400+
1401+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1402+
1403+ /* Final refinement. */
1404+ d = FNMSUB (g, g, b);
1405+
1406+ fesetenv_register (fe);
1407+ return FMADD (d, h, g);
1408+ }
1409+ }
1410+ else if (b < 0)
1411+ {
1412+ /* For some reason, some PowerPC32 processors don't implement
1413+ FE_INVALID_SQRT. */
1414+#ifdef FE_INVALID_SQRT
1415+ feraiseexcept (FE_INVALID_SQRT);
1416+
1417+ fenv_union_t u = { .fenv = fegetenv_register () };
1418+ if ((u.l & FE_INVALID) == 0)
1419+#endif
1420+ feraiseexcept (FE_INVALID);
1421+ b = a_nan.value;
1422+ }
1423+ return f_wash (b);
1424+}
1425diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1426new file mode 100644
1427index 0000000000..26fa067abf
1428--- /dev/null
1429+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1430@@ -0,0 +1,101 @@
1431+/* Single-precision floating point square root.
1432+ Copyright (C) 2010 Free Software Foundation, Inc.
1433+ This file is part of the GNU C Library.
1434+
1435+ The GNU C Library is free software; you can redistribute it and/or
1436+ modify it under the terms of the GNU Lesser General Public
1437+ License as published by the Free Software Foundation; either
1438+ version 2.1 of the License, or (at your option) any later version.
1439+
1440+ The GNU C Library is distributed in the hope that it will be useful,
1441+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1442+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1443+ Lesser General Public License for more details.
1444+
1445+ You should have received a copy of the GNU Lesser General Public
1446+ License along with the GNU C Library; if not, write to the Free
1447+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1448+ 02111-1307 USA. */
1449+
1450+#include <math.h>
1451+#include <math_private.h>
1452+#include <fenv_libc.h>
1453+#include <inttypes.h>
1454+
1455+#include <sysdep.h>
1456+#include <ldsodefs.h>
1457+
1458+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1459+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1460+static const float threehalf = 1.5;
1461+
1462+/* The method is based on the descriptions in:
1463+
1464+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1465+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1466+
1467+ We find the reciprocal square root and use that to compute the actual
1468+ square root. */
1469+
1470+#ifdef __STDC__
1471+float
1472+__ieee754_sqrtf (float b)
1473+#else
1474+float
1475+__ieee754_sqrtf (b)
1476+ float b;
1477+#endif
1478+{
1479+ if (__builtin_expect (b > 0, 1))
1480+ {
1481+#define FMSUB(a_, c_, b_) \
1482+ ({ double __r; \
1483+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1484+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1485+ __r;})
1486+#define FNMSUB(a_, c_, b_) \
1487+ ({ double __r; \
1488+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1489+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1490+ __r;})
1491+
1492+ if (__builtin_expect (b != a_inf.value, 1))
1493+ {
1494+ double y, x;
1495+ fenv_t fe;
1496+
1497+ fe = fegetenv_register ();
1498+
1499+ relax_fenv_state ();
1500+
1501+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1502+ y = FMSUB (threehalf, b, b);
1503+
1504+ /* Initial estimate. */
1505+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1506+
1507+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1508+ x = x * FNMSUB (y, x * x, threehalf);
1509+ x = x * FNMSUB (y, x * x, threehalf);
1510+ x = x * FNMSUB (y, x * x, threehalf);
1511+
1512+ /* All done. */
1513+ fesetenv_register (fe);
1514+ return x * b;
1515+ }
1516+ }
1517+ else if (b < 0)
1518+ {
1519+ /* For some reason, some PowerPC32 processors don't implement
1520+ FE_INVALID_SQRT. */
1521+#ifdef FE_INVALID_SQRT
1522+ feraiseexcept (FE_INVALID_SQRT);
1523+
1524+ fenv_union_t u = { .fenv = fegetenv_register () };
1525+ if ((u.l & FE_INVALID) == 0)
1526+#endif
1527+ feraiseexcept (FE_INVALID);
1528+ b = a_nan.value;
1529+ }
1530+ return f_washf (b);
1531+}
1532diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1533new file mode 100644
1534index 0000000000..b103b4dea5
1535--- /dev/null
1536+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1537@@ -0,0 +1 @@
1538+powerpc/powerpc32/603e/fpu
1539diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1540new file mode 100644
1541index 0000000000..64db17fada
1542--- /dev/null
1543+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1544@@ -0,0 +1,2 @@
1545+# e300c3 is a variant of 603e so use the same optimizations for sqrt
1546+powerpc/powerpc32/603e/fpu
1547diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1548new file mode 100644
1549index 0000000000..7eac5fcf02
1550--- /dev/null
1551+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1552@@ -0,0 +1 @@
1553+powerpc/powerpc32/e500mc/fpu
1554diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1555new file mode 100644
1556index 0000000000..264b2a7700
1557--- /dev/null
1558+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1559@@ -0,0 +1 @@
1560+powerpc/powerpc32/e5500/fpu
1561diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1562new file mode 100644
1563index 0000000000..a25934467b
1564--- /dev/null
1565+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1566@@ -0,0 +1 @@
1567+powerpc/powerpc32/e6500/fpu
1568diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1569new file mode 100644
1570index 0000000000..a7bc854be8
1571--- /dev/null
1572+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1573@@ -0,0 +1 @@
1574+powerpc/powerpc64/e5500/fpu
1575diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1576new file mode 100644
1577index 0000000000..04ff8cc181
1578--- /dev/null
1579+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1580@@ -0,0 +1 @@
1581+powerpc/powerpc64/e6500/fpu
diff --git a/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch b/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch
new file mode 100644
index 0000000000..025ad153d6
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch
@@ -0,0 +1,32 @@
1From 789083eea1feb1249ec5817710552dc31653b36e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 6 Mar 2021 14:48:56 -0800
4Subject: [PATCH] nativesdk-glibc: Fall back to faccessat on faccess2 returns
5 EPERM
6
7Fedora-specific workaround for systemd-nspawn
8
9Upstream-Status: Inappropriate [Distro Specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 sysdeps/unix/sysv/linux/faccessat.c | 6 +++++-
14 1 file changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
17index edb22ebce6..b67684a3ba 100644
18--- a/sysdeps/unix/sysv/linux/faccessat.c
19+++ b/sysdeps/unix/sysv/linux/faccessat.c
20@@ -30,7 +30,11 @@ __faccessat (int fd, const char *file, int mode, int flag)
21 #if __ASSUME_FACCESSAT2
22 return ret;
23 #else
24- if (ret == 0 || errno != ENOSYS)
25+ /* Fedora-specific workaround:
26+ As a workround for a broken systemd-nspawn that returns
27+ EPERM when a syscall is not allowed instead of ENOSYS
28+ we must check for EPERM here and fall back to faccessat. */
29+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
30 return ret;
31
32 if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
diff --git a/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
deleted file mode 100644
index 0c8bf94a75..0000000000
--- a/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
+++ /dev/null
@@ -1,205 +0,0 @@
1From 3b5fe5b1a7390cde0f07351415e3891f62d1f7e0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:15:07 +0000
4Subject: [PATCH] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
5
6on ppc fixes the errors like below
7| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
8| collect2: ld returned 1 exit status
9
10Upstream-Status: Pending
11
12ChangeLog
13
142012-01-06 Khem Raj <raj.khem@gmail.com>
15
16 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
17 Remove cruft.
18 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
19 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
20 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
21
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 7 +------
25 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 7 +------
26 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 1 +
27 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 +
28 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 1 +
29 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 1 +
30 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 1 +
31 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 1 +
32 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 7 +------
33 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 7 +------
34 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 1 +
35 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 1 +
36 12 files changed, 12 insertions(+), 24 deletions(-)
37
38diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
39index 71e516d1c8..1795fd6c3e 100644
40--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
41+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
42@@ -39,14 +39,8 @@ static const float half = 0.5;
43 We find the actual square root and half of its reciprocal
44 simultaneously. */
45
46-#ifdef __STDC__
47 double
48 __ieee754_sqrt (double b)
49-#else
50-double
51-__ieee754_sqrt (b)
52- double b;
53-#endif
54 {
55 if (__builtin_expect (b > 0, 1))
56 {
57@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
58 }
59 return f_wash (b);
60 }
61+strong_alias (__ieee754_sqrt, __sqrt_finite)
62diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
63index 26fa067abf..a917f313ab 100644
64--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
65+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
66@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
67 We find the reciprocal square root and use that to compute the actual
68 square root. */
69
70-#ifdef __STDC__
71 float
72 __ieee754_sqrtf (float b)
73-#else
74-float
75-__ieee754_sqrtf (b)
76- float b;
77-#endif
78 {
79 if (__builtin_expect (b > 0, 1))
80 {
81@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
82 }
83 return f_washf (b);
84 }
85+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
86diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
87index 71e516d1c8..fc4a74990e 100644
88--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
89+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
90@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
91 }
92 return f_wash (b);
93 }
94+strong_alias (__ieee754_sqrt, __sqrt_finite)
95diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
96index 26fa067abf..9d175122a8 100644
97--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
98+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
99@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
100 }
101 return f_washf (b);
102 }
103+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
104diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
105index 71e516d1c8..fc4a74990e 100644
106--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
107+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
108@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
109 }
110 return f_wash (b);
111 }
112+strong_alias (__ieee754_sqrt, __sqrt_finite)
113diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
114index 26fa067abf..9d175122a8 100644
115--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
116+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
117@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
118 }
119 return f_washf (b);
120 }
121+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
122diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
123index 71e516d1c8..fc4a74990e 100644
124--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
125+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
126@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
127 }
128 return f_wash (b);
129 }
130+strong_alias (__ieee754_sqrt, __sqrt_finite)
131diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
132index 26fa067abf..9d175122a8 100644
133--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
134+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
135@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
136 }
137 return f_washf (b);
138 }
139+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
140diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
141index 71e516d1c8..1795fd6c3e 100644
142--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
143+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
144@@ -39,14 +39,8 @@ static const float half = 0.5;
145 We find the actual square root and half of its reciprocal
146 simultaneously. */
147
148-#ifdef __STDC__
149 double
150 __ieee754_sqrt (double b)
151-#else
152-double
153-__ieee754_sqrt (b)
154- double b;
155-#endif
156 {
157 if (__builtin_expect (b > 0, 1))
158 {
159@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
160 }
161 return f_wash (b);
162 }
163+strong_alias (__ieee754_sqrt, __sqrt_finite)
164diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
165index 26fa067abf..a917f313ab 100644
166--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
167+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
168@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
169 We find the reciprocal square root and use that to compute the actual
170 square root. */
171
172-#ifdef __STDC__
173 float
174 __ieee754_sqrtf (float b)
175-#else
176-float
177-__ieee754_sqrtf (b)
178- float b;
179-#endif
180 {
181 if (__builtin_expect (b > 0, 1))
182 {
183@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
184 }
185 return f_washf (b);
186 }
187+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
188diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
189index 71e516d1c8..fc4a74990e 100644
190--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
191+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
192@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
193 }
194 return f_wash (b);
195 }
196+strong_alias (__ieee754_sqrt, __sqrt_finite)
197diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
198index 26fa067abf..9d175122a8 100644
199--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
200+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
201@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
202 }
203 return f_washf (b);
204 }
205+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch
index 15e83f8917..dbb6d674d5 100644
--- a/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
+++ b/meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch
@@ -1,4 +1,4 @@
1From 0bd39d8907953f18e01742f42b24647ac7689d0a Mon Sep 17 00:00:00 2001 1From 4a1ff3c313645aa425a0a87459c907dad1b9ca4b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:31:06 +0000 3Date: Wed, 18 Mar 2015 00:31:06 +0000
4Subject: [PATCH] 'yes' within the path sets wrong config variables 4Subject: [PATCH] 'yes' within the path sets wrong config variables
@@ -20,20 +20,22 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 sysdeps/arm/configure.ac | 4 ++-- 20 sysdeps/arm/configure.ac | 4 ++--
21 sysdeps/mips/configure | 4 ++-- 21 sysdeps/mips/configure | 4 ++--
22 sysdeps/mips/configure.ac | 4 ++-- 22 sysdeps/mips/configure.ac | 4 ++--
23 sysdeps/nios2/configure | 4 ++--
24 sysdeps/nios2/configure.ac | 4 ++--
25 sysdeps/unix/sysv/linux/mips/configure | 4 ++-- 23 sysdeps/unix/sysv/linux/mips/configure | 4 ++--
26 sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++-- 24 sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++--
27 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++---- 25 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++----
28 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++---- 26 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++----
29 12 files changed, 28 insertions(+), 28 deletions(-) 27 10 files changed, 24 insertions(+), 24 deletions(-)
28 mode change 100644 => 100755 sysdeps/arm/configure
29 mode change 100644 => 100755 sysdeps/mips/configure
30 mode change 100644 => 100755 sysdeps/unix/sysv/linux/mips/configure
31 mode change 100644 => 100755 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
30 32
31diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure 33diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
32index 83c3a23e44..a68c946277 100644 34index 4bd5496a4a..6c051369fb 100755
33--- a/sysdeps/aarch64/configure 35--- a/sysdeps/aarch64/configure
34+++ b/sysdeps/aarch64/configure 36+++ b/sysdeps/aarch64/configure
35@@ -157,12 +157,12 @@ else 37@@ -157,12 +157,12 @@ else case e in #(
36 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 38 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37 /* end confdefs.h. */ 39 /* end confdefs.h. */
38 #ifdef __AARCH64EB__ 40 #ifdef __AARCH64EB__
39- yes 41- yes
@@ -42,16 +44,16 @@ index 83c3a23e44..a68c946277 100644
42 44
43 _ACEOF 45 _ACEOF
44 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 46 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
45- $EGREP "yes" >/dev/null 2>&1; then : 47- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
46+ $EGREP "is_aarch64_be" >/dev/null 2>&1; then : 48+ $EGREP_TRADITIONAL "is_aarch64_be" >/dev/null 2>&1
49 then :
47 libc_cv_aarch64_be=yes 50 libc_cv_aarch64_be=yes
48 else 51 else case e in #(
49 libc_cv_aarch64_be=no
50diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac 52diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
51index 66f755078a..a32b265bbe 100644 53index 56d12d661d..80fca20873 100644
52--- a/sysdeps/aarch64/configure.ac 54--- a/sysdeps/aarch64/configure.ac
53+++ b/sysdeps/aarch64/configure.ac 55+++ b/sysdeps/aarch64/configure.ac
54@@ -17,8 +17,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE) 56@@ -13,8 +13,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE)
55 # the dynamic linker via %ifdef. 57 # the dynamic linker via %ifdef.
56 AC_CACHE_CHECK([for big endian], 58 AC_CACHE_CHECK([for big endian],
57 [libc_cv_aarch64_be], 59 [libc_cv_aarch64_be],
@@ -63,11 +65,13 @@ index 66f755078a..a32b265bbe 100644
63 ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)]) 65 ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
64 if test $libc_cv_aarch64_be = yes; then 66 if test $libc_cv_aarch64_be = yes; then
65diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure 67diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
66index 431e843b2b..e152461138 100644 68old mode 100644
69new mode 100755
70index 935e022c74..9f7c98bcd3
67--- a/sysdeps/arm/configure 71--- a/sysdeps/arm/configure
68+++ b/sysdeps/arm/configure 72+++ b/sysdeps/arm/configure
69@@ -151,12 +151,12 @@ else 73@@ -153,12 +153,12 @@ else case e in #(
70 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
71 /* end confdefs.h. */ 75 /* end confdefs.h. */
72 #ifdef __ARM_PCS_VFP 76 #ifdef __ARM_PCS_VFP
73- yes 77- yes
@@ -76,16 +80,16 @@ index 431e843b2b..e152461138 100644
76 80
77 _ACEOF 81 _ACEOF
78 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 82 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
79- $EGREP "yes" >/dev/null 2>&1; then : 83- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
80+ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then : 84+ $EGREP_TRADITIONAL "use_arm_pcs_vfp" >/dev/null 2>&1
85 then :
81 libc_cv_arm_pcs_vfp=yes 86 libc_cv_arm_pcs_vfp=yes
82 else 87 else case e in #(
83 libc_cv_arm_pcs_vfp=no
84diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac 88diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
85index 90cdd69c75..05a262ba00 100644 89index cd00ddc9d9..d3831867ac 100644
86--- a/sysdeps/arm/configure.ac 90--- a/sysdeps/arm/configure.ac
87+++ b/sysdeps/arm/configure.ac 91+++ b/sysdeps/arm/configure.ac
88@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN) 92@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
89 # the dynamic linker via %ifdef. 93 # the dynamic linker via %ifdef.
90 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], 94 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
91 [libc_cv_arm_pcs_vfp], 95 [libc_cv_arm_pcs_vfp],
@@ -97,10 +101,12 @@ index 90cdd69c75..05a262ba00 100644
97 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)]) 101 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
98 if test $libc_cv_arm_pcs_vfp = yes; then 102 if test $libc_cv_arm_pcs_vfp = yes; then
99diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure 103diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure
100index 4e13248c03..f14af952d0 100644 104old mode 100644
105new mode 100755
106index 60dbd947e2..e3d10d7b96
101--- a/sysdeps/mips/configure 107--- a/sysdeps/mips/configure
102+++ b/sysdeps/mips/configure 108+++ b/sysdeps/mips/configure
103@@ -143,11 +143,11 @@ else 109@@ -150,11 +150,11 @@ else case e in #(
104 /* end confdefs.h. */ 110 /* end confdefs.h. */
105 dnl 111 dnl
106 #ifdef __mips_nan2008 112 #ifdef __mips_nan2008
@@ -109,17 +115,17 @@ index 4e13248c03..f14af952d0 100644
109 #endif 115 #endif
110 _ACEOF 116 _ACEOF
111 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 117 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
112- $EGREP "yes" >/dev/null 2>&1; then : 118- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
113+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : 119+ $EGREP_TRADITIONAL "use_mips_nan2008" >/dev/null 2>&1
120 then :
114 libc_cv_mips_nan2008=yes 121 libc_cv_mips_nan2008=yes
115 else 122 else case e in #(
116 libc_cv_mips_nan2008=no
117diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac 123diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac
118index bcbdaffd9f..ad3057f4cc 100644 124index d3cd780d78..250223d206 100644
119--- a/sysdeps/mips/configure.ac 125--- a/sysdeps/mips/configure.ac
120+++ b/sysdeps/mips/configure.ac 126+++ b/sysdeps/mips/configure.ac
121@@ -6,9 +6,9 @@ dnl position independent way. 127@@ -6,9 +6,9 @@ dnl position independent way.
122 dnl AC_DEFINE(PI_STATIC_AND_HIDDEN) 128 AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
123 129
124 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], 130 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
125- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl 131- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
@@ -130,45 +136,13 @@ index bcbdaffd9f..ad3057f4cc 100644
130 #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)]) 136 #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
131 if test x$libc_cv_mips_nan2008 = xyes; then 137 if test x$libc_cv_mips_nan2008 = xyes; then
132 AC_DEFINE(HAVE_MIPS_NAN2008) 138 AC_DEFINE(HAVE_MIPS_NAN2008)
133diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure
134index 14c8a3a014..dde3814ef2 100644
135--- a/sysdeps/nios2/configure
136+++ b/sysdeps/nios2/configure
137@@ -142,12 +142,12 @@ else
138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
139 /* end confdefs.h. */
140 #ifdef __nios2_big_endian__
141- yes
142+ is_nios2_be
143 #endif
144
145 _ACEOF
146 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
147- $EGREP "yes" >/dev/null 2>&1; then :
148+ $EGREP "is_nios2_be" >/dev/null 2>&1; then :
149 libc_cv_nios2_be=yes
150 else
151 libc_cv_nios2_be=no
152diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac
153index f05f43802b..dc8639902d 100644
154--- a/sysdeps/nios2/configure.ac
155+++ b/sysdeps/nios2/configure.ac
156@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
157 # Nios II big endian is not yet supported.
158 AC_CACHE_CHECK([for big endian],
159 [libc_cv_nios2_be],
160- [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__
161- yes
162+ [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__
163+ is_nios2_be
164 #endif
165 ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)])
166 if test $libc_cv_nios2_be = yes; then
167diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure 139diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
168index f25f2a3a65..1b7483e6c6 100644 140old mode 100644
141new mode 100755
142index 6e3402c111..a23f24ef8e
169--- a/sysdeps/unix/sysv/linux/mips/configure 143--- a/sysdeps/unix/sysv/linux/mips/configure
170+++ b/sysdeps/unix/sysv/linux/mips/configure 144+++ b/sysdeps/unix/sysv/linux/mips/configure
171@@ -414,11 +414,11 @@ else 145@@ -443,11 +443,11 @@ else case e in #(
172 /* end confdefs.h. */ 146 /* end confdefs.h. */
173 dnl 147 dnl
174 #ifdef __mips_nan2008 148 #ifdef __mips_nan2008
@@ -177,11 +151,11 @@ index f25f2a3a65..1b7483e6c6 100644
177 #endif 151 #endif
178 _ACEOF 152 _ACEOF
179 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 153 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
180- $EGREP "yes" >/dev/null 2>&1; then : 154- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
181+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : 155+ $EGREP_TRADITIONAL "use_mips_nan2008" >/dev/null 2>&1
156 then :
182 libc_cv_mips_nan2008=yes 157 libc_cv_mips_nan2008=yes
183 else 158 else case e in #(
184 libc_cv_mips_nan2008=no
185diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac 159diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac
186index 049a0f4bdf..005526d4e8 100644 160index 049a0f4bdf..005526d4e8 100644
187--- a/sysdeps/unix/sysv/linux/mips/configure.ac 161--- a/sysdeps/unix/sysv/linux/mips/configure.ac
@@ -199,11 +173,13 @@ index 049a0f4bdf..005526d4e8 100644
199 173
200 libc_mips_nan= 174 libc_mips_nan=
201diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 175diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
202index ae7f254da4..874519000b 100644 176old mode 100644
177new mode 100755
178index 5dd70689fc..7d6c2322d3
203--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 179--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
204+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 180+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
205@@ -155,12 +155,12 @@ else 181@@ -160,12 +160,12 @@ else case e in #(
206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 182 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
207 /* end confdefs.h. */ 183 /* end confdefs.h. */
208 #if _CALL_ELF == 2 184 #if _CALL_ELF == 2
209- yes 185- yes
@@ -212,13 +188,13 @@ index ae7f254da4..874519000b 100644
212 188
213 _ACEOF 189 _ACEOF
214 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 190 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
215- $EGREP "yes" >/dev/null 2>&1; then : 191- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
216+ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then : 192+ $EGREP_TRADITIONAL "use_ppc_elfv2_abi" >/dev/null 2>&1
193 then :
217 libc_cv_ppc64_elfv2_abi=yes 194 libc_cv_ppc64_elfv2_abi=yes
218 else 195 else case e in #(
219 libc_cv_ppc64_elfv2_abi=no 196@@ -197,12 +197,12 @@ else case e in #(
220@@ -188,12 +188,12 @@ else 197 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
222 /* end confdefs.h. */ 198 /* end confdefs.h. */
223 #ifdef _CALL_ELF 199 #ifdef _CALL_ELF
224- yes 200- yes
@@ -227,11 +203,11 @@ index ae7f254da4..874519000b 100644
227 203
228 _ACEOF 204 _ACEOF
229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 205 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
230- $EGREP "yes" >/dev/null 2>&1; then : 206- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1
231+ $EGREP "is_def_call_elf" >/dev/null 2>&1; then : 207+ $EGREP_TRADITIONAL "is_def_call_elf" >/dev/null 2>&1
208 then :
232 libc_cv_ppc64_def_call_elf=yes 209 libc_cv_ppc64_def_call_elf=yes
233 else 210 else case e in #(
234 libc_cv_ppc64_def_call_elf=no
235diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac 211diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
236index f9cba6e15d..b21f72f1e4 100644 212index f9cba6e15d..b21f72f1e4 100644
237--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac 213--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
diff --git a/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
deleted file mode 100644
index cadaa0b2e2..0000000000
--- a/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ /dev/null
@@ -1,384 +0,0 @@
1From 6b6e1dcd707017598ea3bdc2d91a761943b62218 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:16:38 +0000
4Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
5 __slow versions
6
7Upstream-Status: Pending
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 12 ++++++++++--
12 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 8 +++++++-
13 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 14 +++++++++++---
14 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++--
15 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 14 +++++++++++---
16 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 12 ++++++++++--
17 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 8 ++++++++
18 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 8 ++++++++
19 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 12 ++++++++++--
20 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 9 ++++++++-
21 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 14 +++++++++++---
22 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 12 ++++++++++--
23 12 files changed, 114 insertions(+), 21 deletions(-)
24
25diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
26index 1795fd6c3e..daa83f3fe8 100644
27--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
28+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
29@@ -40,7 +40,7 @@ static const float half = 0.5;
30 simultaneously. */
31
32 double
33-__ieee754_sqrt (double b)
34+__slow_ieee754_sqrt (double b)
35 {
36 if (__builtin_expect (b > 0, 1))
37 {
38@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
39
40 /* Handle small numbers by scaling. */
41 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
42- return __ieee754_sqrt (b * two108) * twom54;
43+ return __slow_ieee754_sqrt (b * two108) * twom54;
44
45 #define FMADD(a_, c_, b_) \
46 ({ double __r; \
47@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
48 }
49 return f_wash (b);
50 }
51+
52+#undef __ieee754_sqrt
53+double
54+__ieee754_sqrt (double x)
55+{
56+ return __slow_ieee754_sqrt (x);
57+}
58+
59 strong_alias (__ieee754_sqrt, __sqrt_finite)
60diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
61index a917f313ab..b812cf1705 100644
62--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
63+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
64@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
65 square root. */
66
67 float
68-__ieee754_sqrtf (float b)
69+__slow_ieee754_sqrtf (float b)
70 {
71 if (__builtin_expect (b > 0, 1))
72 {
73@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
74 }
75 return f_washf (b);
76 }
77+#undef __ieee754_sqrtf
78+float
79+__ieee754_sqrtf (float x)
80+{
81+ return __slow_ieee754_sqrtf (x);
82+}
83 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
84diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
85index fc4a74990e..7038a70b47 100644
86--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
87+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
88@@ -41,10 +41,10 @@ static const float half = 0.5;
89
90 #ifdef __STDC__
91 double
92-__ieee754_sqrt (double b)
93+__slow_ieee754_sqrt (double b)
94 #else
95 double
96-__ieee754_sqrt (b)
97+__slow_ieee754_sqrt (b)
98 double b;
99 #endif
100 {
101@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
102
103 /* Handle small numbers by scaling. */
104 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
105- return __ieee754_sqrt (b * two108) * twom54;
106+ return __slow_ieee754_sqrt (b * two108) * twom54;
107
108 #define FMADD(a_, c_, b_) \
109 ({ double __r; \
110@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
111 }
112 return f_wash (b);
113 }
114+
115+#undef __ieee754_sqrt
116+double
117+__ieee754_sqrt (double x)
118+{
119+ return __slow_ieee754_sqrt (x);
120+}
121+
122 strong_alias (__ieee754_sqrt, __sqrt_finite)
123diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
124index 9d175122a8..10de1f0cc3 100644
125--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
126+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
127@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
128
129 #ifdef __STDC__
130 float
131-__ieee754_sqrtf (float b)
132+__slow_ieee754_sqrtf (float b)
133 #else
134 float
135-__ieee754_sqrtf (b)
136+__slow_ieee754_sqrtf (b)
137 float b;
138 #endif
139 {
140@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
141 }
142 return f_washf (b);
143 }
144+
145+#undef __ieee754_sqrtf
146+float
147+__ieee754_sqrtf (float x)
148+{
149+ return __slow_ieee754_sqrtf (x);
150+}
151+
152 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
153diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
154index fc4a74990e..7038a70b47 100644
155--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
156+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
157@@ -41,10 +41,10 @@ static const float half = 0.5;
158
159 #ifdef __STDC__
160 double
161-__ieee754_sqrt (double b)
162+__slow_ieee754_sqrt (double b)
163 #else
164 double
165-__ieee754_sqrt (b)
166+__slow_ieee754_sqrt (b)
167 double b;
168 #endif
169 {
170@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
171
172 /* Handle small numbers by scaling. */
173 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
174- return __ieee754_sqrt (b * two108) * twom54;
175+ return __slow_ieee754_sqrt (b * two108) * twom54;
176
177 #define FMADD(a_, c_, b_) \
178 ({ double __r; \
179@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
180 }
181 return f_wash (b);
182 }
183+
184+#undef __ieee754_sqrt
185+double
186+__ieee754_sqrt (double x)
187+{
188+ return __slow_ieee754_sqrt (x);
189+}
190+
191 strong_alias (__ieee754_sqrt, __sqrt_finite)
192diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
193index 9d175122a8..10de1f0cc3 100644
194--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
195+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
196@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
197
198 #ifdef __STDC__
199 float
200-__ieee754_sqrtf (float b)
201+__slow_ieee754_sqrtf (float b)
202 #else
203 float
204-__ieee754_sqrtf (b)
205+__slow_ieee754_sqrtf (b)
206 float b;
207 #endif
208 {
209@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
210 }
211 return f_washf (b);
212 }
213+
214+#undef __ieee754_sqrtf
215+float
216+__ieee754_sqrtf (float x)
217+{
218+ return __slow_ieee754_sqrtf (x);
219+}
220+
221 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
222diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
223index fc4a74990e..1c34244bd8 100644
224--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
225+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
226@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
227 }
228 return f_wash (b);
229 }
230+
231+#undef __ieee754_sqrt
232+double
233+__ieee754_sqrt (double x)
234+{
235+ return __slow_ieee754_sqrt (x);
236+}
237+
238 strong_alias (__ieee754_sqrt, __sqrt_finite)
239diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
240index 9d175122a8..812653558f 100644
241--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
242+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
243@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
244 }
245 return f_washf (b);
246 }
247+
248+#undef __ieee754_sqrtf
249+float
250+__ieee754_sqrtf (float x)
251+{
252+ return __slow_ieee754_sqrtf (x);
253+}
254+
255 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
256diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
257index 1795fd6c3e..13a81973e3 100644
258--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
259+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
260@@ -40,7 +40,7 @@ static const float half = 0.5;
261 simultaneously. */
262
263 double
264-__ieee754_sqrt (double b)
265+__slow_ieee754_sqrt (double b)
266 {
267 if (__builtin_expect (b > 0, 1))
268 {
269@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
270
271 /* Handle small numbers by scaling. */
272 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
273- return __ieee754_sqrt (b * two108) * twom54;
274+ return __slow_ieee754_sqrt (b * two108) * twom54;
275
276 #define FMADD(a_, c_, b_) \
277 ({ double __r; \
278@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
279 }
280 return f_wash (b);
281 }
282+
283+#undef __ieee754_sqrt
284+double
285+__ieee754_sqrt (double x)
286+{
287+ return __slow_ieee754_sqrt (x);
288+}
289+
290 strong_alias (__ieee754_sqrt, __sqrt_finite)
291diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
292index a917f313ab..fae2d81210 100644
293--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
294+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
295@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
296 square root. */
297
298 float
299-__ieee754_sqrtf (float b)
300+__slow_ieee754_sqrtf (float b)
301 {
302 if (__builtin_expect (b > 0, 1))
303 {
304@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
305 }
306 return f_washf (b);
307 }
308+#undef __ieee754_sqrtf
309+float
310+__ieee754_sqrtf (float x)
311+{
312+ return __slow_ieee754_sqrtf (x);
313+}
314+
315 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
316diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
317index fc4a74990e..7038a70b47 100644
318--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
319+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
320@@ -41,10 +41,10 @@ static const float half = 0.5;
321
322 #ifdef __STDC__
323 double
324-__ieee754_sqrt (double b)
325+__slow_ieee754_sqrt (double b)
326 #else
327 double
328-__ieee754_sqrt (b)
329+__slow_ieee754_sqrt (b)
330 double b;
331 #endif
332 {
333@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
334
335 /* Handle small numbers by scaling. */
336 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
337- return __ieee754_sqrt (b * two108) * twom54;
338+ return __slow_ieee754_sqrt (b * two108) * twom54;
339
340 #define FMADD(a_, c_, b_) \
341 ({ double __r; \
342@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
343 }
344 return f_wash (b);
345 }
346+
347+#undef __ieee754_sqrt
348+double
349+__ieee754_sqrt (double x)
350+{
351+ return __slow_ieee754_sqrt (x);
352+}
353+
354 strong_alias (__ieee754_sqrt, __sqrt_finite)
355diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
356index 9d175122a8..10de1f0cc3 100644
357--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
358+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
359@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
360
361 #ifdef __STDC__
362 float
363-__ieee754_sqrtf (float b)
364+__slow_ieee754_sqrtf (float b)
365 #else
366 float
367-__ieee754_sqrtf (b)
368+__slow_ieee754_sqrtf (b)
369 float b;
370 #endif
371 {
372@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
373 }
374 return f_washf (b);
375 }
376+
377+#undef __ieee754_sqrtf
378+float
379+__ieee754_sqrtf (float x)
380+{
381+ return __slow_ieee754_sqrtf (x);
382+}
383+
384 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch
index 826e5af465..b1bed71f2b 100644
--- a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
+++ b/meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch
@@ -1,4 +1,4 @@
1From 060ba13b5ac5e90517d540f009ebdcdcf62f9685 Mon Sep 17 00:00:00 2001 1From 7d158af5750b351b3b08e78bb6c5fe80e7cb36ba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:42:58 +0000 3Date: Wed, 18 Mar 2015 00:42:58 +0000
4Subject: [PATCH] eglibc: Cross building and testing instructions 4Subject: [PATCH] eglibc: Cross building and testing instructions
diff --git a/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
deleted file mode 100644
index e4c78b5c79..0000000000
--- a/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 297bac9429260f8df495b81d3fae8ae4c6913f5f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:20:09 +0000
4Subject: [PATCH] Quote from bug 1443 which explains what the patch does :
5
6 We build some random program and link it with -lust. When we run it,
7 it dies with a SIGSEGV before reaching main().
8
9 Libust.so depends on liburcu-bp.so from the usermode-rcu package.
10 Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
11 is critical.
12
13 Libust.so uses a TLS / __thread variable that is defined in liburcu-
14 bp.so. There are special ARM-specific relocation types that allow two
15 shared libraries to share thread-specific data. This is critical too.
16
17 One more critical issue: although liburcu-bp.so is prelinked, we can't
18 load it at its prelinked address, because we also link against
19 librt.so, and librt.so uses that address.
20
21 The dynamic linker is forced to relink liburcu-bp.so at a different
22 address. In the course of relinking, it processes the special ARM
23 relocation record mentioned above. The prelinker has already filled
24 in the information, which is a short offset into a table of thread-
25 specific data that is allocated per-thread for each library that uses
26 TLS. Because the normal behavior of a relocation is to add the symbol
27 value to an addend stored at the address being relocated, we end up
28 adding the short offset to itself, doubling it.
29
30 Now we have an awkward situation. The libust.so library doesn't know
31 about the addend, so its TLS data for this element is correct. The
32 liburcu-bp.so library has a different offset for the element. When we
33 go to initialize the element for the first time in liburcu-bp.so, we
34 write the address of the result at the doubled (broken) offset.
35 Later, when we refer to the address from libust.so, we check the value
36 at the correct offset, but it's NULL, so we eat hot SIGSEGV.
37
38Upstream-Status: Pending
39
40Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
41Signed-off-by: Khem Raj <raj.khem@gmail.com>
42---
43 sysdeps/arm/dl-machine.h | 2 +-
44 1 file changed, 1 insertion(+), 1 deletion(-)
45
46diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
47index ff5e09e207..d68bfe5cbe 100644
48--- a/sysdeps/arm/dl-machine.h
49+++ b/sysdeps/arm/dl-machine.h
50@@ -510,7 +510,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
51
52 case R_ARM_TLS_DTPOFF32:
53 if (sym != NULL)
54- *reloc_addr += sym->st_value;
55+ *reloc_addr = sym->st_value;
56 break;
57
58 case R_ARM_TLS_TPOFF32:
diff --git a/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch
index afac2e04f6..13190125eb 100644
--- a/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
+++ b/meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -1,4 +1,4 @@
1From f13c2f525e9bc82ce13e4cf486f7fe0831fc3fac Mon Sep 17 00:00:00 2001 1From 435b57e8327555b273a52df672b2611050a8c579 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:49:28 +0000 3Date: Wed, 18 Mar 2015 00:49:28 +0000
4Subject: [PATCH] eglibc: Help bootstrap cross toolchain 4Subject: [PATCH] eglibc: Help bootstrap cross toolchain
@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
29 create mode 100644 include/stubs-bootstrap.h 29 create mode 100644 include/stubs-bootstrap.h
30 30
31diff --git a/Makefile b/Makefile 31diff --git a/Makefile b/Makefile
32index 50f99ca611..31eed15f02 100644 32index 97b4328af8..5c20ed3cff 100644
33--- a/Makefile 33--- a/Makefile
34+++ b/Makefile 34+++ b/Makefile
35@@ -79,9 +79,18 @@ subdir-dirs = include 35@@ -79,9 +79,18 @@ subdir-dirs = include
@@ -52,7 +52,7 @@ index 50f99ca611..31eed15f02 100644
52 ifeq (yes,$(build-shared)) 52 ifeq (yes,$(build-shared))
53 headers += gnu/lib-names.h 53 headers += gnu/lib-names.h
54 endif 54 endif
55@@ -416,6 +425,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh 55@@ -421,6 +430,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh
56 56
57 subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) 57 subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
58 58
@@ -69,7 +69,7 @@ index 50f99ca611..31eed15f02 100644
69 ifndef abi-variants 69 ifndef abi-variants
70 installed-stubs = $(inst_includedir)/gnu/stubs.h 70 installed-stubs = $(inst_includedir)/gnu/stubs.h
71 else 71 else
72@@ -442,6 +461,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) 72@@ -447,6 +466,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
73 73
74 install-others-nosubdir: $(installed-stubs) 74 install-others-nosubdir: $(installed-stubs)
75 endif 75 endif
diff --git a/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch b/meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch
index 9a610c6703..780aff1e7d 100644
--- a/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch
+++ b/meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -1,4 +1,4 @@
1From 330c4e50e28e29c31fb8d6ab39cdbb2af4d3def7 Mon Sep 17 00:00:00 2001 1From 46937c30c52cf186609bee1ec927464d395afb30 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:55:53 +0000 3Date: Wed, 18 Mar 2015 00:55:53 +0000
4Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4 4Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 2 files changed, 12 insertions(+) 21 2 files changed, 12 insertions(+)
22 22
23diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions 23diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
24index e0938c4165..ca1d7da339 100644 24index 3ad702e165..931985b5d6 100644
25--- a/sysdeps/unix/sysv/linux/sh/Versions 25--- a/sysdeps/unix/sysv/linux/sh/Versions
26+++ b/sysdeps/unix/sysv/linux/sh/Versions 26+++ b/sysdeps/unix/sysv/linux/sh/Versions
27@@ -2,6 +2,7 @@ libc { 27@@ -3,6 +3,7 @@ libc {
28 GLIBC_2.2 { 28 GLIBC_2.2 {
29 # functions used in other libraries 29 # functions used in other libraries
30 __xstat64; __fxstat64; __lxstat64; 30 __xstat64; __fxstat64; __lxstat64;
@@ -33,7 +33,7 @@ index e0938c4165..ca1d7da339 100644
33 # a* 33 # a*
34 alphasort64; 34 alphasort64;
35diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S 35diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
36index a18fbb2e8b..59421bfbb0 100644 36index db898e9e39..6e2972e814 100644
37--- a/sysdeps/unix/sysv/linux/sh/sysdep.S 37--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
38+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S 38+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
39@@ -30,3 +30,14 @@ ENTRY (__syscall_error) 39@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
diff --git a/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
deleted file mode 100644
index c5e8e6473a..0000000000
--- a/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From f389babf3c920e68b7d7391556a78ebf62a21ebe Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Wed, 19 Dec 2012 04:39:57 -0600
4Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S}
5
6libm-err-tab.pl will parse all the files named "libm-test-ulps"
7in the given dir recursively. To avoid parsing the one in
8${S}/.pc/ (it does exist after eglibc adds aarch64 support,
9${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
10aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
11in ${S}.
12
13Upstream-Status: inappropriate [OE specific]
14
15Signed-off-by: Ting Liu <b28495@freescale.com>
16---
17 manual/Makefile | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/manual/Makefile b/manual/Makefile
21index e83444341e..aa2645bc55 100644
22--- a/manual/Makefile
23+++ b/manual/Makefile
24@@ -103,7 +103,8 @@ $(objpfx)stamp-libm-err: $(..)math/gen-libm-test.py \
25 $(wildcard $(foreach dir,$(sysdirs),\
26 $(dir)/libm-test-ulps))
27 pwd=`pwd`; \
28- $(PYTHON) $< -s $$pwd/.. -m $(objpfx)libm-err-tmp
29+ $(PYTHON) $< -s $$pwd/../ports -m $(objpfx)libm-err-tmp
30+ $(PYTHON) $< -s $$pwd/../sysdeps -m $(objpfx)libm-err-tmp
31 $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
32 touch $@
33
diff --git a/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
deleted file mode 100644
index 7f362cace0..0000000000
--- a/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 4b0d41a315e66f688fef7b0c2e2b6ce9fa16ec93 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:24:46 +0000
4Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
5 __slow versions
6
7Upstream-Status: Pending
8
9Signed-off-by: chunrong guo <B40290@freescale.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 6 +++---
13 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++--
14 2 files changed, 5 insertions(+), 5 deletions(-)
15
16diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
17index 1c34244bd8..7038a70b47 100644
18--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
19+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
20@@ -41,10 +41,10 @@ static const float half = 0.5;
21
22 #ifdef __STDC__
23 double
24-__ieee754_sqrt (double b)
25+__slow_ieee754_sqrt (double b)
26 #else
27 double
28-__ieee754_sqrt (b)
29+__slow_ieee754_sqrt (b)
30 double b;
31 #endif
32 {
33@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
34
35 /* Handle small numbers by scaling. */
36 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
37- return __ieee754_sqrt (b * two108) * twom54;
38+ return __slow_ieee754_sqrt (b * two108) * twom54;
39
40 #define FMADD(a_, c_, b_) \
41 ({ double __r; \
42diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
43index 812653558f..10de1f0cc3 100644
44--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
45+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
46@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
47
48 #ifdef __STDC__
49 float
50-__ieee754_sqrtf (float b)
51+__slow_ieee754_sqrtf (float b)
52 #else
53 float
54-__ieee754_sqrtf (b)
55+__slow_ieee754_sqrtf (b)
56 float b;
57 #endif
58 {
diff --git a/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch b/meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch
index 0b2f020fdd..8f9bbb6cf3 100644
--- a/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch
+++ b/meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -1,4 +1,4 @@
1From 557ed640b26bd208ce8d4a6fd725b124893668d7 Mon Sep 17 00:00:00 2001 1From 68dcae2527a64a4448334fdfe27c7b6014589aae Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:33:49 +0000 3Date: Wed, 18 Mar 2015 01:33:49 +0000
4Subject: [PATCH] eglibc: Forward port cross locale generation support 4Subject: [PATCH] eglibc: Forward port cross locale generation support
@@ -7,7 +7,7 @@ Upstream-Status: Pending
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
10 locale/Makefile | 3 +- 10 locale/Makefile | 1 +
11 locale/catnames.c | 46 +++++++++++++++++++++++++++ 11 locale/catnames.c | 46 +++++++++++++++++++++++++++
12 locale/localeinfo.h | 2 +- 12 locale/localeinfo.h | 2 +-
13 locale/programs/charmap-dir.c | 6 ++++ 13 locale/programs/charmap-dir.c | 6 ++++
@@ -19,23 +19,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 locale/programs/locfile.c | 5 ++- 19 locale/programs/locfile.c | 5 ++-
20 locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++-- 20 locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++--
21 locale/setlocale.c | 29 ----------------- 21 locale/setlocale.c | 29 -----------------
22 12 files changed, 167 insertions(+), 68 deletions(-) 22 12 files changed, 166 insertions(+), 67 deletions(-)
23 create mode 100644 locale/catnames.c 23 create mode 100644 locale/catnames.c
24 24
25diff --git a/locale/Makefile b/locale/Makefile 25diff --git a/locale/Makefile b/locale/Makefile
26index b7c60681fa..07c606cde3 100644 26index 9d9c1a7691..bf271fd0a8 100644
27--- a/locale/Makefile 27--- a/locale/Makefile
28+++ b/locale/Makefile 28+++ b/locale/Makefile
29@@ -26,7 +26,8 @@ headers = langinfo.h locale.h bits/locale.h \ 29@@ -30,6 +30,7 @@ headers = \
30 bits/types/locale_t.h bits/types/__locale_t.h 30 locale.h \
31 routines = setlocale findlocale loadlocale loadarchive \ 31 # headers
32 localeconv nl_langinfo nl_langinfo_l mb_cur_max \ 32 routines = \
33- newlocale duplocale freelocale uselocale 33+ catnames \
34+ newlocale duplocale freelocale uselocale \ 34 duplocale \
35+ catnames 35 findlocale \
36 tests = tst-C-locale tst-locname tst-duplocale 36 freelocale \
37 tests-container = tst-localedef-path-norm
38 categories = ctype messages monetary numeric time paper name \
39diff --git a/locale/catnames.c b/locale/catnames.c 37diff --git a/locale/catnames.c b/locale/catnames.c
40new file mode 100644 38new file mode 100644
41index 0000000000..538f3f5edb 39index 0000000000..538f3f5edb
@@ -89,10 +87,10 @@ index 0000000000..538f3f5edb
89+ [LC_ALL] = sizeof ("LC_ALL") - 1 87+ [LC_ALL] = sizeof ("LC_ALL") - 1
90+ }; 88+ };
91diff --git a/locale/localeinfo.h b/locale/localeinfo.h 89diff --git a/locale/localeinfo.h b/locale/localeinfo.h
92index 22f9dc1140..fa31b3c5ea 100644 90index 92aef8d58e..ae23b2f7fe 100644
93--- a/locale/localeinfo.h 91--- a/locale/localeinfo.h
94+++ b/locale/localeinfo.h 92+++ b/locale/localeinfo.h
95@@ -230,7 +230,7 @@ __libc_tsd_define (extern, locale_t, LOCALE) 93@@ -246,7 +246,7 @@ __libc_tsd_define (extern, locale_t, LOCALE)
96 unused. We can manage this playing some tricks with weak references. 94 unused. We can manage this playing some tricks with weak references.
97 But with thread-local locale settings, it becomes quite ungainly unless 95 But with thread-local locale settings, it becomes quite ungainly unless
98 we can use __thread variables. So only in that case do we attempt this. */ 96 we can use __thread variables. So only in that case do we attempt this. */
@@ -102,7 +100,7 @@ index 22f9dc1140..fa31b3c5ea 100644
102 # define NL_CURRENT_INDIRECT 1 100 # define NL_CURRENT_INDIRECT 1
103 #endif 101 #endif
104diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c 102diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
105index 4841bfd05d..ffcba1fd79 100644 103index e635a01ede..10e34a6da9 100644
106--- a/locale/programs/charmap-dir.c 104--- a/locale/programs/charmap-dir.c
107+++ b/locale/programs/charmap-dir.c 105+++ b/locale/programs/charmap-dir.c
108@@ -18,7 +18,9 @@ 106@@ -18,7 +18,9 @@
@@ -148,10 +146,10 @@ index 4841bfd05d..ffcba1fd79 100644
148 return NULL; 146 return NULL;
149 } 147 }
150diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c 148diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
151index 0af21e05e2..4980b0c52f 100644 149index 7de3ba064d..3256427d21 100644
152--- a/locale/programs/ld-collate.c 150--- a/locale/programs/ld-collate.c
153+++ b/locale/programs/ld-collate.c 151+++ b/locale/programs/ld-collate.c
154@@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen, 152@@ -352,7 +352,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
155 } 153 }
156 if (wcs != NULL) 154 if (wcs != NULL)
157 { 155 {
@@ -160,7 +158,7 @@ index 0af21e05e2..4980b0c52f 100644
160 uint32_t zero = 0; 158 uint32_t zero = 0;
161 /* Handle <U0000> as a single character. */ 159 /* Handle <U0000> as a single character. */
162 if (nwcs == 0) 160 if (nwcs == 0)
163@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); 161@@ -1776,8 +1776,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
164 162
165 if ((*eptr)->nwcs == runp->nwcs) 163 if ((*eptr)->nwcs == runp->nwcs)
166 { 164 {
@@ -170,7 +168,7 @@ index 0af21e05e2..4980b0c52f 100644
170 168
171 if (c == 0) 169 if (c == 0)
172 { 170 {
173@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) 171@@ -2004,9 +2003,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
174 one consecutive entry. */ 172 one consecutive entry. */
175 if (runp->wcnext != NULL 173 if (runp->wcnext != NULL
176 && runp->nwcs == runp->wcnext->nwcs 174 && runp->nwcs == runp->wcnext->nwcs
@@ -183,7 +181,7 @@ index 0af21e05e2..4980b0c52f 100644
183 && (runp->wcs[runp->nwcs - 1] 181 && (runp->wcs[runp->nwcs - 1]
184 == runp->wcnext->wcs[runp->nwcs - 1] + 1)) 182 == runp->wcnext->wcs[runp->nwcs - 1] + 1))
185 { 183 {
186@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) 184@@ -2030,9 +2029,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
187 runp = runp->wcnext; 185 runp = runp->wcnext;
188 while (runp->wcnext != NULL 186 while (runp->wcnext != NULL
189 && runp->nwcs == runp->wcnext->nwcs 187 && runp->nwcs == runp->wcnext->nwcs
@@ -197,10 +195,10 @@ index 0af21e05e2..4980b0c52f 100644
197 == runp->wcnext->wcs[runp->nwcs - 1] + 1)); 195 == runp->wcnext->wcs[runp->nwcs - 1] + 1));
198 196
199diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c 197diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
200index 2fb579bbbf..d0be99581c 100644 198index 15fd39c637..d4c5e0c9e7 100644
201--- a/locale/programs/ld-ctype.c 199--- a/locale/programs/ld-ctype.c
202+++ b/locale/programs/ld-ctype.c 200+++ b/locale/programs/ld-ctype.c
203@@ -915,7 +915,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap, 201@@ -914,7 +914,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
204 allocate_arrays (ctype, charmap, ctype->repertoire); 202 allocate_arrays (ctype, charmap, ctype->repertoire);
205 203
206 default_missing_len = (ctype->default_missing 204 default_missing_len = (ctype->default_missing
@@ -209,7 +207,7 @@ index 2fb579bbbf..d0be99581c 100644
209 : 0); 207 : 0);
210 208
211 init_locale_data (&file, nelems); 209 init_locale_data (&file, nelems);
212@@ -1927,7 +1927,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, 210@@ -1926,7 +1926,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
213 ignore = 1; 211 ignore = 1;
214 else 212 else
215 /* This value is usable. */ 213 /* This value is usable. */
@@ -218,7 +216,7 @@ index 2fb579bbbf..d0be99581c 100644
218 216
219 first = 0; 217 first = 0;
220 } 218 }
221@@ -2461,8 +2461,8 @@ with character code range values one must use the absolute ellipsis `...'")); 219@@ -2460,8 +2460,8 @@ with character code range values one must use the absolute ellipsis `...'"));
222 } 220 }
223 221
224 handle_tok_digit: 222 handle_tok_digit:
@@ -229,7 +227,7 @@ index 2fb579bbbf..d0be99581c 100644
229 handle_digits = 1; 227 handle_digits = 1;
230 goto read_charclass; 228 goto read_charclass;
231 229
232@@ -3904,8 +3904,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 230@@ -3876,8 +3876,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
233 231
234 while (idx < number) 232 while (idx < number)
235 { 233 {
@@ -239,7 +237,7 @@ index 2fb579bbbf..d0be99581c 100644
239 if (res == 0) 237 if (res == 0)
240 { 238 {
241 replace = 1; 239 replace = 1;
242@@ -3942,11 +3941,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 240@@ -3914,11 +3913,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
243 for (size_t cnt = 0; cnt < number; ++cnt) 241 for (size_t cnt = 0; cnt < number; ++cnt)
244 { 242 {
245 struct translit_to_t *srunp; 243 struct translit_to_t *srunp;
@@ -253,7 +251,7 @@ index 2fb579bbbf..d0be99581c 100644
253 srunp = srunp->next; 251 srunp = srunp->next;
254 } 252 }
255 /* Plus one for the extra NUL character marking the end of 253 /* Plus one for the extra NUL character marking the end of
256@@ -3970,18 +3969,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 254@@ -3942,18 +3941,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
257 ctype->translit_from_idx[cnt] = from_len; 255 ctype->translit_from_idx[cnt] = from_len;
258 ctype->translit_to_idx[cnt] = to_len; 256 ctype->translit_to_idx[cnt] = to_len;
259 257
@@ -279,10 +277,10 @@ index 2fb579bbbf..d0be99581c 100644
279 srunp = srunp->next; 277 srunp = srunp->next;
280 } 278 }
281diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c 279diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
282index dcd2a2386d..6814740325 100644 280index 9529d7945a..554454b9c1 100644
283--- a/locale/programs/ld-time.c 281--- a/locale/programs/ld-time.c
284+++ b/locale/programs/ld-time.c 282+++ b/locale/programs/ld-time.c
285@@ -220,8 +220,10 @@ No definition for %s category found"), "LC_TIME"); 283@@ -219,8 +219,10 @@ No definition for %s category found"), "LC_TIME");
286 } 284 }
287 else 285 else
288 { 286 {
@@ -294,7 +292,7 @@ index dcd2a2386d..6814740325 100644
294 } 292 }
295 } 293 }
296 294
297@@ -231,7 +233,7 @@ No definition for %s category found"), "LC_TIME"); 295@@ -230,7 +232,7 @@ No definition for %s category found"), "LC_TIME");
298 const int days_per_month[12] = { 31, 29, 31, 30, 31, 30, 296 const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
299 31, 31, 30, 31 ,30, 31 }; 297 31, 31, 30, 31 ,30, 31 };
300 size_t idx; 298 size_t idx;
@@ -303,7 +301,7 @@ index dcd2a2386d..6814740325 100644
303 301
304 time->era_entries = 302 time->era_entries =
305 (struct era_data *) xmalloc (time->num_era 303 (struct era_data *) xmalloc (time->num_era
306@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME"); 304@@ -456,18 +458,18 @@ No definition for %s category found"), "LC_TIME");
307 } 305 }
308 306
309 /* Now generate the wide character name and format. */ 307 /* Now generate the wide character name and format. */
@@ -329,7 +327,7 @@ index dcd2a2386d..6814740325 100644
329 } 327 }
330 else 328 else
331 time->era_entries[idx].wname = 329 time->era_entries[idx].wname =
332@@ -527,7 +529,16 @@ No definition for %s category found"), "LC_TIME"); 330@@ -526,7 +528,16 @@ No definition for %s category found"), "LC_TIME");
333 if (time->date_fmt == NULL) 331 if (time->date_fmt == NULL)
334 time->date_fmt = "%a %b %e %H:%M:%S %Z %Y"; 332 time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
335 if (time->wdate_fmt == NULL) 333 if (time->wdate_fmt == NULL)
@@ -348,23 +346,23 @@ index dcd2a2386d..6814740325 100644
348 346
349 347
350diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c 348diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
351index 96d3ab66db..3af379d2c3 100644 349index 6f40ecf77a..573d051d0a 100644
352--- a/locale/programs/linereader.c 350--- a/locale/programs/linereader.c
353+++ b/locale/programs/linereader.c 351+++ b/locale/programs/linereader.c
354@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap, 352@@ -776,7 +776,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
355 { 353 {
356 int return_widestr = lr->return_widestr; 354 int return_widestr = lr->return_widestr;
357 char *buf; 355 struct lr_buffer lrb;
358- wchar_t *buf2 = NULL; 356- wchar_t *buf2 = NULL;
359+ uint32_t *buf2 = NULL; 357+ uint32_t *buf2 = NULL;
360 size_t bufact; 358
361 size_t bufmax = 56; 359 lr_buffer_init (&lrb);
362 360
363diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c 361diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
364index 832c8fd1fc..fe689b3ae1 100644 362index 7b66cd279c..dd0c3f1562 100644
365--- a/locale/programs/localedef.c 363--- a/locale/programs/localedef.c
366+++ b/locale/programs/localedef.c 364+++ b/locale/programs/localedef.c
367@@ -109,6 +109,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; 365@@ -108,6 +108,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
368 #define OPT_NO_WARN 402 366 #define OPT_NO_WARN 402
369 #define OPT_WARN 403 367 #define OPT_WARN 403
370 #define OPT_NO_HARD_LINKS 404 368 #define OPT_NO_HARD_LINKS 404
@@ -372,7 +370,7 @@ index 832c8fd1fc..fe689b3ae1 100644
372 370
373 /* Definitions of arguments for argp functions. */ 371 /* Definitions of arguments for argp functions. */
374 static const struct argp_option options[] = 372 static const struct argp_option options[] =
375@@ -153,6 +154,8 @@ static const struct argp_option options[] = 373@@ -152,6 +153,8 @@ static const struct argp_option options[] =
376 N_("Generate little-endian output") }, 374 N_("Generate little-endian output") },
377 { "big-endian", OPT_BIG_ENDIAN, NULL, 0, 375 { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
378 N_("Generate big-endian output") }, 376 N_("Generate big-endian output") },
@@ -381,7 +379,7 @@ index 832c8fd1fc..fe689b3ae1 100644
381 { NULL, 0, NULL, 0, NULL } 379 { NULL, 0, NULL, 0, NULL }
382 }; 380 };
383 381
384@@ -243,12 +246,14 @@ main (int argc, char *argv[]) 382@@ -242,12 +245,14 @@ main (int argc, char *argv[])
385 ctype locale. (P1003.2 4.35.5.2) */ 383 ctype locale. (P1003.2 4.35.5.2) */
386 setlocale (LC_CTYPE, "POSIX"); 384 setlocale (LC_CTYPE, "POSIX");
387 385
@@ -396,7 +394,7 @@ index 832c8fd1fc..fe689b3ae1 100644
396 394
397 /* Process charmap file. */ 395 /* Process charmap file. */
398 charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1); 396 charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
399@@ -400,6 +405,9 @@ parse_opt (int key, char *arg, struct argp_state *state) 397@@ -399,6 +404,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
400 /* Do not hard link to other locales. */ 398 /* Do not hard link to other locales. */
401 hard_links = false; 399 hard_links = false;
402 break; 400 break;
@@ -407,10 +405,10 @@ index 832c8fd1fc..fe689b3ae1 100644
407 force_output = 1; 405 force_output = 1;
408 break; 406 break;
409diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c 407diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
410index 0f1affa1d4..7d86fae801 100644 408index b54fcbbceb..6110c7b369 100644
411--- a/locale/programs/locfile.c 409--- a/locale/programs/locfile.c
412+++ b/locale/programs/locfile.c 410+++ b/locale/programs/locfile.c
413@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size, 411@@ -543,6 +543,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
414 machine running localedef. */ 412 machine running localedef. */
415 bool swap_endianness_p; 413 bool swap_endianness_p;
416 414
@@ -420,7 +418,7 @@ index 0f1affa1d4..7d86fae801 100644
420 /* When called outside a start_locale_structure/end_locale_structure 418 /* When called outside a start_locale_structure/end_locale_structure
421 or start_locale_prelude/end_locale_prelude block, record that the 419 or start_locale_prelude/end_locale_prelude block, record that the
422 next byte in FILE's obstack will be the first byte of a new element. 420 next byte in FILE's obstack will be the first byte of a new element.
423@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string) 421@@ -620,7 +623,7 @@ add_locale_string (struct locale_file *file, const char *string)
424 void 422 void
425 add_locale_wstring (struct locale_file *file, const uint32_t *string) 423 add_locale_wstring (struct locale_file *file, const uint32_t *string)
426 { 424 {
@@ -430,10 +428,10 @@ index 0f1affa1d4..7d86fae801 100644
430 428
431 /* Record that FILE's next element is the 32-bit integer VALUE. */ 429 /* Record that FILE's next element is the 32-bit integer VALUE. */
432diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h 430diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
433index c986d599ec..222a779176 100644 431index 9103fade14..ecd878563d 100644
434--- a/locale/programs/locfile.h 432--- a/locale/programs/locfile.h
435+++ b/locale/programs/locfile.h 433+++ b/locale/programs/locfile.h
436@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions, 434@@ -70,6 +70,8 @@ extern void write_all_categories (struct localedef_t *definitions,
437 435
438 extern bool swap_endianness_p; 436 extern bool swap_endianness_p;
439 437
@@ -442,7 +440,7 @@ index c986d599ec..222a779176 100644
442 /* Change the output to be big-endian if BIG_ENDIAN is true and 440 /* Change the output to be big-endian if BIG_ENDIAN is true and
443 little-endian otherwise. */ 441 little-endian otherwise. */
444 static inline void 442 static inline void
445@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value) 443@@ -88,7 +90,8 @@ maybe_swap_uint32 (uint32_t value)
446 } 444 }
447 445
448 /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */ 446 /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
@@ -452,7 +450,7 @@ index c986d599ec..222a779176 100644
452 maybe_swap_uint32_array (uint32_t *array, size_t n) 450 maybe_swap_uint32_array (uint32_t *array, size_t n)
453 { 451 {
454 if (swap_endianness_p) 452 if (swap_endianness_p)
455@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n) 453@@ -98,7 +101,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
456 454
457 /* Like maybe_swap_uint32_array, but the array of N elements is at 455 /* Like maybe_swap_uint32_array, but the array of N elements is at
458 the end of OBSTACK's current object. */ 456 the end of OBSTACK's current object. */
@@ -462,7 +460,7 @@ index c986d599ec..222a779176 100644
462 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n) 460 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
463 { 461 {
464 maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n); 462 maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
465@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale, 463@@ -275,4 +279,55 @@ extern void identification_output (struct localedef_t *locale,
466 const struct charmap_t *charmap, 464 const struct charmap_t *charmap,
467 const char *output_path); 465 const char *output_path);
468 466
@@ -519,7 +517,7 @@ index c986d599ec..222a779176 100644
519+ 517+
520 #endif /* locfile.h */ 518 #endif /* locfile.h */
521diff --git a/locale/setlocale.c b/locale/setlocale.c 519diff --git a/locale/setlocale.c b/locale/setlocale.c
522index 19ed85ae8e..f28ca11446 100644 520index c04740ca19..12deadeb24 100644
523--- a/locale/setlocale.c 521--- a/locale/setlocale.c
524+++ b/locale/setlocale.c 522+++ b/locale/setlocale.c
525@@ -63,35 +63,6 @@ static char *const _nl_current_used[] = 523@@ -63,35 +63,6 @@ static char *const _nl_current_used[] =
diff --git a/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
index a5a7a0cad7..9448f360ef 100644
--- a/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
+++ b/meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
@@ -1,4 +1,4 @@
1From 2ec233ce078b74030de9195096058cd502fdc395 Mon Sep 17 00:00:00 2001 1From 194e83794369783287956fb12c7f8469e6b7d110 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:42:06 -0700 3Date: Fri, 3 Aug 2018 09:42:06 -0700
4Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path 4Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 25 insertions(+), 10 deletions(-) 18 1 file changed, 25 insertions(+), 10 deletions(-)
19 19
20diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c 20diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
21index 6bb189ae37..0711c5c44e 100644 21index 2c19f4fd29..b8495848c3 100644
22--- a/locale/programs/locarchive.c 22--- a/locale/programs/locarchive.c
23+++ b/locale/programs/locarchive.c 23+++ b/locale/programs/locarchive.c
24@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) 24@@ -339,12 +339,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
25 struct namehashent *oldnamehashtab; 25 struct namehashent *oldnamehashtab;
26 struct locarhandle new_ah; 26 struct locarhandle new_ah;
27 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; 27 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
@@ -51,7 +51,7 @@ index 6bb189ae37..0711c5c44e 100644
51 strcpy (stpcpy (fname, archivefname), ".XXXXXX"); 51 strcpy (stpcpy (fname, archivefname), ".XXXXXX");
52 52
53 /* Not all of the old file has to be mapped. Change this now this 53 /* Not all of the old file has to be mapped. Change this now this
54@@ -569,10 +581,13 @@ open_archive (struct locarhandle *ah, bool readonly) 54@@ -568,10 +580,13 @@ open_archive (struct locarhandle *ah, bool readonly)
55 /* If ah has a non-NULL fname open that otherwise open the default. */ 55 /* If ah has a non-NULL fname open that otherwise open the default. */
56 if (archivefname == NULL) 56 if (archivefname == NULL)
57 { 57 {
@@ -69,7 +69,7 @@ index 6bb189ae37..0711c5c44e 100644
69 } 69 }
70 70
71 while (1) 71 while (1)
72@@ -585,7 +600,7 @@ open_archive (struct locarhandle *ah, bool readonly) 72@@ -584,7 +599,7 @@ open_archive (struct locarhandle *ah, bool readonly)
73 the default locale archive we ignore the failure and 73 the default locale archive we ignore the failure and
74 list an empty archive, otherwise we print an error 74 list an empty archive, otherwise we print an error
75 and exit. */ 75 and exit. */
diff --git a/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch b/meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch
index 5ef1ac2ed7..0e00c04659 100644
--- a/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch
+++ b/meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch
@@ -1,4 +1,4 @@
1From 5cc14938f05ae1354c8062f017a21f39d5fc9729 Mon Sep 17 00:00:00 2001 1From 7d7f6fcd4f4b6664bff75addc92bc7b8a86dc22d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Aug 2020 14:31:16 -0700 3Date: Fri, 7 Aug 2020 14:31:16 -0700
4Subject: [PATCH] powerpc: Do not ask compiler for finding arch 4Subject: [PATCH] powerpc: Do not ask compiler for finding arch
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 2 files changed, 2 insertions(+), 8 deletions(-) 15 2 files changed, 2 insertions(+), 8 deletions(-)
16 16
17diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure 17diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
18index dfe8e20399..bbff040f0f 100644 18index 48b9c9b65a..7eb260fc78 100644
19--- a/sysdeps/powerpc/preconfigure 19--- a/sysdeps/powerpc/preconfigure
20+++ b/sysdeps/powerpc/preconfigure 20+++ b/sysdeps/powerpc/preconfigure
21@@ -29,10 +29,7 @@ esac 21@@ -29,10 +29,7 @@ esac
@@ -31,7 +31,7 @@ index dfe8e20399..bbff040f0f 100644
31 # directory exists in sysdeps/powerpc. Likewise, if we find a 31 # directory exists in sysdeps/powerpc. Likewise, if we find a
32 # cpu, don't let the generic configure append extra compiler options. 32 # cpu, don't let the generic configure append extra compiler options.
33diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac 33diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac
34index 6c63bd8257..3e925f1d48 100644 34index 14b6dafd4a..1acc6a457c 100644
35--- a/sysdeps/powerpc/preconfigure.ac 35--- a/sysdeps/powerpc/preconfigure.ac
36+++ b/sysdeps/powerpc/preconfigure.ac 36+++ b/sysdeps/powerpc/preconfigure.ac
37@@ -29,10 +29,7 @@ esac 37@@ -29,10 +29,7 @@ esac
diff --git a/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
deleted file mode 100644
index 79bd704153..0000000000
--- a/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 3feb4213628f1485000ffe1d3fd26e37a7b14336 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:33:03 +0000
4Subject: [PATCH] timezone: re-written tzselect as posix sh
5
6To avoid the bash dependency.
7
8Upstream-Status: Pending
9
10Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 timezone/Makefile | 2 +-
14 timezone/tzselect.ksh | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/timezone/Makefile b/timezone/Makefile
18index 395abfeebd..2d939edf75 100644
19--- a/timezone/Makefile
20+++ b/timezone/Makefile
21@@ -123,7 +123,7 @@ $(testdata)/XT%: testdata/XT%
22 cp $< $@
23
24 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
25- sed -e 's|/bin/bash|$(BASH)|' \
26+ sed -e 's|/bin/bash|/bin/sh|' \
27 -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
28 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
29 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
30diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
31index 18fce27e24..70745f9d36 100755
32--- a/timezone/tzselect.ksh
33+++ b/timezone/tzselect.ksh
34@@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org
35
36 # Specify default values for environment variables if they are unset.
37 : ${AWK=awk}
38-: ${TZDIR=`pwd`}
39+: ${TZDIR=$(pwd)}
40
41 # Output one argument as-is to standard output.
42 # Safer than 'echo', which can mishandle '\' or leading '-'.
diff --git a/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
new file mode 100644
index 0000000000..f40a8eff07
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
@@ -0,0 +1,79 @@
1From 2bd0ea2c8f9595414741ed523c6ca07630a4fc96 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2020 17:05:45 -0700
4Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
5
6This helps OE multilibs to not sythesize this header which causes all
7kind of recursions and other issues since wordsize is fundamental header
8and ends up including itself in many case e.g. clang tidy, bpf etc.
9
10Upstream-Status: Inappropriate [ OE-Specific ]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/aarch64/bits/wordsize.h | 11 +++++++++--
15 sysdeps/arm/bits/wordsize.h | 22 +---------------------
16 2 files changed, 10 insertions(+), 23 deletions(-)
17 mode change 100644 => 120000 sysdeps/arm/bits/wordsize.h
18
19diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
20index f56260c2de..391d79d5a8 100644
21--- a/sysdeps/aarch64/bits/wordsize.h
22+++ b/sysdeps/aarch64/bits/wordsize.h
23@@ -17,12 +17,19 @@
24 License along with the GNU C Library; if not, see
25 <https://www.gnu.org/licenses/>. */
26
27-#ifdef __LP64__
28+#if defined (__aarch64__) && defined (__LP64__)
29 # define __WORDSIZE 64
30-#else
31+#elif defined (__aarch64__)
32 # define __WORDSIZE 32
33 # define __WORDSIZE32_SIZE_ULONG 1
34 # define __WORDSIZE32_PTRDIFF_LONG 1
35+#else
36+# define __WORDSIZE 32
37+# define __WORDSIZE_TIME64_COMPAT32 1
38+# define __WORDSIZE32_SIZE_ULONG 0
39+# define __WORDSIZE32_PTRDIFF_LONG 0
40 #endif
41
42+#ifdef __aarch64__
43 #define __WORDSIZE_TIME64_COMPAT32 0
44+#endif
45diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
46deleted file mode 100644
47index be457d84d3..0000000000
48--- a/sysdeps/arm/bits/wordsize.h
49+++ /dev/null
50@@ -1,21 +0,0 @@
51-/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
52- This file is part of the GNU C Library.
53-
54- The GNU C Library is free software; you can redistribute it and/or
55- modify it under the terms of the GNU Lesser General Public
56- License as published by the Free Software Foundation; either
57- version 2.1 of the License, or (at your option) any later version.
58-
59- The GNU C Library is distributed in the hope that it will be useful,
60- but WITHOUT ANY WARRANTY; without even the implied warranty of
61- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
62- Lesser General Public License for more details.
63-
64- You should have received a copy of the GNU Lesser General Public
65- License along with the GNU C Library; if not, see
66- <https://www.gnu.org/licenses/>. */
67-
68-#define __WORDSIZE 32
69-#define __WORDSIZE_TIME64_COMPAT32 1
70-#define __WORDSIZE32_SIZE_ULONG 0
71-#define __WORDSIZE32_PTRDIFF_LONG 0
72diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
73new file mode 120000
74index 0000000000..4c4a788ec2
75--- /dev/null
76+++ b/sysdeps/arm/bits/wordsize.h
77@@ -0,0 +1 @@
78+../../aarch64/bits/wordsize.h
79\ No newline at end of file
diff --git a/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch
index c32d70b593..2af39799be 100644
--- a/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
+++ b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch
@@ -1,21 +1,22 @@
1From f6119b98a9caa80642d69a97edc98f57ecef5c3c Mon Sep 17 00:00:00 2001 1From 7ef9358bbb184026914fb4d9ff479361b82bf6c9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 14:33:02 -0800 3Date: Thu, 31 Dec 2015 14:33:02 -0800
4Subject: [PATCH] Remove bash dependency for nscd init script 4Subject: [PATCH] Replace echo with printf builtin in nscd init script
5 5
6The nscd init script uses #! /bin/bash but only really uses one bashism 6The nscd init script calls for #! /bin/bash interpreter
7(translated strings), so remove them and switch the shell to #!/bin/sh. 7since it uses bash specific extentions namely (translated strings)
8and echo -n command, replace echo with printf and
9switch the shell interpreter to #!/bin/sh.
8 10
9Upstream-Status: Pending 11Upstream-Status: Pending
10 12Signed-off-by: Ross Burton <ross.burton@arm.com>
11Signed-off-by: Ross Burton <ross.burton@intel.com>
12Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
13--- 14---
14 nscd/nscd.init | 14 +++++++------- 15 nscd/nscd.init | 20 ++++++++++----------
15 1 file changed, 7 insertions(+), 7 deletions(-) 16 1 file changed, 10 insertions(+), 10 deletions(-)
16 17
17diff --git a/nscd/nscd.init b/nscd/nscd.init 18diff --git a/nscd/nscd.init b/nscd/nscd.init
18index a882da7d8b..b02986ec15 100644 19index a882da7d8b..857b541381 100644
19--- a/nscd/nscd.init 20--- a/nscd/nscd.init
20+++ b/nscd/nscd.init 21+++ b/nscd/nscd.init
21@@ -1,4 +1,4 @@ 22@@ -1,4 +1,4 @@
@@ -24,25 +25,27 @@ index a882da7d8b..b02986ec15 100644
24 # 25 #
25 # nscd: Starts the Name Switch Cache Daemon 26 # nscd: Starts the Name Switch Cache Daemon
26 # 27 #
27@@ -49,7 +49,7 @@ prog=nscd 28@@ -49,16 +49,16 @@ prog=nscd
28 start () { 29 start () {
29 [ -d /var/run/nscd ] || mkdir /var/run/nscd 30 [ -d /var/run/nscd ] || mkdir /var/run/nscd
30 [ -d /var/db/nscd ] || mkdir /var/db/nscd 31 [ -d /var/db/nscd ] || mkdir /var/db/nscd
31- echo -n $"Starting $prog: " 32- echo -n $"Starting $prog: "
32+ echo -n "Starting $prog: " 33+ printf "Starting $prog: "
33 daemon /usr/sbin/nscd 34 daemon /usr/sbin/nscd
34 RETVAL=$? 35 RETVAL=$?
35 echo 36- echo
36@@ -58,7 +58,7 @@ start () { 37+ printf "\n"
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
39 return $RETVAL
37 } 40 }
38 41
39 stop () { 42 stop () {
40- echo -n $"Stopping $prog: " 43- echo -n $"Stopping $prog: "
41+ echo -n "Stopping $prog: " 44+ printf "Stopping $prog: "
42 /usr/sbin/nscd -K 45 /usr/sbin/nscd -K
43 RETVAL=$? 46 RETVAL=$?
44 if [ $RETVAL -eq 0 ]; then 47 if [ $RETVAL -eq 0 ]; then
45@@ -67,9 +67,9 @@ stop () { 48@@ -67,11 +67,11 @@ stop () {
46 # a non-privileged user 49 # a non-privileged user
47 rm -f /var/run/nscd/nscd.pid 50 rm -f /var/run/nscd/nscd.pid
48 rm -f /var/run/nscd/socket 51 rm -f /var/run/nscd/socket
@@ -52,21 +55,25 @@ index a882da7d8b..b02986ec15 100644
52- failure $"$prog shutdown" 55- failure $"$prog shutdown"
53+ failure "$prog shutdown" 56+ failure "$prog shutdown"
54 fi 57 fi
55 echo 58- echo
59+ printf "\n"
56 return $RETVAL 60 return $RETVAL
61 }
62
57@@ -103,13 +103,13 @@ case "$1" in 63@@ -103,13 +103,13 @@ case "$1" in
58 RETVAL=$? 64 RETVAL=$?
59 ;; 65 ;;
60 force-reload | reload) 66 force-reload | reload)
61- echo -n $"Reloading $prog: " 67- echo -n $"Reloading $prog: "
62+ echo -n "Reloading $prog: " 68+ printf "Reloading $prog: "
63 killproc /usr/sbin/nscd -HUP 69 killproc /usr/sbin/nscd -HUP
64 RETVAL=$? 70 RETVAL=$?
65 echo 71- echo
72+ printf "\n"
66 ;; 73 ;;
67 *) 74 *)
68- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" 75- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
69+ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" 76+ printf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n"
70 RETVAL=1 77 RETVAL=1
71 ;; 78 ;;
72 esac 79 esac
diff --git a/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch
index 4da0e003c0..ca30edd91c 100644
--- a/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
+++ b/meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch
@@ -1,11 +1,12 @@
1From c062a462fee53a30a85d693c8288b5bd8fe4ec6e Mon Sep 17 00:00:00 2001 1From c43c1758baddaff1fb82afc118f7dba23af12540 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:27:10 +0000 3Date: Wed, 18 Mar 2015 00:27:10 +0000
4Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly 4Subject: [PATCH] sysdeps/gnu/configure.ac: Set libc_cv_rootsbindir only if its
5 $libc_cv_rootsbindir 5 empty
6 6
7Upstream-Status:Pending 7This ensures that it can be set in build environment
8 8
9Upstream-Status: Pending
9Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> 10Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 12---
@@ -14,19 +15,20 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 2 files changed, 2 insertions(+), 2 deletions(-) 15 2 files changed, 2 insertions(+), 2 deletions(-)
15 16
16diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure 17diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
17index c15d1087e8..37cc983f2a 100644 18index 18c9d7945a..ef22cc845d 100644
18--- a/sysdeps/gnu/configure 19--- a/sysdeps/gnu/configure
19+++ b/sysdeps/gnu/configure 20+++ b/sysdeps/gnu/configure
20@@ -32,6 +32,6 @@ case "$prefix" in 21@@ -32,7 +32,7 @@ case "$prefix" in
21 else 22 else
22 libc_cv_localstatedir=$localstatedir 23 libc_cv_localstatedir=$localstatedir
23 fi 24 fi
24- libc_cv_rootsbindir=/sbin 25- libc_cv_rootsbindir=/sbin
25+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin 26+ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin}
26 ;; 27 ;;
27 esac 28 esac
29
28diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac 30diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac
29index 634fe4de2a..3db1697f4f 100644 31index 634fe4de2a..492112e0fd 100644
30--- a/sysdeps/gnu/configure.ac 32--- a/sysdeps/gnu/configure.ac
31+++ b/sysdeps/gnu/configure.ac 33+++ b/sysdeps/gnu/configure.ac
32@@ -21,6 +21,6 @@ case "$prefix" in 34@@ -21,6 +21,6 @@ case "$prefix" in
@@ -34,6 +36,6 @@ index 634fe4de2a..3db1697f4f 100644
34 libc_cv_localstatedir=$localstatedir 36 libc_cv_localstatedir=$localstatedir
35 fi 37 fi
36- libc_cv_rootsbindir=/sbin 38- libc_cv_rootsbindir=/sbin
37+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin 39+ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin}
38 ;; 40 ;;
39 esac 41 esac
diff --git a/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch b/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch
new file mode 100644
index 0000000000..2e4c6ced9e
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch
@@ -0,0 +1,47 @@
1From a2179a1a5e0f6ded889d2c88cabb23c92b5a4b1e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 9 Dec 2021 15:14:42 -0800
4Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
5
6define new macro called KSHELL which can be used to define default shell
7use Bash by default
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 Makeconfig | 9 +++++++++
13 timezone/Makefile | 1 +
14 2 files changed, 10 insertions(+)
15
16diff --git a/Makeconfig b/Makeconfig
17index d0108d2caa..75887b1334 100644
18--- a/Makeconfig
19+++ b/Makeconfig
20@@ -309,6 +309,15 @@ ifndef sysincludedir
21 sysincludedir = /usr/include
22 endif
23
24+# The full path name of a Posix-compliant shell, preferably one that supports
25+# the Korn shell's 'select' statement as an extension.
26+# These days, Bash is the most popular.
27+# It should be OK to set this to /bin/sh, on platforms where /bin/sh
28+# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
29+# is typically nicer if it works.
30+ifndef KSHELL
31+KSHELL = /bin/bash
32+endif
33
34 # Commands to install files.
35 ifndef INSTALL_DATA
36diff --git a/timezone/Makefile b/timezone/Makefile
37index ebe5cf73a1..b5fa38f4d7 100644
38--- a/timezone/Makefile
39+++ b/timezone/Makefile
40@@ -143,6 +143,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
41 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
42 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
43 -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
44+ -e 's|#!/bin/bash|#!$(KSHELL)|g' \
45 < $< > $@.new
46 chmod 555 $@.new
47 mv -f $@.new $@
diff --git a/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch b/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch
new file mode 100644
index 0000000000..e68e37b125
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch
@@ -0,0 +1,27 @@
1From c86de3e8b739f20fd7211b66dc3c69b61d28d611 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 15 Dec 2021 21:47:53 -0800
4Subject: [PATCH] tzselect.ksh: Use /bin/sh default shell interpreter
5
6checkbashism reports no issues with tzselect.ksh, therefore using
7/bin/sh instead of /bin/bash should be safe and portable across systems
8which don't ship bash ( embedded systems )
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
13Cc: Paul Eggert <eggert@cs.ucla.edu>
14---
15 timezone/tzselect.ksh | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
19index ca3d82c6aa..1be42814fe 100755
20--- a/timezone/tzselect.ksh
21+++ b/timezone/tzselect.ksh
22@@ -1,4 +1,4 @@
23-#!/bin/bash
24+#!/bin/sh
25 # Ask the user about the time zone, and output the resulting TZ value to stdout.
26 # Interact with the user via stderr and stdin.
27
diff --git a/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch b/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch
new file mode 100644
index 0000000000..f1391a095c
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch
@@ -0,0 +1,86 @@
1From 06dd2eec0d57e1e2702069ee4c970c68fc4d3bcb Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Sun, 29 Aug 2021 20:49:16 +0800
4Subject: [PATCH] fix create thread failed in unprivileged process [BZ #28287]
5
6Since commit [d8ea0d0168 Add an internal wrapper for clone, clone2 and clone3]
7applied, start a unprivileged container (docker run without --privileged),
8it creates a thread failed in container.
9
10In commit d8ea0d0168, it calls __clone3 if HAVE_CLONE3_WAPPER is defined. If
11__clone3 returns -1 with ENOSYS, fall back to clone or clone2.
12
13As known from [1], cloneXXX fails with EPERM if CLONE_NEWCGROUP,
14CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, or CLONE_NEWUTS
15was specified by an unprivileged process (process without CAP_SYS_ADMIN)
16
17[1] https://man7.org/linux/man-pages/man2/clone3.2.html
18
19So if __clone3 returns -1 with EPERM, fall back to clone or clone2 could
20fix the issue. Here are the test steps:
21
221) Prepare test code
23cat > conftest.c <<ENDOF
24 #include <pthread.h>
25 #include <stdio.h>
26
27int check_me = 0;
28void* func(void* data) {check_me = 42; printf("start thread: check_me %d\n", check_me); return &check_me;}
29int main()
30{
31 pthread_t t;
32 void *ret;
33 pthread_create (&t, 0, func, 0);
34 pthread_join (t, &ret);
35 printf("check_me %d, p %p\n", check_me, &ret);
36 return (check_me != 42 || ret != &check_me);
37}
38
39ENDOF
40
412) Compile
42gcc -o conftest -pthread conftest.c
43
443) Start a container with glibc 2.34 installed
45[skip details]
46docker run -it <container-image-name> bash
47
484) Run conftest without this patch
49$ ./conftest
50check_me 0, p 0x7ffd91ccd400
51
525) Run conftest with this patch
53$ ./conftest
54start thread: check_me 42
55check_me 42, p 0x7ffe253c6f20
56
57Upstream-Status: Inappropriate [Rejected by upstream]
58
59Upstream glibc rejected it because the latest docker has resolved the issue [1],
60and upstream glibc does not backward compatibility with old docker[2]
61
62In order to build Yocto with uninative in old docker, we need this local
63patch
64
65[1] https://github.com/moby/moby/commit/9f6b562dd12ef7b1f9e2f8e6f2ab6477790a6594
66[2] https://sourceware.org/pipermail/libc-alpha/2021-August/130590.html
67
68Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
69Signed-off-by: Khem Raj <raj.khem@gmail.com>
70---
71 sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
72 1 file changed, 1 insertion(+), 1 deletion(-)
73
74diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
75index 9a1f27d017..9a48340055 100644
76--- a/sysdeps/unix/sysv/linux/clone-internal.c
77+++ b/sysdeps/unix/sysv/linux/clone-internal.c
78@@ -98,7 +98,7 @@ __clone_internal (struct clone_args *cl_args,
79 #ifdef HAVE_CLONE3_WRAPPER
80 int saved_errno = errno;
81 int ret = __clone3_internal (cl_args, func, arg);
82- if (ret != -1 || errno != ENOSYS)
83+ if (ret != -1 || (errno != ENOSYS && errno != EPERM))
84 return ret;
85
86 /* NB: Restore errno since errno may be checked against non-zero
diff --git a/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch b/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch
new file mode 100644
index 0000000000..a90814c63a
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch
@@ -0,0 +1,32 @@
1From cd66a5301c4d84e3dbc4e30fdb9e32b341e66b3d Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sun, 24 Jul 2022 07:07:29 -0700
4Subject: [PATCH] Avoid hardcoded build time paths in the output binaries
5
6replace the compile definitions with the output locations.
7
8Upstream-Status: Inappropriate [would need reworking somehow to be acceptable upstream]
9
10Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 support/Makefile | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/support/Makefile b/support/Makefile
17index 59a9974539..c3f7302bcb 100644
18--- a/support/Makefile
19+++ b/support/Makefile
20@@ -238,9 +238,9 @@ libsupport-inhibit-o += .o
21 endif
22
23 CFLAGS-support_paths.c = \
24- -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
25- -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
26- -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
27+ -DSRCDIR_PATH=\"$(oe_srcdir)\" \
28+ -DOBJDIR_PATH=\"$(libdir)/glibc-tests/ptest/tests/glibc-ptest\" \
29+ -DOBJDIR_ELF_LDSO_PATH=\"$(slibdir)/$(rtld-installed-name)\" \
30 -DINSTDIR_PATH=\"$(prefix)\" \
31 -DLIBDIR_PATH=\"$(libdir)\" \
32 -DBINDIR_PATH=\"$(bindir)\" \
diff --git a/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch b/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch
deleted file mode 100644
index 33d912d356..0000000000
--- a/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From c8df3cf4556d8d78a98675865395ce42f3b67109 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Apr 2016 21:11:00 -0700
4Subject: [PATCH] Define DUMMY_LOCALE_T if not defined
5
6This is a hack to fix building the locale bits on an older
7CentOs 5.X machine
8
9Upstream-Status: Inappropriate [other]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 locale/programs/config.h | 3 +++
14 1 file changed, 3 insertions(+)
15
16diff --git a/locale/programs/config.h b/locale/programs/config.h
17index 2edcf3696c..5350101e38 100644
18--- a/locale/programs/config.h
19+++ b/locale/programs/config.h
20@@ -19,6 +19,9 @@
21 #ifndef _LD_CONFIG_H
22 #define _LD_CONFIG_H 1
23
24+#ifndef DUMMY_LOCALE_T
25+#define DUMMY_LOCALE_T
26+#endif
27 /* Use the internal textdomain used for libc messages. */
28 #define PACKAGE _libc_intl_domainname
29 #ifndef VERSION
diff --git a/meta/recipes-core/glibc/glibc/0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch b/meta/recipes-core/glibc/glibc/0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch
new file mode 100644
index 0000000000..50d80ed577
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch
@@ -0,0 +1,54 @@
1From 5395ccff4478d42fab7f2bd6ba7f7188bec09ddf Mon Sep 17 00:00:00 2001
2From: Yash Shinde <Yash.Shinde@windriver.com>
3Date: Fri, 5 Apr 2024 08:24:36 -0700
4Subject: [PATCH] tests: Skip 2 qemu tests that can hang in oe-selftest
5
6qemumips and qemuppc were leaving stale processes behind after
7running glibc oe-selftest. During analysis, it was found that
8it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
9Disable them so that there are no stale processes left behind.
10
11[YOCTO #15423]
12https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
13
14Upstream-Status: Inappropriate [oe-core specific]
15
16Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 sysdeps/unix/sysv/linux/Makefile | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-)
21
22diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
23index 8a755293b3..22dafcaad1 100644
24--- a/sysdeps/unix/sysv/linux/Makefile
25+++ b/sysdeps/unix/sysv/linux/Makefile
26@@ -228,7 +228,6 @@ tests += \
27 tst-rlimit-infinity \
28 tst-sched-affinity-inheritance \
29 tst-sched_setattr \
30- tst-scm_rights \
31 tst-sigtimedwait \
32 tst-sync_file_range \
33 tst-syscall-restart \
34@@ -240,6 +239,8 @@ tests += \
35 tst-timerfd \
36 tst-ttyname-direct \
37 tst-ttyname-namespace \
38+ # Skip this test to avoid stale qemu process
39+ # tst-scm_rights \
40 # tests
41
42 # process_madvise requires CAP_SYS_ADMIN.
43@@ -282,9 +283,10 @@ tests-time64 += \
44 tst-ntp_gettimex-time64 \
45 tst-ppoll-time64 \
46 tst-prctl-time64 \
47- tst-scm_rights-time64 \
48 tst-sigtimedwait-time64 \
49 tst-timerfd-time64 \
50+ # Skip this test to avoid stale qemu process
51+ # tst-scm_rights-time64 \
52 # tests-time64
53
54 tests-clone-internal = \
diff --git a/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
deleted file mode 100644
index d2691e1ee7..0000000000
--- a/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From f8289aa320b00f6db43213979cceab2325a7a611 Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Thu, 18 Aug 2016 14:07:58 -0500
4Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first
5
6According to the ELF specification:
7
8When resolving symbolic references, the dynamic linker examines the symbol
9tables with a breadth-first search.
10
11This function was using a depth first search. By doing so the conflict
12resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
13was incorrect. This caused problems when their were various circular
14dependencies between libraries. The problem usually manifested itself by
15the wrong IFUNC being executed.
16
17[BZ# 20488]
18
19Upstream-Status: Submitted [libc-alpha]
20
21Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
22---
23 elf/dl-deps.c | 14 ++++++++++----
24 1 file changed, 10 insertions(+), 4 deletions(-)
25
26diff --git a/elf/dl-deps.c b/elf/dl-deps.c
27index 087a49b212..c09f9334f2 100644
28--- a/elf/dl-deps.c
29+++ b/elf/dl-deps.c
30@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
31 {
32 struct link_map **p = list;
33 struct link_map **q;
34+ struct link_map **r;
35
36 *p++ = map;
37 map->l_reserved = 1;
38- if (map->l_initfini)
39- for (q = map->l_initfini + 1; *q; ++q)
40- if (! (*q)->l_reserved)
41- p += _dl_build_local_scope (p, *q);
42+
43+ for (r = list; r < p; ++r)
44+ if ((*r)->l_initfini)
45+ for (q = (*r)->l_initfini + 1; *q; ++q)
46+ if (! (*q)->l_reserved)
47+ {
48+ *p++ = *q;
49+ (*q)->l_reserved = 1;
50+ }
51 return p - list;
52 }
53
diff --git a/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch b/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch
deleted file mode 100644
index 32f8fd22b8..0000000000
--- a/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 3156464f9a95bf1dafd2e22d19d7bf89c520acc1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:44:00 -0700
4Subject: [PATCH] intl: Emit no lines in bison generated files
5
6Improve reproducibility:
7Do not put any #line preprocessor commands in bison generated files.
8These lines contain absolute paths containing file locations on
9the host build machine.
10
11Upstream-Status: Pending
12
13Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 intl/Makefile | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/intl/Makefile b/intl/Makefile
20index 93478d87e8..b27a7935eb 100644
21--- a/intl/Makefile
22+++ b/intl/Makefile
23@@ -155,7 +155,7 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
24
25 CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \
26 -D'LOCALE_ALIAS_PATH="$(localedir)"'
27-BISONFLAGS = --yacc --name-prefix=__gettext --output
28+BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output
29
30 $(inst_localedir)/locale.alias: locale.alias $(+force)
31 $(do-install)
diff --git a/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
deleted file mode 100644
index 782d931f22..0000000000
--- a/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 881f5b8134afd9a30049b93fc79dda7a44947a5f Mon Sep 17 00:00:00 2001
2From: Martin Jansa <martin.jansa@gmail.com>
3Date: Mon, 17 Dec 2018 21:36:18 +0000
4Subject: [PATCH] locale: prevent maybe-uninitialized errors with -Os [BZ
5 #19444]
6
7Fixes following error when building for aarch64 with -Os:
8| In file included from strcoll_l.c:43:
9| strcoll_l.c: In function '__strcoll_l':
10| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
11| int_fast32_t i = table[*(*cpp)++];
12| ^~~~~~~~~
13| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here
14| coll_seq seq1, seq2;
15| ^~~~
16| In file included from strcoll_l.c:43:
17| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
18| int_fast32_t i = table[*(*cpp)++];
19| ^~~~~~~~~
20| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here
21| coll_seq seq1, seq2;
22| ^~~~
23
24 Partial fix for [BZ #19444]
25 * locale/weight.h: Fix build with -Os.
26
27Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1014766]
28
29Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
30Signed-off-by: Khem Raj <raj.khem@gmail.com>
31---
32 locale/weight.h | 7 +++++++
33 1 file changed, 7 insertions(+)
34
35diff --git a/locale/weight.h b/locale/weight.h
36index 723e1fefda..f5798d379a 100644
37--- a/locale/weight.h
38+++ b/locale/weight.h
39@@ -28,7 +28,14 @@ findidx (const int32_t *table,
40 const unsigned char *extra,
41 const unsigned char **cpp, size_t len)
42 {
43+ /* With GCC 8 when compiling with -Os the compiler warns that
44+ seq1.back_us and seq2.back_us might be used uninitialized.
45+ This uninitialized use is impossible for the same reason
46+ as described in comments in locale/weightwc.h. */
47+ DIAG_PUSH_NEEDS_COMMENT;
48+ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
49 int_fast32_t i = table[*(*cpp)++];
50+ DIAG_POP_NEEDS_COMMENT;
51 const unsigned char *cp;
52 const unsigned char *usrc;
53
diff --git a/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
deleted file mode 100644
index d273cab4a3..0000000000
--- a/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From b4e0a034b12b313dcb82d22341bef6a66b3e9ef9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:11:22 +0000
4Subject: [PATCH] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known names
5
6This bolts in a hook for OE to pass its own version of interpreter
7names into glibc especially for multilib case, where it differs from any
8other distros
9
10Upstream-Status: Inappropriate [OE specific]
11
12Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 elf/readlib.c | 1 +
16 1 file changed, 1 insertion(+)
17
18diff --git a/elf/readlib.c b/elf/readlib.c
19index 7383c23249..e97ea9449d 100644
20--- a/elf/readlib.c
21+++ b/elf/readlib.c
22@@ -51,6 +51,7 @@ static struct known_names interpreters[] =
23 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
24 SYSDEP_KNOWN_INTERPRETER_NAMES
25 #endif
26+ OECORE_KNOWN_INTERPRETER_NAMES
27 };
28
29 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
deleted file mode 100644
index 11a77cdf93..0000000000
--- a/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1From 2ae3ff3ae28abb1d0d100b4722da7ff188de9a30 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2020 17:05:45 -0700
4Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
5
6This helps OE multilibs to not sythesize this header which causes all
7kind of recursions and other issues since wordsize is fundamental header
8and ends up including itself in many case e.g. clang tidy, bpf etc.
9
10Upstream-Status: Inappropriate [ OE-Specific ]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/aarch64/bits/wordsize.h | 8 ++++++--
15 sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++---
16 2 files changed, 13 insertions(+), 5 deletions(-)
17 copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%)
18
19diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
20index 91da566b74..9a754514b3 100644
21--- a/sysdeps/aarch64/bits/wordsize.h
22+++ b/sysdeps/aarch64/bits/wordsize.h
23@@ -17,12 +17,16 @@
24 License along with the GNU C Library; if not, see
25 <https://www.gnu.org/licenses/>. */
26
27-#ifdef __LP64__
28+#if defined (__aarch64__) && defined (__LP64__)
29 # define __WORDSIZE 64
30-#else
31+#elif defined (__aarch64__)
32 # define __WORDSIZE 32
33 # define __WORDSIZE32_SIZE_ULONG 1
34 # define __WORDSIZE32_PTRDIFF_LONG 1
35+#else
36+# define __WORDSIZE 32
37+# define __WORDSIZE32_SIZE_ULONG 0
38+# define __WORDSIZE32_PTRDIFF_LONG 0
39 #endif
40
41 #define __WORDSIZE_TIME64_COMPAT32 0
42diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
43similarity index 80%
44copy from sysdeps/aarch64/bits/wordsize.h
45copy to sysdeps/arm/bits/wordsize.h
46index 91da566b74..34fcdef1f1 100644
47--- a/sysdeps/aarch64/bits/wordsize.h
48+++ b/sysdeps/arm/bits/wordsize.h
49@@ -1,6 +1,6 @@
50 /* Determine the wordsize from the preprocessor defines.
51
52- Copyright (C) 2016-2021 Free Software Foundation, Inc.
53+ Copyright (C) 2016-2021 Free Software Foundation, Inc.
54 This file is part of the GNU C Library.
55
56 The GNU C Library is free software; you can redistribute it and/or
57@@ -17,12 +17,16 @@
58 License along with the GNU C Library; if not, see
59 <https://www.gnu.org/licenses/>. */
60
61-#ifdef __LP64__
62+#if defined (__aarch64__) && defined (__LP64__)
63 # define __WORDSIZE 64
64-#else
65+#elif defined (__aarch64__)
66 # define __WORDSIZE 32
67 # define __WORDSIZE32_SIZE_ULONG 1
68 # define __WORDSIZE32_PTRDIFF_LONG 1
69+#else
70+# define __WORDSIZE 32
71+# define __WORDSIZE32_SIZE_ULONG 0
72+# define __WORDSIZE32_PTRDIFF_LONG 0
73 #endif
74
75 #define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch b/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch
deleted file mode 100644
index 3cb60b2e55..0000000000
--- a/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch
+++ /dev/null
@@ -1,116 +0,0 @@
1From b1971f6f1331d738d1d6b376b4741668a7546125 Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Tue, 2 Feb 2021 13:45:58 -0800
4Subject: [PATCH] x86: Require full ISA support for x86-64 level marker [BZ #27318]
5
6Since -march=sandybridge enables ISAs in x86-64 ISA level v3, the v3
7marker is set on libc.so. We couldn't set the needed ISA marker to v2
8since this libc won't run on all v2 machines. Technically, the v3 marker
9is correct. But the resulting libc.so won't run on Sandy Brigde, which
10is a v2 machine, even when libc is compiled with -march=sandybridge:
11
12$ ./elf/ld.so ./libc.so
13./libc.so: (p) CPU ISA level is lower than required: needed: 7; got: 3
14
15Instead, we require full ISA support for x86-64 level marker and disable
16x86-64 level marker for -march=sandybridge which enables ISAs between v2
17and v3.
18
19Upstream-Status: Submitted [https://sourceware.org/pipermail/libc-alpha/2021-February/122297.html]
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22
23 sysdeps/x86/configure | 7 ++++++-
24 sysdeps/x86/configure.ac | 2 +-
25 sysdeps/x86/isa-level.c | 21 ++++++++++++++++++++-
26 3 files changed, 27 insertions(+), 3 deletions(-)
27
28diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure
29index 5e32dc62b3..5b20646843 100644
30--- a/sysdeps/x86/configure
31+++ b/sysdeps/x86/configure
32@@ -133,7 +133,12 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest c
33 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
34 test $ac_status = 0; }; }; then
35 count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
36- if test "$count" = 1; then
37+ if test "$count" = 1 && { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -DINCLUDE_X86_ISA_LEVEL -S -o conftest.s $srcdir/sysdeps/x86/isa-level.c'
38+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
39+ (eval $ac_try) 2>&5
40+ ac_status=$?
41+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
42+ test $ac_status = 0; }; }; then
43 libc_cv_include_x86_isa_level=yes
44 fi
45 fi
46diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac
47index f94088f377..54ecd33d2c 100644
48--- a/sysdeps/x86/configure.ac
49+++ b/sysdeps/x86/configure.ac
50@@ -100,7 +100,7 @@ EOF
51 libc_cv_include_x86_isa_level=no
52 if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S); then
53 count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
54- if test "$count" = 1; then
55+ if test "$count" = 1 && AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -DINCLUDE_X86_ISA_LEVEL -S -o conftest.s $srcdir/sysdeps/x86/isa-level.c); then
56 libc_cv_include_x86_isa_level=yes
57 fi
58 fi
59diff --git a/sysdeps/x86/isa-level.c b/sysdeps/x86/isa-level.c
60index aaf524cb56..7f83449061 100644
61--- a/sysdeps/x86/isa-level.c
62+++ b/sysdeps/x86/isa-level.c
63@@ -25,12 +25,17 @@
64 License along with the GNU C Library; if not, see
65 <https://www.gnu.org/licenses/>. */
66
67-#include <elf.h>
68+#ifdef _LIBC
69+# include <elf.h>
70+#endif
71
72 /* ELF program property for x86 ISA level. */
73 #ifdef INCLUDE_X86_ISA_LEVEL
74 # if defined __x86_64__ || defined __FXSR__ || !defined _SOFT_FLOAT \
75 || defined __MMX__ || defined __SSE__ || defined __SSE2__
76+# if !defined __SSE__ || !defined __SSE2__
77+# error "Missing ISAs for x86-64 ISA level baseline"
78+# endif
79 # define ISA_BASELINE GNU_PROPERTY_X86_ISA_1_BASELINE
80 # else
81 # define ISA_BASELINE 0
82@@ -40,6 +45,11 @@
83 || (defined __x86_64__ && defined __LAHF_SAHF__) \
84 || defined __POPCNT__ || defined __SSE3__ \
85 || defined __SSSE3__ || defined __SSE4_1__ || defined __SSE4_2__
86+# if !defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 \
87+ || !defined __POPCNT__ || !defined __SSE3__ \
88+ || !defined __SSSE3__ || !defined __SSE4_1__ || !defined __SSE4_2__
89+# error "Missing ISAs for x86-64 ISA level v2"
90+# endif
91 # define ISA_V2 GNU_PROPERTY_X86_ISA_1_V2
92 # else
93 # define ISA_V2 0
94@@ -48,6 +58,10 @@
95 # if defined __AVX__ || defined __AVX2__ || defined __F16C__ \
96 || defined __FMA__ || defined __LZCNT__ || defined __MOVBE__ \
97 || defined __XSAVE__
98+# if !defined __AVX__ || !defined __AVX2__ || !defined __F16C__ \
99+ || !defined __FMA__ || !defined __LZCNT__
100+# error "Missing ISAs for x86-64 ISA level v3"
101+# endif
102 # define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3
103 # else
104 # define ISA_V3 0
105@@ -55,6 +69,11 @@
106
107 # if defined __AVX512F__ || defined __AVX512BW__ || defined __AVX512CD__ \
108 || defined __AVX512DQ__ || defined __AVX512VL__
109+# if !defined __AVX512F__ || !defined __AVX512BW__ \
110+ || !defined __AVX512CD__ || !defined __AVX512DQ__ \
111+ || !defined __AVX512VL__
112+# error "Missing ISAs for x86-64 ISA level v4"
113+# endif
114 # define ISA_V4 GNU_PROPERTY_X86_ISA_1_V4
115 # else
116 # define ISA_V4 0
diff --git a/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch b/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch
deleted file mode 100644
index e904b28a05..0000000000
--- a/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 044e603b698093cf48f6e6229e0b66acf05227e4 Mon Sep 17 00:00:00 2001
2From: Florian Weimer <fweimer@redhat.com>
3Date: Fri, 19 Feb 2021 13:29:00 +0100
4Subject: [PATCH] string: Work around GCC PR 98512 in rawmemchr
5
6Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=044e603b698093cf48f6e6229e0b66acf05227e4]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 string/rawmemchr.c | 26 +++++++++++++++-----------
10 1 file changed, 15 insertions(+), 11 deletions(-)
11
12diff --git a/string/rawmemchr.c b/string/rawmemchr.c
13index 59bbeeaa42..b8523118e5 100644
14--- a/string/rawmemchr.c
15+++ b/string/rawmemchr.c
16@@ -22,24 +22,28 @@
17 # define RAWMEMCHR __rawmemchr
18 #endif
19
20-/* Find the first occurrence of C in S. */
21-void *
22-RAWMEMCHR (const void *s, int c)
23-{
24- DIAG_PUSH_NEEDS_COMMENT;
25+/* The pragmata should be nested inside RAWMEMCHR below, but that
26+ triggers GCC PR 98512. */
27+DIAG_PUSH_NEEDS_COMMENT;
28 #if __GNUC_PREREQ (7, 0)
29- /* GCC 8 warns about the size passed to memchr being larger than
30- PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
31- DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow=");
32+/* GCC 8 warns about the size passed to memchr being larger than
33+ PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
34+DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow=");
35 #endif
36 #if __GNUC_PREREQ (11, 0)
37- /* Likewise GCC 11, with a different warning option. */
38- DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
39+/* Likewise GCC 11, with a different warning option. */
40+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
41 #endif
42+
43+/* Find the first occurrence of C in S. */
44+void *
45+RAWMEMCHR (const void *s, int c)
46+{
47 if (c != '\0')
48 return memchr (s, c, (size_t)-1);
49- DIAG_POP_NEEDS_COMMENT;
50 return (char *)s + strlen (s);
51 }
52 libc_hidden_def (__rawmemchr)
53 weak_alias (__rawmemchr, rawmemchr)
54+
55+DIAG_POP_NEEDS_COMMENT;
56--
572.30.1
58
diff --git a/meta/recipes-core/glibc/glibc/check-test-wrapper b/meta/recipes-core/glibc/glibc/check-test-wrapper
index f8e04e02d2..5cc993f718 100644
--- a/meta/recipes-core/glibc/glibc/check-test-wrapper
+++ b/meta/recipes-core/glibc/glibc/check-test-wrapper
@@ -2,6 +2,7 @@
2import sys 2import sys
3import os 3import os
4import subprocess 4import subprocess
5import resource
5 6
6env = os.environ.copy() 7env = os.environ.copy()
7args = sys.argv[1:] 8args = sys.argv[1:]
@@ -44,12 +45,20 @@ if targettype == "user":
44 qemuargs += ["-L", sysroot] 45 qemuargs += ["-L", sysroot]
45 qemuargs += ["-E", "LD_LIBRARY_PATH={}".format(":".join(libpaths))] 46 qemuargs += ["-E", "LD_LIBRARY_PATH={}".format(":".join(libpaths))]
46 command = qemuargs + args 47 command = qemuargs + args
48
49 # We've seen qemu-arm using up all system memory for some glibc
50 # tests e.g. nptl/tst-pthread-timedlock-lockloop
51 # Cap at 8GB since no test should need more than that
52 # (5GB adds 7 failures for qemuarm glibc test run)
53 limit = 8*1024*1024*1024
54 resource.setrlimit(resource.RLIMIT_AS, (limit, limit))
55
47elif targettype == "ssh": 56elif targettype == "ssh":
48 host = os.environ.get("SSH_HOST", None) 57 host = os.environ.get("SSH_HOST", None)
49 user = os.environ.get("SSH_HOST_USER", None) 58 user = os.environ.get("SSH_HOST_USER", None)
50 port = os.environ.get("SSH_HOST_PORT", None) 59 port = os.environ.get("SSH_HOST_PORT", None)
51 60
52 command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no"] 61 command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=quiet"]
53 if port: 62 if port:
54 command += ["-p", str(port)] 63 command += ["-p", str(port)]
55 if not host: 64 if not host:
diff --git a/meta/recipes-core/glibc/glibc/faccessat2-perm.patch b/meta/recipes-core/glibc/glibc/faccessat2-perm.patch
deleted file mode 100644
index 2ee7110ca1..0000000000
--- a/meta/recipes-core/glibc/glibc/faccessat2-perm.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1Older seccomp-based filters used in container frameworks will block faccessat2
2calls as it's a relatively new syscall. This isn't a big problem with
3glibc <2.33 but 2.33 will call faccessat2 itself, get EPERM, and thenn be confused
4about what to do as EPERM isn't an expected error code.
5
6This manifests itself as mysterious errors, for example a kernel failing to link.
7
8The root cause of bad seccomp filters is mostly fixed (systemd 247, Docker 20.10.0)
9but we can't expect everyone to upgrade, so add a workaound (originally from
10Red Hat) to handle EPERM like ENOSYS and fallback to faccessat().
11
12Upstream-Status: Inappropriate
13Signed-off-by: Ross Burton <ross.burton@arm.com>
14
15diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
16index 56cb6dcc8b4d58d3..5de75032bbc93a2c 100644
17--- a/sysdeps/unix/sysv/linux/faccessat.c
18+++ b/sysdeps/unix/sysv/linux/faccessat.c
19@@ -34,7 +34,11 @@ faccessat (int fd, const char *file, int mode, int flag)
20 #if __ASSUME_FACCESSAT2
21 return ret;
22 #else
23- if (ret == 0 || errno != ENOSYS)
24+ /* Fedora-specific workaround:
25+ As a workround for a broken systemd-nspawn that returns
26+ EPERM when a syscall is not allowed instead of ENOSYS
27+ we must check for EPERM here and fall back to faccessat. */
28+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
29 return ret;
30
31 if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
diff --git a/meta/recipes-core/glibc/glibc_2.33.bb b/meta/recipes-core/glibc/glibc_2.33.bb
deleted file mode 100644
index c47826a51e..0000000000
--- a/meta/recipes-core/glibc/glibc_2.33.bb
+++ /dev/null
@@ -1,120 +0,0 @@
1require glibc.inc
2require glibc-version.inc
3
4CVE_CHECK_WHITELIST += "CVE-2020-10029"
5
6DEPENDS += "gperf-native bison-native make-native"
7
8NATIVESDKFIXES ?= ""
9NATIVESDKFIXES_class-nativesdk = "\
10 file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
11 file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
12 file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
13 file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
14 file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
15 file://faccessat2-perm.patch \
16"
17
18SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
19 file://etc/ld.so.conf \
20 file://generate-supported.mk \
21 file://makedbs.sh \
22 \
23 ${NATIVESDKFIXES} \
24 file://0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
25 file://0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
26 file://0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
27 file://0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
28 file://0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
29 file://0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
30 file://0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
31 file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
32 file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
33 file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
34 file://0018-eglibc-Cross-building-and-testing-instructions.patch \
35 file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
36 file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \
37 file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \
38 file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \
39 file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
40 file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
41 file://0025-intl-Emit-no-lines-in-bison-generated-files.patch \
42 file://0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
43 file://0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
44 file://0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \
45 file://0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch \
46 file://0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch \
47 file://0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch \
48 "
49S = "${WORKDIR}/git"
50B = "${WORKDIR}/build-${TARGET_SYS}"
51
52PACKAGES_DYNAMIC = ""
53
54# the -isystem in bitbake.conf screws up glibc do_stage
55BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
56TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
57
58GLIBC_BROKEN_LOCALES = ""
59
60GLIBCPIE ??= ""
61
62EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
63 --disable-profile \
64 --disable-debug --without-gd \
65 --enable-clocale=gnu \
66 --with-headers=${STAGING_INCDIR} \
67 --without-selinux \
68 --enable-tunables \
69 --enable-bind-now \
70 --enable-stack-protector=strong \
71 --enable-stackguard-randomization \
72 --disable-crypt \
73 --with-default-link \
74 ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
75 ${GLIBCPIE} \
76 ${GLIBC_EXTRA_OECONF}"
77
78EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
79
80EXTRA_OECONF_append_x86 = " --enable-cet"
81EXTRA_OECONF_append_x86-64 = " --enable-cet"
82
83PACKAGECONFIG ??= "nscd"
84PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
85
86do_patch_append() {
87 bb.build.exec_func('do_fix_readlib_c', d)
88}
89
90do_fix_readlib_c () {
91 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
92}
93
94do_configure () {
95# override this function to avoid the autoconf/automake/aclocal/autoheader
96# calls for now
97# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
98# version check and doesn't really help with anything
99 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
100 find ${S} -name "configure" | xargs touch
101 CPPFLAGS="" oe_runconf
102}
103
104LDFLAGS += "-fuse-ld=bfd"
105do_compile () {
106 base_do_compile
107 echo "Adjust ldd script"
108 if [ -n "${RTLDLIST}" ]
109 then
110 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
111 # remove duplicate entries
112 newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
113 echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
114 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
115 fi
116}
117
118require glibc-package.inc
119
120BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/glibc/glibc_2.41.bb b/meta/recipes-core/glibc/glibc_2.41.bb
new file mode 100644
index 0000000000..7771fac041
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc_2.41.bb
@@ -0,0 +1,142 @@
1require glibc.inc
2require glibc-version.inc
3
4# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010022
5# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010023
6# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010024
7CVE_STATUS_GROUPS = "CVE_STATUS_RECIPE"
8CVE_STATUS_RECIPE = "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024"
9CVE_STATUS_RECIPE[status] = "disputed: \
10Upstream glibc maintainers dispute there is any issue and have no plans to address it further. \
11this is being treated as a non-security bug and no real threat."
12
13# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010025
14# Potential patch at https://sourceware.org/bugzilla/show_bug.cgi?id=22853
15CVE_STATUS[CVE-2019-1010025] = "disputed: \
16Allows for ASLR bypass so can bypass some hardening, not an exploit in itself, may allow \
17easier access for another. 'ASLR bypass itself is not a vulnerability.'"
18
19CVE_STATUS_GROUPS += "CVE_STATUS_STABLE_BACKPORTS"
20CVE_STATUS_STABLE_BACKPORTS = "CVE-2025-4802 CVE-2025-5702 CVE-2025-5745"
21CVE_STATUS_STABLE_BACKPORTS[status] = "cpe-stable-backport: fix available in used git hash"
22
23DEPENDS += "gperf-native bison-native"
24
25NATIVESDKFIXES ?= ""
26NATIVESDKFIXES:class-nativesdk = "\
27 file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
28 file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
29 file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
30 file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
31 file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
32 file://0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch \
33"
34
35SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
36 file://etc/ld.so.conf \
37 file://generate-supported.mk \
38 file://makedbs.sh \
39 \
40 ${NATIVESDKFIXES} \
41 file://0009-yes-within-the-path-sets-wrong-config-variables.patch \
42 file://0010-eglibc-Cross-building-and-testing-instructions.patch \
43 file://0011-eglibc-Help-bootstrap-cross-toolchain.patch \
44 file://0012-eglibc-Resolve-__fpscr_values-on-SH4.patch \
45 file://0013-eglibc-Forward-port-cross-locale-generation-support.patch \
46 file://0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
47 file://0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch \
48 file://0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \
49 file://0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch \
50 file://0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \
51 file://0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \
52 file://0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \
53 file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
54 file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
55 file://0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch \
56 file://0001-stdlib-Add-single-threaded-fast-path-to-rand.patch \
57 file://0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch \
58"
59B = "${WORKDIR}/build-${TARGET_SYS}"
60
61PACKAGES_DYNAMIC = ""
62
63# the -isystem in bitbake.conf screws up glibc do_stage
64BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
65TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
66
67GLIBC_BROKEN_LOCALES = ""
68
69GLIBCPIE ??= ""
70
71EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
72 --disable-profile \
73 --disable-debug --without-gd \
74 --enable-clocale=gnu \
75 --with-headers=${STAGING_INCDIR} \
76 --without-selinux \
77 --enable-bind-now \
78 --enable-stack-protector=strong \
79 --disable-crypt \
80 --with-default-link \
81 --disable-werror \
82 --enable-fortify-source \
83 ${GLIBCPIE} \
84 ${GLIBC_EXTRA_OECONF}"
85
86EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
87
88EXTRA_OECONF:append:x86-64 = " --enable-cet"
89
90PACKAGECONFIG ??= "nscd memory-tagging"
91
92PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
93PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
94
95do_patch:append() {
96 bb.build.exec_func('do_fix_readlib_c', d)
97}
98
99do_fix_readlib_c () {
100 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
101}
102
103do_configure () {
104# override this function to avoid the autoconf/automake/aclocal/autoheader
105# calls for now
106# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
107# version check and doesn't really help with anything
108 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
109 find ${S} -name "configure" | xargs touch
110 CPPFLAGS="" LD="${HOST_PREFIX}ld.bfd ${TOOLCHAIN_OPTIONS}" oe_runconf
111}
112
113LDFLAGS += "-fuse-ld=bfd"
114CC += "-fuse-ld=bfd"
115
116do_compile () {
117 base_do_compile
118 echo "Adjust ldd script"
119 if [ -n "${RTLDLIST}" ]
120 then
121 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
122 # remove duplicate entries
123 newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
124 echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
125 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
126 fi
127}
128
129require glibc-package.inc
130
131# When upgrading glibc it's important to know if there are any new symbols
132# that pseudo needs to wrap. In the future a generalised ABI comparison tool
133# would be good, but to solve the immediate need we can simply list the
134# exported symbols to files in WORKDIR.
135do_symlist() {
136 for LIB in ${D}${base_libdir}/lib*.so.*; do
137 ${NM} --dynamic $LIB | awk --source '$2 == "T" { print $3 }' | sort > ${WORKDIR}/$(basename $LIB)-${PV}.symbols
138 done
139}
140addtask symlist after do_install
141
142BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-riscv-support.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-riscv-support.patch
new file mode 100644
index 0000000000..fc41aee264
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-riscv-support.patch
@@ -0,0 +1,79 @@
1From fd50228cc213d2d87f5e3cf1f123acb3fda9b04e Mon Sep 17 00:00:00 2001
2From: Christoph Muellner <cmuellner@linux.com>
3Date: Mon, 28 Jun 2021 00:34:12 +0200
4Subject: [PATCH] ldconfig: Add RISC-V support
5
6ldconfig-native does not support RISC-V at the moment.
7Let's pull the reqired constants from upstream and add
8the required parsing code.
9
10Upstream-Status: Backport
11
12Signed-off-by: Christoph Muellner <cmuellner@linux.com>
13---
14 cache.c | 6 ++++++
15 ldconfig.h | 2 ++
16 readelflib.c | 10 ++++++++++
17 3 files changed, 18 insertions(+)
18
19diff --git a/cache.c b/cache.c
20index c4f5411..a3b9e70 100644
21--- a/cache.c
22+++ b/cache.c
23@@ -125,6 +125,12 @@ print_entry (const char *lib, int flag, unsigned int osversion,
24 case FLAG_AARCH64_LIB64:
25 fputs (",AArch64", stdout);
26 break;
27+ case FLAG_RISCV_FLOAT_ABI_SOFT:
28+ fputs (",soft-float", stdout);
29+ break;
30+ case FLAG_RISCV_FLOAT_ABI_DOUBLE:
31+ fputs (",double-float", stdout);
32+ break;
33 case 0:
34 break;
35 default:
36diff --git a/ldconfig.h b/ldconfig.h
37index 6a8a750..2e5e379 100644
38--- a/ldconfig.h
39+++ b/ldconfig.h
40@@ -38,6 +38,8 @@
41 #define FLAG_ARM_LIBHF 0x0900
42 #define FLAG_AARCH64_LIB64 0x0a00
43 #define FLAG_ARM_LIBSF 0x0b00
44+#define FLAG_RISCV_FLOAT_ABI_SOFT 0x0f00
45+#define FLAG_RISCV_FLOAT_ABI_DOUBLE 0x1000
46
47 /* Name of auxiliary cache. */
48 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
49diff --git a/readelflib.c b/readelflib.c
50index 9ec0a54..a01e1ce 100644
51--- a/readelflib.c
52+++ b/readelflib.c
53@@ -33,6 +33,10 @@
54 #define EM_AARCH64 183 /* ARM AARCH64 */
55 #endif
56
57+#ifndef EM_RISCV
58+#define EM_RISCV 243 /* RISC-V */
59+#endif
60+
61 #undef check_ptr
62 #define check_ptr(ptr) \
63 do \
64@@ -331,6 +335,12 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
65 /* see sysdeps/unix/sysv/linux/arm/readelflib.c */
66 *flag |= FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
67 break;
68+ case EM_RISCV:
69+ /* RISC-V libraries are always libc.so.6+. */
70+ /* NOTE: This does not correctly handle soft-float binaries */
71+ /* see sysdeps/unix/sysv/linux/riscv/readelflib.c */
72+ *flag |= FLAG_RISCV_FLOAT_ABI_DOUBLE|FLAG_ELF_LIBC6;
73+ break;
74 default:
75 error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n",
76 file_name, (long)elf_header->e_machine);
77--
782.25.1
79
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-handle-.dynstr-located-in-separate-segment.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-handle-.dynstr-located-in-separate-segment.patch
new file mode 100644
index 0000000000..36f04adfde
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-handle-.dynstr-located-in-separate-segment.patch
@@ -0,0 +1,178 @@
1From 864054a6cb971688a181316b8227ae0361b4d69e Mon Sep 17 00:00:00 2001
2From: Andreas Schwab <schwab@suse.de>
3Date: Wed, 9 Oct 2019 17:46:47 +0200
4Subject: [PATCH] ldconfig: handle .dynstr located in separate segment (bug
5 25087)
6
7To determine the load offset of the DT_STRTAB section search for the
8segment containing it, instead of using the load offset of the first
9segment.
10
11Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=58e8f5fd2ba47b6dc47fd4d0a35e4175c7c87aaa]
12
13Backported: ported to support endianness and 32/64 bits.
14Signed-off-by: Fabien Mahot <fabien.mahot@external.desouttertools.com>
15---
16 readelflib.c | 86 +++++++++++++++++++++++++++++++---------------------
17 1 file changed, 52 insertions(+), 34 deletions(-)
18
19diff --git a/readelflib.c b/readelflib.c
20index a01e1cede3..380aed563d 100644
21--- a/readelflib.c
22+++ b/readelflib.c
23@@ -80,7 +80,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag,
24 {
25 int i;
26 unsigned int j;
27- Elf32_Addr loadaddr;
28 unsigned int dynamic_addr;
29 size_t dynamic_size;
30 char *program_interpreter;
31@@ -110,7 +109,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag,
32 libc5/libc6. */
33 *flag = FLAG_ELF;
34
35- loadaddr = -1;
36 dynamic_addr = 0;
37 dynamic_size = 0;
38 program_interpreter = NULL;
39@@ -121,11 +119,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag,
40
41 switch (read32(segment->p_type, be))
42 {
43- case PT_LOAD:
44- if (loadaddr == (Elf32_Addr) -1)
45- loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
46- break;
47-
48 case PT_DYNAMIC:
49 if (dynamic_addr)
50 error (0, 0, _("more than one dynamic segment\n"));
51@@ -188,11 +181,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag,
52 }
53
54 }
55- if (loadaddr == (Elf32_Addr) -1)
56- {
57- /* Very strange. */
58- loadaddr = 0;
59- }
60
61 /* Now we can read the dynamic sections. */
62 if (dynamic_size == 0)
63@@ -208,11 +196,32 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag,
64 {
65 check_ptr (dyn_entry);
66 if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
67- {
68- dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
69- check_ptr (dynamic_strings);
70- break;
71- }
72+ {
73+ /* Find the file offset of the segment containing the dynamic
74+ string table. */
75+ Elf32_Off loadoff = -1;
76+ for (i = 0, segment = elf_pheader;
77+ i < read16(elf_header->e_phnum, be); i++, segment++)
78+ {
79+ if (read32(segment->p_type, be) == PT_LOAD
80+ && read32(dyn_entry->d_un.d_val, be) >= read32(segment->p_vaddr, be)
81+ && (read32(dyn_entry->d_un.d_val, be) - read32(segment->p_vaddr, be)
82+ < read32(segment->p_filesz, be)))
83+ {
84+ loadoff = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
85+ break;
86+ }
87+ }
88+ if (loadoff == (Elf32_Off) -1)
89+ {
90+ /* Very strange. */
91+ loadoff = 0;
92+ }
93+
94+ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadoff);
95+ check_ptr (dynamic_strings);
96+ break;
97+ }
98 }
99
100 if (dynamic_strings == NULL)
101@@ -269,7 +278,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
102 {
103 int i;
104 unsigned int j;
105- Elf64_Addr loadaddr;
106 Elf64_Addr dynamic_addr;
107 Elf64_Xword dynamic_size;
108 char *program_interpreter;
109@@ -347,7 +355,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
110 break;
111 }
112
113- loadaddr = -1;
114 dynamic_addr = 0;
115 dynamic_size = 0;
116 program_interpreter = NULL;
117@@ -358,11 +365,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
118
119 switch (read32(segment->p_type, be))
120 {
121- case PT_LOAD:
122- if (loadaddr == (Elf64_Addr) -1)
123- loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
124- break;
125-
126 case PT_DYNAMIC:
127 if (dynamic_addr)
128 error (0, 0, _("more than one dynamic segment\n"));
129@@ -426,11 +428,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
130 }
131
132 }
133- if (loadaddr == (Elf64_Addr) -1)
134- {
135- /* Very strange. */
136- loadaddr = 0;
137- }
138
139 /* Now we can read the dynamic sections. */
140 if (dynamic_size == 0)
141@@ -446,11 +443,32 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
142 {
143 check_ptr (dyn_entry);
144 if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
145- {
146- dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
147- check_ptr (dynamic_strings);
148- break;
149- }
150+ {
151+ /* Find the file offset of the segment containing the dynamic
152+ string table. */
153+ Elf64_Off loadoff = -1;
154+ for (i = 0, segment = elf_pheader;
155+ i < read16(elf_header->e_phnum, be); i++, segment++)
156+ {
157+ if (read64(segment->p_type, be) == PT_LOAD
158+ && read64(dyn_entry->d_un.d_val, be) >= read64(segment->p_vaddr, be)
159+ && (read64(dyn_entry->d_un.d_val, be) - read64(segment->p_vaddr, be)
160+ < read64(segment->p_filesz, be)))
161+ {
162+ loadoff = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
163+ break;
164+ }
165+ }
166+ if (loadoff == (Elf32_Off) -1)
167+ {
168+ /* Very strange. */
169+ loadoff = 0;
170+ }
171+
172+ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadoff);
173+ check_ptr (dynamic_strings);
174+ break;
175+ }
176 }
177
178 if (dynamic_strings == NULL)
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
index 52986e61c7..d1835c7a10 100644
--- a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -400,7 +400,7 @@ Index: ldconfig-native-2.12.1/ldconfig.c
400 return 0; 400 return 0;
401 } 401 }
402 402
403+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org" 403+#define REPORT_BUGS_TO "mailing list : poky@lists.yoctoproject.org"
404 /* Print bug-reporting information in the help message. */ 404 /* Print bug-reporting information in the help message. */
405 static char * 405 static char *
406 more_help (int key, const char *text, void *input) 406 more_help (int key, const char *text, void *input)
diff --git a/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
index 919d11417d..1c475eeb8a 100644
--- a/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
+++ b/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
@@ -1,6 +1,6 @@
1SUMMARY = "A standalone native ldconfig build" 1SUMMARY = "A standalone native ldconfig build"
2 2
3LICENSE = "GPLv2+" 3LICENSE = "GPL-2.0-or-later"
4 4
5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399" 5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
6 6
@@ -15,15 +15,15 @@ SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
15 file://endian-ness_handling_fix.patch \ 15 file://endian-ness_handling_fix.patch \
16 file://add-64-bit-flag-for-ELF64-entries.patch \ 16 file://add-64-bit-flag-for-ELF64-entries.patch \
17 file://no-aux-cache.patch \ 17 file://no-aux-cache.patch \
18 file://add-riscv-support.patch \
19 file://ldconfig-handle-.dynstr-located-in-separate-segment.patch \
18" 20"
19 21
20PR = "r2"
21
22FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:" 22FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:"
23 23
24inherit native 24inherit native
25 25
26S = "${WORKDIR}/${PN}-${PV}" 26S = "${UNPACKDIR}/${PN}-${PV}"
27 27
28do_compile () { 28do_compile () {
29 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig 29 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig