diff options
Diffstat (limited to 'meta/recipes-core/glibc')
59 files changed, 1244 insertions, 3093 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.33.bb b/meta/recipes-core/glibc/cross-localedef-native_2.40.bb index ec59c6ba10..fed6e4ea97 100644 --- a/meta/recipes-core/glibc/cross-localedef-native_2.33.bb +++ b/meta/recipes-core/glibc/cross-localedef-native_2.40.bb @@ -1,9 +1,9 @@ SUMMARY = "Cross locale generation tool for glibc" HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" SECTION = "libs" -LICENSE = "LGPL-2.1" +LICENSE = "LGPL-2.1-only" -LIC_FILES_CHKSUM = "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ +LIC_FILES_CHKSUM = "file://LICENSES;md5=f77e878d320e99e94ae9a4aea7f491d1 \ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" @@ -20,20 +20,19 @@ inherit native FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:" SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ - git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \ + git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef;protocol=https \ \ file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ \ - file://0016-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0017-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0018-eglibc-Cross-building-and-testing-instructions.patch \ - file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ -" + file://0010-eglibc-Cross-building-and-testing-instructions.patch \ + file://0011-eglibc-Help-bootstrap-cross-toolchain.patch \ + file://0012-eglibc-Resolve-__fpscr_values-on-SH4.patch \ + file://0013-eglibc-Forward-port-cross-locale-generation-support.patch \ + file://0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ + file://0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch \ + file://0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \ + " # Makes for a rather long rev (22 characters), but... # SRCREV_FORMAT = "glibc_localedef" @@ -41,6 +40,11 @@ SRCREV_FORMAT = "glibc_localedef" S = "${WORKDIR}/git" EXTRA_OECONF = "--with-glibc=${S}" + +# We do not need bash to run tzselect script, the default is to use +# bash but it can be configured by setting KSHELL Makefile variable +EXTRA_OEMAKE += "KSHELL=/bin/sh" + CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" do_install() { diff --git a/meta/recipes-core/glibc/glibc-common.inc b/meta/recipes-core/glibc/glibc-common.inc index 41ff7e9a19..72d5dcd74b 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)" DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel." HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" SECTION = "libs" -LICENSE = "GPLv2 & LGPLv2.1" +LICENSE = "GPL-2.0-only & LGPL-2.1-or-later" -LIC_FILES_CHKSUM ?= "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ +LIC_FILES_CHKSUM ?= "file://LICENSES;md5=f77e878d320e99e94ae9a4aea7f491d1 \ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" @@ -13,13 +13,13 @@ CVE_PRODUCT = "glibc" INHIBIT_DEFAULT_DEPS = "1" -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" -ARM_INSTRUCTION_SET_armv6 = "arm" +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +ARM_INSTRUCTION_SET:armv6 = "arm" # # We will skip parsing glibc when target system C library selection is not glibc # this helps in easing out parsing for non-glibc system libraries # -COMPATIBLE_HOST_libc-musl_class-target = "null" +COMPATIBLE_HOST:libc-musl:class-target = "null" -PV = "2.33" +PV = "2.40+git" 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): EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}" RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}" -RTLDLIST_class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}" +RTLDLIST:class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}" glibc_dl_info[vardepsexclude] = "OVERRIDES" diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc index ef06389ff9..c63c9edd76 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" BPN = "glibc" LOCALEBASEPN = "${MLPREFIX}glibc" -# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy -# 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') -# ERROR: Function failed: split_and_strip_files -BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" -BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" -do_package[depends] += "${BINUTILSDEP}" - -DEPENDS += "virtual/libc" +# Do not inhibit default deps, do_package requires binutils/gcc for +# objcopy/gcc-nm and glibc-locale depends on virtual/libc directly. +INHIBIT_DEFAULT_DEPS = "" # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION # is set. The idea is to avoid running localedef on the target (at first boot) @@ -21,11 +16,11 @@ DEPENDS += "virtual/libc" # default to disabled ENABLE_BINARY_LOCALE_GENERATION ?= "0" -ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "1" +ENABLE_BINARY_LOCALE_GENERATION:pn-nativesdk-glibc-locale = "1" #enable locale generation on these arches # BINARY_LOCALE_ARCHES is a space separated list of regular expressions -BINARY_LOCALE_ARCHES ?= "arc arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64" +BINARY_LOCALE_ARCHES ?= "arc arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64 loongarch64" # set "1" to use cross-localedef for locale generation # set "0" for qemu emulation of native localedef for locale generation @@ -33,39 +28,40 @@ LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1" PROVIDES = "virtual/libc-locale" -PACKAGES = "localedef ${PN}-dbg" +PACKAGES = "localedef ${PN}-dbg ${LOCALEBASEPN}-locale-alias" PACKAGES_DYNAMIC = "^locale-base-.* \ ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ ^${MLPREFIX}glibc-gconv$" # Create a glibc-binaries package -ALLOW_EMPTY_${BPN}-binaries = "1" +ALLOW_EMPTY:${BPN}-binaries = "1" PACKAGES += "${BPN}-binaries" -RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}" +RRECOMMENDS:${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary-") != -1])}" # Create a glibc-charmaps package -ALLOW_EMPTY_${BPN}-charmaps = "1" +ALLOW_EMPTY:${BPN}-charmaps = "1" PACKAGES += "${BPN}-charmaps" -RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}" +RRECOMMENDS:${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap-") != -1])}" # Create a glibc-gconvs package -ALLOW_EMPTY_${BPN}-gconvs = "1" +ALLOW_EMPTY:${BPN}-gconvs = "1" PACKAGES += "${BPN}-gconvs" -RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}" +RRECOMMENDS:${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv-") != -1])}" # Create a glibc-localedatas package -ALLOW_EMPTY_${BPN}-localedatas = "1" +ALLOW_EMPTY:${BPN}-localedatas = "1" PACKAGES += "${BPN}-localedatas" -RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}" +RRECOMMENDS:${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata-") != -1])}" -DESCRIPTION_localedef = "glibc: compile locale definition files" +DESCRIPTION:localedef = "glibc: compile locale definition files" # glibc-gconv is dynamically added into PACKAGES, thus -# FILES_glibc-gconv will not be automatically extended in multilib. -# Explicitly add ${MLPREFIX} for FILES_glibc-gconv. -FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*" -FILES_localedef = "${bindir}/localedef" +# FILES:glibc-gconv will not be automatically extended in multilib. +# Explicitly add ${MLPREFIX} for FILES:glibc-gconv. +FILES:${MLPREFIX}glibc-gconv = "${libdir}/gconv/*" +FILES:localedef = "${bindir}/localedef" +FILES:${LOCALEBASEPN}-locale-alias = "${datadir}/locale/locale.alias" LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale" @@ -87,10 +83,9 @@ do_install() { if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then copy_locale_files ${libdir}/gconv 0755 copy_locale_files ${datadir}/i18n 0644 - else - # Remove the libdir if it is empty when gconv is not copied - find ${D}${libdir} -type d -empty -delete fi + # Remove empty dirs in libdir when gconv or locales are not copied + find ${D}${libdir} -type d -empty -delete copy_locale_files ${datadir}/locale 0644 install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED } diff --git a/meta/recipes-core/glibc/glibc-locale_2.33.bb b/meta/recipes-core/glibc/glibc-locale_2.40.bb index f7702e0358..f7702e0358 100644 --- a/meta/recipes-core/glibc/glibc-locale_2.33.bb +++ b/meta/recipes-core/glibc/glibc-locale_2.40.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 SUMMARY = "mtrace utility provided by glibc" DESCRIPTION = "mtrace utility provided by glibc" -RDEPENDS_${PN} = "perl" -RPROVIDES_${PN} = "libc-mtrace" +RDEPENDS:${PN} = "perl" +RPROVIDES:${PN} = "libc-mtrace" SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts" diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.33.bb b/meta/recipes-core/glibc/glibc-mtrace_2.40.bb index 0b69bad46a..0b69bad46a 100644 --- a/meta/recipes-core/glibc/glibc-mtrace_2.33.bb +++ b/meta/recipes-core/glibc/glibc-mtrace_2.40.bb diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc index 92e5dbac61..3352f3e2f5 100644 --- a/meta/recipes-core/glibc/glibc-package.inc +++ b/meta/recipes-core/glibc/glibc-package.inc @@ -1,77 +1,77 @@ INHIBIT_SYSROOT_STRIP = "1" -PACKAGES = "${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 ${PN}-src" +PACKAGES = "${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" # The ld.so in this glibc supports the GNU_HASH -RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)" -RPROVIDES_${PN}-utils = "eglibc-utils" -RPROVIDES_${PN}-mtrace = "eglibc-mtrace libc-mtrace" -RPROVIDES_${PN}-pic = "eglibc-pic" -RPROVIDES_${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev" -RPROVIDES_${PN}-staticdev = "eglibc-staticdev" -RPROVIDES_${PN}-doc = "eglibc-doc" -RPROVIDES_glibc-extra-nss = "eglibc-extra-nss" -RPROVIDES_glibc-thread-db = "eglibc-thread-db" -RPROVIDES_${PN}-pcprofile = "eglibc-pcprofile" -RPROVIDES_${PN}-dbg = "eglibc-dbg" +RPROVIDES:${PN} = "eglibc rtld(GNU_HASH)" +RPROVIDES:${PN}-utils = "eglibc-utils" +RPROVIDES:${PN}-mtrace = "eglibc-mtrace libc-mtrace" +RPROVIDES:${PN}-pic = "eglibc-pic" +RPROVIDES:${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev" +RPROVIDES:${PN}-staticdev = "eglibc-staticdev" +RPROVIDES:${PN}-doc = "eglibc-doc" +RPROVIDES:glibc-extra-nss = "eglibc-extra-nss" +RPROVIDES:glibc-thread-db = "eglibc-thread-db" +RPROVIDES:${PN}-pcprofile = "eglibc-pcprofile" +RPROVIDES:${PN}-dbg = "eglibc-dbg" libc_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" ARCH_DYNAMIC_LOADER = "" # The aarch64 ABI says the dynamic linker -must- be # /lib/ld-linux-aarch64{,_be}.so.1. With usrmerge, that may mean that # we need to install it in /usr/lib. -ARCH_DYNAMIC_LOADER_aarch64 = "ld-linux-${TARGET_ARCH}.so.1" -libc_baselibs_append = " ${@oe.utils.conditional('ARCH_DYNAMIC_LOADER', '', '', '${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}', d)}" -INSANE_SKIP_${PN}_append_aarch64 = " libdir" - -FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf" -RRECOMMENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}" -FILES_ldconfig = "${base_sbindir}/ldconfig" -FILES_ldd = "${bindir}/ldd" -FILES_libsegfault = "${base_libdir}/libSegFault*" -FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" -FILES_libmemusage = "${base_libdir}/libmemusage.so" -FILES_libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh" -RDEPENDS_libnss-db = "${PN}-utils" -FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" -FILES_sln = "${base_sbindir}/sln" -FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" -FILES_libsotruss = "${libdir}/audit/sotruss-lib.so" +ARCH_DYNAMIC_LOADER:aarch64 = "ld-linux-${TARGET_ARCH}.so.1" +libc_baselibs:append = " ${@oe.utils.conditional('ARCH_DYNAMIC_LOADER', '', '', '${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}', d)}" +INSANE_SKIP:${PN}:append:aarch64 = " libdir" +INSANE_SKIP:${PN}-dev += "staticdev" +INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so libdir" + +FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf" +RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}" +FILES:ldconfig = "${base_sbindir}/ldconfig" +FILES:ldd = "${bindir}/ldd" +FILES:ldso = "${bindir}/${MLPREFIX}ld.so" +FILES:libmemusage = "${base_libdir}/libmemusage.so" +FILES:malloc-debug = "${base_libdir}/libc_malloc_debug.so.0" +FILES:libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh" +RDEPENDS:libnss-db = "${PN}-utils" +FILES:glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" +FILES:sln = "${base_sbindir}/sln" +FILES:${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" +FILES:libsotruss = "${libdir}/audit/sotruss-lib.so" FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}" -FILES_${PN}-dev += "${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal" -RDEPENDS_${PN}-dev = "linux-libc-headers-dev" -FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a" -FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \ +FILES:${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" +RDEPENDS:${PN}-dev = "linux-libc-headers-dev" +FILES:${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a" +FILES:nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_system_unitdir}/nscd* ${nonarch_libdir}/tmpfiles.d/nscd.conf \ ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd" -FILES_${PN}-mtrace = "${bindir}/mtrace" -FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${bindir}/zdump" -FILES_${PN}-utils = "${bindir}/* ${sbindir}/*" -FILES_catchsegv = "${bindir}/catchsegv" -RDEPENDS_catchsegv = "libsegfault" -FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so" -FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so" -RPROVIDES_${PN}-dev += "libc-dev" -RPROVIDES_${PN}-staticdev += "libc-staticdev" - -SUMMARY_sln = "The static ln" -DESCRIPTION_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." -SUMMARY_nscd = "Name service cache daemon" -DESCRIPTION_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." -SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries" -DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services." -SUMMARY_ldd = "print shared library dependencies" -DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line." -SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc" -DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, ..." -DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs" -DESCRIPTION_tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" +FILES:${PN}-mtrace = "${bindir}/mtrace" +FILES:tzcode = "${bindir}/tzselect ${sbindir}/zic ${bindir}/zdump" +FILES:${PN}-utils = "${bindir}/* ${sbindir}/*" +FILES:${PN}-pcprofile = "${base_libdir}/libpcprofile.so" +FILES:glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so" +RPROVIDES:${PN}-dev += "libc-dev" +RPROVIDES:${PN}-staticdev += "libc-staticdev" + +SUMMARY:sln = "The static ln" +DESCRIPTION: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." +SUMMARY:nscd = "Name service cache daemon" +DESCRIPTION: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." +SUMMARY:glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries" +DESCRIPTION:glibc-extra-nss = "glibc: nis, nisplus and hesiod search services." +SUMMARY:ldd = "print shared library dependencies" +DESCRIPTION:ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line." +SUMMARY:${PN}-utils = "Miscellaneous utilities provided by glibc" +DESCRIPTION:${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, ..." +DESCRIPTION:libsotruss = "Library to support sotruss which traces calls through PLTs" +DESCRIPTION:tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" inherit multilib_header do_install() { oe_runmake install_root=${D} install - install -Dm 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ld.so.conf + install -Dm 0644 ${UNPACKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ld.so.conf install -d ${D}${localedir} - make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED" + make -f ${UNPACKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED" # get rid of some broken files... for i in ${GLIBC_BROKEN_LOCALES}; do sed -i "/$i/d" ${WORKDIR}/SUPPORTED @@ -87,7 +87,7 @@ do_install() { rmdir --ignore-fail-on-non-empty ${D}${libexecdir} fi - oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h bits/endianness.h bits/struct_rwlock.h + oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h bits/endianness.h bits/struct_rwlock.h bits/math-vector.h if [ -f ${D}${bindir}/mtrace ]; then sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace @@ -101,12 +101,12 @@ do_install() { install -d ${D}${localstatedir}/db/nscd install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf - install -m 0755 ${WORKDIR}/makedbs.sh ${D}${localstatedir}/db + install -m 0755 ${UNPACKDIR}/makedbs.sh ${D}${localstatedir}/db sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/ + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_system_unitdir}/ # The dynamic loader will have been installed into # ${base_libdir}. However, if that isn't going to end up being @@ -118,6 +118,11 @@ do_install() { ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \ ${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER} fi + ln -rs ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so + ln -rs ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so + if [ -n "${MLPREFIX}" ]; then + mv ${D}${bindir}/ld.so ${D}${bindir}/${MLPREFIX}ld.so + fi } def get_libc_fpu_setting(bb, d): @@ -125,11 +130,11 @@ def get_libc_fpu_setting(bb, d): return "--without-fp" return "" -do_install_append_class-target() { +do_install:append:class-target() { if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d + install -d ${D}${nonarch_libdir}/tmpfiles.d echo "d /run/nscd 755 root root -" \ - > ${D}${sysconfdir}/tmpfiles.d/nscd.conf + > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf fi if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then @@ -139,15 +144,15 @@ do_install_append_class-target() { fi } -do_install_append_aarch64 () { +do_install:append:aarch64 () { do_install_armmultilib } -do_install_append_arm () { +do_install:append:arm () { do_install_armmultilib } -do_install_append_armeb () { +do_install:append:armeb () { do_install_armmultilib } @@ -156,13 +161,20 @@ do_install_armmultilib () { 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 oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h oe_multilib_header bits/procfs-id.h bits/procfs.h bits/shmlba.h - oe_multilib_header bits/struct_stat.h + oe_multilib_header bits/struct_stat.h bits/pthread_stack_min.h + oe_multilib_header bits/dl_find_object.h bits/rseq.h bits/timesize.h oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h } +do_install_armmultilib:append:class-target() { + gcc_version=$($CC -dumpversion) + mkdir -p ${D}${libdir}/gcc/${TARGET_SYS}/${gcc_version}/finclude + mv ${D}${includedir}/finclude/math-vector-fortran.h ${D}${libdir}/gcc/${TARGET_SYS}/${gcc_version}/finclude/ + rmdir --ignore-fail-on-non-empty ${D}${includedir}/finclude +} LOCALESTASH = "${WORKDIR}/stashed-locale" bashscripts = "mtrace sotruss xtrace" @@ -252,35 +264,35 @@ stash_locale_package_cleanup() { stash_locale_cleanup ${PKGD} } -python populate_packages_prepend () { +python populate_packages:prepend () { if d.getVar('DEBIAN_NAMES'): pkgs = d.getVar('PACKAGES').split() bpn = d.getVar('BPN') prefix = d.getVar('MLPREFIX') or "" # Set the base package... - d.setVar('PKG_' + prefix + bpn, prefix + 'libc6') + d.setVar('PKG:' + prefix + bpn, prefix + 'libc6') libcprefix = prefix + bpn + '-' for p in pkgs: # And all the subpackages. if p.startswith(libcprefix): renamed = p.replace(bpn, 'libc6', 1) - d.setVar('PKG_' + p, renamed) + d.setVar('PKG:' + p, renamed) # For backward compatibility with old -dbg package - d.appendVar('RPROVIDES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') - d.appendVar('RCONFLICTS_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') - d.appendVar('RREPLACES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') + d.appendVar('RPROVIDES:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') + d.appendVar('RCONFLICTS:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') + d.appendVar('RREPLACES:' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg') } -pkg_postinst_nscd () { +pkg_postinst:nscd () { if [ -z "$D" ]; then if command -v systemd-tmpfiles >/dev/null; then - systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf + systemd-tmpfiles --create ${nonarch_libdir}/tmpfiles.d/nscd.conf elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then ${sysconfdir}/init.d/populate-volatile.sh update fi fi } -CONFFILES_nscd="${sysconfdir}/nscd.conf" +CONFFILES:nscd="${sysconfdir}/nscd.conf" SYSTEMD_PACKAGES = "nscd" -SYSTEMD_SERVICE_nscd = "nscd.service" +SYSTEMD_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 SUMMARY = "utility scripts provided by glibc" DESCRIPTION = "utility scripts provided by glibc" -RDEPENDS_${PN} = "bash glibc-mtrace" +RDEPENDS:${PN} = "bash glibc-mtrace" SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts" @@ -17,7 +17,7 @@ do_install() { # sotruss script requires sotruss-lib.so (given by libsotruss package), # to produce trace of the library calls. -RDEPENDS_${PN} += "libsotruss" +RDEPENDS:${PN} += "libsotruss" # Don't scan for CVEs as glibc will be scanned CVE_PRODUCT = "" diff --git a/meta/recipes-core/glibc/glibc-scripts_2.33.bb b/meta/recipes-core/glibc/glibc-scripts_2.40.bb index 5a89bd8022..5a89bd8022 100644 --- a/meta/recipes-core/glibc/glibc-scripts_2.33.bb +++ b/meta/recipes-core/glibc/glibc-scripts_2.40.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 @@ -require glibc_${PV}.bb - EXCLUDE_FROM_WORLD = "1" # handle PN differences -FILESEXTRAPATHS_prepend := "${THISDIR}/glibc:" +FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:" -# strip provides -PROVIDES = "" # setup depends INHIBIT_DEFAULT_DEPS = "" @@ -20,24 +16,10 @@ python () { DEPENDS += "glibc-locale libgcc gcc-runtime" # remove the initial depends -DEPENDS_remove = "libgcc-initial" - -inherit qemu - -SRC_URI += "file://check-test-wrapper" - -DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}" - -TOOLCHAIN_TEST_TARGET ??= "user" -TOOLCHAIN_TEST_HOST ??= "localhost" -TOOLCHAIN_TEST_HOST_USER ??= "root" -TOOLCHAIN_TEST_HOST_PORT ??= "2222" +DEPENDS:remove = "libgcc-initial" do_check[dirs] += "${B}" -do_check[nostamp] = "1" do_check () { - chmod 0755 ${WORKDIR}/check-test-wrapper - # clean out previous test results oe_runmake tests-clean # makefiles don't clean entirely (and also sometimes fails due to too many args) @@ -46,18 +28,5 @@ do_check () { find ${B}/catgets -name "*.cat" -delete find ${B}/conform -name "symlist-*" -delete [ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata - - oe_runmake -i \ - QEMU_SYSROOT="${RECIPE_SYSROOT}" \ - QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \ - SSH_HOST="${TOOLCHAIN_TEST_HOST}" \ - SSH_HOST_USER="${TOOLCHAIN_TEST_HOST_USER}" \ - SSH_HOST_PORT="${TOOLCHAIN_TEST_HOST_PORT}" \ - test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \ - check } addtask do_check after do_compile - -inherit nopackages -deltask do_stash_locale -deltask do_install diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.40.bb b/meta/recipes-core/glibc/glibc-testsuite_2.40.bb new file mode 100644 index 0000000000..3a2764e40b --- /dev/null +++ b/meta/recipes-core/glibc/glibc-testsuite_2.40.bb @@ -0,0 +1,36 @@ +require glibc_${PV}.bb +require glibc-tests.inc + +inherit qemu + +SRC_URI += "file://check-test-wrapper" + +# strip provides +PROVIDES = "" + +DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}" + +TOOLCHAIN_TEST_TARGET ??= "user" +TOOLCHAIN_TEST_HOST ??= "localhost" +TOOLCHAIN_TEST_HOST_USER ??= "root" +TOOLCHAIN_TEST_HOST_PORT ??= "2222" + +do_check[nostamp] = "1" +do_check[network] = "1" +do_check:append () { + chmod 0755 ${UNPACKDIR}/check-test-wrapper + + oe_runmake -i \ + QEMU_SYSROOT="${RECIPE_SYSROOT}" \ + QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \ + SSH_HOST="${TOOLCHAIN_TEST_HOST}" \ + SSH_HOST_USER="${TOOLCHAIN_TEST_HOST_USER}" \ + SSH_HOST_PORT="${TOOLCHAIN_TEST_HOST_PORT}" \ + test-wrapper="${UNPACKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \ + check +} + +inherit nopackages +deltask do_stash_locale +deltask do_install +deltask do_populate_sysroot diff --git a/meta/recipes-core/glibc/glibc-version.inc b/meta/recipes-core/glibc/glibc-version.inc index 376ead66ac..61996781bd 100644 --- a/meta/recipes-core/glibc/glibc-version.inc +++ b/meta/recipes-core/glibc/glibc-version.inc @@ -1,8 +1,8 @@ -SRCBRANCH ?= "release/2.33/master" -PV = "2.33" -SRCREV_glibc ?= "3f5080aedd164c1f92a53552dd3e0b82ac6d2bd3" -SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28" +SRCBRANCH ?= "release/2.40/master" +PV = "2.40+git" +SRCREV_glibc ?= "6daa77104520ca992a9369bd01cccd4d98c82984" +SRCREV_localedef ?= "fab74f31b3811df543e24b6de47efdf45b538abc" -GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" +GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git;protocol=https" UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)" diff --git a/meta/recipes-core/glibc/glibc-y2038-tests_2.40.bb b/meta/recipes-core/glibc/glibc-y2038-tests_2.40.bb new file mode 100644 index 0000000000..8ed94386d2 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-y2038-tests_2.40.bb @@ -0,0 +1,107 @@ +require glibc_${PV}.bb +require glibc-tests.inc + +inherit ptest features_check +REQUIRED_DISTRO_FEATURES = "ptest" + +SRC_URI += "\ + file://run-ptest \ +" + +SUMMARY = "glibc tests using time32/time64 interfaces to be run with ptest for the purpose of checking y2038 compatiblity" + +# Erase some variables already set by glibc_${PV} +python __anonymous() { + # Remove packages provided by glibc build, we only need a subset of them + d.setVar("PACKAGES", "${PN} ${PN}-dbg ${PN}-ptest") + + d.setVar("PROVIDES", "${PN} ${PN}-ptest") + + bbclassextend = d.getVar("BBCLASSEXTEND").replace("nativesdk", "").strip() + d.setVar("BBCLASSEXTEND", bbclassextend) + d.setVar("RRECOMMENDS", "") + d.setVar("SYSTEMD_SERVICE:nscd", "") + d.setVar("SYSTEMD_PACKAGES", "") +} + +# Remove any leftovers from original glibc recipe +RPROVIDES:${PN} = "${PN}" +RRECOMMENDS:${PN} = "" +RDEPENDS:${PN} = "glibc libgcc sed bash" +RDEPENDS:${PN}-ptest = "${PN}" +DEPENDS += "sed" + +export oe_srcdir="${exec_prefix}/src/debug/glibc/${PV}/" + +# Just build tests for target - do not run them +do_check:append () { + oe_runmake -i check run-built-tests=no +} +addtask do_check after do_compile before do_install_ptest_base + +glibc_strip_build_directory () { + # Delete all non executable files from build directory + find ${B} ! -executable -type f -delete + + # Remove build dynamic libraries and links to them as + # those are already installed in the target device + find ${B} -type f -name "*.so" -delete + find ${B} -type l -name "*.so*" -delete + + # Remove headers (installed with glibc) + find ${B} -type f -name "*.h" -delete + + find ${B} -type f -name "isomac" -delete + find ${B} -type f -name "annexc" -delete +} + +do_install_ptest_base () { + glibc_strip_build_directory + + ls -r ${B}/*/*-time64 > ${B}/tst_time64 + + # Remove '-time64' suffix - those tests are also time related + sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp + tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64) + + rm ${B}/tst_time_tmp ${B}/tst_time64 + echo "${tst_time}" + + # Install build test programs to the image + install -d ${D}${PTEST_PATH}/tests/glibc-ptest/ + + for f in "${tst_time}" + do + cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/ + done + + install -d ${D}${PTEST_PATH} + cp ${UNPACKDIR}/run-ptest ${D}${PTEST_PATH}/ + +} + +# The datadir directory is required to allow core (and reused) +# glibc cleanup function to finish correctly, as this directory +# is not created for ptests +stash_locale_package_cleanup:prepend () { + mkdir -p ${PKGD}${datadir} +} + +stash_locale_sysroot_cleanup:prepend () { + mkdir -p ${SYSROOT_DESTDIR}${datadir} +} + +# Prevent the do_package() task to set 'libc6' prefix +# for glibc tests related packages +python populate_packages:prepend () { + if d.getVar('DEBIAN_NAMES'): + d.setVar('DEBIAN_NAMES', '') +} + +FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/${PN}/*" + +EXCLUDE_FROM_SHLIBS = "1" + +deltask do_stash_locale +do_install[noexec] = "1" +do_populate_sysroot[noexec] = "1" diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index 7d14306377..b08a70aa46 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc @@ -1,7 +1,7 @@ require glibc-common.inc require glibc-ld.inc -DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers" +DEPENDS = "virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}binutils libgcc-initial linux-libc-headers" PROVIDES = "virtual/libc" PROVIDES += "virtual/libintl virtual/libiconv" @@ -24,10 +24,10 @@ CACHED_CONFIGUREVARS += " \ " # ifunc doesn't appear to work on mips, casuses libbfd assertion failures -CACHED_CONFIGUREVARS_append_mipsarch = " libc_cv_ld_gnu_indirect_function=no" +CACHED_CONFIGUREVARS:append:mipsarch = " libc_cv_ld_gnu_indirect_function=no" GLIBC_EXTRA_OECONF ?= "" -GLIBC_EXTRA_OECONF_class-nativesdk = "" +GLIBC_EXTRA_OECONF:class-nativesdk = "" # glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer # PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE @@ -41,12 +41,16 @@ PARALLEL_MAKE = "" # ensure make uses /bin/bash EXTRA_OEMAKE += "SHELL=/bin/bash" -do_configure_prepend() { - sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in +# We do not need bash to run tzselect script, the default is to use +# bash but it can be configured by setting KSHELL Makefile variable +EXTRA_OEMAKE += "KSHELL=/bin/sh" + +do_configure:prepend() { + sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in } # Enable backtrace from abort() -do_configure_append_arm () { +do_configure:append:arm () { echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms } 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..e4fb2a7a28 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 @@ -From d1f1671034a222417f9a829dcaa4f0c3d4f8954d Mon Sep 17 00:00:00 2001 +From c22fc168dd00cdabcf24a54b4d9383a3f1a7b313 Mon Sep 17 00:00:00 2001 From: Jason Wessel <jason.wessel@windriver.com> Date: Sat, 7 Dec 2019 09:59:22 -0800 Subject: [PATCH] localedef: Add hardlink resolver from util-linux 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..1bbd07d331 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 @@ -From 14d256e2db009f8bac9a265e8393d7ed25050df9 Mon Sep 17 00:00:00 2001 +From fe564c5944621f240dd28a1b4157504384635518 Mon Sep 17 00:00:00 2001 From: Jason Wessel <jason.wessel@windriver.com> Date: Sat, 7 Dec 2019 10:01:37 -0800 Subject: [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..650e608750 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 @@ -From 32a4b8ae046fe4bb1b19f61378d079d44deaede7 Mon Sep 17 00:00:00 2001 +From 213a4e5b43369f24d6f07a7c971f3909ec5d26a3 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 01:48:24 +0000 +Date: Sat, 3 Feb 2024 13:54:16 -0800 Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well Upstream-Status: Inappropriate [embedded specific] @@ -30,25 +30,25 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c -index 9e2089cfaa..ad01674027 100644 +index 8a89b71016..1ea5415b76 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -2175,6 +2175,14 @@ _dl_map_object (struct link_map *loader, const char *name, - } - } +@@ -2046,6 +2046,14 @@ _dl_map_object (struct link_map *loader, const char *name, + &loader->l_runpath_dirs, &realname, &fb, loader, + LA_SER_RUNPATH, &found_other_class); -+ /* try the default path. */ -+ if (fd == -1 -+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL -+ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) -+ && __rtld_search_dirs.dirs != (void *) -1) -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &__rtld_search_dirs, -+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); -+ /* Finally try ld.so.cache */ ++ /* Try the default path. */ ++ if (fd == -1 ++ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL ++ || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB))) ++ && __rtld_search_dirs.dirs != (void *) -1) ++ fd = open_path (name, namelen, mode, &__rtld_search_dirs, ++ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); ++ /* Finally try ld.so.cache */ #ifdef USE_LDCONFIG if (fd == -1 && (__glibc_likely ((mode & __RTLD_SECURE) == 0) -@@ -2233,14 +2241,6 @@ _dl_map_object (struct link_map *loader, const char *name, +@@ -2104,14 +2112,6 @@ _dl_map_object (struct link_map *loader, const char *name, } #endif 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..b98b6ec5fb 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 @@ -From aa8393bff257e4badfd208b88473ead175c69362 Mon Sep 17 00:00:00 2001 +From c17e485fc4ff3f7f16a824b43372bc9e3fe57dd6 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:50:00 +0000 Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 12 insertions(+) diff --git a/elf/dl-load.c b/elf/dl-load.c -index ad01674027..f455207e79 100644 +index 1ea5415b76..e149dd7e76 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -1871,7 +1871,19 @@ open_path (const char *name, size_t namelen, int mode, +@@ -1757,7 +1757,19 @@ open_path (const char *name, size_t namelen, int mode, given on the command line when rtld is run directly. */ return -1; 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..21c39dce59 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 @@ -From 3ea08e491a8494ff03e598b5e0fc2d8131e75da9 Mon Sep 17 00:00:00 2001 +From 97229d19eca7d93d38ed7893640efe36a57e7bcb Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:51:38 +0000 Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths @@ -19,17 +19,17 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> elf/dl-load.c | 4 ++-- elf/dl-usage.c | 6 ++++-- elf/interp.c | 2 +- - elf/ldconfig.c | 3 +++ + elf/ldconfig.c | 2 ++ elf/rtld.c | 1 + iconv/gconv_conf.c | 2 +- sysdeps/generic/dl-cache.h | 4 ---- - 8 files changed, 16 insertions(+), 10 deletions(-) + 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/elf/dl-cache.c b/elf/dl-cache.c -index 32f3bef5ea..71f3a82dc0 100644 +index 7c7dc58745..0147a281ad 100644 --- a/elf/dl-cache.c +++ b/elf/dl-cache.c -@@ -359,6 +359,10 @@ search_cache (const char *string_table, uint32_t string_table_size, +@@ -336,6 +336,10 @@ search_cache (const char *string_table, uint32_t string_table_size, return best; } @@ -41,10 +41,10 @@ index 32f3bef5ea..71f3a82dc0 100644 _dl_cache_libcmp (const char *p1, const char *p2) { diff --git a/elf/dl-load.c b/elf/dl-load.c -index f455207e79..a144e24fcf 100644 +index e149dd7e76..c99ce0ee45 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -115,8 +115,8 @@ enum { ncapstr = 1, max_capstrlen = 0 }; +@@ -106,8 +106,8 @@ enum { ncapstr = 1, max_capstrlen = 0 }; gen-trusted-dirs.awk. */ #include "trusted-dirs.h" @@ -56,7 +56,7 @@ index f455207e79..a144e24fcf 100644 SYSTEM_DIRS_LEN }; diff --git a/elf/dl-usage.c b/elf/dl-usage.c -index 6e26818bd7..f09e8b93e5 100644 +index 5baac4ba8e..60097ad0e2 100644 --- a/elf/dl-usage.c +++ b/elf/dl-usage.c @@ -25,6 +25,8 @@ @@ -68,7 +68,7 @@ index 6e26818bd7..f09e8b93e5 100644 void _dl_usage (const char *argv0, const char *wrong_option) { -@@ -244,7 +246,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ +@@ -185,7 +187,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ --list list all dependencies and how they are resolved\n\ --verify verify that given object really is a dynamically linked\n\ object we can handle\n\ @@ -77,7 +77,7 @@ index 6e26818bd7..f09e8b93e5 100644 --library-path PATH use given PATH instead of content of the environment\n\ variable LD_LIBRARY_PATH\n\ --glibc-hwcaps-prepend LIST\n\ -@@ -266,7 +268,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ +@@ -204,7 +206,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ \n\ This program interpreter self-identifies as: " RTLD "\n\ ", @@ -85,9 +85,9 @@ index 6e26818bd7..f09e8b93e5 100644 + argv0, LD_SO_CACHE); print_search_path_for_help (state); print_hwcaps_subdirectories (state); - print_legacy_hwcap_directories (); + _exit (EXIT_SUCCESS); diff --git a/elf/interp.c b/elf/interp.c -index 91966702ca..dc86c20e83 100644 +index 8b705824bf..7d094829f3 100644 --- a/elf/interp.c +++ b/elf/interp.c @@ -18,5 +18,5 @@ @@ -98,24 +98,23 @@ index 91966702ca..dc86c20e83 100644 +const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) = RUNTIME_LINKER; diff --git a/elf/ldconfig.c b/elf/ldconfig.c -index 28ed637a29..5d38a60c5d 100644 +index b64c54b53e..caf7001745 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c -@@ -176,6 +176,9 @@ static struct argp argp = +@@ -150,6 +150,8 @@ static struct argp argp = options, parse_opt, NULL, doc, NULL, more_help, NULL }; -+ +extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); + - /* Check if string corresponds to an important hardware capability or - a platform. */ - static int + /* Handle program arguments. */ + static error_t + parse_opt (int key, char *arg, struct argp_state *state) diff --git a/elf/rtld.c b/elf/rtld.c -index 596b6ac3d9..1ccd33f668 100644 +index 6352ba76c5..02316b8b16 100644 --- a/elf/rtld.c +++ b/elf/rtld.c -@@ -185,6 +185,7 @@ dso_name_valid_for_suid (const char *p) +@@ -190,6 +190,7 @@ dso_name_valid_for_suid (const char *p) } return *p != '\0'; } @@ -124,11 +123,11 @@ index 596b6ac3d9..1ccd33f668 100644 static void audit_list_init (struct audit_list *list) diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c -index 682f949834..7eed87bc9d 100644 +index 1063c31a2b..57fa832e52 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c -@@ -36,7 +36,7 @@ - +@@ -35,7 +35,7 @@ + #include <gconv_parseconfdir.h> /* This is the default path where we look for module lists. */ -static const char default_gconv_path[] = GCONV_PATH; @@ -137,7 +136,7 @@ index 682f949834..7eed87bc9d 100644 /* Type to represent search path. */ struct path_elem diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h -index 964d50a486..94bf68ca9d 100644 +index 919e49ffc8..cd3f8ba94b 100644 --- a/sysdeps/generic/dl-cache.h +++ b/sysdeps/generic/dl-cache.h @@ -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..b867ffde48 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 @@ -From 19e3e45eb1838ee80af13c3d27fcff446773211e Mon Sep 17 00:00:00 2001 +From 680ceb8bf43f07884674a08423b8a1c15d1a48b5 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Thu, 31 Dec 2015 14:35:35 -0800 Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 @@ -13,14 +13,14 @@ Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - sysdeps/x86/atomic-machine.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + sysdeps/x86/atomic-machine.h | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h -index 695222e4fa..9d39bfdbd5 100644 +index cfd395087b..28a937c468 100644 --- a/sysdeps/x86/atomic-machine.h +++ b/sysdeps/x86/atomic-machine.h -@@ -52,15 +52,14 @@ typedef uintmax_t uatomic_max_t; +@@ -26,19 +26,14 @@ #define LOCK_PREFIX "lock;" #define USE_ATOMIC_COMPILER_BUILTINS 1 @@ -33,6 +33,10 @@ index 695222e4fa..9d39bfdbd5 100644 # define BR_CONSTRAINT "q" # define IBR_CONSTRAINT "iq" #else +-/* Since the Pentium, i386 CPUs have supported 64-bit atomics, but the +- i386 psABI supplement provides only 4-byte alignment for uint64_t +- inside structs, so it is currently not possible to use 64-bit +- atomics on this platform. */ -# define __HAVE_64B_ATOMICS 0 # define SP_REG "esp" # 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..a1d4f07724 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 @@ -From 732d4f4954fe60718870048d0583a20a7a8a8540 Mon Sep 17 00:00:00 2001 +From 88c37776dca4603d6618fd7a12a055a15e2a519e Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 3 Aug 2018 09:55:12 -0700 Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales @@ -19,10 +19,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/locale/findlocale.c b/locale/findlocale.c -index ab09122b0c..f42cc75780 100644 +index 43ff7201c1..9684a4249b 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c -@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = +@@ -55,7 +55,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = which are somehow addressed. */ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; @@ -31,7 +31,7 @@ index ab09122b0c..f42cc75780 100644 /* Checks if the name is actually present, that is, not NULL and not empty. */ -@@ -166,7 +166,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, +@@ -165,7 +165,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, /* Nothing in the archive. Set the default path to search below. */ locale_path = _nl_default_locale_path; @@ -41,7 +41,7 @@ index ab09122b0c..f42cc75780 100644 else /* We really have to load some data. First see whether the name is diff --git a/locale/loadarchive.c b/locale/loadarchive.c -index 4177fc8972..40247b1e68 100644 +index 452e3eb6e3..c7467aec42 100644 --- a/locale/loadarchive.c +++ b/locale/loadarchive.c @@ -42,7 +42,7 @@ @@ -54,10 +54,10 @@ index 4177fc8972..40247b1e68 100644 /* Size of initial mapping window, optimal if large enough to cover the header plus the initial locale. */ diff --git a/locale/localeinfo.h b/locale/localeinfo.h -index b3d4da0185..22f9dc1140 100644 +index ed698faef1..f7efc288a5 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h -@@ -331,7 +331,7 @@ _nl_lookup_word (locale_t l, int category, int item) +@@ -347,7 +347,7 @@ _nl_lookup_word (locale_t l, int category, int item) } /* Default search path if no LOCPATH environment variable. */ @@ -67,10 +67,10 @@ index b3d4da0185..22f9dc1140 100644 /* Load the locale data for CATEGORY from the file specified by *NAME. If *NAME is "", use environment variables as specified by POSIX, and diff --git a/locale/programs/locale.c b/locale/programs/locale.c -index 575b208e82..5ec630c3a4 100644 +index c7ee1874e8..8281e32236 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c -@@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b) +@@ -631,6 +631,7 @@ nameentcmp (const void *a, const void *b) ((const struct nameent *) b)->name); } @@ -78,7 +78,7 @@ index 575b208e82..5ec630c3a4 100644 static int write_archive_locales (void **all_datap, char *linebuf) -@@ -645,7 +646,7 @@ write_archive_locales (void **all_datap, char *linebuf) +@@ -644,7 +645,7 @@ write_archive_locales (void **all_datap, char *linebuf) int fd, ret = 0; uint32_t cnt; @@ -87,7 +87,7 @@ index 575b208e82..5ec630c3a4 100644 if (fd < 0) return 0; -@@ -700,8 +701,8 @@ write_archive_locales (void **all_datap, char *linebuf) +@@ -699,8 +700,8 @@ write_archive_locales (void **all_datap, char *linebuf) if (cnt) putchar_unlocked ('\n'); 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 @@ -From 3d58330390a7d4f4ed32f4a9c25628af3e0dd5c1 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:01:50 +0000 -Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation - -Upstream-Status: Pending -Signed-off-by: Edmar Wienskoski <edmar@freescale.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 134 ++++++++++++++++++ - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 101 +++++++++++++ - sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 134 ++++++++++++++++++ - .../powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 101 +++++++++++++ - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++ - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 101 +++++++++++++ - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++ - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 101 +++++++++++++ - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++ - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 101 +++++++++++++ - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++ - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 101 +++++++++++++ - .../linux/powerpc/powerpc32/603e/fpu/Implies | 1 + - .../powerpc/powerpc32/e300c3/fpu/Implies | 2 + - .../powerpc/powerpc32/e500mc/fpu/Implies | 1 + - .../linux/powerpc/powerpc32/e5500/fpu/Implies | 1 + - .../linux/powerpc/powerpc32/e6500/fpu/Implies | 1 + - .../linux/powerpc/powerpc64/e5500/fpu/Implies | 1 + - .../linux/powerpc/powerpc64/e6500/fpu/Implies | 1 + - 19 files changed, 1418 insertions(+) - create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c - create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c - create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c - create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c - create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c - create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c - create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies - create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies - -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -new file mode 100644 -index 0000000000..71e516d1c8 ---- /dev/null -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -@@ -0,0 +1,134 @@ -+/* Double-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float two108 = 3.245185536584267269e+32; -+static const float twom54 = 5.551115123125782702e-17; -+static const float half = 0.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the actual square root and half of its reciprocal -+ simultaneously. */ -+ -+#ifdef __STDC__ -+double -+__ieee754_sqrt (double b) -+#else -+double -+__ieee754_sqrt (b) -+ double b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+ double y, g, h, d, r; -+ ieee_double_shape_type u; -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ u.value = b; -+ -+ relax_fenv_state (); -+ -+ __asm__ ("frsqrte %[estimate], %[x]\n" -+ : [estimate] "=f" (y) : [x] "f" (b)); -+ -+ /* Following Muller et al, page 168, equation 5.20. -+ -+ h goes to 1/(2*sqrt(b)) -+ g goes to sqrt(b). -+ -+ We need three iterations to get within 1ulp. */ -+ -+ /* Indicate that these can be performed prior to the branch. GCC -+ insists on sinking them below the branch, however; it seems like -+ they'd be better before the branch so that we can cover any latency -+ from storing the argument and loading its high word. Oh well. */ -+ -+ g = b * y; -+ h = 0.5 * y; -+ -+ /* Handle small numbers by scaling. */ -+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -+ return __ieee754_sqrt (b * two108) * twom54; -+ -+#define FMADD(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ r = FNMSUB (g, h, half); -+ g = FMADD (g, r, g); -+ h = FMADD (h, r, h); -+ -+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ -+ -+ /* Final refinement. */ -+ d = FNMSUB (g, g, b); -+ -+ fesetenv_register (fe); -+ return FMADD (d, h, g); -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_wash (b); -+} -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -new file mode 100644 -index 0000000000..26fa067abf ---- /dev/null -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -@@ -0,0 +1,101 @@ -+/* Single-precision floating point square root. -+ Copyright (C) 2010 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <math.h> -+#include <math_private.h> -+#include <fenv_libc.h> -+#include <inttypes.h> -+ -+#include <sysdep.h> -+#include <ldsodefs.h> -+ -+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; -+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; -+static const float threehalf = 1.5; -+ -+/* The method is based on the descriptions in: -+ -+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; -+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 -+ -+ We find the reciprocal square root and use that to compute the actual -+ square root. */ -+ -+#ifdef __STDC__ -+float -+__ieee754_sqrtf (float b) -+#else -+float -+__ieee754_sqrtf (b) -+ float b; -+#endif -+{ -+ if (__builtin_expect (b > 0, 1)) -+ { -+#define FMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+#define FNMSUB(a_, c_, b_) \ -+ ({ double __r; \ -+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ -+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ -+ __r;}) -+ -+ if (__builtin_expect (b != a_inf.value, 1)) -+ { -+ double y, x; -+ fenv_t fe; -+ -+ fe = fegetenv_register (); -+ -+ relax_fenv_state (); -+ -+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ -+ y = FMSUB (threehalf, b, b); -+ -+ /* Initial estimate. */ -+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); -+ -+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ x = x * FNMSUB (y, x * x, threehalf); -+ -+ /* All done. */ -+ fesetenv_register (fe); -+ return x * b; -+ } -+ } -+ else if (b < 0) -+ { -+ /* For some reason, some PowerPC32 processors don't implement -+ FE_INVALID_SQRT. */ -+#ifdef FE_INVALID_SQRT -+ feraiseexcept (FE_INVALID_SQRT); -+ -+ fenv_union_t u = { .fenv = fegetenv_register () }; -+ if ((u.l & FE_INVALID) == 0) -+#endif -+ feraiseexcept (FE_INVALID); -+ b = a_nan.value; -+ } -+ return f_washf (b); -+} -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies -new file mode 100644 -index 0000000000..b103b4dea5 ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies -@@ -0,0 +1 @@ -+powerpc/powerpc32/603e/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies -new file mode 100644 -index 0000000000..64db17fada ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies -@@ -0,0 +1,2 @@ -+# e300c3 is a variant of 603e so use the same optimizations for sqrt -+powerpc/powerpc32/603e/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies -new file mode 100644 -index 0000000000..7eac5fcf02 ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies -@@ -0,0 +1 @@ -+powerpc/powerpc32/e500mc/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies -new file mode 100644 -index 0000000000..264b2a7700 ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies -@@ -0,0 +1 @@ -+powerpc/powerpc32/e5500/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies -new file mode 100644 -index 0000000000..a25934467b ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies -@@ -0,0 +1 @@ -+powerpc/powerpc32/e6500/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies -new file mode 100644 -index 0000000000..a7bc854be8 ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies -@@ -0,0 +1 @@ -+powerpc/powerpc64/e5500/fpu -diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies -new file mode 100644 -index 0000000000..04ff8cc181 ---- /dev/null -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies -@@ -0,0 +1 @@ -+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..09f64421ae --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch @@ -0,0 +1,32 @@ +From ab38fdad1d435b68ae2d178f2e5d24c77f4e8d98 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 6 Mar 2021 14:48:56 -0800 +Subject: [PATCH] nativesdk-glibc: Fall back to faccessat on faccess2 returns + EPERM + +Fedora-specific workaround for systemd-nspawn + +Upstream-Status: Inappropriate [Distro Specific] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/unix/sysv/linux/faccessat.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c +index 2fa57fd63d..4d0d5ff0c4 100644 +--- a/sysdeps/unix/sysv/linux/faccessat.c ++++ b/sysdeps/unix/sysv/linux/faccessat.c +@@ -30,7 +30,11 @@ __faccessat (int fd, const char *file, int mode, int flag) + #if __ASSUME_FACCESSAT2 + return ret; + #else +- if (ret == 0 || errno != ENOSYS) ++ /* Fedora-specific workaround: ++ As a workround for a broken systemd-nspawn that returns ++ EPERM when a syscall is not allowed instead of ENOSYS ++ we must check for EPERM here and fall back to faccessat. */ ++ if (ret == 0 || !(errno == ENOSYS || errno == EPERM)) + return ret; + + 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 @@ -From 3b5fe5b1a7390cde0f07351415e3891f62d1f7e0 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:15:07 +0000 -Subject: [PATCH] ppc/sqrt: Fix undefined reference to `__sqrt_finite' - -on ppc fixes the errors like below -| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite' -| collect2: ld returned 1 exit status - -Upstream-Status: Pending - -ChangeLog - -2012-01-06 Khem Raj <raj.khem@gmail.com> - - * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias. - Remove cruft. - * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto. - * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto. - * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 7 +------ - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 7 +------ - sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 1 + - sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 + - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 1 + - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 1 + - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 1 + - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 1 + - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 7 +------ - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 7 +------ - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 1 + - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 1 + - 12 files changed, 12 insertions(+), 24 deletions(-) - -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -index 71e516d1c8..1795fd6c3e 100644 ---- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -@@ -39,14 +39,8 @@ static const float half = 0.5; - We find the actual square root and half of its reciprocal - simultaneously. */ - --#ifdef __STDC__ - double - __ieee754_sqrt (double b) --#else --double --__ieee754_sqrt (b) -- double b; --#endif - { - if (__builtin_expect (b > 0, 1)) - { -@@ -132,3 +126,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -index 26fa067abf..a917f313ab 100644 ---- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -@@ -37,14 +37,8 @@ static const float threehalf = 1.5; - We find the reciprocal square root and use that to compute the actual - square root. */ - --#ifdef __STDC__ - float - __ieee754_sqrtf (float b) --#else --float --__ieee754_sqrtf (b) -- float b; --#endif - { - if (__builtin_expect (b > 0, 1)) - { -@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -index 71e516d1c8..fc4a74990e 100644 ---- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -@@ -132,3 +132,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -index 26fa067abf..9d175122a8 100644 ---- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -index 71e516d1c8..fc4a74990e 100644 ---- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -@@ -132,3 +132,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -index 26fa067abf..9d175122a8 100644 ---- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -index 71e516d1c8..fc4a74990e 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -@@ -132,3 +132,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -index 26fa067abf..9d175122a8 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -index 71e516d1c8..1795fd6c3e 100644 ---- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -@@ -39,14 +39,8 @@ static const float half = 0.5; - We find the actual square root and half of its reciprocal - simultaneously. */ - --#ifdef __STDC__ - double - __ieee754_sqrt (double b) --#else --double --__ieee754_sqrt (b) -- double b; --#endif - { - if (__builtin_expect (b > 0, 1)) - { -@@ -132,3 +126,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -index 26fa067abf..a917f313ab 100644 ---- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -@@ -37,14 +37,8 @@ static const float threehalf = 1.5; - We find the reciprocal square root and use that to compute the actual - square root. */ - --#ifdef __STDC__ - float - __ieee754_sqrtf (float b) --#else --float --__ieee754_sqrtf (b) -- float b; --#endif - { - if (__builtin_expect (b > 0, 1)) - { -@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -index 71e516d1c8..fc4a74990e 100644 ---- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -@@ -132,3 +132,4 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -index 26fa067abf..9d175122a8 100644 ---- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+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..b862b12d66 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 @@ -From 0bd39d8907953f18e01742f42b24647ac7689d0a Mon Sep 17 00:00:00 2001 +From cac7bbbc82423697f8d3223222db8b787b63f500 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:31:06 +0000 Subject: [PATCH] 'yes' within the path sets wrong config variables @@ -27,13 +27,18 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++---- sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++---- 12 files changed, 28 insertions(+), 28 deletions(-) + mode change 100644 => 100755 sysdeps/arm/configure + mode change 100644 => 100755 sysdeps/mips/configure + mode change 100644 => 100755 sysdeps/nios2/configure + mode change 100644 => 100755 sysdeps/unix/sysv/linux/mips/configure + mode change 100644 => 100755 sysdeps/unix/sysv/linux/powerpc/powerpc64/configure diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure -index 83c3a23e44..a68c946277 100644 +index 4bd5496a4a..6c051369fb 100755 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure -@@ -157,12 +157,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -157,12 +157,12 @@ else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __AARCH64EB__ - yes @@ -42,16 +47,16 @@ index 83c3a23e44..a68c946277 100644 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "is_aarch64_be" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "is_aarch64_be" >/dev/null 2>&1 + then : libc_cv_aarch64_be=yes - else - libc_cv_aarch64_be=no + else case e in #( diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac -index 66f755078a..a32b265bbe 100644 +index 56d12d661d..80fca20873 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac -@@ -17,8 +17,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE) +@@ -13,8 +13,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE) # the dynamic linker via %ifdef. AC_CACHE_CHECK([for big endian], [libc_cv_aarch64_be], @@ -63,11 +68,13 @@ index 66f755078a..a32b265bbe 100644 ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)]) if test $libc_cv_aarch64_be = yes; then diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure -index 431e843b2b..e152461138 100644 +old mode 100644 +new mode 100755 +index 935e022c74..9f7c98bcd3 --- a/sysdeps/arm/configure +++ b/sysdeps/arm/configure -@@ -151,12 +151,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -153,12 +153,12 @@ else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ARM_PCS_VFP - yes @@ -76,16 +83,16 @@ index 431e843b2b..e152461138 100644 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "use_arm_pcs_vfp" >/dev/null 2>&1 + then : libc_cv_arm_pcs_vfp=yes - else - libc_cv_arm_pcs_vfp=no + else case e in #( diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac -index 90cdd69c75..05a262ba00 100644 +index cd00ddc9d9..d3831867ac 100644 --- a/sysdeps/arm/configure.ac +++ b/sysdeps/arm/configure.ac -@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN) +@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # the dynamic linker via %ifdef. AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], [libc_cv_arm_pcs_vfp], @@ -97,10 +104,12 @@ index 90cdd69c75..05a262ba00 100644 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)]) if test $libc_cv_arm_pcs_vfp = yes; then diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure -index 4e13248c03..f14af952d0 100644 +old mode 100644 +new mode 100755 +index 60dbd947e2..e3d10d7b96 --- a/sysdeps/mips/configure +++ b/sysdeps/mips/configure -@@ -143,11 +143,11 @@ else +@@ -150,11 +150,11 @@ else case e in #( /* end confdefs.h. */ dnl #ifdef __mips_nan2008 @@ -109,17 +118,17 @@ index 4e13248c03..f14af952d0 100644 #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "use_mips_nan2008" >/dev/null 2>&1 + then : libc_cv_mips_nan2008=yes - else - libc_cv_mips_nan2008=no + else case e in #( diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac -index bcbdaffd9f..ad3057f4cc 100644 +index d3cd780d78..250223d206 100644 --- a/sysdeps/mips/configure.ac +++ b/sysdeps/mips/configure.ac @@ -6,9 +6,9 @@ dnl position independent way. - dnl AC_DEFINE(PI_STATIC_AND_HIDDEN) + AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC) AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], - libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl @@ -131,11 +140,13 @@ index bcbdaffd9f..ad3057f4cc 100644 if test x$libc_cv_mips_nan2008 = xyes; then AC_DEFINE(HAVE_MIPS_NAN2008) diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure -index 14c8a3a014..dde3814ef2 100644 +old mode 100644 +new mode 100755 +index d25684d5ad..5801978aee --- a/sysdeps/nios2/configure +++ b/sysdeps/nios2/configure -@@ -142,12 +142,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -147,12 +147,12 @@ else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __nios2_big_endian__ - yes @@ -144,13 +155,13 @@ index 14c8a3a014..dde3814ef2 100644 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "is_nios2_be" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "is_nios2_be" >/dev/null 2>&1 + then : libc_cv_nios2_be=yes - else - libc_cv_nios2_be=no + else case e in #( diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac -index f05f43802b..dc8639902d 100644 +index f738e9a7ed..4085851cbc 100644 --- a/sysdeps/nios2/configure.ac +++ b/sysdeps/nios2/configure.ac @@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. @@ -165,10 +176,12 @@ index f05f43802b..dc8639902d 100644 ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)]) if test $libc_cv_nios2_be = yes; then diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure -index f25f2a3a65..1b7483e6c6 100644 +old mode 100644 +new mode 100755 +index 6e3402c111..a23f24ef8e --- a/sysdeps/unix/sysv/linux/mips/configure +++ b/sysdeps/unix/sysv/linux/mips/configure -@@ -414,11 +414,11 @@ else +@@ -443,11 +443,11 @@ else case e in #( /* end confdefs.h. */ dnl #ifdef __mips_nan2008 @@ -177,11 +190,11 @@ index f25f2a3a65..1b7483e6c6 100644 #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "use_mips_nan2008" >/dev/null 2>&1 + then : libc_cv_mips_nan2008=yes - else - libc_cv_mips_nan2008=no + else case e in #( diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac index 049a0f4bdf..005526d4e8 100644 --- a/sysdeps/unix/sysv/linux/mips/configure.ac @@ -199,11 +212,13 @@ index 049a0f4bdf..005526d4e8 100644 libc_mips_nan= diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure -index ae7f254da4..874519000b 100644 +old mode 100644 +new mode 100755 +index 5dd70689fc..7d6c2322d3 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure -@@ -155,12 +155,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -160,12 +160,12 @@ else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if _CALL_ELF == 2 - yes @@ -212,13 +227,13 @@ index ae7f254da4..874519000b 100644 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "use_ppc_elfv2_abi" >/dev/null 2>&1 + then : libc_cv_ppc64_elfv2_abi=yes - else - libc_cv_ppc64_elfv2_abi=no -@@ -188,12 +188,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + else case e in #( +@@ -197,12 +197,12 @@ else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _CALL_ELF - yes @@ -227,11 +242,11 @@ index ae7f254da4..874519000b 100644 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- $EGREP "yes" >/dev/null 2>&1; then : -+ $EGREP "is_def_call_elf" >/dev/null 2>&1; then : +- $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 ++ $EGREP_TRADITIONAL "is_def_call_elf" >/dev/null 2>&1 + then : libc_cv_ppc64_def_call_elf=yes - else - libc_cv_ppc64_def_call_elf=no + else case e in #( diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac index f9cba6e15d..b21f72f1e4 100644 --- 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 @@ -From 6b6e1dcd707017598ea3bdc2d91a761943b62218 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:16:38 +0000 -Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out - __slow versions - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 12 ++++++++++-- - sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 8 +++++++- - sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 14 +++++++++++--- - sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++-- - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 14 +++++++++++--- - sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 12 ++++++++++-- - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 8 ++++++++ - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 8 ++++++++ - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 12 ++++++++++-- - sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 9 ++++++++- - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 14 +++++++++++--- - sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 12 ++++++++++-- - 12 files changed, 114 insertions(+), 21 deletions(-) - -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -index 1795fd6c3e..daa83f3fe8 100644 ---- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c -@@ -40,7 +40,7 @@ static const float half = 0.5; - simultaneously. */ - - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - { - if (__builtin_expect (b > 0, 1)) - { -@@ -77,7 +77,7 @@ __ieee754_sqrt (double b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -@@ -126,4 +126,12 @@ __ieee754_sqrt (double b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -index a917f313ab..b812cf1705 100644 ---- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c -@@ -38,7 +38,7 @@ static const float threehalf = 1.5; - square root. */ - - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - { - if (__builtin_expect (b > 0, 1)) - { -@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b) - } - return f_washf (b); - } -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} - strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -index fc4a74990e..7038a70b47 100644 ---- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c -@@ -41,10 +41,10 @@ static const float half = 0.5; - - #ifdef __STDC__ - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - #else - double --__ieee754_sqrt (b) -+__slow_ieee754_sqrt (b) - double b; - #endif - { -@@ -83,7 +83,7 @@ __ieee754_sqrt (b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -@@ -132,4 +132,12 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -index 9d175122a8..10de1f0cc3 100644 ---- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c -@@ -39,10 +39,10 @@ static const float threehalf = 1.5; - - #ifdef __STDC__ - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - #else - float --__ieee754_sqrtf (b) -+__slow_ieee754_sqrtf (b) - float b; - #endif - { -@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+ -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} -+ - strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -index fc4a74990e..7038a70b47 100644 ---- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c -@@ -41,10 +41,10 @@ static const float half = 0.5; - - #ifdef __STDC__ - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - #else - double --__ieee754_sqrt (b) -+__slow_ieee754_sqrt (b) - double b; - #endif - { -@@ -83,7 +83,7 @@ __ieee754_sqrt (b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -@@ -132,4 +132,12 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -index 9d175122a8..10de1f0cc3 100644 ---- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c -@@ -39,10 +39,10 @@ static const float threehalf = 1.5; - - #ifdef __STDC__ - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - #else - float --__ieee754_sqrtf (b) -+__slow_ieee754_sqrtf (b) - float b; - #endif - { -@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+ -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} -+ - strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -index fc4a74990e..1c34244bd8 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -@@ -132,4 +132,12 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -index 9d175122a8..812653558f 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+ -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} -+ - strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -index 1795fd6c3e..13a81973e3 100644 ---- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c -@@ -40,7 +40,7 @@ static const float half = 0.5; - simultaneously. */ - - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - { - if (__builtin_expect (b > 0, 1)) - { -@@ -77,7 +77,7 @@ __ieee754_sqrt (double b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -@@ -126,4 +126,12 @@ __ieee754_sqrt (double b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -index a917f313ab..fae2d81210 100644 ---- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c -@@ -38,7 +38,7 @@ static const float threehalf = 1.5; - square root. */ - - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - { - if (__builtin_expect (b > 0, 1)) - { -@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b) - } - return f_washf (b); - } -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} -+ - strong_alias (__ieee754_sqrtf, __sqrtf_finite) -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -index fc4a74990e..7038a70b47 100644 ---- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c -@@ -41,10 +41,10 @@ static const float half = 0.5; - - #ifdef __STDC__ - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - #else - double --__ieee754_sqrt (b) -+__slow_ieee754_sqrt (b) - double b; - #endif - { -@@ -83,7 +83,7 @@ __ieee754_sqrt (b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -@@ -132,4 +132,12 @@ __ieee754_sqrt (b) - } - return f_wash (b); - } -+ -+#undef __ieee754_sqrt -+double -+__ieee754_sqrt (double x) -+{ -+ return __slow_ieee754_sqrt (x); -+} -+ - strong_alias (__ieee754_sqrt, __sqrt_finite) -diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -index 9d175122a8..10de1f0cc3 100644 ---- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c -@@ -39,10 +39,10 @@ static const float threehalf = 1.5; - - #ifdef __STDC__ - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - #else - float --__ieee754_sqrtf (b) -+__slow_ieee754_sqrtf (b) - float b; - #endif - { -@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) - } - return f_washf (b); - } -+ -+#undef __ieee754_sqrtf -+float -+__ieee754_sqrtf (float x) -+{ -+ return __slow_ieee754_sqrtf (x); -+} -+ - 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..8b79916b81 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 @@ -From 060ba13b5ac5e90517d540f009ebdcdcf62f9685 Mon Sep 17 00:00:00 2001 +From 8216e0927262392f3b60a5cc5592d39c9f18ef3c Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:42:58 +0000 Subject: [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 @@ -From 297bac9429260f8df495b81d3fae8ae4c6913f5f Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:20:09 +0000 -Subject: [PATCH] Quote from bug 1443 which explains what the patch does : - - We build some random program and link it with -lust. When we run it, - it dies with a SIGSEGV before reaching main(). - - Libust.so depends on liburcu-bp.so from the usermode-rcu package. - Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this - is critical. - - Libust.so uses a TLS / __thread variable that is defined in liburcu- - bp.so. There are special ARM-specific relocation types that allow two - shared libraries to share thread-specific data. This is critical too. - - One more critical issue: although liburcu-bp.so is prelinked, we can't - load it at its prelinked address, because we also link against - librt.so, and librt.so uses that address. - - The dynamic linker is forced to relink liburcu-bp.so at a different - address. In the course of relinking, it processes the special ARM - relocation record mentioned above. The prelinker has already filled - in the information, which is a short offset into a table of thread- - specific data that is allocated per-thread for each library that uses - TLS. Because the normal behavior of a relocation is to add the symbol - value to an addend stored at the address being relocated, we end up - adding the short offset to itself, doubling it. - - Now we have an awkward situation. The libust.so library doesn't know - about the addend, so its TLS data for this element is correct. The - liburcu-bp.so library has a different offset for the element. When we - go to initialize the element for the first time in liburcu-bp.so, we - write the address of the result at the doubled (broken) offset. - Later, when we refer to the address from libust.so, we check the value - at the correct offset, but it's NULL, so we eat hot SIGSEGV. - -Upstream-Status: Pending - -Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/arm/dl-machine.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h -index ff5e09e207..d68bfe5cbe 100644 ---- a/sysdeps/arm/dl-machine.h -+++ b/sysdeps/arm/dl-machine.h -@@ -510,7 +510,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, - - case R_ARM_TLS_DTPOFF32: - if (sym != NULL) -- *reloc_addr += sym->st_value; -+ *reloc_addr = sym->st_value; - break; - - 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..0275133790 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 @@ -From f13c2f525e9bc82ce13e4cf486f7fe0831fc3fac Mon Sep 17 00:00:00 2001 +From bd4b95bcc335599e736a3554112f1e912a79542b Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:49:28 +0000 Subject: [PATCH] eglibc: Help bootstrap cross toolchain @@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> create mode 100644 include/stubs-bootstrap.h diff --git a/Makefile b/Makefile -index 50f99ca611..31eed15f02 100644 +index c84f266ce7..790c717958 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,18 @@ subdir-dirs = include @@ -52,7 +52,7 @@ index 50f99ca611..31eed15f02 100644 ifeq (yes,$(build-shared)) headers += gnu/lib-names.h endif -@@ -416,6 +425,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh +@@ -421,6 +430,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) @@ -69,7 +69,7 @@ index 50f99ca611..31eed15f02 100644 ifndef abi-variants installed-stubs = $(inst_includedir)/gnu/stubs.h else -@@ -442,6 +461,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) +@@ -447,6 +466,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) install-others-nosubdir: $(installed-stubs) 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..91e52a0db9 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 @@ -From 330c4e50e28e29c31fb8d6ab39cdbb2af4d3def7 Mon Sep 17 00:00:00 2001 +From ab08ea10e9bc8a91f83fea12ccf40abf1a150326 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:55:53 +0000 Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4 @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 2 files changed, 12 insertions(+) diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions -index e0938c4165..ca1d7da339 100644 +index 3ad702e165..931985b5d6 100644 --- a/sysdeps/unix/sysv/linux/sh/Versions +++ b/sysdeps/unix/sysv/linux/sh/Versions -@@ -2,6 +2,7 @@ libc { +@@ -3,6 +3,7 @@ libc { GLIBC_2.2 { # functions used in other libraries __xstat64; __fxstat64; __lxstat64; @@ -33,7 +33,7 @@ index e0938c4165..ca1d7da339 100644 # a* alphasort64; diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S -index a18fbb2e8b..59421bfbb0 100644 +index d5d8c5e033..f356d02077 100644 --- a/sysdeps/unix/sysv/linux/sh/sysdep.S +++ b/sysdeps/unix/sysv/linux/sh/sysdep.S @@ -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 @@ -From f389babf3c920e68b7d7391556a78ebf62a21ebe Mon Sep 17 00:00:00 2001 -From: Ting Liu <b28495@freescale.com> -Date: Wed, 19 Dec 2012 04:39:57 -0600 -Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S} - -libm-err-tab.pl will parse all the files named "libm-test-ulps" -in the given dir recursively. To avoid parsing the one in -${S}/.pc/ (it does exist after eglibc adds aarch64 support, -${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/ -aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs -in ${S}. - -Upstream-Status: inappropriate [OE specific] - -Signed-off-by: Ting Liu <b28495@freescale.com> ---- - manual/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/manual/Makefile b/manual/Makefile -index e83444341e..aa2645bc55 100644 ---- a/manual/Makefile -+++ b/manual/Makefile -@@ -103,7 +103,8 @@ $(objpfx)stamp-libm-err: $(..)math/gen-libm-test.py \ - $(wildcard $(foreach dir,$(sysdirs),\ - $(dir)/libm-test-ulps)) - pwd=`pwd`; \ -- $(PYTHON) $< -s $$pwd/.. -m $(objpfx)libm-err-tmp -+ $(PYTHON) $< -s $$pwd/../ports -m $(objpfx)libm-err-tmp -+ $(PYTHON) $< -s $$pwd/../sysdeps -m $(objpfx)libm-err-tmp - $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi - touch $@ - 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 @@ -From 4b0d41a315e66f688fef7b0c2e2b6ce9fa16ec93 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:24:46 +0000 -Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out - __slow versions - -Upstream-Status: Pending - -Signed-off-by: chunrong guo <B40290@freescale.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 6 +++--- - sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++-- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -index 1c34244bd8..7038a70b47 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c -@@ -41,10 +41,10 @@ static const float half = 0.5; - - #ifdef __STDC__ - double --__ieee754_sqrt (double b) -+__slow_ieee754_sqrt (double b) - #else - double --__ieee754_sqrt (b) -+__slow_ieee754_sqrt (b) - double b; - #endif - { -@@ -83,7 +83,7 @@ __ieee754_sqrt (b) - - /* Handle small numbers by scaling. */ - if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) -- return __ieee754_sqrt (b * two108) * twom54; -+ return __slow_ieee754_sqrt (b * two108) * twom54; - - #define FMADD(a_, c_, b_) \ - ({ double __r; \ -diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -index 812653558f..10de1f0cc3 100644 ---- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c -@@ -39,10 +39,10 @@ static const float threehalf = 1.5; - - #ifdef __STDC__ - float --__ieee754_sqrtf (float b) -+__slow_ieee754_sqrtf (float b) - #else - float --__ieee754_sqrtf (b) -+__slow_ieee754_sqrtf (b) - float b; - #endif - { 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..ae14ba82db 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 @@ -From 557ed640b26bd208ce8d4a6fd725b124893668d7 Mon Sep 17 00:00:00 2001 +From ae0b0897228da4c8815061fe57d9b31c2b742dbc Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:33:49 +0000 Subject: [PATCH] eglibc: Forward port cross locale generation support @@ -7,7 +7,7 @@ Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - locale/Makefile | 3 +- + locale/Makefile | 1 + locale/catnames.c | 46 +++++++++++++++++++++++++++ locale/localeinfo.h | 2 +- locale/programs/charmap-dir.c | 6 ++++ @@ -19,23 +19,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> locale/programs/locfile.c | 5 ++- locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++-- locale/setlocale.c | 29 ----------------- - 12 files changed, 167 insertions(+), 68 deletions(-) + 12 files changed, 166 insertions(+), 67 deletions(-) create mode 100644 locale/catnames.c diff --git a/locale/Makefile b/locale/Makefile -index b7c60681fa..07c606cde3 100644 +index 2810f28605..05f847f9a6 100644 --- a/locale/Makefile +++ b/locale/Makefile -@@ -26,7 +26,8 @@ headers = langinfo.h locale.h bits/locale.h \ - bits/types/locale_t.h bits/types/__locale_t.h - routines = setlocale findlocale loadlocale loadarchive \ - localeconv nl_langinfo nl_langinfo_l mb_cur_max \ -- newlocale duplocale freelocale uselocale -+ newlocale duplocale freelocale uselocale \ -+ catnames - tests = tst-C-locale tst-locname tst-duplocale - tests-container = tst-localedef-path-norm - categories = ctype messages monetary numeric time paper name \ +@@ -30,6 +30,7 @@ headers = \ + locale.h \ + # headers + routines = \ ++ catnames \ + duplocale \ + findlocale \ + freelocale \ diff --git a/locale/catnames.c b/locale/catnames.c new file mode 100644 index 0000000000..538f3f5edb @@ -89,10 +87,10 @@ index 0000000000..538f3f5edb + [LC_ALL] = sizeof ("LC_ALL") - 1 + }; diff --git a/locale/localeinfo.h b/locale/localeinfo.h -index 22f9dc1140..fa31b3c5ea 100644 +index f7efc288a5..6ef082eb25 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h -@@ -230,7 +230,7 @@ __libc_tsd_define (extern, locale_t, LOCALE) +@@ -246,7 +246,7 @@ __libc_tsd_define (extern, locale_t, LOCALE) unused. We can manage this playing some tricks with weak references. But with thread-local locale settings, it becomes quite ungainly unless we can use __thread variables. So only in that case do we attempt this. */ @@ -102,7 +100,7 @@ index 22f9dc1140..fa31b3c5ea 100644 # define NL_CURRENT_INDIRECT 1 #endif diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c -index 4841bfd05d..ffcba1fd79 100644 +index 36504f238d..56ee97e61b 100644 --- a/locale/programs/charmap-dir.c +++ b/locale/programs/charmap-dir.c @@ -18,7 +18,9 @@ @@ -148,10 +146,10 @@ index 4841bfd05d..ffcba1fd79 100644 return NULL; } diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c -index 0af21e05e2..4980b0c52f 100644 +index 5048adbd9f..4232834ead 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c -@@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen, +@@ -352,7 +352,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen, } if (wcs != NULL) { @@ -160,7 +158,7 @@ index 0af21e05e2..4980b0c52f 100644 uint32_t zero = 0; /* Handle <U0000> as a single character. */ if (nwcs == 0) -@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); +@@ -1776,8 +1776,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); if ((*eptr)->nwcs == runp->nwcs) { @@ -170,7 +168,7 @@ index 0af21e05e2..4980b0c52f 100644 if (c == 0) { -@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) +@@ -2004,9 +2003,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) one consecutive entry. */ if (runp->wcnext != NULL && runp->nwcs == runp->wcnext->nwcs @@ -183,7 +181,7 @@ index 0af21e05e2..4980b0c52f 100644 && (runp->wcs[runp->nwcs - 1] == runp->wcnext->wcs[runp->nwcs - 1] + 1)) { -@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) +@@ -2030,9 +2029,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) runp = runp->wcnext; while (runp->wcnext != NULL && runp->nwcs == runp->wcnext->nwcs @@ -197,10 +195,10 @@ index 0af21e05e2..4980b0c52f 100644 == runp->wcnext->wcs[runp->nwcs - 1] + 1)); diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c -index 2fb579bbbf..d0be99581c 100644 +index eb6e7e145c..14736d1cac 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c -@@ -915,7 +915,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap, +@@ -914,7 +914,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap, allocate_arrays (ctype, charmap, ctype->repertoire); default_missing_len = (ctype->default_missing @@ -209,7 +207,7 @@ index 2fb579bbbf..d0be99581c 100644 : 0); init_locale_data (&file, nelems); -@@ -1927,7 +1927,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, +@@ -1926,7 +1926,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, ignore = 1; else /* This value is usable. */ @@ -218,7 +216,7 @@ index 2fb579bbbf..d0be99581c 100644 first = 0; } -@@ -2461,8 +2461,8 @@ with character code range values one must use the absolute ellipsis `...'")); +@@ -2460,8 +2460,8 @@ with character code range values one must use the absolute ellipsis `...'")); } handle_tok_digit: @@ -229,7 +227,7 @@ index 2fb579bbbf..d0be99581c 100644 handle_digits = 1; goto read_charclass; -@@ -3904,8 +3904,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, +@@ -3876,8 +3876,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, while (idx < number) { @@ -239,7 +237,7 @@ index 2fb579bbbf..d0be99581c 100644 if (res == 0) { replace = 1; -@@ -3942,11 +3941,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, +@@ -3914,11 +3913,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, for (size_t cnt = 0; cnt < number; ++cnt) { struct translit_to_t *srunp; @@ -253,7 +251,7 @@ index 2fb579bbbf..d0be99581c 100644 srunp = srunp->next; } /* Plus one for the extra NUL character marking the end of -@@ -3970,18 +3969,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, +@@ -3942,18 +3941,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, ctype->translit_from_idx[cnt] = from_len; ctype->translit_to_idx[cnt] = to_len; @@ -279,10 +277,10 @@ index 2fb579bbbf..d0be99581c 100644 srunp = srunp->next; } diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c -index dcd2a2386d..6814740325 100644 +index 1abff3cf53..8a2f2b820a 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c -@@ -220,8 +220,10 @@ No definition for %s category found"), "LC_TIME"); +@@ -219,8 +219,10 @@ No definition for %s category found"), "LC_TIME"); } else { @@ -294,7 +292,7 @@ index dcd2a2386d..6814740325 100644 } } -@@ -231,7 +233,7 @@ No definition for %s category found"), "LC_TIME"); +@@ -230,7 +232,7 @@ No definition for %s category found"), "LC_TIME"); const int days_per_month[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31 ,30, 31 }; size_t idx; @@ -303,7 +301,7 @@ index dcd2a2386d..6814740325 100644 time->era_entries = (struct era_data *) xmalloc (time->num_era -@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME"); +@@ -456,18 +458,18 @@ No definition for %s category found"), "LC_TIME"); } /* Now generate the wide character name and format. */ @@ -329,7 +327,7 @@ index dcd2a2386d..6814740325 100644 } else time->era_entries[idx].wname = -@@ -527,7 +529,16 @@ No definition for %s category found"), "LC_TIME"); +@@ -526,7 +528,16 @@ No definition for %s category found"), "LC_TIME"); if (time->date_fmt == NULL) time->date_fmt = "%a %b %e %H:%M:%S %Z %Y"; if (time->wdate_fmt == NULL) @@ -348,23 +346,23 @@ index dcd2a2386d..6814740325 100644 diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c -index 96d3ab66db..3af379d2c3 100644 +index 61373d2657..7ec5726377 100644 --- a/locale/programs/linereader.c +++ b/locale/programs/linereader.c -@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap, +@@ -776,7 +776,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap, { int return_widestr = lr->return_widestr; - char *buf; + struct lr_buffer lrb; - wchar_t *buf2 = NULL; + uint32_t *buf2 = NULL; - size_t bufact; - size_t bufmax = 56; + + lr_buffer_init (&lrb); diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c -index 832c8fd1fc..fe689b3ae1 100644 +index 907bb5fb25..3106529043 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c -@@ -109,6 +109,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +@@ -108,6 +108,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; #define OPT_NO_WARN 402 #define OPT_WARN 403 #define OPT_NO_HARD_LINKS 404 @@ -372,7 +370,7 @@ index 832c8fd1fc..fe689b3ae1 100644 /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = -@@ -153,6 +154,8 @@ static const struct argp_option options[] = +@@ -152,6 +153,8 @@ static const struct argp_option options[] = N_("Generate little-endian output") }, { "big-endian", OPT_BIG_ENDIAN, NULL, 0, N_("Generate big-endian output") }, @@ -381,7 +379,7 @@ index 832c8fd1fc..fe689b3ae1 100644 { NULL, 0, NULL, 0, NULL } }; -@@ -243,12 +246,14 @@ main (int argc, char *argv[]) +@@ -242,12 +245,14 @@ main (int argc, char *argv[]) ctype locale. (P1003.2 4.35.5.2) */ setlocale (LC_CTYPE, "POSIX"); @@ -396,7 +394,7 @@ index 832c8fd1fc..fe689b3ae1 100644 /* Process charmap file. */ charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1); -@@ -400,6 +405,9 @@ parse_opt (int key, char *arg, struct argp_state *state) +@@ -399,6 +404,9 @@ parse_opt (int key, char *arg, struct argp_state *state) /* Do not hard link to other locales. */ hard_links = false; break; @@ -407,10 +405,10 @@ index 832c8fd1fc..fe689b3ae1 100644 force_output = 1; break; diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c -index 0f1affa1d4..7d86fae801 100644 +index 6c6ebf2dd6..cc02ab82bf 100644 --- a/locale/programs/locfile.c +++ b/locale/programs/locfile.c -@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size, +@@ -543,6 +543,9 @@ compare_files (const char *filename1, const char *filename2, size_t size, machine running localedef. */ bool swap_endianness_p; @@ -420,7 +418,7 @@ index 0f1affa1d4..7d86fae801 100644 /* When called outside a start_locale_structure/end_locale_structure or start_locale_prelude/end_locale_prelude block, record that the next byte in FILE's obstack will be the first byte of a new element. -@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string) +@@ -620,7 +623,7 @@ add_locale_string (struct locale_file *file, const char *string) void add_locale_wstring (struct locale_file *file, const uint32_t *string) { @@ -430,10 +428,10 @@ index 0f1affa1d4..7d86fae801 100644 /* Record that FILE's next element is the 32-bit integer VALUE. */ diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h -index c986d599ec..222a779176 100644 +index 3afb0a8d29..46785374e8 100644 --- a/locale/programs/locfile.h +++ b/locale/programs/locfile.h -@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions, +@@ -70,6 +70,8 @@ extern void write_all_categories (struct localedef_t *definitions, extern bool swap_endianness_p; @@ -442,7 +440,7 @@ index c986d599ec..222a779176 100644 /* Change the output to be big-endian if BIG_ENDIAN is true and little-endian otherwise. */ static inline void -@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value) +@@ -88,7 +90,8 @@ maybe_swap_uint32 (uint32_t value) } /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */ @@ -452,7 +450,7 @@ index c986d599ec..222a779176 100644 maybe_swap_uint32_array (uint32_t *array, size_t n) { if (swap_endianness_p) -@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n) +@@ -98,7 +101,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n) /* Like maybe_swap_uint32_array, but the array of N elements is at the end of OBSTACK's current object. */ @@ -462,7 +460,7 @@ index c986d599ec..222a779176 100644 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n) { maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n); -@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale, +@@ -275,4 +279,55 @@ extern void identification_output (struct localedef_t *locale, const struct charmap_t *charmap, const char *output_path); @@ -519,7 +517,7 @@ index c986d599ec..222a779176 100644 + #endif /* locfile.h */ diff --git a/locale/setlocale.c b/locale/setlocale.c -index 19ed85ae8e..f28ca11446 100644 +index 7bd27e5398..2f194bad7c 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -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..94d5abf72f 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 @@ -From 2ec233ce078b74030de9195096058cd502fdc395 Mon Sep 17 00:00:00 2001 +From ccac9ff221fa08dbe330ae75a570da33edaaac4e Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 3 Aug 2018 09:42:06 -0700 Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c -index 6bb189ae37..0711c5c44e 100644 +index 8d79a1b6d1..6dc7ecd4e7 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c -@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) +@@ -339,12 +339,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) struct namehashent *oldnamehashtab; struct locarhandle new_ah; size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; @@ -51,7 +51,7 @@ index 6bb189ae37..0711c5c44e 100644 strcpy (stpcpy (fname, archivefname), ".XXXXXX"); /* Not all of the old file has to be mapped. Change this now this -@@ -569,10 +581,13 @@ open_archive (struct locarhandle *ah, bool readonly) +@@ -568,10 +580,13 @@ open_archive (struct locarhandle *ah, bool readonly) /* If ah has a non-NULL fname open that otherwise open the default. */ if (archivefname == NULL) { @@ -69,7 +69,7 @@ index 6bb189ae37..0711c5c44e 100644 } while (1) -@@ -585,7 +600,7 @@ open_archive (struct locarhandle *ah, bool readonly) +@@ -584,7 +599,7 @@ open_archive (struct locarhandle *ah, bool readonly) the default locale archive we ignore the failure and list an empty archive, otherwise we print an error 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..51d152f8c0 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 @@ -From 5cc14938f05ae1354c8062f017a21f39d5fc9729 Mon Sep 17 00:00:00 2001 +From e79835037312f8d58c8c555e1ebf5746e09d10cd Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 7 Aug 2020 14:31:16 -0700 Subject: [PATCH] powerpc: Do not ask compiler for finding arch @@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure -index dfe8e20399..bbff040f0f 100644 +index 9e5a07ab6d..a308bdd863 100644 --- a/sysdeps/powerpc/preconfigure +++ b/sysdeps/powerpc/preconfigure @@ -29,10 +29,7 @@ esac @@ -31,7 +31,7 @@ index dfe8e20399..bbff040f0f 100644 # directory exists in sysdeps/powerpc. Likewise, if we find a # cpu, don't let the generic configure append extra compiler options. diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac -index 6c63bd8257..3e925f1d48 100644 +index 14b6dafd4a..1acc6a457c 100644 --- a/sysdeps/powerpc/preconfigure.ac +++ b/sysdeps/powerpc/preconfigure.ac @@ -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 @@ -From 3feb4213628f1485000ffe1d3fd26e37a7b14336 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:33:03 +0000 -Subject: [PATCH] timezone: re-written tzselect as posix sh - -To avoid the bash dependency. - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - timezone/Makefile | 2 +- - timezone/tzselect.ksh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/timezone/Makefile b/timezone/Makefile -index 395abfeebd..2d939edf75 100644 ---- a/timezone/Makefile -+++ b/timezone/Makefile -@@ -123,7 +123,7 @@ $(testdata)/XT%: testdata/XT% - cp $< $@ - - $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make -- sed -e 's|/bin/bash|$(BASH)|' \ -+ sed -e 's|/bin/bash|/bin/sh|' \ - -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \ - -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ - -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ -diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh -index 18fce27e24..70745f9d36 100755 ---- a/timezone/tzselect.ksh -+++ b/timezone/tzselect.ksh -@@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org - - # Specify default values for environment variables if they are unset. - : ${AWK=awk} --: ${TZDIR=`pwd`} -+: ${TZDIR=$(pwd)} - - # Output one argument as-is to standard output. - # 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..87bc7a840e --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch @@ -0,0 +1,79 @@ +From 4dd93c44d85ad04343daa9933edfb6ae59863095 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 15 May 2020 17:05:45 -0700 +Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64 + +This helps OE multilibs to not sythesize this header which causes all +kind of recursions and other issues since wordsize is fundamental header +and ends up including itself in many case e.g. clang tidy, bpf etc. + +Upstream-Status: Inappropriate [ OE-Specific ] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/aarch64/bits/wordsize.h | 11 +++++++++-- + sysdeps/arm/bits/wordsize.h | 22 +--------------------- + 2 files changed, 10 insertions(+), 23 deletions(-) + mode change 100644 => 120000 sysdeps/arm/bits/wordsize.h + +diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h +index 118e59172d..c6278c6afa 100644 +--- a/sysdeps/aarch64/bits/wordsize.h ++++ b/sysdeps/aarch64/bits/wordsize.h +@@ -17,12 +17,19 @@ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +-#ifdef __LP64__ ++#if defined (__aarch64__) && defined (__LP64__) + # define __WORDSIZE 64 +-#else ++#elif defined (__aarch64__) + # define __WORDSIZE 32 + # define __WORDSIZE32_SIZE_ULONG 1 + # define __WORDSIZE32_PTRDIFF_LONG 1 ++#else ++# define __WORDSIZE 32 ++# define __WORDSIZE_TIME64_COMPAT32 1 ++# define __WORDSIZE32_SIZE_ULONG 0 ++# define __WORDSIZE32_PTRDIFF_LONG 0 + #endif + ++#ifdef __aarch64__ + #define __WORDSIZE_TIME64_COMPAT32 0 ++#endif +diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h +deleted file mode 100644 +index 6ecbfe7c86..0000000000 +--- a/sysdeps/arm/bits/wordsize.h ++++ /dev/null +@@ -1,21 +0,0 @@ +-/* Copyright (C) 1999-2024 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- <https://www.gnu.org/licenses/>. */ +- +-#define __WORDSIZE 32 +-#define __WORDSIZE_TIME64_COMPAT32 1 +-#define __WORDSIZE32_SIZE_ULONG 0 +-#define __WORDSIZE32_PTRDIFF_LONG 0 +diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h +new file mode 120000 +index 0000000000..4c4a788ec2 +--- /dev/null ++++ b/sysdeps/arm/bits/wordsize.h +@@ -0,0 +1 @@ ++../../aarch64/bits/wordsize.h +\ 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..ff60c00102 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 @@ -From f6119b98a9caa80642d69a97edc98f57ecef5c3c Mon Sep 17 00:00:00 2001 +From 0a29c4828c2440bf4768f4342480958a67d58954 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Thu, 31 Dec 2015 14:33:02 -0800 -Subject: [PATCH] Remove bash dependency for nscd init script +Subject: [PATCH] Replace echo with printf builtin in nscd init script -The nscd init script uses #! /bin/bash but only really uses one bashism -(translated strings), so remove them and switch the shell to #!/bin/sh. +The nscd init script calls for #! /bin/bash interpreter +since it uses bash specific extentions namely (translated strings) +and echo -n command, replace echo with printf and +switch the shell interpreter to #!/bin/sh. Upstream-Status: Pending - -Signed-off-by: Ross Burton <ross.burton@intel.com> +Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - nscd/nscd.init | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) + nscd/nscd.init | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nscd/nscd.init b/nscd/nscd.init -index a882da7d8b..b02986ec15 100644 +index a882da7d8b..857b541381 100644 --- a/nscd/nscd.init +++ b/nscd/nscd.init @@ -1,4 +1,4 @@ @@ -24,25 +25,27 @@ index a882da7d8b..b02986ec15 100644 # # nscd: Starts the Name Switch Cache Daemon # -@@ -49,7 +49,7 @@ prog=nscd +@@ -49,16 +49,16 @@ prog=nscd start () { [ -d /var/run/nscd ] || mkdir /var/run/nscd [ -d /var/db/nscd ] || mkdir /var/db/nscd - echo -n $"Starting $prog: " -+ echo -n "Starting $prog: " ++ printf "Starting $prog: " daemon /usr/sbin/nscd RETVAL=$? - echo -@@ -58,7 +58,7 @@ start () { +- echo ++ printf "\n" + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd + return $RETVAL } stop () { - echo -n $"Stopping $prog: " -+ echo -n "Stopping $prog: " ++ printf "Stopping $prog: " /usr/sbin/nscd -K RETVAL=$? if [ $RETVAL -eq 0 ]; then -@@ -67,9 +67,9 @@ stop () { +@@ -67,11 +67,11 @@ stop () { # a non-privileged user rm -f /var/run/nscd/nscd.pid rm -f /var/run/nscd/socket @@ -52,21 +55,25 @@ index a882da7d8b..b02986ec15 100644 - failure $"$prog shutdown" + failure "$prog shutdown" fi - echo +- echo ++ printf "\n" return $RETVAL + } + @@ -103,13 +103,13 @@ case "$1" in RETVAL=$? ;; force-reload | reload) - echo -n $"Reloading $prog: " -+ echo -n "Reloading $prog: " ++ printf "Reloading $prog: " killproc /usr/sbin/nscd -HUP RETVAL=$? - echo +- echo ++ printf "\n" ;; *) - echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" -+ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" ++ printf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n" RETVAL=1 ;; 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..e4bc40b123 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 @@ -From c062a462fee53a30a85d693c8288b5bd8fe4ec6e Mon Sep 17 00:00:00 2001 +From 1b1e654726931c27c86cf9c68371c32410f8d766 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:27:10 +0000 -Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly - $libc_cv_rootsbindir +Subject: [PATCH] sysdeps/gnu/configure.ac: Set libc_cv_rootsbindir only if its + empty -Upstream-Status:Pending +This ensures that it can be set in build environment +Upstream-Status: Pending Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- @@ -14,19 +15,20 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure -index c15d1087e8..37cc983f2a 100644 +index 18c9d7945a..ef22cc845d 100644 --- a/sysdeps/gnu/configure +++ b/sysdeps/gnu/configure -@@ -32,6 +32,6 @@ case "$prefix" in +@@ -32,7 +32,7 @@ case "$prefix" in else libc_cv_localstatedir=$localstatedir fi - libc_cv_rootsbindir=/sbin -+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin ++ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin} ;; esac + diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac -index 634fe4de2a..3db1697f4f 100644 +index 634fe4de2a..492112e0fd 100644 --- a/sysdeps/gnu/configure.ac +++ b/sysdeps/gnu/configure.ac @@ -21,6 +21,6 @@ case "$prefix" in @@ -34,6 +36,6 @@ index 634fe4de2a..3db1697f4f 100644 libc_cv_localstatedir=$localstatedir fi - libc_cv_rootsbindir=/sbin -+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin ++ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin} ;; 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..24dd4dad56 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch @@ -0,0 +1,47 @@ +From 99aac9db31f52c3b59b32c424b26d881069aa5df Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 9 Dec 2021 15:14:42 -0800 +Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh + +define new macro called KSHELL which can be used to define default shell +use Bash by default + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makeconfig | 9 +++++++++ + timezone/Makefile | 1 + + 2 files changed, 10 insertions(+) + +diff --git a/Makeconfig b/Makeconfig +index 2d4343b604..1992e19c4e 100644 +--- a/Makeconfig ++++ b/Makeconfig +@@ -309,6 +309,15 @@ ifndef sysincludedir + sysincludedir = /usr/include + endif + ++# The full path name of a Posix-compliant shell, preferably one that supports ++# the Korn shell's 'select' statement as an extension. ++# These days, Bash is the most popular. ++# It should be OK to set this to /bin/sh, on platforms where /bin/sh ++# lacks 'select' or doesn't completely conform to Posix, but /bin/bash ++# is typically nicer if it works. ++ifndef KSHELL ++KSHELL = /bin/bash ++endif + + # Commands to install files. + ifndef INSTALL_DATA +diff --git a/timezone/Makefile b/timezone/Makefile +index cf4ef3bf7e..559b9a7e3d 100644 +--- a/timezone/Makefile ++++ b/timezone/Makefile +@@ -143,6 +143,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make + -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ + -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ + -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ ++ -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + < $< > $@.new + chmod 555 $@.new + 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..c294dda29d --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch @@ -0,0 +1,27 @@ +From 4c68d7aa739ebd997db43d73cf2a43b776969c89 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 15 Dec 2021 21:47:53 -0800 +Subject: [PATCH] tzselect.ksh: Use /bin/sh default shell interpreter + +checkbashism reports no issues with tzselect.ksh, therefore using +/bin/sh instead of /bin/bash should be safe and portable across systems +which don't ship bash ( embedded systems ) + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org> +Cc: Paul Eggert <eggert@cs.ucla.edu> +--- + timezone/tzselect.ksh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh +index 38941bbc55..588bcb9f06 100755 +--- a/timezone/tzselect.ksh ++++ b/timezone/tzselect.ksh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # Ask the user about the time zone, and output the resulting TZ value to stdout. + # Interact with the user via stderr and stdin. + 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..6f7b765acc --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch @@ -0,0 +1,86 @@ +From 5352c59f08d8e5e1f44fb5834d6bbbd3a20bdd36 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sun, 29 Aug 2021 20:49:16 +0800 +Subject: [PATCH] fix create thread failed in unprivileged process [BZ #28287] + +Since commit [d8ea0d0168 Add an internal wrapper for clone, clone2 and clone3] +applied, start a unprivileged container (docker run without --privileged), +it creates a thread failed in container. + +In commit d8ea0d0168, it calls __clone3 if HAVE_CLONE3_WAPPER is defined. If +__clone3 returns -1 with ENOSYS, fall back to clone or clone2. + +As known from [1], cloneXXX fails with EPERM if CLONE_NEWCGROUP, +CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, or CLONE_NEWUTS +was specified by an unprivileged process (process without CAP_SYS_ADMIN) + +[1] https://man7.org/linux/man-pages/man2/clone3.2.html + +So if __clone3 returns -1 with EPERM, fall back to clone or clone2 could +fix the issue. Here are the test steps: + +1) Prepare test code +cat > conftest.c <<ENDOF + #include <pthread.h> + #include <stdio.h> + +int check_me = 0; +void* func(void* data) {check_me = 42; printf("start thread: check_me %d\n", check_me); return &check_me;} +int main() +{ + pthread_t t; + void *ret; + pthread_create (&t, 0, func, 0); + pthread_join (t, &ret); + printf("check_me %d, p %p\n", check_me, &ret); + return (check_me != 42 || ret != &check_me); +} + +ENDOF + +2) Compile +gcc -o conftest -pthread conftest.c + +3) Start a container with glibc 2.34 installed +[skip details] +docker run -it <container-image-name> bash + +4) Run conftest without this patch +$ ./conftest +check_me 0, p 0x7ffd91ccd400 + +5) Run conftest with this patch +$ ./conftest +start thread: check_me 42 +check_me 42, p 0x7ffe253c6f20 + +Upstream-Status: Inappropriate [Rejected by upstream] + +Upstream glibc rejected it because the latest docker has resolved the issue [1], +and upstream glibc does not backward compatibility with old docker[2] + +In order to build Yocto with uninative in old docker, we need this local +patch + +[1] https://github.com/moby/moby/commit/9f6b562dd12ef7b1f9e2f8e6f2ab6477790a6594 +[2] https://sourceware.org/pipermail/libc-alpha/2021-August/130590.html + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/unix/sysv/linux/clone-internal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c +index 40ef30303f..f97b1f6900 100644 +--- a/sysdeps/unix/sysv/linux/clone-internal.c ++++ b/sysdeps/unix/sysv/linux/clone-internal.c +@@ -98,7 +98,7 @@ __clone_internal (struct clone_args *cl_args, + #ifdef HAVE_CLONE3_WRAPPER + int saved_errno = errno; + int ret = __clone3_internal (cl_args, func, arg); +- if (ret != -1 || errno != ENOSYS) ++ if (ret != -1 || (errno != ENOSYS && errno != EPERM)) + return ret; + + /* 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..f8e73662e7 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch @@ -0,0 +1,32 @@ +From 51694f72b7326d36e51214eb2af0be1d6831c7a4 Mon Sep 17 00:00:00 2001 +From: Richard Purdie <richard.purdie@linuxfoundation.org> +Date: Sun, 24 Jul 2022 07:07:29 -0700 +Subject: [PATCH] Avoid hardcoded build time paths in the output binaries + +replace the compile definitions with the output locations. + +Upstream-Status: Inappropriate [would need reworking somehow to be acceptable upstream] + +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + support/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/support/Makefile b/support/Makefile +index aa57207bdc..3c66cec6c8 100644 +--- a/support/Makefile ++++ b/support/Makefile +@@ -229,9 +229,9 @@ libsupport-inhibit-o += .o + endif + + CFLAGS-support_paths.c = \ +- -DSRCDIR_PATH=\"`cd .. ; pwd`\" \ +- -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \ +- -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \ ++ -DSRCDIR_PATH=\"$(oe_srcdir)\" \ ++ -DOBJDIR_PATH=\"$(libdir)/glibc-tests/ptest/tests/glibc-ptest\" \ ++ -DOBJDIR_ELF_LDSO_PATH=\"$(slibdir)/$(rtld-installed-name)\" \ + -DINSTDIR_PATH=\"$(prefix)\" \ + -DLIBDIR_PATH=\"$(libdir)\" \ + -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 @@ -From c8df3cf4556d8d78a98675865395ce42f3b67109 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 20 Apr 2016 21:11:00 -0700 -Subject: [PATCH] Define DUMMY_LOCALE_T if not defined - -This is a hack to fix building the locale bits on an older -CentOs 5.X machine - -Upstream-Status: Inappropriate [other] - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - locale/programs/config.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/locale/programs/config.h b/locale/programs/config.h -index 2edcf3696c..5350101e38 100644 ---- a/locale/programs/config.h -+++ b/locale/programs/config.h -@@ -19,6 +19,9 @@ - #ifndef _LD_CONFIG_H - #define _LD_CONFIG_H 1 - -+#ifndef DUMMY_LOCALE_T -+#define DUMMY_LOCALE_T -+#endif - /* Use the internal textdomain used for libc messages. */ - #define PACKAGE _libc_intl_domainname - #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..256dab45f9 --- /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 @@ +From 19795af92830251dd03943bda4825def5bf774c4 Mon Sep 17 00:00:00 2001 +From: Yash Shinde <Yash.Shinde@windriver.com> +Date: Fri, 5 Apr 2024 08:24:36 -0700 +Subject: [PATCH] tests: Skip 2 qemu tests that can hang in oe-selftest + +qemumips and qemuppc were leaving stale processes behind after +running glibc oe-selftest. During analysis, it was found that +it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests. +Disable them so that there are no stale processes left behind. + +[YOCTO #15423] +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423 + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/unix/sysv/linux/Makefile | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile +index ae66590e91..b2f0469273 100644 +--- a/sysdeps/unix/sysv/linux/Makefile ++++ b/sysdeps/unix/sysv/linux/Makefile +@@ -223,7 +223,6 @@ tests += \ + tst-process_mrelease \ + tst-quota \ + tst-rlimit-infinity \ +- tst-scm_rights \ + tst-sigtimedwait \ + tst-sync_file_range \ + tst-sysconf-iov_max \ +@@ -234,6 +233,8 @@ tests += \ + tst-timerfd \ + tst-ttyname-direct \ + tst-ttyname-namespace \ ++ # Skip this test to avoid stale qemu process ++ # tst-scm_rights \ + # tests + + # process_madvise requires CAP_SYS_ADMIN. +@@ -271,9 +272,10 @@ tests-time64 += \ + tst-ntp_gettimex-time64 \ + tst-ppoll-time64 \ + tst-prctl-time64 \ +- tst-scm_rights-time64 \ + tst-sigtimedwait-time64 \ + tst-timerfd-time64 \ ++ # Skip this test to avoid stale qemu process ++ # tst-scm_rights-time64 \ + # tests-time64 + + 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 @@ -From f8289aa320b00f6db43213979cceab2325a7a611 Mon Sep 17 00:00:00 2001 -From: Mark Hatle <mark.hatle@windriver.com> -Date: Thu, 18 Aug 2016 14:07:58 -0500 -Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first - -According to the ELF specification: - -When resolving symbolic references, the dynamic linker examines the symbol -tables with a breadth-first search. - -This function was using a depth first search. By doing so the conflict -resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set) -was incorrect. This caused problems when their were various circular -dependencies between libraries. The problem usually manifested itself by -the wrong IFUNC being executed. - -[BZ# 20488] - -Upstream-Status: Submitted [libc-alpha] - -Signed-off-by: Mark Hatle <mark.hatle@windriver.com> ---- - elf/dl-deps.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/elf/dl-deps.c b/elf/dl-deps.c -index 087a49b212..c09f9334f2 100644 ---- a/elf/dl-deps.c -+++ b/elf/dl-deps.c -@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map) - { - struct link_map **p = list; - struct link_map **q; -+ struct link_map **r; - - *p++ = map; - map->l_reserved = 1; -- if (map->l_initfini) -- for (q = map->l_initfini + 1; *q; ++q) -- if (! (*q)->l_reserved) -- p += _dl_build_local_scope (p, *q); -+ -+ for (r = list; r < p; ++r) -+ if ((*r)->l_initfini) -+ for (q = (*r)->l_initfini + 1; *q; ++q) -+ if (! (*q)->l_reserved) -+ { -+ *p++ = *q; -+ (*q)->l_reserved = 1; -+ } - return p - list; - } - 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 @@ -From 3156464f9a95bf1dafd2e22d19d7bf89c520acc1 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 3 Aug 2018 09:44:00 -0700 -Subject: [PATCH] intl: Emit no lines in bison generated files - -Improve reproducibility: -Do not put any #line preprocessor commands in bison generated files. -These lines contain absolute paths containing file locations on -the host build machine. - -Upstream-Status: Pending - -Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - intl/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/intl/Makefile b/intl/Makefile -index 93478d87e8..b27a7935eb 100644 ---- a/intl/Makefile -+++ b/intl/Makefile -@@ -155,7 +155,7 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out - - CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \ - -D'LOCALE_ALIAS_PATH="$(localedir)"' --BISONFLAGS = --yacc --name-prefix=__gettext --output -+BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output - - $(inst_localedir)/locale.alias: locale.alias $(+force) - $(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 @@ -From 881f5b8134afd9a30049b93fc79dda7a44947a5f Mon Sep 17 00:00:00 2001 -From: Martin Jansa <martin.jansa@gmail.com> -Date: Mon, 17 Dec 2018 21:36:18 +0000 -Subject: [PATCH] locale: prevent maybe-uninitialized errors with -Os [BZ - #19444] - -Fixes following error when building for aarch64 with -Os: -| In file included from strcoll_l.c:43: -| strcoll_l.c: In function '__strcoll_l': -| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized] -| int_fast32_t i = table[*(*cpp)++]; -| ^~~~~~~~~ -| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here -| coll_seq seq1, seq2; -| ^~~~ -| In file included from strcoll_l.c:43: -| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized] -| int_fast32_t i = table[*(*cpp)++]; -| ^~~~~~~~~ -| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here -| coll_seq seq1, seq2; -| ^~~~ - - Partial fix for [BZ #19444] - * locale/weight.h: Fix build with -Os. - -Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1014766] - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - locale/weight.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/locale/weight.h b/locale/weight.h -index 723e1fefda..f5798d379a 100644 ---- a/locale/weight.h -+++ b/locale/weight.h -@@ -28,7 +28,14 @@ findidx (const int32_t *table, - const unsigned char *extra, - const unsigned char **cpp, size_t len) - { -+ /* With GCC 8 when compiling with -Os the compiler warns that -+ seq1.back_us and seq2.back_us might be used uninitialized. -+ This uninitialized use is impossible for the same reason -+ as described in comments in locale/weightwc.h. */ -+ DIAG_PUSH_NEEDS_COMMENT; -+ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); - int_fast32_t i = table[*(*cpp)++]; -+ DIAG_POP_NEEDS_COMMENT; - const unsigned char *cp; - const unsigned char *usrc; - 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 @@ -From b4e0a034b12b313dcb82d22341bef6a66b3e9ef9 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 18 Mar 2015 00:11:22 +0000 -Subject: [PATCH] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known names - -This bolts in a hook for OE to pass its own version of interpreter -names into glibc especially for multilib case, where it differs from any -other distros - -Upstream-Status: Inappropriate [OE specific] - -Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - elf/readlib.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/elf/readlib.c b/elf/readlib.c -index 7383c23249..e97ea9449d 100644 ---- a/elf/readlib.c -+++ b/elf/readlib.c -@@ -51,6 +51,7 @@ static struct known_names interpreters[] = - #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES - SYSDEP_KNOWN_INTERPRETER_NAMES - #endif -+ OECORE_KNOWN_INTERPRETER_NAMES - }; - - 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 @@ -From 2ae3ff3ae28abb1d0d100b4722da7ff188de9a30 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 15 May 2020 17:05:45 -0700 -Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64 - -This helps OE multilibs to not sythesize this header which causes all -kind of recursions and other issues since wordsize is fundamental header -and ends up including itself in many case e.g. clang tidy, bpf etc. - -Upstream-Status: Inappropriate [ OE-Specific ] - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - sysdeps/aarch64/bits/wordsize.h | 8 ++++++-- - sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++--- - 2 files changed, 13 insertions(+), 5 deletions(-) - copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%) - -diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h -index 91da566b74..9a754514b3 100644 ---- a/sysdeps/aarch64/bits/wordsize.h -+++ b/sysdeps/aarch64/bits/wordsize.h -@@ -17,12 +17,16 @@ - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - --#ifdef __LP64__ -+#if defined (__aarch64__) && defined (__LP64__) - # define __WORDSIZE 64 --#else -+#elif defined (__aarch64__) - # define __WORDSIZE 32 - # define __WORDSIZE32_SIZE_ULONG 1 - # define __WORDSIZE32_PTRDIFF_LONG 1 -+#else -+# define __WORDSIZE 32 -+# define __WORDSIZE32_SIZE_ULONG 0 -+# define __WORDSIZE32_PTRDIFF_LONG 0 - #endif - - #define __WORDSIZE_TIME64_COMPAT32 0 -diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h -similarity index 80% -copy from sysdeps/aarch64/bits/wordsize.h -copy to sysdeps/arm/bits/wordsize.h -index 91da566b74..34fcdef1f1 100644 ---- a/sysdeps/aarch64/bits/wordsize.h -+++ b/sysdeps/arm/bits/wordsize.h -@@ -1,6 +1,6 @@ - /* Determine the wordsize from the preprocessor defines. - -- Copyright (C) 2016-2021 Free Software Foundation, Inc. -+ Copyright (C) 2016-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or -@@ -17,12 +17,16 @@ - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - --#ifdef __LP64__ -+#if defined (__aarch64__) && defined (__LP64__) - # define __WORDSIZE 64 --#else -+#elif defined (__aarch64__) - # define __WORDSIZE 32 - # define __WORDSIZE32_SIZE_ULONG 1 - # define __WORDSIZE32_PTRDIFF_LONG 1 -+#else -+# define __WORDSIZE 32 -+# define __WORDSIZE32_SIZE_ULONG 0 -+# define __WORDSIZE32_PTRDIFF_LONG 0 - #endif - - #define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/meta/recipes-core/glibc/glibc/check-test-wrapper b/meta/recipes-core/glibc/glibc/check-test-wrapper index 6ec9b9b29e..5cc993f718 100644 --- a/meta/recipes-core/glibc/glibc/check-test-wrapper +++ b/meta/recipes-core/glibc/glibc/check-test-wrapper @@ -58,7 +58,7 @@ elif targettype == "ssh": user = os.environ.get("SSH_HOST_USER", None) port = os.environ.get("SSH_HOST_PORT", None) - command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no"] + command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=quiet"] if port: command += ["-p", str(port)] 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 @@ -Older seccomp-based filters used in container frameworks will block faccessat2 -calls as it's a relatively new syscall. This isn't a big problem with -glibc <2.33 but 2.33 will call faccessat2 itself, get EPERM, and thenn be confused -about what to do as EPERM isn't an expected error code. - -This manifests itself as mysterious errors, for example a kernel failing to link. - -The root cause of bad seccomp filters is mostly fixed (systemd 247, Docker 20.10.0) -but we can't expect everyone to upgrade, so add a workaound (originally from -Red Hat) to handle EPERM like ENOSYS and fallback to faccessat(). - -Upstream-Status: Inappropriate -Signed-off-by: Ross Burton <ross.burton@arm.com> - -diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c -index 56cb6dcc8b4d58d3..5de75032bbc93a2c 100644 ---- a/sysdeps/unix/sysv/linux/faccessat.c -+++ b/sysdeps/unix/sysv/linux/faccessat.c -@@ -34,7 +34,11 @@ faccessat (int fd, const char *file, int mode, int flag) - #if __ASSUME_FACCESSAT2 - return ret; - #else -- if (ret == 0 || errno != ENOSYS) -+ /* Fedora-specific workaround: -+ As a workround for a broken systemd-nspawn that returns -+ EPERM when a syscall is not allowed instead of ENOSYS -+ we must check for EPERM here and fall back to faccessat. */ -+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM)) - return ret; - - if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS)) diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest new file mode 100755 index 0000000000..cb71c75682 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/run-ptest @@ -0,0 +1,37 @@ +#!/bin/bash +# ptest script for glibc - to run time related tests to +# facilitate Y2038 validation +# Run with 'ptest-runner glibc-tests' + +output() { + retcode=$? + if [ $retcode -eq 0 ] + then echo "PASS: $i" + elif [ $retcode -eq 77 ] + then echo "SKIP: $i" + else echo "FAIL: $i" + fi +} + +# Allow altering time on the target +export GLIBC_TEST_ALLOW_TIME_SETTING="1" + +tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64) + +# Remove '-time64' suffix - those tests are also time +# related +tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64}) + +# Do not run tests supporting only 32 bit time +#for i in ${tst_time_tmp} +#do +# $i >/dev/null 2>&1 +# output +#done + +# Run tests supporting only 64 bit time +for i in ${tst_time64} +do + $i >/dev/null 2>&1 + output +done diff --git a/meta/recipes-core/glibc/glibc_2.33.bb b/meta/recipes-core/glibc/glibc_2.40.bb index caa2e2ae18..71b89ac9ff 100644 --- a/meta/recipes-core/glibc/glibc_2.33.bb +++ b/meta/recipes-core/glibc/glibc_2.40.bb @@ -1,31 +1,35 @@ require glibc.inc require glibc-version.inc -CVE_CHECK_WHITELIST += "CVE-2020-10029 CVE-2021-27645" - # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010022 # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010023 # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010024 -# Upstream glibc maintainers dispute there is any issue and have no plans to address it further. -# "this is being treated as a non-security bug and no real threat." -CVE_CHECK_WHITELIST += "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024" +CVE_STATUS_GROUPS = "CVE_STATUS_RECIPE" +CVE_STATUS_RECIPE = "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024" +CVE_STATUS_RECIPE[status] = "disputed: \ +Upstream glibc maintainers dispute there is any issue and have no plans to address it further. \ +this is being treated as a non-security bug and no real threat." # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010025 -# Allows for ASLR bypass so can bypass some hardening, not an exploit in itself, may allow -# easier access for another. "ASLR bypass itself is not a vulnerability." # Potential patch at https://sourceware.org/bugzilla/show_bug.cgi?id=22853 -CVE_CHECK_WHITELIST += "CVE-2019-1010025" +CVE_STATUS[CVE-2019-1010025] = "disputed: \ +Allows for ASLR bypass so can bypass some hardening, not an exploit in itself, may allow \ +easier access for another. 'ASLR bypass itself is not a vulnerability.'" + +CVE_STATUS_GROUPS += "CVE_STATUS_STABLE_BACKPORTS" +CVE_STATUS_STABLE_BACKPORTS = "" +CVE_STATUS_STABLE_BACKPORTS[status] = "cpe-stable-backport: fix available in used git hash" -DEPENDS += "gperf-native bison-native make-native" +DEPENDS += "gperf-native bison-native" NATIVESDKFIXES ?= "" -NATIVESDKFIXES_class-nativesdk = "\ +NATIVESDKFIXES:class-nativesdk = "\ file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \ file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \ file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \ file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \ file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \ - file://faccessat2-perm.patch \ + file://0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch \ " SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ @@ -34,29 +38,22 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://makedbs.sh \ \ ${NATIVESDKFIXES} \ - file://0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \ - file://0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \ - file://0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \ - file://0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ - file://0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ - file://0015-yes-within-the-path-sets-wrong-config-variables.patch \ - file://0016-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0017-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0018-eglibc-Cross-building-and-testing-instructions.patch \ - file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ - file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ - file://0025-intl-Emit-no-lines-in-bison-generated-files.patch \ - file://0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ - file://0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \ - file://0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \ - file://0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch \ - " + file://0009-yes-within-the-path-sets-wrong-config-variables.patch \ + file://0010-eglibc-Cross-building-and-testing-instructions.patch \ + file://0011-eglibc-Help-bootstrap-cross-toolchain.patch \ + file://0012-eglibc-Resolve-__fpscr_values-on-SH4.patch \ + file://0013-eglibc-Forward-port-cross-locale-generation-support.patch \ + file://0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ + file://0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch \ + file://0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \ + file://0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch \ + file://0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \ + file://0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \ + file://0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \ + file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ + file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ + file://0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch \ +" S = "${WORKDIR}/git" B = "${WORKDIR}/build-${TARGET_SYS}" @@ -76,26 +73,25 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ --enable-clocale=gnu \ --with-headers=${STAGING_INCDIR} \ --without-selinux \ - --enable-tunables \ --enable-bind-now \ --enable-stack-protector=strong \ - --enable-stackguard-randomization \ --disable-crypt \ --with-default-link \ - ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \ + --disable-werror \ + --enable-fortify-source \ ${GLIBCPIE} \ ${GLIBC_EXTRA_OECONF}" EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" -EXTRA_OECONF_append_x86 = " --enable-cet" -EXTRA_OECONF_append_x86-64 = " --enable-cet" +EXTRA_OECONF:append:x86-64 = " --enable-cet" + +PACKAGECONFIG ??= "nscd memory-tagging" -PACKAGECONFIG ??= "nscd" PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd" PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging" -do_patch_append() { +do_patch:append() { bb.build.exec_func('do_fix_readlib_c', d) } @@ -110,10 +106,12 @@ do_configure () { # version check and doesn't really help with anything (cd ${S} && gnu-configize) || die "failure in running gnu-configize" find ${S} -name "configure" | xargs touch - CPPFLAGS="" oe_runconf + CPPFLAGS="" LD="${HOST_PREFIX}ld.bfd ${TOOLCHAIN_OPTIONS}" oe_runconf } LDFLAGS += "-fuse-ld=bfd" +CC += "-fuse-ld=bfd" + do_compile () { base_do_compile echo "Adjust ldd script" @@ -129,4 +127,15 @@ do_compile () { require glibc-package.inc +# When upgrading glibc it's important to know if there are any new symbols +# that pseudo needs to wrap. In the future a generalised ABI comparison tool +# would be good, but to solve the immediate need we can simply list the +# exported symbols to files in WORKDIR. +do_symlist() { + for LIB in ${D}${base_libdir}/lib*.so.*; do + ${NM} --dynamic $LIB | awk --source '$2 == "T" { print $3 }' | sort > ${WORKDIR}/$(basename $LIB)-${PV}.symbols + done +} +addtask symlist after do_install + BBCLASSEXTEND = "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 @@ +From fd50228cc213d2d87f5e3cf1f123acb3fda9b04e Mon Sep 17 00:00:00 2001 +From: Christoph Muellner <cmuellner@linux.com> +Date: Mon, 28 Jun 2021 00:34:12 +0200 +Subject: [PATCH] ldconfig: Add RISC-V support + +ldconfig-native does not support RISC-V at the moment. +Let's pull the reqired constants from upstream and add +the required parsing code. + +Upstream-Status: Backport + +Signed-off-by: Christoph Muellner <cmuellner@linux.com> +--- + cache.c | 6 ++++++ + ldconfig.h | 2 ++ + readelflib.c | 10 ++++++++++ + 3 files changed, 18 insertions(+) + +diff --git a/cache.c b/cache.c +index c4f5411..a3b9e70 100644 +--- a/cache.c ++++ b/cache.c +@@ -125,6 +125,12 @@ print_entry (const char *lib, int flag, unsigned int osversion, + case FLAG_AARCH64_LIB64: + fputs (",AArch64", stdout); + break; ++ case FLAG_RISCV_FLOAT_ABI_SOFT: ++ fputs (",soft-float", stdout); ++ break; ++ case FLAG_RISCV_FLOAT_ABI_DOUBLE: ++ fputs (",double-float", stdout); ++ break; + case 0: + break; + default: +diff --git a/ldconfig.h b/ldconfig.h +index 6a8a750..2e5e379 100644 +--- a/ldconfig.h ++++ b/ldconfig.h +@@ -38,6 +38,8 @@ + #define FLAG_ARM_LIBHF 0x0900 + #define FLAG_AARCH64_LIB64 0x0a00 + #define FLAG_ARM_LIBSF 0x0b00 ++#define FLAG_RISCV_FLOAT_ABI_SOFT 0x0f00 ++#define FLAG_RISCV_FLOAT_ABI_DOUBLE 0x1000 + + /* Name of auxiliary cache. */ + #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" +diff --git a/readelflib.c b/readelflib.c +index 9ec0a54..a01e1ce 100644 +--- a/readelflib.c ++++ b/readelflib.c +@@ -33,6 +33,10 @@ + #define EM_AARCH64 183 /* ARM AARCH64 */ + #endif + ++#ifndef EM_RISCV ++#define EM_RISCV 243 /* RISC-V */ ++#endif ++ + #undef check_ptr + #define check_ptr(ptr) \ + do \ +@@ -331,6 +335,12 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + /* see sysdeps/unix/sysv/linux/arm/readelflib.c */ + *flag |= FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6; + break; ++ case EM_RISCV: ++ /* RISC-V libraries are always libc.so.6+. */ ++ /* NOTE: This does not correctly handle soft-float binaries */ ++ /* see sysdeps/unix/sysv/linux/riscv/readelflib.c */ ++ *flag |= FLAG_RISCV_FLOAT_ABI_DOUBLE|FLAG_ELF_LIBC6; ++ break; + default: + error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n", + file_name, (long)elf_header->e_machine); +-- +2.25.1 + 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 @@ +From 864054a6cb971688a181316b8227ae0361b4d69e Mon Sep 17 00:00:00 2001 +From: Andreas Schwab <schwab@suse.de> +Date: Wed, 9 Oct 2019 17:46:47 +0200 +Subject: [PATCH] ldconfig: handle .dynstr located in separate segment (bug + 25087) + +To determine the load offset of the DT_STRTAB section search for the +segment containing it, instead of using the load offset of the first +segment. + +Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=58e8f5fd2ba47b6dc47fd4d0a35e4175c7c87aaa] + +Backported: ported to support endianness and 32/64 bits. +Signed-off-by: Fabien Mahot <fabien.mahot@external.desouttertools.com> +--- + readelflib.c | 86 +++++++++++++++++++++++++++++++--------------------- + 1 file changed, 52 insertions(+), 34 deletions(-) + +diff --git a/readelflib.c b/readelflib.c +index a01e1cede3..380aed563d 100644 +--- a/readelflib.c ++++ b/readelflib.c +@@ -80,7 +80,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag, + { + int i; + unsigned int j; +- Elf32_Addr loadaddr; + unsigned int dynamic_addr; + size_t dynamic_size; + char *program_interpreter; +@@ -110,7 +109,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag, + libc5/libc6. */ + *flag = FLAG_ELF; + +- loadaddr = -1; + dynamic_addr = 0; + dynamic_size = 0; + program_interpreter = NULL; +@@ -121,11 +119,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag, + + switch (read32(segment->p_type, be)) + { +- case PT_LOAD: +- if (loadaddr == (Elf32_Addr) -1) +- loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be); +- break; +- + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); +@@ -188,11 +181,6 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag, + } + + } +- if (loadaddr == (Elf32_Addr) -1) +- { +- /* Very strange. */ +- loadaddr = 0; +- } + + /* Now we can read the dynamic sections. */ + if (dynamic_size == 0) +@@ -208,11 +196,32 @@ process_elf_file32 (const char *file_name, const char *lib, int *flag, + { + check_ptr (dyn_entry); + if (read32(dyn_entry->d_tag, be) == DT_STRTAB) +- { +- dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr); +- check_ptr (dynamic_strings); +- break; +- } ++ { ++ /* Find the file offset of the segment containing the dynamic ++ string table. */ ++ Elf32_Off loadoff = -1; ++ for (i = 0, segment = elf_pheader; ++ i < read16(elf_header->e_phnum, be); i++, segment++) ++ { ++ if (read32(segment->p_type, be) == PT_LOAD ++ && read32(dyn_entry->d_un.d_val, be) >= read32(segment->p_vaddr, be) ++ && (read32(dyn_entry->d_un.d_val, be) - read32(segment->p_vaddr, be) ++ < read32(segment->p_filesz, be))) ++ { ++ loadoff = read32(segment->p_vaddr, be) - read32(segment->p_offset, be); ++ break; ++ } ++ } ++ if (loadoff == (Elf32_Off) -1) ++ { ++ /* Very strange. */ ++ loadoff = 0; ++ } ++ ++ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadoff); ++ check_ptr (dynamic_strings); ++ break; ++ } + } + + if (dynamic_strings == NULL) +@@ -269,7 +278,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + { + int i; + unsigned int j; +- Elf64_Addr loadaddr; + Elf64_Addr dynamic_addr; + Elf64_Xword dynamic_size; + char *program_interpreter; +@@ -347,7 +355,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + break; + } + +- loadaddr = -1; + dynamic_addr = 0; + dynamic_size = 0; + program_interpreter = NULL; +@@ -358,11 +365,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + + switch (read32(segment->p_type, be)) + { +- case PT_LOAD: +- if (loadaddr == (Elf64_Addr) -1) +- loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be); +- break; +- + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); +@@ -426,11 +428,6 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + } + + } +- if (loadaddr == (Elf64_Addr) -1) +- { +- /* Very strange. */ +- loadaddr = 0; +- } + + /* Now we can read the dynamic sections. */ + if (dynamic_size == 0) +@@ -446,11 +443,32 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + { + check_ptr (dyn_entry); + if (read64(dyn_entry->d_tag, be) == DT_STRTAB) +- { +- dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr); +- check_ptr (dynamic_strings); +- break; +- } ++ { ++ /* Find the file offset of the segment containing the dynamic ++ string table. */ ++ Elf64_Off loadoff = -1; ++ for (i = 0, segment = elf_pheader; ++ i < read16(elf_header->e_phnum, be); i++, segment++) ++ { ++ if (read64(segment->p_type, be) == PT_LOAD ++ && read64(dyn_entry->d_un.d_val, be) >= read64(segment->p_vaddr, be) ++ && (read64(dyn_entry->d_un.d_val, be) - read64(segment->p_vaddr, be) ++ < read64(segment->p_filesz, be))) ++ { ++ loadoff = read64(segment->p_vaddr, be) - read64(segment->p_offset, be); ++ break; ++ } ++ } ++ if (loadoff == (Elf32_Off) -1) ++ { ++ /* Very strange. */ ++ loadoff = 0; ++ } ++ ++ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadoff); ++ check_ptr (dynamic_strings); ++ break; ++ } + } + + 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 return 0; } -+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org" ++#define REPORT_BUGS_TO "mailing list : poky@lists.yoctoproject.org" /* Print bug-reporting information in the help message. */ static char * 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..9ca95d1e52 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 @@ SUMMARY = "A standalone native ldconfig build" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399" @@ -15,9 +15,10 @@ SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \ file://endian-ness_handling_fix.patch \ file://add-64-bit-flag-for-ELF64-entries.patch \ file://no-aux-cache.patch \ + file://add-riscv-support.patch \ + file://ldconfig-handle-.dynstr-located-in-separate-segment.patch \ " -PR = "r2" FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:" |