From 392c117e7ab05da10a374f695d5232e7527ab5de Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 7 Aug 2020 15:09:36 -0700 Subject: glibc: Upgrade to 2.32 release Drop 0001-localedef-Add-hardlink-resolver-to-build.patch as its applied to localedef upstream Drop CVE patches which are already part of 2.32 release Drop unused attribute patch as its fixed differently in 2.32 Add a patch to mitigate the sideffect of [1] for ppc which detect wrong cpu in OE since we are cross compiling [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=146fea07640387c78e334933de24b6353e1f0eba (From OE-Core rev: fe3d5136ef02721f9bbe01d98c1743b8dbcb69c5) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- meta/conf/distro/include/tcmode-default.inc | 2 +- .../glibc/cross-localedef-native_2.31.bb | 52 -- .../glibc/cross-localedef-native_2.32.bb | 50 ++ meta/recipes-core/glibc/glibc-common.inc | 2 +- meta/recipes-core/glibc/glibc-locale_2.31.bb | 1 - meta/recipes-core/glibc/glibc-locale_2.32.bb | 1 + meta/recipes-core/glibc/glibc-mtrace_2.31.bb | 1 - meta/recipes-core/glibc/glibc-mtrace_2.32.bb | 1 + meta/recipes-core/glibc/glibc-scripts_2.31.bb | 1 - meta/recipes-core/glibc/glibc-scripts_2.32.bb | 1 + meta/recipes-core/glibc/glibc-testsuite_2.31.bb | 63 --- meta/recipes-core/glibc/glibc-testsuite_2.32.bb | 63 +++ meta/recipes-core/glibc/glibc-version.inc | 8 +- ...def-Add-hardlink-resolver-from-util-linux.patch | 7 +- ...-localedef-Add-hardlink-resolver-to-build.patch | 52 -- ...ledef-fix-ups-hardlink-to-make-it-compile.patch | 7 +- ...libc-Look-for-host-system-ld.so.cache-as-.patch | 14 +- ...libc-Fix-buffer-overrun-with-a-relocated-.patch | 12 +- ...libc-Raise-the-size-of-arrays-containing-.patch | 28 +- ...ivesdk-glibc-Allow-64-bit-atomics-for-x86.patch | 7 +- ...libc-Make-relocatable-install-for-locales.patch | 60 +- ...500-e5500-e6500-603e-fsqrt-implementation.patch | 7 +- ...-Fix-undefined-reference-to-__sqrt_finite.patch | 208 +++++++ ...-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch | 29 - ...qrt-f-are-now-inline-functions-and-call-o.patch | 387 +++++++++++++ ...-Fix-undefined-reference-to-__sqrt_finite.patch | 205 ------- ...bug-1443-which-explains-what-the-patch-do.patch | 62 +++ ...qrt-f-are-now-inline-functions-and-call-o.patch | 384 ------------- ...bug-1443-which-explains-what-the-patch-do.patch | 58 -- ...n-libm-err-tab.pl-with-specific-dirs-in-S.patch | 36 ++ ...qrt-f-are-now-inline-functions-and-call-o.patch | 61 ++ ...n-libm-err-tab.pl-with-specific-dirs-in-S.patch | 33 -- ...qrt-f-are-now-inline-functions-and-call-o.patch | 58 -- ...-configure.ac-handle-correctly-libc_cv_ro.patch | 42 ++ ...-configure.ac-handle-correctly-libc_cv_ro.patch | 39 -- ...thin-the-path-sets-wrong-config-variables.patch | 263 +++++++++ .../glibc/glibc/0016-Add-unused-attribute.patch | 31 -- ...-timezone-re-written-tzselect-as-posix-sh.patch | 45 ++ ...move-bash-dependency-for-nscd-init-script.patch | 75 +++ ...thin-the-path-sets-wrong-config-variables.patch | 260 --------- ...c-Cross-building-and-testing-instructions.patch | 619 +++++++++++++++++++++ ...-timezone-re-written-tzselect-as-posix-sh.patch | 42 -- ...move-bash-dependency-for-nscd-init-script.patch | 72 --- ...019-eglibc-Help-bootstrap-cross-toolchain.patch | 100 ++++ ...c-Cross-building-and-testing-instructions.patch | 616 -------------------- ...0020-eglibc-Resolve-__fpscr_values-on-SH4.patch | 56 ++ ...ward-port-cross-locale-generation-support.patch | 563 +++++++++++++++++++ ...021-eglibc-Help-bootstrap-cross-toolchain.patch | 97 ---- ...0022-Define-DUMMY_LOCALE_T-if-not-defined.patch | 32 ++ ...0022-eglibc-Resolve-__fpscr_values-on-SH4.patch | 53 -- ...ward-port-cross-locale-generation-support.patch | 560 ------------------- ...dd-to-archive-uses-a-hard-coded-locale-pa.patch | 84 +++ ...0024-Define-DUMMY_LOCALE_T-if-not-defined.patch | 29 - ....c-Make-_dl_build_local_scope-breadth-fir.patch | 56 ++ ...tl-Emit-no-lines-in-bison-generated-files.patch | 34 ++ ...dd-to-archive-uses-a-hard-coded-locale-pa.patch | 80 --- ....c-Make-_dl_build_local_scope-breadth-fir.patch | 53 -- .../0026-inject-file-assembly-directives.patch | 240 ++++++++ ...tl-Emit-no-lines-in-bison-generated-files.patch | 31 -- ...ent-maybe-uninitialized-errors-with-Os-BZ.patch | 56 ++ .../0028-inject-file-assembly-directives.patch | 301 ---------- ...-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch | 33 ++ ...ent-maybe-uninitialized-errors-with-Os-BZ.patch | 53 -- ...-Unify-the-header-between-arm-and-aarch64.patch | 70 +++ ...erpc-Do-not-ask-compiler-for-finding-arch.patch | 51 ++ ...-Unify-the-header-between-arm-and-aarch64.patch | 67 --- meta/recipes-core/glibc/glibc/CVE-2020-6096.patch | 112 ---- .../recipes-core/glibc/glibc/CVE-2020-6096_2.patch | 194 ------- meta/recipes-core/glibc/glibc_2.31.bb | 115 ---- meta/recipes-core/glibc/glibc_2.32.bb | 113 ++++ 70 files changed, 3493 insertions(+), 3805 deletions(-) delete mode 100644 meta/recipes-core/glibc/cross-localedef-native_2.31.bb create mode 100644 meta/recipes-core/glibc/cross-localedef-native_2.32.bb delete mode 100644 meta/recipes-core/glibc/glibc-locale_2.31.bb create mode 100644 meta/recipes-core/glibc/glibc-locale_2.32.bb delete mode 100644 meta/recipes-core/glibc/glibc-mtrace_2.31.bb create mode 100644 meta/recipes-core/glibc/glibc-mtrace_2.32.bb delete mode 100644 meta/recipes-core/glibc/glibc-scripts_2.31.bb create mode 100644 meta/recipes-core/glibc/glibc-scripts_2.32.bb delete mode 100644 meta/recipes-core/glibc/glibc-testsuite_2.31.bb create mode 100644 meta/recipes-core/glibc/glibc-testsuite_2.32.bb delete mode 100644 meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-to-build.patch create mode 100644 meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch delete mode 100644 meta/recipes-core/glibc/glibc/0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch create mode 100644 meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch delete mode 100644 meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch create mode 100644 meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch delete mode 100644 meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch delete mode 100644 meta/recipes-core/glibc/glibc/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch create mode 100644 meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch create mode 100644 meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch delete mode 100644 meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch delete mode 100644 meta/recipes-core/glibc/glibc/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch create mode 100644 meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch delete mode 100644 meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch create mode 100644 meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch delete mode 100644 meta/recipes-core/glibc/glibc/0016-Add-unused-attribute.patch create mode 100644 meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch create mode 100644 meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch delete mode 100644 meta/recipes-core/glibc/glibc/0017-yes-within-the-path-sets-wrong-config-variables.patch create mode 100644 meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch delete mode 100644 meta/recipes-core/glibc/glibc/0018-timezone-re-written-tzselect-as-posix-sh.patch delete mode 100644 meta/recipes-core/glibc/glibc/0019-Remove-bash-dependency-for-nscd-init-script.patch create mode 100644 meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch delete mode 100644 meta/recipes-core/glibc/glibc/0020-eglibc-Cross-building-and-testing-instructions.patch create mode 100644 meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch create mode 100644 meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch delete mode 100644 meta/recipes-core/glibc/glibc/0021-eglibc-Help-bootstrap-cross-toolchain.patch create mode 100644 meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch delete mode 100644 meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch delete mode 100644 meta/recipes-core/glibc/glibc/0023-eglibc-Forward-port-cross-locale-generation-support.patch create mode 100644 meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch delete mode 100644 meta/recipes-core/glibc/glibc/0024-Define-DUMMY_LOCALE_T-if-not-defined.patch create mode 100644 meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch create mode 100644 meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch delete mode 100644 meta/recipes-core/glibc/glibc/0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch create mode 100644 meta/recipes-core/glibc/glibc/0026-inject-file-assembly-directives.patch delete mode 100644 meta/recipes-core/glibc/glibc/0027-intl-Emit-no-lines-in-bison-generated-files.patch create mode 100644 meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch delete mode 100644 meta/recipes-core/glibc/glibc/0028-inject-file-assembly-directives.patch create mode 100644 meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch delete mode 100644 meta/recipes-core/glibc/glibc/0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch create mode 100644 meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch create mode 100644 meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch delete mode 100644 meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch delete mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-6096.patch delete mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch delete mode 100644 meta/recipes-core/glibc/glibc_2.31.bb create mode 100644 meta/recipes-core/glibc/glibc_2.32.bb diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index 2de64d5d6b..c5cc4bdcdf 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc @@ -20,7 +20,7 @@ GCCVERSION ?= "10.%" SDKGCCVERSION ?= "${GCCVERSION}" BINUVERSION ?= "2.35%" GDBVERSION ?= "9.%" -GLIBCVERSION ?= "2.31%" +GLIBCVERSION ?= "2.32" LINUXLIBCVERSION ?= "5.4%" QEMUVERSION ?= "5.0%" GOVERSION ?= "1.14%" diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.31.bb b/meta/recipes-core/glibc/cross-localedef-native_2.31.bb deleted file mode 100644 index 24de55d929..0000000000 --- a/meta/recipes-core/glibc/cross-localedef-native_2.31.bb +++ /dev/null @@ -1,52 +0,0 @@ -SUMMARY = "Cross locale generation tool for glibc" -HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" -SECTION = "libs" -LICENSE = "LGPL-2.1" - -LIC_FILES_CHKSUM = "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ - file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ - file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" - -require glibc-version.inc - -# Tell autotools that we're working in the localedef directory -# -AUTOTOOLS_SCRIPT_PATH = "${S}/localedef" - -inherit native -inherit autotools - -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 \ - \ - file://0001-localedef-Add-hardlink-resolver-to-build.patch;patchdir=localedef \ - \ - file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ - file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ - \ - file://0018-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0019-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0020-eglibc-Cross-building-and-testing-instructions.patch \ - file://0021-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0023-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0024-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ -" -# Makes for a rather long rev (22 characters), but... -# -SRCREV_FORMAT = "glibc_localedef" - -S = "${WORKDIR}/git" - -EXTRA_OECONF = "--with-glibc=${S}" -CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" - -do_install() { - install -d ${D}${bindir} - install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef - install -m 0755 ${B}/cross-localedef-hardlink ${D}${bindir}/cross-localedef-hardlink -} diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.32.bb b/meta/recipes-core/glibc/cross-localedef-native_2.32.bb new file mode 100644 index 0000000000..5a0abbb70f --- /dev/null +++ b/meta/recipes-core/glibc/cross-localedef-native_2.32.bb @@ -0,0 +1,50 @@ +SUMMARY = "Cross locale generation tool for glibc" +HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" +SECTION = "libs" +LICENSE = "LGPL-2.1" + +LIC_FILES_CHKSUM = "file://LICENSES;md5=1541fd8f5e8f1579512bf05f533371ba \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + +require glibc-version.inc + +# Tell autotools that we're working in the localedef directory +# +AUTOTOOLS_SCRIPT_PATH = "${S}/localedef" + +inherit native +inherit autotools + +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 \ + \ + 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 \ +" +# Makes for a rather long rev (22 characters), but... +# +SRCREV_FORMAT = "glibc_localedef" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = "--with-glibc=${S}" +CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef + install -m 0755 ${B}/cross-localedef-hardlink ${D}${bindir}/cross-localedef-hardlink +} diff --git a/meta/recipes-core/glibc/glibc-common.inc b/meta/recipes-core/glibc/glibc-common.inc index 8d412cc857..027c700998 100644 --- a/meta/recipes-core/glibc/glibc-common.inc +++ b/meta/recipes-core/glibc/glibc-common.inc @@ -22,4 +22,4 @@ ARM_INSTRUCTION_SET_armv6 = "arm" # COMPATIBLE_HOST_libc-musl_class-target = "null" -PV = "2.31" +PV = "2.32" diff --git a/meta/recipes-core/glibc/glibc-locale_2.31.bb b/meta/recipes-core/glibc/glibc-locale_2.31.bb deleted file mode 100644 index f7702e0358..0000000000 --- a/meta/recipes-core/glibc/glibc-locale_2.31.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-locale.inc diff --git a/meta/recipes-core/glibc/glibc-locale_2.32.bb b/meta/recipes-core/glibc/glibc-locale_2.32.bb new file mode 100644 index 0000000000..f7702e0358 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-locale_2.32.bb @@ -0,0 +1 @@ +require glibc-locale.inc diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.31.bb b/meta/recipes-core/glibc/glibc-mtrace_2.31.bb deleted file mode 100644 index 0b69bad46a..0000000000 --- a/meta/recipes-core/glibc/glibc-mtrace_2.31.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-mtrace.inc diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.32.bb b/meta/recipes-core/glibc/glibc-mtrace_2.32.bb new file mode 100644 index 0000000000..0b69bad46a --- /dev/null +++ b/meta/recipes-core/glibc/glibc-mtrace_2.32.bb @@ -0,0 +1 @@ +require glibc-mtrace.inc diff --git a/meta/recipes-core/glibc/glibc-scripts_2.31.bb b/meta/recipes-core/glibc/glibc-scripts_2.31.bb deleted file mode 100644 index 5a89bd8022..0000000000 --- a/meta/recipes-core/glibc/glibc-scripts_2.31.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-scripts.inc diff --git a/meta/recipes-core/glibc/glibc-scripts_2.32.bb b/meta/recipes-core/glibc/glibc-scripts_2.32.bb new file mode 100644 index 0000000000..5a89bd8022 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-scripts_2.32.bb @@ -0,0 +1 @@ +require glibc-scripts.inc diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.31.bb b/meta/recipes-core/glibc/glibc-testsuite_2.31.bb deleted file mode 100644 index d887aeff79..0000000000 --- a/meta/recipes-core/glibc/glibc-testsuite_2.31.bb +++ /dev/null @@ -1,63 +0,0 @@ -require glibc_${PV}.bb - -EXCLUDE_FROM_WORLD = "1" - -# handle PN differences -FILESEXTRAPATHS_prepend := "${THISDIR}/glibc:" - -# strip provides -PROVIDES = "" -# setup depends -INHIBIT_DEFAULT_DEPS = "" - -python () { - libc = d.getVar("PREFERRED_PROVIDER_virtual/libc") - libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale") - if libc != "glibc" or libclocale != "glibc-locale": - raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc") -} - -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" - -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) - find ${B} -type f -name "*.out" -delete - find ${B} -type f -name "*.test-result" -delete - 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.32.bb b/meta/recipes-core/glibc/glibc-testsuite_2.32.bb new file mode 100644 index 0000000000..d887aeff79 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-testsuite_2.32.bb @@ -0,0 +1,63 @@ +require glibc_${PV}.bb + +EXCLUDE_FROM_WORLD = "1" + +# handle PN differences +FILESEXTRAPATHS_prepend := "${THISDIR}/glibc:" + +# strip provides +PROVIDES = "" +# setup depends +INHIBIT_DEFAULT_DEPS = "" + +python () { + libc = d.getVar("PREFERRED_PROVIDER_virtual/libc") + libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale") + if libc != "glibc" or libclocale != "glibc-locale": + raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc") +} + +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" + +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) + find ${B} -type f -name "*.out" -delete + find ${B} -type f -name "*.test-result" -delete + 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-version.inc b/meta/recipes-core/glibc/glibc-version.inc index c2d68979eb..2e0a71c303 100644 --- a/meta/recipes-core/glibc/glibc-version.inc +++ b/meta/recipes-core/glibc/glibc-version.inc @@ -1,7 +1,7 @@ -SRCBRANCH ?= "release/2.31/master" -PV = "2.31+git${SRCPV}" -SRCREV_glibc ?= "109474122400ca7d60782b131dc867a5c1f2fe55" -SRCREV_localedef ?= "cd9f958c4c94a638fa7b2b4e21627364f1a1a655" +SRCBRANCH ?= "release/2.32/master" +PV = "2.32" +SRCREV_glibc ?= "3de512be7ea6053255afed6154db9ee31d4e557a" +SRCREV_localedef ?= "b6ca7c146c6d2c93cddfa61e395cb8a196e3d46f" GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" 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 d0786be8b8..e0ec1887dc 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,7 +1,7 @@ -From 3dcf144e998aed17b3fb957a255b1e923ba07d71 Mon Sep 17 00:00:00 2001 +From 5db90855621a81d02f1434d5602cefea8c45de1c Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Sat, 7 Dec 2019 09:59:22 -0800 -Subject: [PATCH] localedef: Add hardlink resolver from util-linux +Subject: [PATCH 01/29] localedef: Add hardlink resolver from util-linux The hard link resolver that is built into localedef cannot be run in parallel. It will search sibling directories (which are be processed @@ -1128,3 +1128,6 @@ index 0000000000..0129a85e2e +} + +#endif +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-to-build.patch b/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-to-build.patch deleted file mode 100644 index d6652981a8..0000000000 --- a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-to-build.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 56ae260ac24ade94e2e0e77c81751312372d253f Mon Sep 17 00:00:00 2001 -From: Jason Wessel -Date: Sat, 7 Dec 2019 09:56:23 -0800 -Subject: [PATCH] localedef: Add hardlink resolver to build - -The sourcecode for this is imported from util-linux and is kept with -glibc sources - -Upstream-Status: Pending -Signed-off-by: Jason Wessel -Signed-off-by: Khem Raj ---- - Makefile.in | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index 77fbded..a87e5b2 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -40,6 +40,8 @@ WARNFLAGS = -Wall -Wno-format - FULLCC = $(CC) $(CPPFLAGS) $(CFLAGS) \ - $(DEFINES) $(INCLUDES) $(WARNFLAGS) - -+CROSS_LOCALEDEF_HARDLINK_OBJS = cross-localedef-hardlink.o -+ - LOCALEDEF_OBJS = charmap.o charmap-dir.o ld-address.o ld-collate.o \ - ld-ctype.o ld-identification.o ld-measurement.o \ - ld-messages.o ld-monetary.o ld-name.o ld-numeric.o \ -@@ -54,11 +56,14 @@ LOCALEDEF_OBJS = charmap.o charmap-dir.o ld-address.o ld-collate.o \ - asprintf.o getdelim.o localedef_extra.o \ - obstack_printf.o vasprintf.o - --all: localedef$(EXEEXT) -+all: localedef$(EXEEXT) cross-localedef-hardlink$(EXEEXT) - - localedef$(EXEEXT): $(LOCALEDEF_OBJS) - $(CC) -o $@ $(LOCALEDEF_OBJS) $(LIBS) - -+cross-localedef-hardlink$(EXEEXT): $(CROSS_LOCALEDEF_HARDLINK_OBJS) -+ $(CC) -o $@ $(CROSS_LOCALEDEF_HARDLINK_OBJS) $(LIBS) -+ - clean: - rm -f locale$(EXEEXT) $(LOCALEDEF_OBJS) - -@@ -77,6 +82,7 @@ clean: - %.o: $(srcdir)/%.c - $(FULLCC) -c -o $@ $< - -+cross-localedef-hardlink.o: glibc/locale/programs/cross-localedef-hardlink.c - charmap.o: glibc/locale/programs/charmap.c - charmap-dir.o: glibc/locale/programs/charmap-dir.c - ld-address.o: glibc/locale/programs/ld-address.c 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 5222e37d1a..05b76803b4 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,7 +1,7 @@ -From b52dba15527380cc18635e3696e0ef87efee9a84 Mon Sep 17 00:00:00 2001 +From ab022ce3c1c01fd6c850f541a33efd0cacabe052 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Sat, 7 Dec 2019 10:01:37 -0800 -Subject: [PATCH] localedef: fix-ups hardlink to make it compile +Subject: [PATCH 02/29] localedef: fix-ups hardlink to make it compile Upstream-Status: Pending Signed-off-by: Jason Wessel @@ -236,3 +236,6 @@ index 63615896b0..726e6dd948 100644 } continue; } +-- +2.27.0 + 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 4cdc8354b6..743994f2db 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,7 +1,8 @@ -From 6987ad183770cb56680ccc4f6ea065a04f31ccb6 Mon Sep 17 00:00:00 2001 +From de4322ef6d4dc9fc3ee9b69af1c10edbc64a66a3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 18 Mar 2015 01:48:24 +0000 -Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well +Subject: [PATCH 03/29] nativesdk-glibc: Look for host system ld.so.cache as + well Upstream-Status: Inappropriate [embedded specific] @@ -30,10 +31,10 @@ Signed-off-by: Khem Raj 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c -index a6b80f9395..3226f2e531 100644 +index e39980fb19..565b039b23 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -2073,6 +2073,14 @@ _dl_map_object (struct link_map *loader, const char *name, +@@ -2160,6 +2160,14 @@ _dl_map_object (struct link_map *loader, const char *name, } } @@ -48,7 +49,7 @@ index a6b80f9395..3226f2e531 100644 #ifdef USE_LDCONFIG if (fd == -1 && (__glibc_likely ((mode & __RTLD_SECURE) == 0) -@@ -2131,14 +2139,6 @@ _dl_map_object (struct link_map *loader, const char *name, +@@ -2218,14 +2226,6 @@ _dl_map_object (struct link_map *loader, const char *name, } #endif @@ -63,3 +64,6 @@ index a6b80f9395..3226f2e531 100644 /* Add another newline when we are tracing the library loading. */ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) _dl_debug_printf ("\n"); +-- +2.27.0 + 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 62e12897f5..a3b5b7750c 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,7 +1,8 @@ -From 7806340c2accc2c51e7e861b618c29fb5609a007 Mon Sep 17 00:00:00 2001 +From 258c44e4ecffd830cb89d0016d45b2bac765f559 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 18 Mar 2015 01:50:00 +0000 -Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK +Subject: [PATCH 04/29] nativesdk-glibc: Fix buffer overrun with a relocated + SDK When ld-linux-*.so.2 is relocated to a path that is longer than the original fixed location, the dynamic loader will crash in open_path @@ -21,10 +22,10 @@ Signed-off-by: Khem Raj 1 file changed, 12 insertions(+) diff --git a/elf/dl-load.c b/elf/dl-load.c -index 3226f2e531..7cb8a86fab 100644 +index 565b039b23..e1b3486549 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -1773,7 +1773,19 @@ open_path (const char *name, size_t namelen, int mode, +@@ -1860,7 +1860,19 @@ open_path (const char *name, size_t namelen, int mode, given on the command line when rtld is run directly. */ return -1; @@ -44,3 +45,6 @@ index 3226f2e531..7cb8a86fab 100644 do { struct r_search_path_elem *this_dir = *dirs; +-- +2.27.0 + 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 294c2b975e..2073576aac 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,7 +1,8 @@ -From 1b97befbe693eb93a77b6098f6ae1394a53462f4 Mon Sep 17 00:00:00 2001 +From 19cd858f5f04a6ac584fbd89a2fbc51791263b85 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 18 Mar 2015 01:51:38 +0000 -Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths +Subject: [PATCH 05/29] nativesdk-glibc: Raise the size of arrays containing dl + paths This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings and lengths as well as ld.so.cache path in the dynamic loader to specific @@ -25,7 +26,7 @@ Signed-off-by: Khem Raj 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/elf/dl-cache.c b/elf/dl-cache.c -index 3eedd9afcf..efdfe5cae7 100644 +index 93d185e788..e115b18756 100644 --- a/elf/dl-cache.c +++ b/elf/dl-cache.c @@ -133,6 +133,10 @@ do \ @@ -40,10 +41,10 @@ index 3eedd9afcf..efdfe5cae7 100644 _dl_cache_libcmp (const char *p1, const char *p2) { diff --git a/elf/dl-load.c b/elf/dl-load.c -index 7cb8a86fab..e32d4aa936 100644 +index e1b3486549..5226d0c4fa 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -110,8 +110,8 @@ static size_t max_capstrlen attribute_relro; +@@ -111,8 +111,8 @@ static size_t max_capstrlen attribute_relro; gen-trusted-dirs.awk. */ #include "trusted-dirs.h" @@ -66,10 +67,10 @@ index 331cc1df48..885b2d9476 100644 +const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) = RUNTIME_LINKER; diff --git a/elf/ldconfig.c b/elf/ldconfig.c -index 681ed78496..8833ed0a6b 100644 +index 0c090dca15..6bb6e0fe72 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c -@@ -168,6 +168,9 @@ static struct argp argp = +@@ -171,6 +171,9 @@ static struct argp argp = options, parse_opt, NULL, doc, NULL, more_help, NULL }; @@ -80,18 +81,18 @@ index 681ed78496..8833ed0a6b 100644 a platform. */ static int diff --git a/elf/rtld.c b/elf/rtld.c -index 553cfbd1b7..39347c2c03 100644 +index 5b882163fa..db407b5d8b 100644 --- a/elf/rtld.c +++ b/elf/rtld.c -@@ -175,6 +175,7 @@ dso_name_valid_for_suid (const char *p) +@@ -217,6 +217,7 @@ dso_name_valid_for_suid (const char *p) } return *p != '\0'; } +extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); - /* LD_AUDIT variable contents. Must be processed before the - audit_list below. */ -@@ -1222,13 +1223,13 @@ of this helper program; chances are you did not intend to run this program.\n\ + static void + audit_list_init (struct audit_list *list) +@@ -1286,13 +1287,13 @@ of this helper program; chances are you did not intend to run this program.\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\ @@ -135,3 +136,6 @@ index 6b310e9e15..3877311df4 100644 #ifndef add_system_dir # define add_system_dir(dir) add_dir (dir) #endif +-- +2.27.0 + 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 db8b6c0f1c..372dca727e 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,7 +1,7 @@ -From a752857cc342ee5136c9a593037b6ee6ff8af8ee Mon Sep 17 00:00:00 2001 +From bd0486cab67c3441210aed48caab67418610a765 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 31 Dec 2015 14:35:35 -0800 -Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 +Subject: [PATCH 06/29] nativesdk-glibc: Allow 64 bit atomics for x86 The fix consist of allowing 64bit atomic ops for x86. This should be safe for i586 and newer CPUs. @@ -37,3 +37,6 @@ index bb49648374..aa08d3c0a7 100644 # define SP_REG "esp" # define SEG_REG "gs" # define BR_CONSTRAINT "r" +-- +2.27.0 + 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 27cd17cdcd..729ce1b42d 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,7 +1,7 @@ -From 3df91d1d8b9c7a01b3ef8133c4f9b9764227d583 Mon Sep 17 00:00:00 2001 +From 9a8bf11ea375a2fe5eddb30bc10943e64d3b96a4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 3 Aug 2018 09:55:12 -0700 -Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales +Subject: [PATCH 07/29] nativesdk-glibc: Make relocatable install for locales The glibc locale path is hard-coded to the install prefix, but in SDKs we need to be able to relocate the binaries. Expand the strings to 4K and put them in a @@ -12,16 +12,17 @@ Upstream-Status: Inappropriate (OE-specific) Signed-off-by: Ross Burton Signed-off-by: Khem Raj --- - locale/findlocale.c | 4 ++-- - locale/loadarchive.c | 2 +- - locale/localeinfo.h | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) + locale/findlocale.c | 4 ++-- + locale/loadarchive.c | 2 +- + locale/localeinfo.h | 2 +- + locale/programs/locale.c | 7 ++++--- + 4 files changed, 8 insertions(+), 7 deletions(-) -Index: git/locale/findlocale.c -=================================================================== ---- git.orig/locale/findlocale.c -+++ git/locale/findlocale.c -@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attr +diff --git a/locale/findlocale.c b/locale/findlocale.c +index 9cd3b71a6d..84272310e0 100644 +--- a/locale/findlocale.c ++++ b/locale/findlocale.c +@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = which are somehow addressed. */ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; @@ -30,7 +31,7 @@ Index: git/locale/findlocale.c /* 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 +@@ -166,7 +166,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; @@ -39,10 +40,10 @@ Index: git/locale/findlocale.c } else /* We really have to load some data. First see whether the name is -Index: git/locale/loadarchive.c -=================================================================== ---- git.orig/locale/loadarchive.c -+++ git/locale/loadarchive.c +diff --git a/locale/loadarchive.c b/locale/loadarchive.c +index ba0fe45648..9737fd4cda 100644 +--- a/locale/loadarchive.c ++++ b/locale/loadarchive.c @@ -42,7 +42,7 @@ @@ -52,11 +53,11 @@ Index: git/locale/loadarchive.c /* Size of initial mapping window, optimal if large enough to cover the header plus the initial locale. */ -Index: git/locale/localeinfo.h -=================================================================== ---- git.orig/locale/localeinfo.h -+++ git/locale/localeinfo.h -@@ -331,7 +331,7 @@ _nl_lookup_word (locale_t l, int categor +diff --git a/locale/localeinfo.h b/locale/localeinfo.h +index 1bfe22aa7f..fdc283c69a 100644 +--- a/locale/localeinfo.h ++++ b/locale/localeinfo.h +@@ -331,7 +331,7 @@ _nl_lookup_word (locale_t l, int category, int item) } /* Default search path if no LOCPATH environment variable. */ @@ -65,11 +66,11 @@ Index: git/locale/localeinfo.h /* Load the locale data for CATEGORY from the file specified by *NAME. If *NAME is "", use environment variables as specified by POSIX, and -Index: git/locale/programs/locale.c -=================================================================== ---- git.orig/locale/programs/locale.c -+++ git/locale/programs/locale.c -@@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b +diff --git a/locale/programs/locale.c b/locale/programs/locale.c +index e2e309c2a1..61a92cdcd1 100644 +--- a/locale/programs/locale.c ++++ b/locale/programs/locale.c +@@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b) ((const struct nameent *) b)->name); } @@ -77,7 +78,7 @@ Index: git/locale/programs/locale.c static int write_archive_locales (void **all_datap, char *linebuf) -@@ -645,7 +646,7 @@ write_archive_locales (void **all_datap, +@@ -645,7 +646,7 @@ write_archive_locales (void **all_datap, char *linebuf) int fd, ret = 0; uint32_t cnt; @@ -86,7 +87,7 @@ Index: git/locale/programs/locale.c if (fd < 0) return 0; -@@ -700,8 +701,8 @@ write_archive_locales (void **all_datap, +@@ -700,8 +701,8 @@ write_archive_locales (void **all_datap, char *linebuf) if (cnt) putchar_unlocked ('\n'); @@ -97,3 +98,6 @@ Index: git/locale/programs/locale.c locrec = (struct locrecent *) (addr + names[cnt].locrec_offset); +-- +2.27.0 + 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 index 3dac325380..5e3b3e2d7b 100644 --- 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 @@ -1,7 +1,7 @@ -From 61b6c9737897c5828ef4b40699ee0a74c570034a Mon Sep 17 00:00:00 2001 +From 59b0a78ae706a540dbd8905bc97c875220d6aeb2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 18 Mar 2015 00:01:50 +0000 -Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation +Subject: [PATCH 08/29] fsl e500/e5500/e6500/603e fsqrt implementation Upstream-Status: Pending Signed-off-by: Edmar Wienskoski @@ -1579,3 +1579,6 @@ index 0000000000..04ff8cc181 +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies @@ -0,0 +1 @@ +powerpc/powerpc64/e6500/fpu +-- +2.27.0 + 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 new file mode 100644 index 0000000000..a94ed207f5 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch @@ -0,0 +1,208 @@ +From 78f67f016ca9e3f7a37af86cf6e400cf17cf1d05 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:15:07 +0000 +Subject: [PATCH 09/29] 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 + + * 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 +--- + 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) +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/meta/recipes-core/glibc/glibc/0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch deleted file mode 100644 index 456f91fb8e..0000000000 --- a/meta/recipes-core/glibc/glibc/0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 13beb1f428ec06778590bf526d6e641f73d5cf62 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Signed-off-by: Khem Raj ---- - elf/readlib.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/elf/readlib.c b/elf/readlib.c -index 994a4426a1..baabf099b1 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/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 new file mode 100644 index 0000000000..743bea1433 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch @@ -0,0 +1,387 @@ +From 670b5d70ab62b42ab02a8e18b8fcee2879b8c4a0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:16:38 +0000 +Subject: [PATCH 10/29] __ieee754_sqrt{,f} are now inline functions and call + out __slow versions + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + 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) +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch deleted file mode 100644 index 01446abc43..0000000000 --- a/meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 4483a83074a340a921e319b88d72166f18e0df0b Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 - - * 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 ---- - 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/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 new file mode 100644 index 0000000000..a9280b7c34 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch @@ -0,0 +1,62 @@ +From de7a7c04a92dbc5d35cb37e47c471e12784cc95e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:20:09 +0000 +Subject: [PATCH 11/29] 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 +Signed-off-by: Khem Raj +--- + 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 90856779b1..a29bb86c56 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: +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch deleted file mode 100644 index 451f372650..0000000000 --- a/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch +++ /dev/null @@ -1,384 +0,0 @@ -From 347b2e31d010b04c42e78157a028aa1d58fe0f5e Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 ---- - 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/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/meta/recipes-core/glibc/glibc/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch deleted file mode 100644 index a0b46c0479..0000000000 --- a/meta/recipes-core/glibc/glibc/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 8ca8e5cd78cbd37a713e1181f8f6641b57352aa8 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Signed-off-by: Khem Raj ---- - 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 90856779b1..a29bb86c56 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/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 new file mode 100644 index 0000000000..ab07455ade --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch @@ -0,0 +1,36 @@ +From c8807899367e64d803585e7dd4b56a1085d5893b Mon Sep 17 00:00:00 2001 +From: Ting Liu +Date: Wed, 19 Dec 2012 04:39:57 -0600 +Subject: [PATCH 12/29] 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 +--- + manual/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/manual/Makefile b/manual/Makefile +index c61e11dcd7..5d859e6f84 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 $@ + +-- +2.27.0 + 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 new file mode 100644 index 0000000000..d875825ff9 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch @@ -0,0 +1,61 @@ +From 86fea3409b89f9d8884053a519282f2f30d7ea87 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:24:46 +0000 +Subject: [PATCH 13/29] __ieee754_sqrt{,f} are now inline functions and call + out __slow versions + +Upstream-Status: Pending + +Signed-off-by: chunrong guo +Signed-off-by: Khem Raj +--- + 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 + { +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch deleted file mode 100644 index 736de8cf04..0000000000 --- a/meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 21509735678990760d5ebf9d0c65efa4b52b838d Mon Sep 17 00:00:00 2001 -From: Ting Liu -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 ---- - manual/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/manual/Makefile b/manual/Makefile -index c61e11dcd7..5d859e6f84 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/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch deleted file mode 100644 index e73b640c16..0000000000 --- a/meta/recipes-core/glibc/glibc/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch +++ /dev/null @@ -1,58 +0,0 @@ -From e33deb119734ef443ef44c42a00a569f90e1e149 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Signed-off-by: Khem Raj ---- - 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/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch new file mode 100644 index 0000000000..954534bae2 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch @@ -0,0 +1,42 @@ +From a3c4f67fb3cb02855073a9cdbcf2881fb53144f0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:27:10 +0000 +Subject: [PATCH 14/29] sysdeps/gnu/configure.ac: handle correctly + $libc_cv_rootsbindir + +Upstream-Status:Pending + +Signed-off-by: Matthieu Crapet +Signed-off-by: Khem Raj +--- + sysdeps/gnu/configure | 2 +- + sysdeps/gnu/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure +index c15d1087e8..37cc983f2a 100644 +--- a/sysdeps/gnu/configure ++++ b/sysdeps/gnu/configure +@@ -32,6 +32,6 @@ case "$prefix" in + else + libc_cv_localstatedir=$localstatedir + fi +- libc_cv_rootsbindir=/sbin ++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin + ;; + esac +diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac +index 634fe4de2a..3db1697f4f 100644 +--- a/sysdeps/gnu/configure.ac ++++ b/sysdeps/gnu/configure.ac +@@ -21,6 +21,6 @@ case "$prefix" in + else + libc_cv_localstatedir=$localstatedir + fi +- libc_cv_rootsbindir=/sbin ++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin + ;; + esac +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch deleted file mode 100644 index 0cdd0567df..0000000000 --- a/meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch +++ /dev/null @@ -1,39 +0,0 @@ -From c50cae36e90c41849301a9a668adf31e81e43a07 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:27:10 +0000 -Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly - $libc_cv_rootsbindir - -Upstream-Status:Pending - -Signed-off-by: Matthieu Crapet -Signed-off-by: Khem Raj ---- - sysdeps/gnu/configure | 2 +- - sysdeps/gnu/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure -index c15d1087e8..37cc983f2a 100644 ---- a/sysdeps/gnu/configure -+++ b/sysdeps/gnu/configure -@@ -32,6 +32,6 @@ case "$prefix" in - else - libc_cv_localstatedir=$localstatedir - fi -- libc_cv_rootsbindir=/sbin -+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin - ;; - esac -diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac -index 634fe4de2a..3db1697f4f 100644 ---- a/sysdeps/gnu/configure.ac -+++ b/sysdeps/gnu/configure.ac -@@ -21,6 +21,6 @@ case "$prefix" in - else - libc_cv_localstatedir=$localstatedir - fi -- libc_cv_rootsbindir=/sbin -+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin - ;; - esac diff --git a/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch new file mode 100644 index 0000000000..04a9bf01c4 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch @@ -0,0 +1,263 @@ +From 17a602b89cbe53a5a92d0153ccb013a737f028cb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:31:06 +0000 +Subject: [PATCH 15/29] 'yes' within the path sets wrong config variables + +It seems that the 'AC_EGREP_CPP(yes...' example is quite popular +but being such a short word to grep it is likely to produce +false-positive matches with the path it is configured into. + +The change is to use a more elaborated string to grep for. + +Upstream-Status: Submitted [libc-alpha@sourceware.org] + +Signed-off-by: Benjamin Esquivel +Signed-off-by: Khem Raj +--- + sysdeps/aarch64/configure | 4 ++-- + sysdeps/aarch64/configure.ac | 4 ++-- + sysdeps/arm/configure | 4 ++-- + sysdeps/arm/configure.ac | 4 ++-- + sysdeps/mips/configure | 4 ++-- + sysdeps/mips/configure.ac | 4 ++-- + sysdeps/nios2/configure | 4 ++-- + sysdeps/nios2/configure.ac | 4 ++-- + sysdeps/unix/sysv/linux/mips/configure | 4 ++-- + sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++-- + sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++---- + sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++---- + 12 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure +index ac3cf6fd36..32add94df9 100644 +--- a/sysdeps/aarch64/configure ++++ b/sysdeps/aarch64/configure +@@ -148,12 +148,12 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #ifdef __AARCH64EB__ +- yes ++ is_aarch64_be + #endif + + _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 : + libc_cv_aarch64_be=yes + else + libc_cv_aarch64_be=no +diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac +index 8b042d6d05..3cdd262951 100644 +--- a/sysdeps/aarch64/configure.ac ++++ b/sysdeps/aarch64/configure.ac +@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. + # the dynamic linker via %ifdef. + AC_CACHE_CHECK([for big endian], + [libc_cv_aarch64_be], +- [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__ +- yes ++ [AC_EGREP_CPP(is_aarch64_be,[#ifdef __AARCH64EB__ ++ is_aarch64_be + #endif + ], 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 +--- a/sysdeps/arm/configure ++++ b/sysdeps/arm/configure +@@ -151,12 +151,12 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #ifdef __ARM_PCS_VFP +- yes ++ use_arm_pcs_vfp + #endif + + _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 : + libc_cv_arm_pcs_vfp=yes + else + libc_cv_arm_pcs_vfp=no +diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac +index 90cdd69c75..05a262ba00 100644 +--- a/sysdeps/arm/configure.ac ++++ b/sysdeps/arm/configure.ac +@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN) + # the dynamic linker via %ifdef. + AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], + [libc_cv_arm_pcs_vfp], +- [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP +- yes ++ [AC_EGREP_CPP(use_arm_pcs_vfp,[#ifdef __ARM_PCS_VFP ++ use_arm_pcs_vfp + #endif + ], 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 +--- a/sysdeps/mips/configure ++++ b/sysdeps/mips/configure +@@ -143,11 +143,11 @@ else + /* end confdefs.h. */ + dnl + #ifdef __mips_nan2008 +-yes ++use_mips_nan2008 + #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 : + libc_cv_mips_nan2008=yes + else + libc_cv_mips_nan2008=no +diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac +index bcbdaffd9f..ad3057f4cc 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_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], +- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl ++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl + #ifdef __mips_nan2008 +-yes ++use_mips_nan2008 + #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)]) + 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 +--- a/sysdeps/nios2/configure ++++ b/sysdeps/nios2/configure +@@ -142,12 +142,12 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #ifdef __nios2_big_endian__ +- yes ++ is_nios2_be + #endif + + _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 : + libc_cv_nios2_be=yes + else + libc_cv_nios2_be=no +diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac +index f05f43802b..dc8639902d 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. + # Nios II big endian is not yet supported. + AC_CACHE_CHECK([for big endian], + [libc_cv_nios2_be], +- [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__ +- yes ++ [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__ ++ is_nios2_be + #endif + ], 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 25f98e0c7b..e95bfae359 100644 +--- a/sysdeps/unix/sysv/linux/mips/configure ++++ b/sysdeps/unix/sysv/linux/mips/configure +@@ -414,11 +414,11 @@ else + /* end confdefs.h. */ + dnl + #ifdef __mips_nan2008 +-yes ++use_mips_nan2008 + #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 : + libc_cv_mips_nan2008=yes + else + libc_cv_mips_nan2008=no +diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac +index 3db1b32b08..f8cd375ebc 100644 +--- a/sysdeps/unix/sysv/linux/mips/configure.ac ++++ b/sysdeps/unix/sysv/linux/mips/configure.ac +@@ -105,9 +105,9 @@ AC_COMPILE_IFELSE( + LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}]) + + AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], +- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl ++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl + #ifdef __mips_nan2008 +-yes ++use_mips_nan2008 + #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)]) + + 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 +--- 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 + /* end confdefs.h. */ + #if _CALL_ELF == 2 +- yes ++ use_ppc_elfv2_abi + #endif + + _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 : + 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 + /* end confdefs.h. */ + #ifdef _CALL_ELF +- yes ++ is_def_call_elf + #endif + + _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 : + libc_cv_ppc64_def_call_elf=yes + else + libc_cv_ppc64_def_call_elf=no +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 ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac +@@ -6,8 +6,8 @@ LIBC_SLIBDIR_RTLDDIR([lib64], [lib64]) + # Define default-abi according to compiler flags. + AC_CACHE_CHECK([whether the compiler is using the PowerPC64 ELFv2 ABI], + [libc_cv_ppc64_elfv2_abi], +- [AC_EGREP_CPP(yes,[#if _CALL_ELF == 2 +- yes ++ [AC_EGREP_CPP(use_ppc_elfv2_abi,[#if _CALL_ELF == 2 ++ use_ppc_elfv2_abi + #endif + ], libc_cv_ppc64_elfv2_abi=yes, libc_cv_ppc64_elfv2_abi=no)]) + if test $libc_cv_ppc64_elfv2_abi = yes; then +@@ -19,8 +19,8 @@ else + # Compiler that do not support ELFv2 ABI does not define _CALL_ELF + AC_CACHE_CHECK([whether the compiler defines _CALL_ELF], + [libc_cv_ppc64_def_call_elf], +- [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF +- yes ++ [AC_EGREP_CPP(is_def_call_elf,[#ifdef _CALL_ELF ++ is_def_call_elf + #endif + ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)]) + if test $libc_cv_ppc64_def_call_elf = no; then +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0016-Add-unused-attribute.patch b/meta/recipes-core/glibc/glibc/0016-Add-unused-attribute.patch deleted file mode 100644 index 574e7c3503..0000000000 --- a/meta/recipes-core/glibc/glibc/0016-Add-unused-attribute.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c323125744020a29f79e50dc4d024b55c482eafc Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:28:41 +0000 -Subject: [PATCH] Add unused attribute - -Helps in avoiding gcc warning when header is is included in -a source file which does not use both functions - - * iconv/gconv_charset.h (strip): - Add unused attribute. - -Signed-off-by: Khem Raj - -Upstream-Status: Pending ---- - iconv/gconv_charset.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h -index 348acc089b..fa92465d89 100644 ---- a/iconv/gconv_charset.h -+++ b/iconv/gconv_charset.h -@@ -21,7 +21,7 @@ - #include - - --static void -+static void __attribute__ ((unused)) - strip (char *wp, const char *s) - { - int slash_count = 0; 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 new file mode 100644 index 0000000000..cd072018e5 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch @@ -0,0 +1,45 @@ +From 4762386b599f5c3287310a69ad3555e0129e0c51 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:33:03 +0000 +Subject: [PATCH 16/29] timezone: re-written tzselect as posix sh + +To avoid the bash dependency. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia +Signed-off-by: Khem Raj +--- + timezone/Makefile | 2 +- + timezone/tzselect.ksh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/timezone/Makefile b/timezone/Makefile +index 75f38df527..74e1ab7ff7 100644 +--- a/timezone/Makefile ++++ b/timezone/Makefile +@@ -122,7 +122,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 '-'. +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch new file mode 100644 index 0000000000..57907fe660 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch @@ -0,0 +1,75 @@ +From dac46c07736a799fc82be03aa546b2d24c19ad78 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 31 Dec 2015 14:33:02 -0800 +Subject: [PATCH 17/29] Remove bash dependency for 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. + +Upstream-Status: Pending + +Signed-off-by: Ross Burton +Signed-off-by: Khem Raj +--- + nscd/nscd.init | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/nscd/nscd.init b/nscd/nscd.init +index a882da7d8b..b02986ec15 100644 +--- a/nscd/nscd.init ++++ b/nscd/nscd.init +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # nscd: Starts the Name Switch Cache Daemon + # +@@ -49,7 +49,7 @@ 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: " + daemon /usr/sbin/nscd + RETVAL=$? + echo +@@ -58,7 +58,7 @@ start () { + } + + stop () { +- echo -n $"Stopping $prog: " ++ echo -n "Stopping $prog: " + /usr/sbin/nscd -K + RETVAL=$? + if [ $RETVAL -eq 0 ]; then +@@ -67,9 +67,9 @@ stop () { + # a non-privileged user + rm -f /var/run/nscd/nscd.pid + rm -f /var/run/nscd/socket +- success $"$prog shutdown" ++ success "$prog shutdown" + else +- failure $"$prog shutdown" ++ failure "$prog shutdown" + fi + echo + return $RETVAL +@@ -103,13 +103,13 @@ case "$1" in + RETVAL=$? + ;; + force-reload | reload) +- echo -n $"Reloading $prog: " ++ echo -n "Reloading $prog: " + killproc /usr/sbin/nscd -HUP + RETVAL=$? + echo + ;; + *) +- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" ++ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" + RETVAL=1 + ;; + esac +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0017-yes-within-the-path-sets-wrong-config-variables.patch b/meta/recipes-core/glibc/glibc/0017-yes-within-the-path-sets-wrong-config-variables.patch deleted file mode 100644 index 49089af41e..0000000000 --- a/meta/recipes-core/glibc/glibc/0017-yes-within-the-path-sets-wrong-config-variables.patch +++ /dev/null @@ -1,260 +0,0 @@ -From c421cd7e885497a99179b982dc4a27e8405f8857 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:31:06 +0000 -Subject: [PATCH] 'yes' within the path sets wrong config variables - -It seems that the 'AC_EGREP_CPP(yes...' example is quite popular -but being such a short word to grep it is likely to produce -false-positive matches with the path it is configured into. - -The change is to use a more elaborated string to grep for. - -Upstream-Status: Submitted [libc-alpha@sourceware.org] - -Signed-off-by: Benjamin Esquivel -Signed-off-by: Khem Raj ---- - sysdeps/aarch64/configure | 4 ++-- - sysdeps/aarch64/configure.ac | 4 ++-- - sysdeps/arm/configure | 4 ++-- - sysdeps/arm/configure.ac | 4 ++-- - sysdeps/mips/configure | 4 ++-- - sysdeps/mips/configure.ac | 4 ++-- - sysdeps/nios2/configure | 4 ++-- - sysdeps/nios2/configure.ac | 4 ++-- - sysdeps/unix/sysv/linux/mips/configure | 4 ++-- - sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++-- - sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++---- - sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++---- - 12 files changed, 28 insertions(+), 28 deletions(-) - -diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure -index 5bd355a691..3bc5537bc0 100644 ---- a/sysdeps/aarch64/configure -+++ b/sysdeps/aarch64/configure -@@ -148,12 +148,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #ifdef __AARCH64EB__ -- yes -+ is_aarch64_be - #endif - - _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 : - libc_cv_aarch64_be=yes - else - libc_cv_aarch64_be=no -diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac -index 7851dd4dac..6e9238171f 100644 ---- a/sysdeps/aarch64/configure.ac -+++ b/sysdeps/aarch64/configure.ac -@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. - # the dynamic linker via %ifdef. - AC_CACHE_CHECK([for big endian], - [libc_cv_aarch64_be], -- [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__ -- yes -+ [AC_EGREP_CPP(is_aarch64_be,[#ifdef __AARCH64EB__ -+ is_aarch64_be - #endif - ], 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 ---- a/sysdeps/arm/configure -+++ b/sysdeps/arm/configure -@@ -151,12 +151,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #ifdef __ARM_PCS_VFP -- yes -+ use_arm_pcs_vfp - #endif - - _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 : - libc_cv_arm_pcs_vfp=yes - else - libc_cv_arm_pcs_vfp=no -diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac -index 90cdd69c75..05a262ba00 100644 ---- a/sysdeps/arm/configure.ac -+++ b/sysdeps/arm/configure.ac -@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN) - # the dynamic linker via %ifdef. - AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], - [libc_cv_arm_pcs_vfp], -- [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP -- yes -+ [AC_EGREP_CPP(use_arm_pcs_vfp,[#ifdef __ARM_PCS_VFP -+ use_arm_pcs_vfp - #endif - ], 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 ---- a/sysdeps/mips/configure -+++ b/sysdeps/mips/configure -@@ -143,11 +143,11 @@ else - /* end confdefs.h. */ - dnl - #ifdef __mips_nan2008 --yes -+use_mips_nan2008 - #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 : - libc_cv_mips_nan2008=yes - else - libc_cv_mips_nan2008=no -diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac -index bcbdaffd9f..ad3057f4cc 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_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], -- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl -+ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl - #ifdef __mips_nan2008 --yes -+use_mips_nan2008 - #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)]) - 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 ---- a/sysdeps/nios2/configure -+++ b/sysdeps/nios2/configure -@@ -142,12 +142,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #ifdef __nios2_big_endian__ -- yes -+ is_nios2_be - #endif - - _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 : - libc_cv_nios2_be=yes - else - libc_cv_nios2_be=no -diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac -index f05f43802b..dc8639902d 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. - # Nios II big endian is not yet supported. - AC_CACHE_CHECK([for big endian], - [libc_cv_nios2_be], -- [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__ -- yes -+ [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__ -+ is_nios2_be - #endif - ], 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 25f98e0c7b..e95bfae359 100644 ---- a/sysdeps/unix/sysv/linux/mips/configure -+++ b/sysdeps/unix/sysv/linux/mips/configure -@@ -414,11 +414,11 @@ else - /* end confdefs.h. */ - dnl - #ifdef __mips_nan2008 --yes -+use_mips_nan2008 - #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 : - libc_cv_mips_nan2008=yes - else - libc_cv_mips_nan2008=no -diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac -index 3db1b32b08..f8cd375ebc 100644 ---- a/sysdeps/unix/sysv/linux/mips/configure.ac -+++ b/sysdeps/unix/sysv/linux/mips/configure.ac -@@ -105,9 +105,9 @@ AC_COMPILE_IFELSE( - LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}]) - - AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], -- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl -+ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl - #ifdef __mips_nan2008 --yes -+use_mips_nan2008 - #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)]) - - 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 ---- 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 - /* end confdefs.h. */ - #if _CALL_ELF == 2 -- yes -+ use_ppc_elfv2_abi - #endif - - _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 : - 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 - /* end confdefs.h. */ - #ifdef _CALL_ELF -- yes -+ is_def_call_elf - #endif - - _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 : - libc_cv_ppc64_def_call_elf=yes - else - libc_cv_ppc64_def_call_elf=no -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 -+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac -@@ -6,8 +6,8 @@ LIBC_SLIBDIR_RTLDDIR([lib64], [lib64]) - # Define default-abi according to compiler flags. - AC_CACHE_CHECK([whether the compiler is using the PowerPC64 ELFv2 ABI], - [libc_cv_ppc64_elfv2_abi], -- [AC_EGREP_CPP(yes,[#if _CALL_ELF == 2 -- yes -+ [AC_EGREP_CPP(use_ppc_elfv2_abi,[#if _CALL_ELF == 2 -+ use_ppc_elfv2_abi - #endif - ], libc_cv_ppc64_elfv2_abi=yes, libc_cv_ppc64_elfv2_abi=no)]) - if test $libc_cv_ppc64_elfv2_abi = yes; then -@@ -19,8 +19,8 @@ else - # Compiler that do not support ELFv2 ABI does not define _CALL_ELF - AC_CACHE_CHECK([whether the compiler defines _CALL_ELF], - [libc_cv_ppc64_def_call_elf], -- [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF -- yes -+ [AC_EGREP_CPP(is_def_call_elf,[#ifdef _CALL_ELF -+ is_def_call_elf - #endif - ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)]) - if test $libc_cv_ppc64_def_call_elf = no; then diff --git a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch new file mode 100644 index 0000000000..58d41ffe04 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch @@ -0,0 +1,619 @@ +From 0bd1dedf77194151397c53b12e0355c2edb8bccc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:42:58 +0000 +Subject: [PATCH 18/29] eglibc: Cross building and testing instructions + +Ported from eglibc +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + GLIBC.cross-building | 383 +++++++++++++++++++++++++++++++++++++++++++ + GLIBC.cross-testing | 205 +++++++++++++++++++++++ + 2 files changed, 588 insertions(+) + create mode 100644 GLIBC.cross-building + create mode 100644 GLIBC.cross-testing + +diff --git a/GLIBC.cross-building b/GLIBC.cross-building +new file mode 100644 +index 0000000000..e6e0da1aaf +--- /dev/null ++++ b/GLIBC.cross-building +@@ -0,0 +1,383 @@ ++ -*- mode: text -*- ++ ++ Cross-Compiling GLIBC ++ Jim Blandy ++ ++ ++Introduction ++ ++Most GNU tools have a simple build procedure: you run their ++'configure' script, and then you run 'make'. Unfortunately, the ++process of cross-compiling the GNU C library is quite a bit more ++involved: ++ ++1) Build a cross-compiler, with certain facilities disabled. ++ ++2) Configure the C library using the compiler you built in step 1). ++ Build a few of the C run-time object files, but not the rest of the ++ library. Install the library's header files and the run-time ++ object files, and create a dummy libc.so. ++ ++3) Build a second cross-compiler, using the header files and object ++ files you installed in step 2. ++ ++4) Configure, build, and install a fresh C library, using the compiler ++ built in step 3. ++ ++5) Build a third cross-compiler, based on the C library built in step 4. ++ ++The reason for this complexity is that, although GCC and the GNU C ++library are distributed separately, they are not actually independent ++of each other: GCC requires the C library's headers and some object ++files to compile its own libraries, while the C library depends on ++GCC's libraries. GLIBC includes features and bug fixes to the stock ++GNU C library that simplify this process, but the fundamental ++interdependency stands. ++ ++In this document, we explain how to cross-compile an GLIBC/GCC pair ++from source. Our intended audience is developers who are already ++familiar with the GNU toolchain and comfortable working with ++cross-development tools. While we do present a worked example to ++accompany the explanation, for clarity's sake we do not cover many of ++the options available to cross-toolchain users. ++ ++ ++Preparation ++ ++GLIBC requires recent versions of the GNU binutils, GCC, and the ++Linux kernel. The web page ++documents the current requirements, and lists patches needed for ++certain target architectures. As of this writing, these build ++instructions have been tested with binutils 2.22.51, GCC 4.6.2, ++and Linux 3.1. ++ ++First, let's set some variables, to simplify later commands. We'll ++build GLIBC and GCC for an ARM target, known to the Linux kernel ++as 'arm', and we'll do the build on an Intel x86_64 Linux box: ++ ++ $ build=x86_64-pc-linux-gnu ++ $ host=$build ++ $ target=arm-none-linux-gnueabi ++ $ linux_arch=arm ++ ++We're using the aforementioned versions of Binutils, GCC, and Linux: ++ ++ $ binutilsv=binutils-2.22.51 ++ $ gccv=gcc-4.6.2 ++ $ linuxv=linux-3.1 ++ ++We're carrying out the entire process under '~/cross-build', which ++contains unpacked source trees for binutils, gcc, and linux kernel, ++along with GLIBC svn trunk (which can be checked-out with ++'svn co http://www.eglibc.org/svn/trunk eglibc'): ++ ++ $ top=$HOME/cross-build/$target ++ $ src=$HOME/cross-build/src ++ $ ls $src ++ binutils-2.22.51 glibc gcc-4.6.2 linux-3.1 ++ ++We're going to place our build directories in a subdirectory 'obj', ++we'll install the cross-development toolchain in 'tools', and we'll ++place our sysroot (containing files to be installed on the target ++system) in 'sysroot': ++ ++ $ obj=$top/obj ++ $ tools=$top/tools ++ $ sysroot=$top/sysroot ++ ++ ++Binutils ++ ++Configuring and building binutils for the target is straightforward: ++ ++ $ mkdir -p $obj/binutils ++ $ cd $obj/binutils ++ $ $src/$binutilsv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot ++ $ make ++ $ make install ++ ++ ++The First GCC ++ ++For our work, we need a cross-compiler targeting an ARM Linux ++system. However, that configuration includes the shared library ++'libgcc_s.so', which is compiled against the GLIBC headers (which we ++haven't installed yet) and linked against 'libc.so' (which we haven't ++built yet). ++ ++Fortunately, there are configuration options for GCC which tell it not ++to build 'libgcc_s.so'. The '--without-headers' option is supposed to ++take care of this, but its implementation is incomplete, so you must ++also configure with the '--with-newlib' option. While '--with-newlib' ++appears to mean "Use the Newlib C library", its effect is to tell the ++GCC build machinery, "Don't assume there is a C library available." ++ ++We also need to disable some of the libraries that would normally be ++built along with GCC, and specify that only the compiler for the C ++language is needed. ++ ++So, we create a build directory, configure, make, and install. ++ ++ $ mkdir -p $obj/gcc1 ++ $ cd $obj/gcc1 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --without-headers --with-newlib \ ++ > --disable-shared --disable-threads --disable-libssp \ ++ > --disable-libgomp --disable-libmudflap --disable-libquadmath \ ++ > --disable-decimal-float --disable-libffi \ ++ > --enable-languages=c ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++ ++Linux Kernel Headers ++ ++To configure GLIBC, we also need Linux kernel headers in place. ++Fortunately, the Linux makefiles have a target that installs them for ++us. Since the process does modify the source tree a bit, we make a ++copy first: ++ ++ $ cp -r $src/$linuxv $obj/linux ++ $ cd $obj/linux ++ ++Now we're ready to install the headers into the sysroot: ++ ++ $ PATH=$tools/bin:$PATH \ ++ > make headers_install \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ > INSTALL_HDR_PATH=$sysroot/usr ++ ++ ++GLIBC Headers and Preliminary Objects ++ ++Using the cross-compiler we've just built, we can now configure GLIBC ++well enough to install the headers and build the object files that the ++full cross-compiler will need: ++ ++ $ mkdir -p $obj/glibc-headers ++ $ cd $obj/glibc-headers ++ $ BUILD_CC=gcc \ ++ > CC=$tools/bin/$target-gcc \ ++ > CXX=$tools/bin/$target-g++ \ ++ > AR=$tools/bin/$target-ar \ ++ > RANLIB=$tools/bin/$target-ranlib \ ++ > $src/glibc/libc/configure \ ++ > --prefix=/usr \ ++ > --with-headers=$sysroot/usr/include \ ++ > --build=$build \ ++ > --host=$target \ ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports ++ ++The option '--prefix=/usr' may look strange, but you should never ++configure GLIBC with a prefix other than '/usr': in various places, ++GLIBC's build system checks whether the prefix is '/usr', and does ++special handling only if that is the case. Unless you use this ++prefix, you will get a sysroot that does not use the standard Linux ++directory layouts and cannot be used as a basis for the root ++filesystem on your target system compatibly with normal GLIBC ++installations. ++ ++The '--with-headers' option tells GLIBC where the Linux headers have ++been installed. ++ ++The '--enable-add-ons=nptl,libidn,../ports' option tells GLIBC to look ++for the listed glibc add-ons. Most notably the ports add-on (located ++just above the libc sources in the GLIBC svn tree) is required to ++support ARM targets. ++ ++We can now use the 'install-headers' makefile target to install the ++headers: ++ ++ $ make install-headers install_root=$sysroot \ ++ > install-bootstrap-headers=yes ++ ++The 'install_root' variable indicates where the files should actually ++be installed; its value is treated as the parent of the '--prefix' ++directory we passed to the configure script, so the headers will go in ++'$sysroot/usr/include'. The 'install-bootstrap-headers' variable ++requests special handling for certain tricky header files. ++ ++Next, there are a few object files needed to link shared libraries, ++which we build and install by hand: ++ ++ $ mkdir -p $sysroot/usr/lib ++ $ make csu/subdir_lib ++ $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib ++ ++Finally, 'libgcc_s.so' requires a 'libc.so' to link against. However, ++since we will never actually execute its code, it doesn't matter what ++it contains. So, treating '/dev/null' as a C source file, we produce ++a dummy 'libc.so' in one step: ++ ++ $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \ ++ > -o $sysroot/usr/lib/libc.so ++ ++ ++The Second GCC ++ ++With the GLIBC headers and selected object files installed, we can ++now build a GCC that is capable of compiling GLIBC. We configure, ++build, and install the second GCC, again building only the C compiler, ++and avoiding libraries we won't use: ++ ++ $ mkdir -p $obj/gcc2 ++ $ cd $obj/gcc2 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot \ ++ > --disable-libssp --disable-libgomp --disable-libmudflap \ ++ > --disable-libffi --disable-libquadmath \ ++ > --enable-languages=c ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++ ++GLIBC, Complete ++ ++With the second compiler built and installed, we're now ready for the ++full GLIBC build: ++ ++ $ mkdir -p $obj/glibc ++ $ cd $obj/glibc ++ $ BUILD_CC=gcc \ ++ > CC=$tools/bin/$target-gcc \ ++ > CXX=$tools/bin/$target-g++ \ ++ > AR=$tools/bin/$target-ar \ ++ > RANLIB=$tools/bin/$target-ranlib \ ++ > $src/glibc/libc/configure \ ++ > --prefix=/usr \ ++ > --with-headers=$sysroot/usr/include \ ++ > --with-kconfig=$obj/linux/scripts/kconfig \ ++ > --build=$build \ ++ > --host=$target \ ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports ++ ++Note the additional '--with-kconfig' option. This tells GLIBC where to ++find the host config tools used by the kernel 'make config' and 'make ++menuconfig'. These tools can be re-used by GLIBC for its own 'make ++*config' support, which will create 'option-groups.config' for you. ++But first make sure those tools have been built by running some ++dummy 'make *config' calls in the kernel directory: ++ ++ $ cd $obj/linux ++ $ PATH=$tools/bin:$PATH make config \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ $ PATH=$tools/bin:$PATH make menuconfig \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ ++Now we can configure and build the full GLIBC: ++ ++ $ cd $obj/glibc ++ $ PATH=$tools/bin:$PATH make defconfig ++ $ PATH=$tools/bin:$PATH make menuconfig ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install install_root=$sysroot ++ ++At this point, we have a complete GLIBC installation in '$sysroot', ++with header files, library files, and most of the C runtime startup ++files in place. ++ ++ ++The Third GCC ++ ++Finally, we recompile GCC against this full installation, enabling ++whatever languages and libraries we would like to use: ++ ++ $ mkdir -p $obj/gcc3 ++ $ cd $obj/gcc3 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot \ ++ > --enable-__cxa_atexit \ ++ > --disable-libssp --disable-libgomp --disable-libmudflap \ ++ > --enable-languages=c,c++ ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++The '--enable-__cxa_atexit' option tells GCC what sort of C++ ++destructor support to expect from the C library; it's required with ++GLIBC. ++ ++And since GCC's installation process isn't designed to help construct ++sysroot trees, we must manually copy certain libraries into place in ++the sysroot. ++ ++ $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib ++ $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib ++ ++ ++Trying Things Out ++ ++At this point, '$tools' contains a cross toolchain ready to use ++the GLIBC installation in '$sysroot': ++ ++ $ cat > hello.c < #include ++ > int ++ > main (int argc, char **argv) ++ > { ++ > puts ("Hello, world!"); ++ > return 0; ++ > } ++ > EOF ++ $ $tools/bin/$target-gcc -Wall hello.c -o hello ++ $ cat > c++-hello.cc < #include ++ > int ++ > main (int argc, char **argv) ++ > { ++ > std::cout << "Hello, C++ world!" << std::endl; ++ > return 0; ++ > } ++ > EOF ++ $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello ++ ++ ++We can use 'readelf' to verify that these are indeed executables for ++our target, using our dynamic linker: ++ ++ $ $tools/bin/$target-readelf -hl hello ++ ELF Header: ++ ... ++ Type: EXEC (Executable file) ++ Machine: ARM ++ ++ ... ++ Program Headers: ++ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align ++ PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4 ++ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1 ++ [Requesting program interpreter: /lib/ld-linux.so.3] ++ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000 ++ ... ++ ++Looking at the dynamic section of the installed 'libgcc_s.so', we see ++that the 'NEEDED' entry for the C library does include the '.6' ++suffix, indicating that was linked against our fully build GLIBC, and ++not our dummy 'libc.so': ++ ++ $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1 ++ Dynamic section at offset 0x1083c contains 24 entries: ++ Tag Type Name/Value ++ 0x00000001 (NEEDED) Shared library: [libc.so.6] ++ 0x0000000e (SONAME) Library soname: [libgcc_s.so.1] ++ ... ++ ++ ++And on the target machine, we can run our programs: ++ ++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ ++ > ./hello ++ Hello, world! ++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ ++ > ./c++-hello ++ Hello, C++ world! +diff --git a/GLIBC.cross-testing b/GLIBC.cross-testing +new file mode 100644 +index 0000000000..b67b468466 +--- /dev/null ++++ b/GLIBC.cross-testing +@@ -0,0 +1,205 @@ ++ -*- mode: text -*- ++ ++ Cross-Testing With GLIBC ++ Jim Blandy ++ ++ ++Introduction ++ ++Developers writing software for embedded systems often use a desktop ++or other similarly capable computer for development, but need to run ++tests on the embedded system, or perhaps on a simulator. When ++configured for cross-compilation, the stock GNU C library simply ++disables running tests altogether: the command 'make tests' builds ++test programs, but does not run them. GLIBC, however, provides ++facilities for compiling tests and generating data files on the build ++system, but running the test programs themselves on a remote system or ++simulator. ++ ++ ++Test environment requirements ++ ++The test environment must meet certain conditions for GLIBC's ++cross-testing facilities to work: ++ ++- Shared filesystems. The 'build' system, on which you configure and ++ compile GLIBC, and the 'host' system, on which you intend to run ++ GLIBC, must share a filesystem containing the GLIBC build and ++ source trees. Files must appear at the same paths on both systems. ++ ++- Remote-shell like invocation. There must be a way to run a program ++ on the host system from the build system, passing it properly quoted ++ command-line arguments, setting environment variables, and ++ inheriting the caller's standard input and output. ++ ++ ++Usage ++ ++To use GLIBC's cross-testing support, provide values for the ++following Make variables when you invoke 'make': ++ ++- cross-test-wrapper ++ ++ This should be the name of the cross-testing wrapper command, along ++ with any arguments. ++ ++- cross-localedef ++ ++ This should be the name of a cross-capable localedef program, like ++ that included in the GLIBC 'localedef' module, along with any ++ arguments needed. ++ ++These are each explained in detail below. ++ ++ ++The Cross-Testing Wrapper ++ ++To run test programs reliably, the stock GNU C library takes care to ++ensure that test programs use the newly compiled dynamic linker and ++shared libraries, and never the host system's installed libraries. To ++accomplish this, it runs the tests by explicitly invoking the dynamic ++linker from the build tree, passing it a list of build tree ++directories to search for shared libraries, followed by the name of ++the executable to run and its arguments. ++ ++For example, where one might normally run a test program like this: ++ ++ $ ./tst-foo arg1 arg2 ++ ++the GNU C library might run that program like this: ++ ++ $ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++(where $objdir is the path to the top of the build tree, and the ++trailing backslash indicates a continuation of the command). In other ++words, each test program invocation is 'wrapped up' inside an explicit ++invocation of the dynamic linker, which must itself execute the test ++program, having loaded shared libraries from the appropriate ++directories. ++ ++To support cross-testing, GLIBC allows the developer to optionally ++set the 'cross-test-wrapper' Make variable to another wrapper command, ++to which it passes the entire dynamic linker invocation shown above as ++arguments. For example, if the developer supplies a wrapper of ++'my-wrapper hostname', then GLIBC would run the test above as ++follows: ++ ++ $ my-wrapper hostname \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++The 'my-wrapper' command is responsible for executing the command ++given on the host system. ++ ++Since tests are run in varying directories, the wrapper should either ++be in your command search path, or 'cross-test-wrapper' should give an ++absolute path for the wrapper. ++ ++The wrapper must meet several requirements: ++ ++- It must preserve the current directory. As explained above, the ++ build directory tree must be visible on both the build and host ++ systems, at the same path. The test wrapper must ensure that the ++ current directory it inherits is also inherited by the dynamic ++ linker (and thus the test program itself). ++ ++- It must preserve environment variables' values. Many GLIBC tests ++ set environment variables for test runs; in native testing, it ++ invokes programs like this: ++ ++ $ GCONV_PATH=$objdir/iconvdata \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++ With the cross-testing wrapper, that invocation becomes: ++ ++ $ GCONV_PATH=$objdir/iconvdata \ ++ my-wrapper hostname \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++ Here, 'my-wrapper' must ensure that the value it sees for ++ 'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo' ++ itself. (The wrapper supplied with GLIBC simply preserves the ++ values of *all* enviroment variables, with a fixed set of ++ exceptions.) ++ ++ If your wrapper is a shell script, take care to correctly propagate ++ environment variables whose values contain spaces and shell ++ metacharacters. ++ ++- It must pass the command's arguments, unmodified. The arguments ++ seen by the test program should be exactly those seen by the wrapper ++ (after whatever arguments are given to the wrapper itself). The ++ GLIBC test framework performs all needed shell word splitting and ++ expansion (wildcard expansion, parameter substitution, and so on) ++ before invoking the wrapper; further expansion may break the tests. ++ ++ ++The 'cross-test-ssh.sh' script ++ ++If you want to use 'ssh' (or something sufficiently similar) to run ++test programs on your host system, GLIBC includes a shell script, ++'scripts/cross-test-ssh.sh', which you can use as your wrapper ++command. This script takes care of setting the test command's current ++directory, propagating environment variable values, and carrying ++command-line arguments, all across an 'ssh' connection. You may even ++supply an alternative to 'ssh' on the command line, if needed. ++ ++For more details, pass 'cross-test-ssh.sh' the '--help' option. ++ ++ ++The Cross-Compiling Locale Definition Command ++ ++Some GLIBC tests rely on locales generated especially for the test ++process. In a native configuration, these tests simply run the ++'localedef' command built by the normal GLIBC build process, ++'locale/localedef', to process and install their locales. However, in ++a cross-compiling configuration, this 'localedef' is built for the ++host system, not the build system, and since it requires quite a bit ++of memory to run (we have seen it fail on systems with 64MiB of ++memory), it may not be practical to run it on the host system. ++ ++If set, GLIBC uses the 'cross-localedef' Make variable as the command ++to run on the build system to process and install locales. The ++localedef program built from the GLIBC 'localedef' module is ++suitable. ++ ++The value of 'cross-localedef' may also include command-line arguments ++to be passed to the program; if you are using GLIBC's 'localedef', ++you may include endianness and 'uint32_t' alignment arguments here. ++ ++ ++Example ++ ++In developing GLIBC's cross-testing facility, we invoked 'make' with ++the following script: ++ ++ #!/bin/sh ++ ++ srcdir=... ++ test_hostname=... ++ localedefdir=... ++ cross_gxx=...-g++ ++ ++ wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname" ++ localedef="$localedefdir/localedef --little-endian --uint32-align=4" ++ ++ make cross-test-wrapper="$wrapper" \ ++ cross-localedef="$localedef" \ ++ CXX="$cross_gxx" \ ++ "$@" ++ ++ ++Other Cross-Testing Concerns ++ ++Here are notes on some other issues which you may encounter in running ++the GLIBC tests in a cross-compiling environment: ++ ++- Some tests require a C++ cross-compiler; you should set the 'CXX' ++ Make variable to the name of an appropriate cross-compiler. ++ ++- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we ++ simply place copies of these libraries in the top GLIBC build ++ directory. +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0018-timezone-re-written-tzselect-as-posix-sh.patch b/meta/recipes-core/glibc/glibc/0018-timezone-re-written-tzselect-as-posix-sh.patch deleted file mode 100644 index 20b0ee98ea..0000000000 --- a/meta/recipes-core/glibc/glibc/0018-timezone-re-written-tzselect-as-posix-sh.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2023d88c355b8af6458c8e39ce38b75c1ca4ea2a Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Signed-off-by: Khem Raj ---- - timezone/Makefile | 2 +- - timezone/tzselect.ksh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/timezone/Makefile b/timezone/Makefile -index 75f38df527..74e1ab7ff7 100644 ---- a/timezone/Makefile -+++ b/timezone/Makefile -@@ -122,7 +122,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/0019-Remove-bash-dependency-for-nscd-init-script.patch b/meta/recipes-core/glibc/glibc/0019-Remove-bash-dependency-for-nscd-init-script.patch deleted file mode 100644 index 1c15a51308..0000000000 --- a/meta/recipes-core/glibc/glibc/0019-Remove-bash-dependency-for-nscd-init-script.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 06da20d9f89907e5f2777537244e6589ca3c9703 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 31 Dec 2015 14:33:02 -0800 -Subject: [PATCH] Remove bash dependency for 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. - -Upstream-Status: Pending - -Signed-off-by: Ross Burton -Signed-off-by: Khem Raj ---- - nscd/nscd.init | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/nscd/nscd.init b/nscd/nscd.init -index a882da7d8b..b02986ec15 100644 ---- a/nscd/nscd.init -+++ b/nscd/nscd.init -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/bin/sh - # - # nscd: Starts the Name Switch Cache Daemon - # -@@ -49,7 +49,7 @@ 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: " - daemon /usr/sbin/nscd - RETVAL=$? - echo -@@ -58,7 +58,7 @@ start () { - } - - stop () { -- echo -n $"Stopping $prog: " -+ echo -n "Stopping $prog: " - /usr/sbin/nscd -K - RETVAL=$? - if [ $RETVAL -eq 0 ]; then -@@ -67,9 +67,9 @@ stop () { - # a non-privileged user - rm -f /var/run/nscd/nscd.pid - rm -f /var/run/nscd/socket -- success $"$prog shutdown" -+ success "$prog shutdown" - else -- failure $"$prog shutdown" -+ failure "$prog shutdown" - fi - echo - return $RETVAL -@@ -103,13 +103,13 @@ case "$1" in - RETVAL=$? - ;; - force-reload | reload) -- echo -n $"Reloading $prog: " -+ echo -n "Reloading $prog: " - killproc /usr/sbin/nscd -HUP - RETVAL=$? - echo - ;; - *) -- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" -+ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" - RETVAL=1 - ;; - esac diff --git a/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch new file mode 100644 index 0000000000..f633079f34 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch @@ -0,0 +1,100 @@ +From 5591b7653411da26fa2939352e50ea4121b327e6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:49:28 +0000 +Subject: [PATCH 19/29] eglibc: Help bootstrap cross toolchain + +Taken from EGLIBC, r1484 + r1525 + + 2007-02-20 Jim Blandy + + * Makefile (install-headers): Preserve old behavior: depend on + $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers + is set; otherwise, place gnu/stubs.h on the 'install-others' list. + + 2007-02-16 Jim Blandy + + * Makefile: Amend make install-headers to install everything + necessary for building a cross-compiler. Install gnu/stubs.h as + part of 'install-headers', not 'install-others'. + If install-bootstrap-headers is 'yes', install a dummy copy of + gnu/stubs.h, instead of computing the real thing. + * include/stubs-bootstrap.h: New file. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + Makefile | 22 +++++++++++++++++++++- + include/stubs-bootstrap.h | 12 ++++++++++++ + 2 files changed, 33 insertions(+), 1 deletion(-) + create mode 100644 include/stubs-bootstrap.h + +diff --git a/Makefile b/Makefile +index 6dcfe40c25..bc37c32e5a 100644 +--- a/Makefile ++++ b/Makefile +@@ -79,9 +79,18 @@ subdir-dirs = include + vpath %.h $(subdir-dirs) + + # What to install. +-install-others = $(inst_includedir)/gnu/stubs.h + install-bin-script = + ++# If we're bootstrapping, install a dummy gnu/stubs.h along with the ++# other headers, so 'make install-headers' produces a useable include ++# tree. Otherwise, install gnu/stubs.h later, after the rest of the ++# build is done. ++ifeq ($(install-bootstrap-headers),yes) ++install-headers: $(inst_includedir)/gnu/stubs.h ++else ++install-others = $(inst_includedir)/gnu/stubs.h ++endif ++ + ifeq (yes,$(build-shared)) + headers += gnu/lib-names.h + endif +@@ -407,6 +416,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh + + subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) + ++# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o ++# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty ++# gnu/stubs.h is good enough. ++ifeq ($(install-bootstrap-headers),yes) ++$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force) ++ $(make-target-directory) ++ $(INSTALL_DATA) $< $@ ++ ++installed-stubs = ++else + ifndef abi-variants + installed-stubs = $(inst_includedir)/gnu/stubs.h + else +@@ -433,6 +452,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) + + install-others-nosubdir: $(installed-stubs) + endif ++endif + + + # Since stubs.h is never needed when building the library, we simplify the +diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h +new file mode 100644 +index 0000000000..1d2b669aff +--- /dev/null ++++ b/include/stubs-bootstrap.h +@@ -0,0 +1,12 @@ ++/* Placeholder stubs.h file for bootstrapping. ++ ++ When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC ++ headers be installed, but we can't fully build EGLIBC without that ++ GCC. So we run the command: ++ ++ make install-headers install-bootstrap-headers=yes ++ ++ to install the headers GCC needs, but avoid building certain ++ difficult headers. The header depends, via the ++ EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but ++ an empty stubs.h like this will do fine for GCC. */ +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0020-eglibc-Cross-building-and-testing-instructions.patch b/meta/recipes-core/glibc/glibc/0020-eglibc-Cross-building-and-testing-instructions.patch deleted file mode 100644 index eda5565371..0000000000 --- a/meta/recipes-core/glibc/glibc/0020-eglibc-Cross-building-and-testing-instructions.patch +++ /dev/null @@ -1,616 +0,0 @@ -From 5641452a24f76c5dafa3749a542fcac93f77390f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:42:58 +0000 -Subject: [PATCH] eglibc: Cross building and testing instructions - -Ported from eglibc -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - GLIBC.cross-building | 383 +++++++++++++++++++++++++++++++++++++++++++ - GLIBC.cross-testing | 205 +++++++++++++++++++++++ - 2 files changed, 588 insertions(+) - create mode 100644 GLIBC.cross-building - create mode 100644 GLIBC.cross-testing - -diff --git a/GLIBC.cross-building b/GLIBC.cross-building -new file mode 100644 -index 0000000000..e6e0da1aaf ---- /dev/null -+++ b/GLIBC.cross-building -@@ -0,0 +1,383 @@ -+ -*- mode: text -*- -+ -+ Cross-Compiling GLIBC -+ Jim Blandy -+ -+ -+Introduction -+ -+Most GNU tools have a simple build procedure: you run their -+'configure' script, and then you run 'make'. Unfortunately, the -+process of cross-compiling the GNU C library is quite a bit more -+involved: -+ -+1) Build a cross-compiler, with certain facilities disabled. -+ -+2) Configure the C library using the compiler you built in step 1). -+ Build a few of the C run-time object files, but not the rest of the -+ library. Install the library's header files and the run-time -+ object files, and create a dummy libc.so. -+ -+3) Build a second cross-compiler, using the header files and object -+ files you installed in step 2. -+ -+4) Configure, build, and install a fresh C library, using the compiler -+ built in step 3. -+ -+5) Build a third cross-compiler, based on the C library built in step 4. -+ -+The reason for this complexity is that, although GCC and the GNU C -+library are distributed separately, they are not actually independent -+of each other: GCC requires the C library's headers and some object -+files to compile its own libraries, while the C library depends on -+GCC's libraries. GLIBC includes features and bug fixes to the stock -+GNU C library that simplify this process, but the fundamental -+interdependency stands. -+ -+In this document, we explain how to cross-compile an GLIBC/GCC pair -+from source. Our intended audience is developers who are already -+familiar with the GNU toolchain and comfortable working with -+cross-development tools. While we do present a worked example to -+accompany the explanation, for clarity's sake we do not cover many of -+the options available to cross-toolchain users. -+ -+ -+Preparation -+ -+GLIBC requires recent versions of the GNU binutils, GCC, and the -+Linux kernel. The web page -+documents the current requirements, and lists patches needed for -+certain target architectures. As of this writing, these build -+instructions have been tested with binutils 2.22.51, GCC 4.6.2, -+and Linux 3.1. -+ -+First, let's set some variables, to simplify later commands. We'll -+build GLIBC and GCC for an ARM target, known to the Linux kernel -+as 'arm', and we'll do the build on an Intel x86_64 Linux box: -+ -+ $ build=x86_64-pc-linux-gnu -+ $ host=$build -+ $ target=arm-none-linux-gnueabi -+ $ linux_arch=arm -+ -+We're using the aforementioned versions of Binutils, GCC, and Linux: -+ -+ $ binutilsv=binutils-2.22.51 -+ $ gccv=gcc-4.6.2 -+ $ linuxv=linux-3.1 -+ -+We're carrying out the entire process under '~/cross-build', which -+contains unpacked source trees for binutils, gcc, and linux kernel, -+along with GLIBC svn trunk (which can be checked-out with -+'svn co http://www.eglibc.org/svn/trunk eglibc'): -+ -+ $ top=$HOME/cross-build/$target -+ $ src=$HOME/cross-build/src -+ $ ls $src -+ binutils-2.22.51 glibc gcc-4.6.2 linux-3.1 -+ -+We're going to place our build directories in a subdirectory 'obj', -+we'll install the cross-development toolchain in 'tools', and we'll -+place our sysroot (containing files to be installed on the target -+system) in 'sysroot': -+ -+ $ obj=$top/obj -+ $ tools=$top/tools -+ $ sysroot=$top/sysroot -+ -+ -+Binutils -+ -+Configuring and building binutils for the target is straightforward: -+ -+ $ mkdir -p $obj/binutils -+ $ cd $obj/binutils -+ $ $src/$binutilsv/configure \ -+ > --target=$target \ -+ > --prefix=$tools \ -+ > --with-sysroot=$sysroot -+ $ make -+ $ make install -+ -+ -+The First GCC -+ -+For our work, we need a cross-compiler targeting an ARM Linux -+system. However, that configuration includes the shared library -+'libgcc_s.so', which is compiled against the GLIBC headers (which we -+haven't installed yet) and linked against 'libc.so' (which we haven't -+built yet). -+ -+Fortunately, there are configuration options for GCC which tell it not -+to build 'libgcc_s.so'. The '--without-headers' option is supposed to -+take care of this, but its implementation is incomplete, so you must -+also configure with the '--with-newlib' option. While '--with-newlib' -+appears to mean "Use the Newlib C library", its effect is to tell the -+GCC build machinery, "Don't assume there is a C library available." -+ -+We also need to disable some of the libraries that would normally be -+built along with GCC, and specify that only the compiler for the C -+language is needed. -+ -+So, we create a build directory, configure, make, and install. -+ -+ $ mkdir -p $obj/gcc1 -+ $ cd $obj/gcc1 -+ $ $src/$gccv/configure \ -+ > --target=$target \ -+ > --prefix=$tools \ -+ > --without-headers --with-newlib \ -+ > --disable-shared --disable-threads --disable-libssp \ -+ > --disable-libgomp --disable-libmudflap --disable-libquadmath \ -+ > --disable-decimal-float --disable-libffi \ -+ > --enable-languages=c -+ $ PATH=$tools/bin:$PATH make -+ $ PATH=$tools/bin:$PATH make install -+ -+ -+Linux Kernel Headers -+ -+To configure GLIBC, we also need Linux kernel headers in place. -+Fortunately, the Linux makefiles have a target that installs them for -+us. Since the process does modify the source tree a bit, we make a -+copy first: -+ -+ $ cp -r $src/$linuxv $obj/linux -+ $ cd $obj/linux -+ -+Now we're ready to install the headers into the sysroot: -+ -+ $ PATH=$tools/bin:$PATH \ -+ > make headers_install \ -+ > ARCH=$linux_arch CROSS_COMPILE=$target- \ -+ > INSTALL_HDR_PATH=$sysroot/usr -+ -+ -+GLIBC Headers and Preliminary Objects -+ -+Using the cross-compiler we've just built, we can now configure GLIBC -+well enough to install the headers and build the object files that the -+full cross-compiler will need: -+ -+ $ mkdir -p $obj/glibc-headers -+ $ cd $obj/glibc-headers -+ $ BUILD_CC=gcc \ -+ > CC=$tools/bin/$target-gcc \ -+ > CXX=$tools/bin/$target-g++ \ -+ > AR=$tools/bin/$target-ar \ -+ > RANLIB=$tools/bin/$target-ranlib \ -+ > $src/glibc/libc/configure \ -+ > --prefix=/usr \ -+ > --with-headers=$sysroot/usr/include \ -+ > --build=$build \ -+ > --host=$target \ -+ > --disable-profile --without-gd --without-cvs \ -+ > --enable-add-ons=nptl,libidn,../ports -+ -+The option '--prefix=/usr' may look strange, but you should never -+configure GLIBC with a prefix other than '/usr': in various places, -+GLIBC's build system checks whether the prefix is '/usr', and does -+special handling only if that is the case. Unless you use this -+prefix, you will get a sysroot that does not use the standard Linux -+directory layouts and cannot be used as a basis for the root -+filesystem on your target system compatibly with normal GLIBC -+installations. -+ -+The '--with-headers' option tells GLIBC where the Linux headers have -+been installed. -+ -+The '--enable-add-ons=nptl,libidn,../ports' option tells GLIBC to look -+for the listed glibc add-ons. Most notably the ports add-on (located -+just above the libc sources in the GLIBC svn tree) is required to -+support ARM targets. -+ -+We can now use the 'install-headers' makefile target to install the -+headers: -+ -+ $ make install-headers install_root=$sysroot \ -+ > install-bootstrap-headers=yes -+ -+The 'install_root' variable indicates where the files should actually -+be installed; its value is treated as the parent of the '--prefix' -+directory we passed to the configure script, so the headers will go in -+'$sysroot/usr/include'. The 'install-bootstrap-headers' variable -+requests special handling for certain tricky header files. -+ -+Next, there are a few object files needed to link shared libraries, -+which we build and install by hand: -+ -+ $ mkdir -p $sysroot/usr/lib -+ $ make csu/subdir_lib -+ $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib -+ -+Finally, 'libgcc_s.so' requires a 'libc.so' to link against. However, -+since we will never actually execute its code, it doesn't matter what -+it contains. So, treating '/dev/null' as a C source file, we produce -+a dummy 'libc.so' in one step: -+ -+ $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \ -+ > -o $sysroot/usr/lib/libc.so -+ -+ -+The Second GCC -+ -+With the GLIBC headers and selected object files installed, we can -+now build a GCC that is capable of compiling GLIBC. We configure, -+build, and install the second GCC, again building only the C compiler, -+and avoiding libraries we won't use: -+ -+ $ mkdir -p $obj/gcc2 -+ $ cd $obj/gcc2 -+ $ $src/$gccv/configure \ -+ > --target=$target \ -+ > --prefix=$tools \ -+ > --with-sysroot=$sysroot \ -+ > --disable-libssp --disable-libgomp --disable-libmudflap \ -+ > --disable-libffi --disable-libquadmath \ -+ > --enable-languages=c -+ $ PATH=$tools/bin:$PATH make -+ $ PATH=$tools/bin:$PATH make install -+ -+ -+GLIBC, Complete -+ -+With the second compiler built and installed, we're now ready for the -+full GLIBC build: -+ -+ $ mkdir -p $obj/glibc -+ $ cd $obj/glibc -+ $ BUILD_CC=gcc \ -+ > CC=$tools/bin/$target-gcc \ -+ > CXX=$tools/bin/$target-g++ \ -+ > AR=$tools/bin/$target-ar \ -+ > RANLIB=$tools/bin/$target-ranlib \ -+ > $src/glibc/libc/configure \ -+ > --prefix=/usr \ -+ > --with-headers=$sysroot/usr/include \ -+ > --with-kconfig=$obj/linux/scripts/kconfig \ -+ > --build=$build \ -+ > --host=$target \ -+ > --disable-profile --without-gd --without-cvs \ -+ > --enable-add-ons=nptl,libidn,../ports -+ -+Note the additional '--with-kconfig' option. This tells GLIBC where to -+find the host config tools used by the kernel 'make config' and 'make -+menuconfig'. These tools can be re-used by GLIBC for its own 'make -+*config' support, which will create 'option-groups.config' for you. -+But first make sure those tools have been built by running some -+dummy 'make *config' calls in the kernel directory: -+ -+ $ cd $obj/linux -+ $ PATH=$tools/bin:$PATH make config \ -+ > ARCH=$linux_arch CROSS_COMPILE=$target- \ -+ $ PATH=$tools/bin:$PATH make menuconfig \ -+ > ARCH=$linux_arch CROSS_COMPILE=$target- \ -+ -+Now we can configure and build the full GLIBC: -+ -+ $ cd $obj/glibc -+ $ PATH=$tools/bin:$PATH make defconfig -+ $ PATH=$tools/bin:$PATH make menuconfig -+ $ PATH=$tools/bin:$PATH make -+ $ PATH=$tools/bin:$PATH make install install_root=$sysroot -+ -+At this point, we have a complete GLIBC installation in '$sysroot', -+with header files, library files, and most of the C runtime startup -+files in place. -+ -+ -+The Third GCC -+ -+Finally, we recompile GCC against this full installation, enabling -+whatever languages and libraries we would like to use: -+ -+ $ mkdir -p $obj/gcc3 -+ $ cd $obj/gcc3 -+ $ $src/$gccv/configure \ -+ > --target=$target \ -+ > --prefix=$tools \ -+ > --with-sysroot=$sysroot \ -+ > --enable-__cxa_atexit \ -+ > --disable-libssp --disable-libgomp --disable-libmudflap \ -+ > --enable-languages=c,c++ -+ $ PATH=$tools/bin:$PATH make -+ $ PATH=$tools/bin:$PATH make install -+ -+The '--enable-__cxa_atexit' option tells GCC what sort of C++ -+destructor support to expect from the C library; it's required with -+GLIBC. -+ -+And since GCC's installation process isn't designed to help construct -+sysroot trees, we must manually copy certain libraries into place in -+the sysroot. -+ -+ $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib -+ $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib -+ -+ -+Trying Things Out -+ -+At this point, '$tools' contains a cross toolchain ready to use -+the GLIBC installation in '$sysroot': -+ -+ $ cat > hello.c < #include -+ > int -+ > main (int argc, char **argv) -+ > { -+ > puts ("Hello, world!"); -+ > return 0; -+ > } -+ > EOF -+ $ $tools/bin/$target-gcc -Wall hello.c -o hello -+ $ cat > c++-hello.cc < #include -+ > int -+ > main (int argc, char **argv) -+ > { -+ > std::cout << "Hello, C++ world!" << std::endl; -+ > return 0; -+ > } -+ > EOF -+ $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello -+ -+ -+We can use 'readelf' to verify that these are indeed executables for -+our target, using our dynamic linker: -+ -+ $ $tools/bin/$target-readelf -hl hello -+ ELF Header: -+ ... -+ Type: EXEC (Executable file) -+ Machine: ARM -+ -+ ... -+ Program Headers: -+ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align -+ PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4 -+ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1 -+ [Requesting program interpreter: /lib/ld-linux.so.3] -+ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000 -+ ... -+ -+Looking at the dynamic section of the installed 'libgcc_s.so', we see -+that the 'NEEDED' entry for the C library does include the '.6' -+suffix, indicating that was linked against our fully build GLIBC, and -+not our dummy 'libc.so': -+ -+ $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1 -+ Dynamic section at offset 0x1083c contains 24 entries: -+ Tag Type Name/Value -+ 0x00000001 (NEEDED) Shared library: [libc.so.6] -+ 0x0000000e (SONAME) Library soname: [libgcc_s.so.1] -+ ... -+ -+ -+And on the target machine, we can run our programs: -+ -+ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ -+ > ./hello -+ Hello, world! -+ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ -+ > ./c++-hello -+ Hello, C++ world! -diff --git a/GLIBC.cross-testing b/GLIBC.cross-testing -new file mode 100644 -index 0000000000..b67b468466 ---- /dev/null -+++ b/GLIBC.cross-testing -@@ -0,0 +1,205 @@ -+ -*- mode: text -*- -+ -+ Cross-Testing With GLIBC -+ Jim Blandy -+ -+ -+Introduction -+ -+Developers writing software for embedded systems often use a desktop -+or other similarly capable computer for development, but need to run -+tests on the embedded system, or perhaps on a simulator. When -+configured for cross-compilation, the stock GNU C library simply -+disables running tests altogether: the command 'make tests' builds -+test programs, but does not run them. GLIBC, however, provides -+facilities for compiling tests and generating data files on the build -+system, but running the test programs themselves on a remote system or -+simulator. -+ -+ -+Test environment requirements -+ -+The test environment must meet certain conditions for GLIBC's -+cross-testing facilities to work: -+ -+- Shared filesystems. The 'build' system, on which you configure and -+ compile GLIBC, and the 'host' system, on which you intend to run -+ GLIBC, must share a filesystem containing the GLIBC build and -+ source trees. Files must appear at the same paths on both systems. -+ -+- Remote-shell like invocation. There must be a way to run a program -+ on the host system from the build system, passing it properly quoted -+ command-line arguments, setting environment variables, and -+ inheriting the caller's standard input and output. -+ -+ -+Usage -+ -+To use GLIBC's cross-testing support, provide values for the -+following Make variables when you invoke 'make': -+ -+- cross-test-wrapper -+ -+ This should be the name of the cross-testing wrapper command, along -+ with any arguments. -+ -+- cross-localedef -+ -+ This should be the name of a cross-capable localedef program, like -+ that included in the GLIBC 'localedef' module, along with any -+ arguments needed. -+ -+These are each explained in detail below. -+ -+ -+The Cross-Testing Wrapper -+ -+To run test programs reliably, the stock GNU C library takes care to -+ensure that test programs use the newly compiled dynamic linker and -+shared libraries, and never the host system's installed libraries. To -+accomplish this, it runs the tests by explicitly invoking the dynamic -+linker from the build tree, passing it a list of build tree -+directories to search for shared libraries, followed by the name of -+the executable to run and its arguments. -+ -+For example, where one might normally run a test program like this: -+ -+ $ ./tst-foo arg1 arg2 -+ -+the GNU C library might run that program like this: -+ -+ $ $objdir/elf/ld-linux.so.3 --library-path $objdir \ -+ ./tst-foo arg1 arg2 -+ -+(where $objdir is the path to the top of the build tree, and the -+trailing backslash indicates a continuation of the command). In other -+words, each test program invocation is 'wrapped up' inside an explicit -+invocation of the dynamic linker, which must itself execute the test -+program, having loaded shared libraries from the appropriate -+directories. -+ -+To support cross-testing, GLIBC allows the developer to optionally -+set the 'cross-test-wrapper' Make variable to another wrapper command, -+to which it passes the entire dynamic linker invocation shown above as -+arguments. For example, if the developer supplies a wrapper of -+'my-wrapper hostname', then GLIBC would run the test above as -+follows: -+ -+ $ my-wrapper hostname \ -+ $objdir/elf/ld-linux.so.3 --library-path $objdir \ -+ ./tst-foo arg1 arg2 -+ -+The 'my-wrapper' command is responsible for executing the command -+given on the host system. -+ -+Since tests are run in varying directories, the wrapper should either -+be in your command search path, or 'cross-test-wrapper' should give an -+absolute path for the wrapper. -+ -+The wrapper must meet several requirements: -+ -+- It must preserve the current directory. As explained above, the -+ build directory tree must be visible on both the build and host -+ systems, at the same path. The test wrapper must ensure that the -+ current directory it inherits is also inherited by the dynamic -+ linker (and thus the test program itself). -+ -+- It must preserve environment variables' values. Many GLIBC tests -+ set environment variables for test runs; in native testing, it -+ invokes programs like this: -+ -+ $ GCONV_PATH=$objdir/iconvdata \ -+ $objdir/elf/ld-linux.so.3 --library-path $objdir \ -+ ./tst-foo arg1 arg2 -+ -+ With the cross-testing wrapper, that invocation becomes: -+ -+ $ GCONV_PATH=$objdir/iconvdata \ -+ my-wrapper hostname \ -+ $objdir/elf/ld-linux.so.3 --library-path $objdir \ -+ ./tst-foo arg1 arg2 -+ -+ Here, 'my-wrapper' must ensure that the value it sees for -+ 'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo' -+ itself. (The wrapper supplied with GLIBC simply preserves the -+ values of *all* enviroment variables, with a fixed set of -+ exceptions.) -+ -+ If your wrapper is a shell script, take care to correctly propagate -+ environment variables whose values contain spaces and shell -+ metacharacters. -+ -+- It must pass the command's arguments, unmodified. The arguments -+ seen by the test program should be exactly those seen by the wrapper -+ (after whatever arguments are given to the wrapper itself). The -+ GLIBC test framework performs all needed shell word splitting and -+ expansion (wildcard expansion, parameter substitution, and so on) -+ before invoking the wrapper; further expansion may break the tests. -+ -+ -+The 'cross-test-ssh.sh' script -+ -+If you want to use 'ssh' (or something sufficiently similar) to run -+test programs on your host system, GLIBC includes a shell script, -+'scripts/cross-test-ssh.sh', which you can use as your wrapper -+command. This script takes care of setting the test command's current -+directory, propagating environment variable values, and carrying -+command-line arguments, all across an 'ssh' connection. You may even -+supply an alternative to 'ssh' on the command line, if needed. -+ -+For more details, pass 'cross-test-ssh.sh' the '--help' option. -+ -+ -+The Cross-Compiling Locale Definition Command -+ -+Some GLIBC tests rely on locales generated especially for the test -+process. In a native configuration, these tests simply run the -+'localedef' command built by the normal GLIBC build process, -+'locale/localedef', to process and install their locales. However, in -+a cross-compiling configuration, this 'localedef' is built for the -+host system, not the build system, and since it requires quite a bit -+of memory to run (we have seen it fail on systems with 64MiB of -+memory), it may not be practical to run it on the host system. -+ -+If set, GLIBC uses the 'cross-localedef' Make variable as the command -+to run on the build system to process and install locales. The -+localedef program built from the GLIBC 'localedef' module is -+suitable. -+ -+The value of 'cross-localedef' may also include command-line arguments -+to be passed to the program; if you are using GLIBC's 'localedef', -+you may include endianness and 'uint32_t' alignment arguments here. -+ -+ -+Example -+ -+In developing GLIBC's cross-testing facility, we invoked 'make' with -+the following script: -+ -+ #!/bin/sh -+ -+ srcdir=... -+ test_hostname=... -+ localedefdir=... -+ cross_gxx=...-g++ -+ -+ wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname" -+ localedef="$localedefdir/localedef --little-endian --uint32-align=4" -+ -+ make cross-test-wrapper="$wrapper" \ -+ cross-localedef="$localedef" \ -+ CXX="$cross_gxx" \ -+ "$@" -+ -+ -+Other Cross-Testing Concerns -+ -+Here are notes on some other issues which you may encounter in running -+the GLIBC tests in a cross-compiling environment: -+ -+- Some tests require a C++ cross-compiler; you should set the 'CXX' -+ Make variable to the name of an appropriate cross-compiler. -+ -+- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we -+ simply place copies of these libraries in the top GLIBC build -+ directory. diff --git a/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch b/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch new file mode 100644 index 0000000000..bb21c54721 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch @@ -0,0 +1,56 @@ +From d3451c186f96c6b2434a4ac9304c01730bf22061 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:55:53 +0000 +Subject: [PATCH 20/29] eglibc: Resolve __fpscr_values on SH4 + +2010-09-29 Nobuhiro Iwamatsu + Andrew Stubbs + + Resolve SH's __fpscr_values to symbol in libc.so. + + * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype. + * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values. + * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + sysdeps/unix/sysv/linux/sh/Versions | 1 + + sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++ + 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 +--- a/sysdeps/unix/sysv/linux/sh/Versions ++++ b/sysdeps/unix/sysv/linux/sh/Versions +@@ -2,6 +2,7 @@ libc { + GLIBC_2.2 { + # functions used in other libraries + __xstat64; __fxstat64; __lxstat64; ++ __fpscr_values; + + # a* + alphasort64; +diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S +index 85ff3f900e..7743b8d57a 100644 +--- a/sysdeps/unix/sysv/linux/sh/sysdep.S ++++ b/sysdeps/unix/sysv/linux/sh/sysdep.S +@@ -30,3 +30,14 @@ ENTRY (__syscall_error) + + #define __syscall_error __syscall_error_1 + #include ++ ++ .data ++ .align 3 ++ .globl ___fpscr_values ++ .type ___fpscr_values, @object ++ .size ___fpscr_values, 8 ++___fpscr_values: ++ .long 0 ++ .long 0x80000 ++weak_alias (___fpscr_values, __fpscr_values) ++ +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch b/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch new file mode 100644 index 0000000000..7fe5db0c2a --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch @@ -0,0 +1,563 @@ +From e4b8abdc2d884d721fd89d67b689546f2f780924 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 01:33:49 +0000 +Subject: [PATCH 21/29] eglibc: Forward port cross locale generation support + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + locale/Makefile | 3 +- + locale/catnames.c | 46 +++++++++++++++++++++++++++ + locale/localeinfo.h | 2 +- + locale/programs/charmap-dir.c | 6 ++++ + locale/programs/ld-collate.c | 17 +++++----- + locale/programs/ld-ctype.c | 27 ++++++++-------- + locale/programs/ld-time.c | 31 ++++++++++++------ + locale/programs/linereader.c | 2 +- + locale/programs/localedef.c | 8 +++++ + locale/programs/locfile.c | 5 ++- + locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++-- + locale/setlocale.c | 29 ----------------- + 12 files changed, 167 insertions(+), 68 deletions(-) + create mode 100644 locale/catnames.c + +diff --git a/locale/Makefile b/locale/Makefile +index 49c0c78c7d..ebfcf4f4da 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 \ +diff --git a/locale/catnames.c b/locale/catnames.c +new file mode 100644 +index 0000000000..538f3f5edb +--- /dev/null ++++ b/locale/catnames.c +@@ -0,0 +1,46 @@ ++/* Copyright (C) 2006 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 "localeinfo.h" ++ ++/* Define an array of category names (also the environment variable names). */ ++const struct catnamestr_t _nl_category_names attribute_hidden = ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ category_name, ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ }; ++ ++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ [category] = offsetof (struct catnamestr_t, CATNAMEMF (__LINE__)), ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ }; ++ ++/* An array of their lengths, for convenience. */ ++const uint8_t _nl_category_name_sizes[] attribute_hidden = ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ [category] = sizeof (category_name) - 1, ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ [LC_ALL] = sizeof ("LC_ALL") - 1 ++ }; +diff --git a/locale/localeinfo.h b/locale/localeinfo.h +index fdc283c69a..4eeed35f90 100644 +--- a/locale/localeinfo.h ++++ b/locale/localeinfo.h +@@ -230,7 +230,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. */ +-#ifndef SHARED ++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF + # include + # define NL_CURRENT_INDIRECT 1 + #endif +diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c +index 1a526a240d..0fb2daf936 100644 +--- a/locale/programs/charmap-dir.c ++++ b/locale/programs/charmap-dir.c +@@ -18,7 +18,9 @@ + #include + #include + #include ++#ifndef NO_UNCOMPRESS + #include ++#endif + #include + #include + #include +@@ -154,6 +156,7 @@ charmap_closedir (CHARMAP_DIR *cdir) + return closedir (dir); + } + ++#ifndef NO_UNCOMPRESS + /* Creates a subprocess decompressing the given pathname, and returns + a stream reading its output (the decompressed data). */ + static +@@ -202,6 +205,7 @@ fopen_uncompressed (const char *pathname, const char *compressor) + } + return NULL; + } ++#endif + + /* Opens a charmap for reading, given its name (not an alias name). */ + FILE * +@@ -224,6 +228,7 @@ charmap_open (const char *directory, const char *name) + if (stream != NULL) + return stream; + ++#ifndef NO_UNCOMPRESS + memcpy (p, ".gz", 4); + stream = fopen_uncompressed (pathname, "gzip"); + if (stream != NULL) +@@ -233,6 +238,7 @@ charmap_open (const char *directory, const char *name) + stream = fopen_uncompressed (pathname, "bzip2"); + if (stream != NULL) + return stream; ++#endif + + return NULL; + } +diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c +index feb1a11258..5a8e522470 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, + } + if (wcs != NULL) + { +- size_t nwcs = wcslen ((wchar_t *) wcs); ++ size_t nwcs = wcslen_uint32 (wcs); + uint32_t zero = 0; + /* Handle as a single character. */ + if (nwcs == 0) +@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); + + if ((*eptr)->nwcs == runp->nwcs) + { +- int c = wmemcmp ((wchar_t *) (*eptr)->wcs, +- (wchar_t *) runp->wcs, runp->nwcs); ++ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs); + + if (c == 0) + { +@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) + one consecutive entry. */ + if (runp->wcnext != NULL + && runp->nwcs == runp->wcnext->nwcs +- && wmemcmp ((wchar_t *) runp->wcs, +- (wchar_t *)runp->wcnext->wcs, +- runp->nwcs - 1) == 0 ++ && wmemcmp_uint32 (runp->wcs, ++ runp->wcnext->wcs, ++ runp->nwcs - 1) == 0 + && (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) + runp = runp->wcnext; + while (runp->wcnext != NULL + && runp->nwcs == runp->wcnext->nwcs +- && wmemcmp ((wchar_t *) runp->wcs, +- (wchar_t *)runp->wcnext->wcs, +- runp->nwcs - 1) == 0 ++ && wmemcmp_uint32 (runp->wcs, ++ runp->wcnext->wcs, ++ runp->nwcs - 1) == 0 + && (runp->wcs[runp->nwcs - 1] + == runp->wcnext->wcs[runp->nwcs - 1] + 1)); + +diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c +index 3328093d0e..d58fb0f4b7 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, + allocate_arrays (ctype, charmap, ctype->repertoire); + + default_missing_len = (ctype->default_missing +- ? wcslen ((wchar_t *) ctype->default_missing) ++ ? wcslen_uint32 (ctype->default_missing) + : 0); + + init_locale_data (&file, nelems); +@@ -1927,7 +1927,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, + ignore = 1; + else + /* This value is usable. */ +- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4); ++ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4); + + first = 0; + } +@@ -2461,8 +2461,8 @@ with character code range values one must use the absolute ellipsis `...'")); + } + + handle_tok_digit: +- class_bit = _ISwdigit; +- class256_bit = _ISdigit; ++ class_bit = BITw (tok_digit); ++ class256_bit = BIT (tok_digit); + handle_digits = 1; + goto read_charclass; + +@@ -3904,8 +3904,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, + + while (idx < number) + { +- int res = wcscmp ((const wchar_t *) sorted[idx]->from, +- (const wchar_t *) runp->from); ++ int res = wcscmp_uint32 (sorted[idx]->from, runp->from); + if (res == 0) + { + replace = 1; +@@ -3942,11 +3941,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; +- from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1; ++ from_len += wcslen_uint32 (sorted[cnt]->from) + 1; + srunp = sorted[cnt]->to; + while (srunp != NULL) + { +- to_len += wcslen ((const wchar_t *) srunp->str) + 1; ++ to_len += wcslen_uint32 (srunp->str) + 1; + 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, + ctype->translit_from_idx[cnt] = from_len; + ctype->translit_to_idx[cnt] = to_len; + +- len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1; +- wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len], +- (const wchar_t *) sorted[cnt]->from, len); ++ len = wcslen_uint32 (sorted[cnt]->from) + 1; ++ wmemcpy_uint32 (&ctype->translit_from_tbl[from_len], ++ sorted[cnt]->from, len); + from_len += len; + + ctype->translit_to_idx[cnt] = to_len; + srunp = sorted[cnt]->to; + while (srunp != NULL) + { +- len = wcslen ((const wchar_t *) srunp->str) + 1; +- wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len], +- (const wchar_t *) srunp->str, len); ++ len = wcslen_uint32 (srunp->str) + 1; ++ wmemcpy_uint32 (&ctype->translit_to_tbl[to_len], ++ srunp->str, len); + to_len += len; + srunp = srunp->next; + } +diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c +index f7db873adb..fec3773c9d 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"); + } + else + { ++ static const uint32_t wt_fmt_ampm[] ++ = { '%','I',':','%','M',':','%','S',' ','%','p',0 }; + time->t_fmt_ampm = "%I:%M:%S %p"; +- time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p"; ++ time->wt_fmt_ampm = wt_fmt_ampm; + } + } + +@@ -231,7 +233,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; +- wchar_t *wstr; ++ uint32_t *wstr; + + time->era_entries = + (struct era_data *) xmalloc (time->num_era +@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME"); + } + + /* Now generate the wide character name and format. */ +- wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */ ++ wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */ + if (wstr != NULL) + { +- time->era_entries[idx].wname = (uint32_t *) wstr + 1; +- wstr = wcschr (wstr + 1, L':'); /* end name */ ++ time->era_entries[idx].wname = wstr + 1; ++ wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */ + if (wstr != NULL) + { + *wstr = L'\0'; +- time->era_entries[idx].wformat = (uint32_t *) wstr + 1; ++ time->era_entries[idx].wformat = wstr + 1; + } + else + time->era_entries[idx].wname = +@@ -527,7 +529,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) +- time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y"; ++ { ++ static const uint32_t wdate_fmt[] = ++ { '%','a',' ', ++ '%','b',' ', ++ '%','e',' ', ++ '%','H',':','%','M',':','%','S',' ', ++ '%','Z',' ', ++ '%','Y',0 }; ++ time->wdate_fmt = wdate_fmt; ++ } + } + + +diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c +index 7ebd933801..5753750756 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, + { + int return_widestr = lr->return_widestr; + char *buf; +- wchar_t *buf2 = NULL; ++ uint32_t *buf2 = NULL; + size_t bufact; + size_t bufmax = 56; + +diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c +index b048bd05b9..fed15c42ec 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; + #define OPT_NO_WARN 402 + #define OPT_WARN 403 + #define OPT_NO_HARD_LINKS 404 ++#define OPT_UINT32_ALIGN 405 + + /* Definitions of arguments for argp functions. */ + static const struct argp_option options[] = +@@ -153,6 +154,8 @@ static const struct argp_option options[] = + N_("Generate little-endian output") }, + { "big-endian", OPT_BIG_ENDIAN, NULL, 0, + N_("Generate big-endian output") }, ++ { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0, ++ N_("Set the target's uint32_t alignment in bytes (default 4)") }, + { NULL, 0, NULL, 0, NULL } + }; + +@@ -243,12 +246,14 @@ main (int argc, char *argv[]) + ctype locale. (P1003.2 4.35.5.2) */ + setlocale (LC_CTYPE, "POSIX"); + ++#ifndef NO_SYSCONF + /* Look whether the system really allows locale definitions. POSIX + defines error code 3 for this situation so I think it must be + a fatal error (see P1003.2 4.35.8). */ + if (sysconf (_SC_2_LOCALEDEF) < 0) + record_error (3, 0, _("\ + FATAL: system does not define `_POSIX2_LOCALEDEF'")); ++#endif + + /* 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) + /* Do not hard link to other locales. */ + hard_links = false; + break; ++ case OPT_UINT32_ALIGN: ++ uint32_align_mask = strtol (arg, NULL, 0) - 1; ++ break; + case 'c': + force_output = 1; + break; +diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c +index eb2f4634da..d387147323 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, + machine running localedef. */ + bool swap_endianness_p; + ++/* The target's value of __align__(uint32_t) - 1. */ ++unsigned int uint32_align_mask = 3; ++ + /* 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) + void + add_locale_wstring (struct locale_file *file, const uint32_t *string) + { +- add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1); ++ add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1); + } + + /* 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 7ea10038b4..0888c09762 100644 +--- a/locale/programs/locfile.h ++++ b/locale/programs/locfile.h +@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions, + + extern bool swap_endianness_p; + ++extern unsigned int uint32_align_mask; ++ + /* 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) + } + + /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */ +-static inline void ++static void ++__attribute__ ((unused)) + 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) + + /* Like maybe_swap_uint32_array, but the array of N elements is at + the end of OBSTACK's current object. */ +-static inline void ++static void ++__attribute__ ((unused)) + 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, + const struct charmap_t *charmap, + const char *output_path); + ++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused)); ++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused)); ++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused)); ++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused)); ++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused)); ++ ++static size_t ++wcslen_uint32 (const uint32_t *str) ++{ ++ size_t len = 0; ++ while (str[len] != 0) ++ len++; ++ return len; ++} ++ ++static int ++wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) ++{ ++ while (n-- != 0) ++ { ++ int diff = *s1++ - *s2++; ++ if (diff != 0) ++ return diff; ++ } ++ return 0; ++} ++ ++static int ++wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) ++{ ++ while (*s1 != 0 && *s1 == *s2) ++ s1++, s2++; ++ return *s1 - *s2; ++} ++ ++static uint32_t * ++wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) ++{ ++ return memcpy (s1, s2, n * sizeof (uint32_t)); ++} ++ ++static uint32_t * ++wcschr_uint32 (const uint32_t *s, uint32_t ch) ++{ ++ do ++ if (*s == ch) ++ return (uint32_t *) s; ++ while (*s++ != 0); ++ return 0; ++} ++ + #endif /* locfile.h */ +diff --git a/locale/setlocale.c b/locale/setlocale.c +index 030f1727bd..096d8ed895 100644 +--- a/locale/setlocale.c ++++ b/locale/setlocale.c +@@ -63,35 +63,6 @@ static char *const _nl_current_used[] = + + #endif + +- +-/* Define an array of category names (also the environment variable names). */ +-const struct catnamestr_t _nl_category_names attribute_hidden = +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- category_name, +-#include "categories.def" +-#undef DEFINE_CATEGORY +- }; +- +-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- [category] = offsetof (struct catnamestr_t, CATNAMEMF (__LINE__)), +-#include "categories.def" +-#undef DEFINE_CATEGORY +- }; +- +-/* An array of their lengths, for convenience. */ +-const uint8_t _nl_category_name_sizes[] attribute_hidden = +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- [category] = sizeof (category_name) - 1, +-#include "categories.def" +-#undef DEFINE_CATEGORY +- [LC_ALL] = sizeof ("LC_ALL") - 1 +- }; +- +- + #ifdef NL_CURRENT_INDIRECT + # define WEAK_POSTLOAD(postload) weak_extern (postload) + #else +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0021-eglibc-Help-bootstrap-cross-toolchain.patch b/meta/recipes-core/glibc/glibc/0021-eglibc-Help-bootstrap-cross-toolchain.patch deleted file mode 100644 index 6374ea4086..0000000000 --- a/meta/recipes-core/glibc/glibc/0021-eglibc-Help-bootstrap-cross-toolchain.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 6a32d5bf40deee5d12d24c06f3ea9b5479c16802 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:49:28 +0000 -Subject: [PATCH] eglibc: Help bootstrap cross toolchain - -Taken from EGLIBC, r1484 + r1525 - - 2007-02-20 Jim Blandy - - * Makefile (install-headers): Preserve old behavior: depend on - $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers - is set; otherwise, place gnu/stubs.h on the 'install-others' list. - - 2007-02-16 Jim Blandy - - * Makefile: Amend make install-headers to install everything - necessary for building a cross-compiler. Install gnu/stubs.h as - part of 'install-headers', not 'install-others'. - If install-bootstrap-headers is 'yes', install a dummy copy of - gnu/stubs.h, instead of computing the real thing. - * include/stubs-bootstrap.h: New file. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - Makefile | 22 +++++++++++++++++++++- - include/stubs-bootstrap.h | 12 ++++++++++++ - 2 files changed, 33 insertions(+), 1 deletion(-) - create mode 100644 include/stubs-bootstrap.h - -diff --git a/Makefile b/Makefile -index 8f0a93aceb..8eba23a868 100644 ---- a/Makefile -+++ b/Makefile -@@ -79,9 +79,18 @@ subdir-dirs = include - vpath %.h $(subdir-dirs) - - # What to install. --install-others = $(inst_includedir)/gnu/stubs.h - install-bin-script = - -+# If we're bootstrapping, install a dummy gnu/stubs.h along with the -+# other headers, so 'make install-headers' produces a useable include -+# tree. Otherwise, install gnu/stubs.h later, after the rest of the -+# build is done. -+ifeq ($(install-bootstrap-headers),yes) -+install-headers: $(inst_includedir)/gnu/stubs.h -+else -+install-others = $(inst_includedir)/gnu/stubs.h -+endif -+ - ifeq (yes,$(build-shared)) - headers += gnu/lib-names.h - endif -@@ -407,6 +416,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh - - subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) - -+# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o -+# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty -+# gnu/stubs.h is good enough. -+ifeq ($(install-bootstrap-headers),yes) -+$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force) -+ $(make-target-directory) -+ $(INSTALL_DATA) $< $@ -+ -+installed-stubs = -+else - ifndef abi-variants - installed-stubs = $(inst_includedir)/gnu/stubs.h - else -@@ -433,6 +452,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) - - install-others-nosubdir: $(installed-stubs) - endif -+endif - - - # Since stubs.h is never needed when building the library, we simplify the -diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h -new file mode 100644 -index 0000000000..1d2b669aff ---- /dev/null -+++ b/include/stubs-bootstrap.h -@@ -0,0 +1,12 @@ -+/* Placeholder stubs.h file for bootstrapping. -+ -+ When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC -+ headers be installed, but we can't fully build EGLIBC without that -+ GCC. So we run the command: -+ -+ make install-headers install-bootstrap-headers=yes -+ -+ to install the headers GCC needs, but avoid building certain -+ difficult headers. The header depends, via the -+ EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but -+ an empty stubs.h like this will do fine for GCC. */ 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 new file mode 100644 index 0000000000..0e93183087 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch @@ -0,0 +1,32 @@ +From ad5bc87134871b99e082e2449b8c1ce2f1375ef9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 20 Apr 2016 21:11:00 -0700 +Subject: [PATCH 22/29] 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 +--- + locale/programs/config.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/locale/programs/config.h b/locale/programs/config.h +index d76d9f7e8b..92b56d7df3 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 +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch b/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch deleted file mode 100644 index 2a503c811e..0000000000 --- a/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 25c21857a3fc0eb26831616ba88a696dd31ecba1 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 00:55:53 +0000 -Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4 - -2010-09-29 Nobuhiro Iwamatsu - Andrew Stubbs - - Resolve SH's __fpscr_values to symbol in libc.so. - - * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype. - * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values. - * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant. - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - sysdeps/unix/sysv/linux/sh/Versions | 1 + - sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++ - 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 ---- a/sysdeps/unix/sysv/linux/sh/Versions -+++ b/sysdeps/unix/sysv/linux/sh/Versions -@@ -2,6 +2,7 @@ libc { - GLIBC_2.2 { - # functions used in other libraries - __xstat64; __fxstat64; __lxstat64; -+ __fpscr_values; - - # a* - alphasort64; -diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S -index 85ff3f900e..7743b8d57a 100644 ---- a/sysdeps/unix/sysv/linux/sh/sysdep.S -+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S -@@ -30,3 +30,14 @@ ENTRY (__syscall_error) - - #define __syscall_error __syscall_error_1 - #include -+ -+ .data -+ .align 3 -+ .globl ___fpscr_values -+ .type ___fpscr_values, @object -+ .size ___fpscr_values, 8 -+___fpscr_values: -+ .long 0 -+ .long 0x80000 -+weak_alias (___fpscr_values, __fpscr_values) -+ diff --git a/meta/recipes-core/glibc/glibc/0023-eglibc-Forward-port-cross-locale-generation-support.patch b/meta/recipes-core/glibc/glibc/0023-eglibc-Forward-port-cross-locale-generation-support.patch deleted file mode 100644 index 1a90f22db6..0000000000 --- a/meta/recipes-core/glibc/glibc/0023-eglibc-Forward-port-cross-locale-generation-support.patch +++ /dev/null @@ -1,560 +0,0 @@ -From 30008327aadf0c775e644bb387d7c25952ed05b5 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Mar 2015 01:33:49 +0000 -Subject: [PATCH] eglibc: Forward port cross locale generation support - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - locale/Makefile | 3 +- - locale/catnames.c | 46 +++++++++++++++++++++++++++ - locale/localeinfo.h | 2 +- - locale/programs/charmap-dir.c | 6 ++++ - locale/programs/ld-collate.c | 17 +++++----- - locale/programs/ld-ctype.c | 27 ++++++++-------- - locale/programs/ld-time.c | 31 ++++++++++++------ - locale/programs/linereader.c | 2 +- - locale/programs/localedef.c | 8 +++++ - locale/programs/locfile.c | 5 ++- - locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++-- - locale/setlocale.c | 29 ----------------- - 12 files changed, 167 insertions(+), 68 deletions(-) - create mode 100644 locale/catnames.c - -diff --git a/locale/Makefile b/locale/Makefile -index c9694e236e..ba7105fad6 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 - categories = ctype messages monetary numeric time paper name \ - address telephone measurement identification collate -diff --git a/locale/catnames.c b/locale/catnames.c -new file mode 100644 -index 0000000000..538f3f5edb ---- /dev/null -+++ b/locale/catnames.c -@@ -0,0 +1,46 @@ -+/* Copyright (C) 2006 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 "localeinfo.h" -+ -+/* Define an array of category names (also the environment variable names). */ -+const struct catnamestr_t _nl_category_names attribute_hidden = -+ { -+#define DEFINE_CATEGORY(category, category_name, items, a) \ -+ category_name, -+#include "categories.def" -+#undef DEFINE_CATEGORY -+ }; -+ -+const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = -+ { -+#define DEFINE_CATEGORY(category, category_name, items, a) \ -+ [category] = offsetof (struct catnamestr_t, CATNAMEMF (__LINE__)), -+#include "categories.def" -+#undef DEFINE_CATEGORY -+ }; -+ -+/* An array of their lengths, for convenience. */ -+const uint8_t _nl_category_name_sizes[] attribute_hidden = -+ { -+#define DEFINE_CATEGORY(category, category_name, items, a) \ -+ [category] = sizeof (category_name) - 1, -+#include "categories.def" -+#undef DEFINE_CATEGORY -+ [LC_ALL] = sizeof ("LC_ALL") - 1 -+ }; -diff --git a/locale/localeinfo.h b/locale/localeinfo.h -index fdc283c69a..4eeed35f90 100644 ---- a/locale/localeinfo.h -+++ b/locale/localeinfo.h -@@ -230,7 +230,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. */ --#ifndef SHARED -+#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF - # include - # define NL_CURRENT_INDIRECT 1 - #endif -diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c -index 1a526a240d..0fb2daf936 100644 ---- a/locale/programs/charmap-dir.c -+++ b/locale/programs/charmap-dir.c -@@ -18,7 +18,9 @@ - #include - #include - #include -+#ifndef NO_UNCOMPRESS - #include -+#endif - #include - #include - #include -@@ -154,6 +156,7 @@ charmap_closedir (CHARMAP_DIR *cdir) - return closedir (dir); - } - -+#ifndef NO_UNCOMPRESS - /* Creates a subprocess decompressing the given pathname, and returns - a stream reading its output (the decompressed data). */ - static -@@ -202,6 +205,7 @@ fopen_uncompressed (const char *pathname, const char *compressor) - } - return NULL; - } -+#endif - - /* Opens a charmap for reading, given its name (not an alias name). */ - FILE * -@@ -224,6 +228,7 @@ charmap_open (const char *directory, const char *name) - if (stream != NULL) - return stream; - -+#ifndef NO_UNCOMPRESS - memcpy (p, ".gz", 4); - stream = fopen_uncompressed (pathname, "gzip"); - if (stream != NULL) -@@ -233,6 +238,7 @@ charmap_open (const char *directory, const char *name) - stream = fopen_uncompressed (pathname, "bzip2"); - if (stream != NULL) - return stream; -+#endif - - return NULL; - } -diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c -index feb1a11258..5a8e522470 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, - } - if (wcs != NULL) - { -- size_t nwcs = wcslen ((wchar_t *) wcs); -+ size_t nwcs = wcslen_uint32 (wcs); - uint32_t zero = 0; - /* Handle as a single character. */ - if (nwcs == 0) -@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); - - if ((*eptr)->nwcs == runp->nwcs) - { -- int c = wmemcmp ((wchar_t *) (*eptr)->wcs, -- (wchar_t *) runp->wcs, runp->nwcs); -+ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs); - - if (c == 0) - { -@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) - one consecutive entry. */ - if (runp->wcnext != NULL - && runp->nwcs == runp->wcnext->nwcs -- && wmemcmp ((wchar_t *) runp->wcs, -- (wchar_t *)runp->wcnext->wcs, -- runp->nwcs - 1) == 0 -+ && wmemcmp_uint32 (runp->wcs, -+ runp->wcnext->wcs, -+ runp->nwcs - 1) == 0 - && (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) - runp = runp->wcnext; - while (runp->wcnext != NULL - && runp->nwcs == runp->wcnext->nwcs -- && wmemcmp ((wchar_t *) runp->wcs, -- (wchar_t *)runp->wcnext->wcs, -- runp->nwcs - 1) == 0 -+ && wmemcmp_uint32 (runp->wcs, -+ runp->wcnext->wcs, -+ runp->nwcs - 1) == 0 - && (runp->wcs[runp->nwcs - 1] - == runp->wcnext->wcs[runp->nwcs - 1] + 1)); - -diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c -index 3328093d0e..d58fb0f4b7 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, - allocate_arrays (ctype, charmap, ctype->repertoire); - - default_missing_len = (ctype->default_missing -- ? wcslen ((wchar_t *) ctype->default_missing) -+ ? wcslen_uint32 (ctype->default_missing) - : 0); - - init_locale_data (&file, nelems); -@@ -1927,7 +1927,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, - ignore = 1; - else - /* This value is usable. */ -- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4); -+ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4); - - first = 0; - } -@@ -2461,8 +2461,8 @@ with character code range values one must use the absolute ellipsis `...'")); - } - - handle_tok_digit: -- class_bit = _ISwdigit; -- class256_bit = _ISdigit; -+ class_bit = BITw (tok_digit); -+ class256_bit = BIT (tok_digit); - handle_digits = 1; - goto read_charclass; - -@@ -3904,8 +3904,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, - - while (idx < number) - { -- int res = wcscmp ((const wchar_t *) sorted[idx]->from, -- (const wchar_t *) runp->from); -+ int res = wcscmp_uint32 (sorted[idx]->from, runp->from); - if (res == 0) - { - replace = 1; -@@ -3942,11 +3941,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; -- from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1; -+ from_len += wcslen_uint32 (sorted[cnt]->from) + 1; - srunp = sorted[cnt]->to; - while (srunp != NULL) - { -- to_len += wcslen ((const wchar_t *) srunp->str) + 1; -+ to_len += wcslen_uint32 (srunp->str) + 1; - 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, - ctype->translit_from_idx[cnt] = from_len; - ctype->translit_to_idx[cnt] = to_len; - -- len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1; -- wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len], -- (const wchar_t *) sorted[cnt]->from, len); -+ len = wcslen_uint32 (sorted[cnt]->from) + 1; -+ wmemcpy_uint32 (&ctype->translit_from_tbl[from_len], -+ sorted[cnt]->from, len); - from_len += len; - - ctype->translit_to_idx[cnt] = to_len; - srunp = sorted[cnt]->to; - while (srunp != NULL) - { -- len = wcslen ((const wchar_t *) srunp->str) + 1; -- wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len], -- (const wchar_t *) srunp->str, len); -+ len = wcslen_uint32 (srunp->str) + 1; -+ wmemcpy_uint32 (&ctype->translit_to_tbl[to_len], -+ srunp->str, len); - to_len += len; - srunp = srunp->next; - } -diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c -index f7db873adb..fec3773c9d 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"); - } - else - { -+ static const uint32_t wt_fmt_ampm[] -+ = { '%','I',':','%','M',':','%','S',' ','%','p',0 }; - time->t_fmt_ampm = "%I:%M:%S %p"; -- time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p"; -+ time->wt_fmt_ampm = wt_fmt_ampm; - } - } - -@@ -231,7 +233,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; -- wchar_t *wstr; -+ uint32_t *wstr; - - time->era_entries = - (struct era_data *) xmalloc (time->num_era -@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME"); - } - - /* Now generate the wide character name and format. */ -- wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */ -- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */ -- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */ -- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */ -+ wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */ -+ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */ -+ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */ -+ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */ - if (wstr != NULL) - { -- time->era_entries[idx].wname = (uint32_t *) wstr + 1; -- wstr = wcschr (wstr + 1, L':'); /* end name */ -+ time->era_entries[idx].wname = wstr + 1; -+ wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */ - if (wstr != NULL) - { - *wstr = L'\0'; -- time->era_entries[idx].wformat = (uint32_t *) wstr + 1; -+ time->era_entries[idx].wformat = wstr + 1; - } - else - time->era_entries[idx].wname = -@@ -527,7 +529,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) -- time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y"; -+ { -+ static const uint32_t wdate_fmt[] = -+ { '%','a',' ', -+ '%','b',' ', -+ '%','e',' ', -+ '%','H',':','%','M',':','%','S',' ', -+ '%','Z',' ', -+ '%','Y',0 }; -+ time->wdate_fmt = wdate_fmt; -+ } - } - - -diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c -index 7ebd933801..5753750756 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, - { - int return_widestr = lr->return_widestr; - char *buf; -- wchar_t *buf2 = NULL; -+ uint32_t *buf2 = NULL; - size_t bufact; - size_t bufmax = 56; - -diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c -index dbbb0145c0..097a8b6193 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; - #define OPT_NO_WARN 402 - #define OPT_WARN 403 - #define OPT_NO_HARD_LINKS 404 -+#define OPT_UINT32_ALIGN 405 - - /* Definitions of arguments for argp functions. */ - static const struct argp_option options[] = -@@ -153,6 +154,8 @@ static const struct argp_option options[] = - N_("Generate little-endian output") }, - { "big-endian", OPT_BIG_ENDIAN, NULL, 0, - N_("Generate big-endian output") }, -+ { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0, -+ N_("Set the target's uint32_t alignment in bytes (default 4)") }, - { NULL, 0, NULL, 0, NULL } - }; - -@@ -242,12 +245,14 @@ main (int argc, char *argv[]) - ctype locale. (P1003.2 4.35.5.2) */ - setlocale (LC_CTYPE, "POSIX"); - -+#ifndef NO_SYSCONF - /* Look whether the system really allows locale definitions. POSIX - defines error code 3 for this situation so I think it must be - a fatal error (see P1003.2 4.35.8). */ - if (sysconf (_SC_2_LOCALEDEF) < 0) - record_error (3, 0, _("\ - FATAL: system does not define `_POSIX2_LOCALEDEF'")); -+#endif - - /* Process charmap file. */ - charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1); -@@ -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; -+ case OPT_UINT32_ALIGN: -+ uint32_align_mask = strtol (arg, NULL, 0) - 1; -+ break; - case 'c': - force_output = 1; - break; -diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c -index eb2f4634da..d387147323 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, - machine running localedef. */ - bool swap_endianness_p; - -+/* The target's value of __align__(uint32_t) - 1. */ -+unsigned int uint32_align_mask = 3; -+ - /* 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) - void - add_locale_wstring (struct locale_file *file, const uint32_t *string) - { -- add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1); -+ add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1); - } - - /* 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 7ea10038b4..0888c09762 100644 ---- a/locale/programs/locfile.h -+++ b/locale/programs/locfile.h -@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions, - - extern bool swap_endianness_p; - -+extern unsigned int uint32_align_mask; -+ - /* 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) - } - - /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */ --static inline void -+static void -+__attribute__ ((unused)) - 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) - - /* Like maybe_swap_uint32_array, but the array of N elements is at - the end of OBSTACK's current object. */ --static inline void -+static void -+__attribute__ ((unused)) - 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, - const struct charmap_t *charmap, - const char *output_path); - -+static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused)); -+static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused)); -+static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused)); -+static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused)); -+static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused)); -+ -+static size_t -+wcslen_uint32 (const uint32_t *str) -+{ -+ size_t len = 0; -+ while (str[len] != 0) -+ len++; -+ return len; -+} -+ -+static int -+wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) -+{ -+ while (n-- != 0) -+ { -+ int diff = *s1++ - *s2++; -+ if (diff != 0) -+ return diff; -+ } -+ return 0; -+} -+ -+static int -+wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) -+{ -+ while (*s1 != 0 && *s1 == *s2) -+ s1++, s2++; -+ return *s1 - *s2; -+} -+ -+static uint32_t * -+wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) -+{ -+ return memcpy (s1, s2, n * sizeof (uint32_t)); -+} -+ -+static uint32_t * -+wcschr_uint32 (const uint32_t *s, uint32_t ch) -+{ -+ do -+ if (*s == ch) -+ return (uint32_t *) s; -+ while (*s++ != 0); -+ return 0; -+} -+ - #endif /* locfile.h */ -diff --git a/locale/setlocale.c b/locale/setlocale.c -index 030f1727bd..096d8ed895 100644 ---- a/locale/setlocale.c -+++ b/locale/setlocale.c -@@ -63,35 +63,6 @@ static char *const _nl_current_used[] = - - #endif - -- --/* Define an array of category names (also the environment variable names). */ --const struct catnamestr_t _nl_category_names attribute_hidden = -- { --#define DEFINE_CATEGORY(category, category_name, items, a) \ -- category_name, --#include "categories.def" --#undef DEFINE_CATEGORY -- }; -- --const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = -- { --#define DEFINE_CATEGORY(category, category_name, items, a) \ -- [category] = offsetof (struct catnamestr_t, CATNAMEMF (__LINE__)), --#include "categories.def" --#undef DEFINE_CATEGORY -- }; -- --/* An array of their lengths, for convenience. */ --const uint8_t _nl_category_name_sizes[] attribute_hidden = -- { --#define DEFINE_CATEGORY(category, category_name, items, a) \ -- [category] = sizeof (category_name) - 1, --#include "categories.def" --#undef DEFINE_CATEGORY -- [LC_ALL] = sizeof ("LC_ALL") - 1 -- }; -- -- - #ifdef NL_CURRENT_INDIRECT - # define WEAK_POSTLOAD(postload) weak_extern (postload) - #else 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/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch new file mode 100644 index 0000000000..7cbf6811a1 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch @@ -0,0 +1,84 @@ +From c5fd8a3d336b8288f631fb6b6dd85f9d1076f25b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 3 Aug 2018 09:42:06 -0700 +Subject: [PATCH 23/29] localedef --add-to-archive uses a hard-coded locale + path + +it doesn't exist in normal use, and there's no way to pass an +alternative filename. + +Add a fallback of $LOCALEARCHIVE from the environment, and allow +creation of new locale archives that are not the system archive. + +Upstream-Status: Inappropriate (OE-specific) + +Signed-off-by: Ross Burton +Signed-off-by: Khem Raj +--- + locale/programs/locarchive.c | 35 +++++++++++++++++++++++++---------- + 1 file changed, 25 insertions(+), 10 deletions(-) + +diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c +index dccaf04e3b..ae0b7fe155 100644 +--- a/locale/programs/locarchive.c ++++ b/locale/programs/locarchive.c +@@ -340,12 +340,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; +- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; +- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1]; ++ char *archivefname; ++ char *fname; ++ char *envarchive = getenv("LOCALEARCHIVE"); + +- if (output_prefix) +- memcpy (archivefname, output_prefix, prefix_len); +- strcpy (archivefname + prefix_len, ARCHIVE_NAME); ++ if (envarchive != NULL) ++ { ++ archivefname = xmalloc(strlen(envarchive) + 1); ++ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX")); ++ strcpy (archivefname, envarchive); ++ } ++ else ++ { ++ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME)); ++ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1); ++ if (output_prefix) ++ memcpy (archivefname, output_prefix, prefix_len); ++ strcpy (archivefname + prefix_len, ARCHIVE_NAME); ++ } + 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) + /* If ah has a non-NULL fname open that otherwise open the default. */ + if (archivefname == NULL) + { +- archivefname = default_fname; +- if (output_prefix) +- memcpy (default_fname, output_prefix, prefix_len); +- strcpy (default_fname + prefix_len, ARCHIVE_NAME); ++ archivefname = getenv("LOCALEARCHIVE"); ++ if (archivefname == NULL) { ++ archivefname = default_fname; ++ if (output_prefix) ++ memcpy (default_fname, output_prefix, prefix_len); ++ strcpy (default_fname + prefix_len, ARCHIVE_NAME); ++ } + } + + while (1) +@@ -585,7 +600,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. */ +- if (errno == ENOENT && archivefname == default_fname) ++ if (errno == ENOENT) + { + if (readonly) + { +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0024-Define-DUMMY_LOCALE_T-if-not-defined.patch b/meta/recipes-core/glibc/glibc/0024-Define-DUMMY_LOCALE_T-if-not-defined.patch deleted file mode 100644 index 15e460eb08..0000000000 --- a/meta/recipes-core/glibc/glibc/0024-Define-DUMMY_LOCALE_T-if-not-defined.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 067f71a381ce6626ef1179be3dd90c4ed2aa52fb Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 ---- - locale/programs/config.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/locale/programs/config.h b/locale/programs/config.h -index d76d9f7e8b..92b56d7df3 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/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 new file mode 100644 index 0000000000..02e73594a0 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch @@ -0,0 +1,56 @@ +From dffa52364f8c54c455b2459ebe83f05cb6ffc9fc Mon Sep 17 00:00:00 2001 +From: Mark Hatle +Date: Thu, 18 Aug 2016 14:07:58 -0500 +Subject: [PATCH 24/29] 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 +--- + 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 b5a43232a7..8aa8f37fa3 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; + } + +-- +2.27.0 + 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 new file mode 100644 index 0000000000..700fb28874 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch @@ -0,0 +1,34 @@ +From bc3380877bd2a1f9368a913fa6a2ca1ee88fd95f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 3 Aug 2018 09:44:00 -0700 +Subject: [PATCH 25/29] 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 +Signed-off-by: Khem Raj +--- + intl/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/intl/Makefile b/intl/Makefile +index ce3072420f..58457840d9 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) +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch deleted file mode 100644 index 543f65d6ea..0000000000 --- a/meta/recipes-core/glibc/glibc/0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 8f4b0bac85d14b184e08848b02de3f30775f05b1 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 3 Aug 2018 09:42:06 -0700 -Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path - -it doesn't exist in normal use, and there's no way to pass an -alternative filename. - -Add a fallback of $LOCALEARCHIVE from the environment, and allow -creation of new locale archives that are not the system archive. - -Upstream-Status: Inappropriate (OE-specific) - -Signed-off-by: Ross Burton -Signed-off-by: Khem Raj ---- - locale/programs/locarchive.c | 35 +++++++++++++++++++++++++---------- - 1 file changed, 25 insertions(+), 10 deletions(-) - -diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c -index dccaf04e3b..ae0b7fe155 100644 ---- a/locale/programs/locarchive.c -+++ b/locale/programs/locarchive.c -@@ -340,12 +340,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; -- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; -- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1]; -+ char *archivefname; -+ char *fname; -+ char *envarchive = getenv("LOCALEARCHIVE"); - -- if (output_prefix) -- memcpy (archivefname, output_prefix, prefix_len); -- strcpy (archivefname + prefix_len, ARCHIVE_NAME); -+ if (envarchive != NULL) -+ { -+ archivefname = xmalloc(strlen(envarchive) + 1); -+ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX")); -+ strcpy (archivefname, envarchive); -+ } -+ else -+ { -+ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME)); -+ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1); -+ if (output_prefix) -+ memcpy (archivefname, output_prefix, prefix_len); -+ strcpy (archivefname + prefix_len, ARCHIVE_NAME); -+ } - 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) - /* If ah has a non-NULL fname open that otherwise open the default. */ - if (archivefname == NULL) - { -- archivefname = default_fname; -- if (output_prefix) -- memcpy (default_fname, output_prefix, prefix_len); -- strcpy (default_fname + prefix_len, ARCHIVE_NAME); -+ archivefname = getenv("LOCALEARCHIVE"); -+ if (archivefname == NULL) { -+ archivefname = default_fname; -+ if (output_prefix) -+ memcpy (default_fname, output_prefix, prefix_len); -+ strcpy (default_fname + prefix_len, ARCHIVE_NAME); -+ } - } - - while (1) -@@ -585,7 +600,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. */ -- if (errno == ENOENT && archivefname == default_fname) -+ if (errno == ENOENT) - { - if (readonly) - { diff --git a/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch deleted file mode 100644 index 5f6ee40f22..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 1dad746ce93928a57b2fe618c74722f710751826 Mon Sep 17 00:00:00 2001 -From: Mark Hatle -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 ---- - 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 5103a8a111..54cd80aaff 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/0026-inject-file-assembly-directives.patch b/meta/recipes-core/glibc/glibc/0026-inject-file-assembly-directives.patch new file mode 100644 index 0000000000..89eef82e1b --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-inject-file-assembly-directives.patch @@ -0,0 +1,240 @@ +From cf043d56638883157dbfaa8c6a8e2f63a6f66280 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 29 Nov 2018 17:29:35 -0800 +Subject: [PATCH 26/29] inject file assembly directives + +Currently, non-IA builds are not reproducibile since build paths are +being injected into the debug symbols. These are coming from the use of +.S assembler files during the glibc build. No STT_FILE section is added +during the assembly but when linking, ld decides to add one to aid +debugging and ensure references between the different object files its +linking remain clear. + +We can avoid this by injecting a file header into the assembler files +ahead of time, choosing a filename which does not contain build system +paths. + +This is a bit of a workaround/hack but does significantly reduce the +build system references in target binaries for the non-IA architectures +which use .S files. + +RP +2018/10/3 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + csu/abi-note.c | 2 ++ + sysdeps/aarch64/crti.S | 2 ++ + sysdeps/aarch64/crtn.S | 1 + + sysdeps/aarch64/dl-tlsdesc.S | 2 ++ + sysdeps/aarch64/dl-trampoline.S | 2 ++ + sysdeps/aarch64/start.S | 2 ++ + sysdeps/arm/crti.S | 2 ++ + sysdeps/arm/crtn.S | 2 ++ + sysdeps/arm/dl-tlsdesc.S | 2 ++ + sysdeps/arm/dl-trampoline.S | 2 ++ + sysdeps/arm/start.S | 2 ++ + sysdeps/mips/start.S | 2 ++ + sysdeps/powerpc/powerpc32/dl-start.S | 2 ++ + sysdeps/powerpc/powerpc32/start.S | 2 ++ + sysdeps/powerpc/powerpc64/start.S | 2 ++ + sysdeps/unix/sysv/linux/aarch64/__read_tp.S | 2 ++ + sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S | 2 ++ + sysdeps/unix/sysv/linux/arm/libc-do-syscall.S | 2 ++ + sysdeps/unix/sysv/linux/powerpc/dl-brk.S | 2 ++ + 19 files changed, 37 insertions(+) + +--- a/sysdeps/aarch64/crti.S ++++ b/sysdeps/aarch64/crti.S +@@ -50,6 +50,8 @@ + # define PREINIT_FUNCTION_WEAK 1 + #endif + ++ .file "crti.S" ++ + #if PREINIT_FUNCTION_WEAK + weak_extern (PREINIT_FUNCTION) + #else +--- a/sysdeps/aarch64/crtn.S ++++ b/sysdeps/aarch64/crtn.S +@@ -38,6 +38,7 @@ + corresponding to the prologues in crti.S. */ + + #include ++ .file "crtn.S" + + .section .init,"ax",%progbits + ldp x29, x30, [sp], 16 +--- a/sysdeps/aarch64/dl-tlsdesc.S ++++ b/sysdeps/aarch64/dl-tlsdesc.S +@@ -22,6 +22,8 @@ + #include + #include "tlsdesc.h" + ++ .file "dl-tlsdesc.S" ++ + #define NSAVEDQREGPAIRS 16 + #define SAVE_Q_REGISTERS \ + stp q0, q1, [sp, #-32*NSAVEDQREGPAIRS]!; \ +--- a/sysdeps/aarch64/dl-trampoline.S ++++ b/sysdeps/aarch64/dl-trampoline.S +@@ -21,6 +21,8 @@ + + #include "dl-link.h" + ++ .file "dl-trampoline.S" ++ + #define ip0 x16 + #define ip0l PTR_REG (16) + #define ip1 x17 +--- a/sysdeps/aarch64/start.S ++++ b/sysdeps/aarch64/start.S +@@ -18,6 +18,8 @@ + + #include + ++ .file "start.S" ++ + /* This is the canonical entry point, usually the first thing in the text + segment. + +--- a/sysdeps/arm/crti.S ++++ b/sysdeps/arm/crti.S +@@ -57,6 +57,8 @@ + .hidden PREINIT_FUNCTION + #endif + ++ .file "crti.S" ++ + #if PREINIT_FUNCTION_WEAK + .p2align 2 + .type call_weak_fn, %function +--- a/sysdeps/arm/crtn.S ++++ b/sysdeps/arm/crtn.S +@@ -37,6 +37,8 @@ + #define NO_THUMB + #include + ++ .file "crtn.S" ++ + /* crtn.S puts function epilogues in the .init and .fini sections + corresponding to the prologues in crti.S. */ + +--- a/sysdeps/arm/dl-tlsdesc.S ++++ b/sysdeps/arm/dl-tlsdesc.S +@@ -21,6 +21,8 @@ + #include + #include "tlsdesc.h" + ++ .file "dl-tlsdesc.S" ++ + .text + @ emit debug information with cfi + @ use arm-specific pseudos for unwinding itself +--- a/sysdeps/arm/dl-trampoline.S ++++ b/sysdeps/arm/dl-trampoline.S +@@ -21,6 +21,8 @@ + #include + #include + ++ .file "dl-trampoline.S" ++ + .text + .globl _dl_runtime_resolve + .type _dl_runtime_resolve, #function +--- a/sysdeps/arm/start.S ++++ b/sysdeps/arm/start.S +@@ -57,6 +57,8 @@ + NULL + */ + ++ .file "start.S" ++ + /* Tag_ABI_align8_preserved: This code preserves 8-byte + alignment in any callee. */ + .eabi_attribute 25, 1 +--- a/sysdeps/mips/start.S ++++ b/sysdeps/mips/start.S +@@ -38,6 +38,8 @@ + #include + #include + ++ .file "start.S" ++ + #ifndef ENTRY_POINT + #error ENTRY_POINT needs to be defined for start.S on MIPS/ELF. + #endif +--- a/sysdeps/powerpc/powerpc32/dl-start.S ++++ b/sysdeps/powerpc/powerpc32/dl-start.S +@@ -18,6 +18,8 @@ + + #include + ++ .file "dl-start.S" ++ + /* Initial entry point code for the dynamic linker. + The C function `_dl_start' is the real entry point; + its return value is the user program's entry point. */ +--- a/sysdeps/powerpc/powerpc32/start.S ++++ b/sysdeps/powerpc/powerpc32/start.S +@@ -35,6 +35,8 @@ + + #include + ++ .file "start.S" ++ + /* We do not want .eh_frame info for crt1.o since crt1.o is linked + before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ + #undef cfi_startproc +--- a/sysdeps/powerpc/powerpc64/start.S ++++ b/sysdeps/powerpc/powerpc64/start.S +@@ -35,6 +35,8 @@ + + #include + ++ .file "start.S" ++ + /* We do not want .eh_frame info for crt1.o since crt1.o is linked + before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ + #undef cfi_startproc +--- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S ++++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S +@@ -18,6 +18,8 @@ + + #include + ++ .file "__read_tp.S" ++ + .hidden __read_tp + ENTRY (__read_tp) + mrs x0, tpidr_el0 +--- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S ++++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S +@@ -39,6 +39,8 @@ + a normal function call) in a high page of memory; tail call to the + helper. */ + ++ .file "aeabi_read_tp.S" ++ + .hidden __aeabi_read_tp + ENTRY (__aeabi_read_tp) + #ifdef ARCH_HAS_HARD_TP +--- a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S ++++ b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S +@@ -27,6 +27,8 @@ + ARM unwind tables for register to register moves, the actual opcodes + are not defined. */ + ++ .file "libc-do-syscall.S" ++ + #if defined(__thumb__) + .thumb + .syntax unified +--- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S ++++ b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S +@@ -1 +1,3 @@ ++ .file "dl-brk.S" ++ + #include diff --git a/meta/recipes-core/glibc/glibc/0027-intl-Emit-no-lines-in-bison-generated-files.patch b/meta/recipes-core/glibc/glibc/0027-intl-Emit-no-lines-in-bison-generated-files.patch deleted file mode 100644 index 2c317d58aa..0000000000 --- a/meta/recipes-core/glibc/glibc/0027-intl-Emit-no-lines-in-bison-generated-files.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3c8d9eae83ab4f1677afc9b379f97114e8503363 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Signed-off-by: Khem Raj ---- - intl/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/intl/Makefile b/intl/Makefile -index ce3072420f..58457840d9 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 new file mode 100644 index 0000000000..d2c88d2354 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch @@ -0,0 +1,56 @@ +From 10aef8f0671d814aaf910ababc0225cf6f0a46e8 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Mon, 17 Dec 2018 21:36:18 +0000 +Subject: [PATCH 27/29] 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 +Signed-off-by: Khem Raj +--- + locale/weight.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/locale/weight.h b/locale/weight.h +index e071253f85..2889c395f1 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; + +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0028-inject-file-assembly-directives.patch b/meta/recipes-core/glibc/glibc/0028-inject-file-assembly-directives.patch deleted file mode 100644 index e1a030d10c..0000000000 --- a/meta/recipes-core/glibc/glibc/0028-inject-file-assembly-directives.patch +++ /dev/null @@ -1,301 +0,0 @@ -From 420454f7098b5445730caa855c37b8143bfccc1b Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 29 Nov 2018 17:29:35 -0800 -Subject: [PATCH] inject file assembly directives - -Currently, non-IA builds are not reproducibile since build paths are -being injected into the debug symbols. These are coming from the use of -.S assembler files during the glibc build. No STT_FILE section is added -during the assembly but when linking, ld decides to add one to aid -debugging and ensure references between the different object files its -linking remain clear. - -We can avoid this by injecting a file header into the assembler files -ahead of time, choosing a filename which does not contain build system -paths. - -This is a bit of a workaround/hack but does significantly reduce the -build system references in target binaries for the non-IA architectures -which use .S files. - -RP -2018/10/3 - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - csu/abi-note.S | 2 ++ - sysdeps/aarch64/crti.S | 2 ++ - sysdeps/aarch64/crtn.S | 2 ++ - sysdeps/aarch64/dl-tlsdesc.S | 2 ++ - sysdeps/aarch64/dl-trampoline.S | 2 ++ - sysdeps/aarch64/start.S | 2 ++ - sysdeps/arm/abi-note.S | 2 ++ - sysdeps/arm/crti.S | 2 ++ - sysdeps/arm/crtn.S | 2 ++ - sysdeps/arm/dl-tlsdesc.S | 2 ++ - sysdeps/arm/dl-trampoline.S | 2 ++ - sysdeps/arm/start.S | 2 ++ - sysdeps/mips/start.S | 2 ++ - sysdeps/powerpc/powerpc32/dl-start.S | 2 ++ - sysdeps/powerpc/powerpc32/start.S | 2 ++ - sysdeps/powerpc/powerpc64/start.S | 2 ++ - sysdeps/unix/sysv/linux/aarch64/__read_tp.S | 2 ++ - sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S | 2 ++ - sysdeps/unix/sysv/linux/arm/libc-do-syscall.S | 2 ++ - sysdeps/unix/sysv/linux/powerpc/dl-brk.S | 2 ++ - 20 files changed, 40 insertions(+) - -diff --git a/csu/abi-note.S b/csu/abi-note.S -index 2b4b5f8824..964843016c 100644 ---- a/csu/abi-note.S -+++ b/csu/abi-note.S -@@ -56,6 +56,8 @@ offset length contents - #include - #include /* OS-specific ABI tag value */ - -+ .file "abi-note.S" -+ - /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose - name begins with `.note' and creates a PT_NOTE program header entry - pointing at it. */ -diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S -index 1728eac37a..76a8ab590b 100644 ---- a/sysdeps/aarch64/crti.S -+++ b/sysdeps/aarch64/crti.S -@@ -50,6 +50,8 @@ - # define PREINIT_FUNCTION_WEAK 1 - #endif - -+ .file "crti.S" -+ - #if PREINIT_FUNCTION_WEAK - weak_extern (PREINIT_FUNCTION) - #else -diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S -index c3e97cc449..fc2e5c2df8 100644 ---- a/sysdeps/aarch64/crtn.S -+++ b/sysdeps/aarch64/crtn.S -@@ -37,6 +37,8 @@ - /* crtn.S puts function epilogues in the .init and .fini sections - corresponding to the prologues in crti.S. */ - -+ .file "crtn.S" -+ - .section .init,"ax",%progbits - ldp x29, x30, [sp], 16 - RET -diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S -index 557ad1d505..194a8531da 100644 ---- a/sysdeps/aarch64/dl-tlsdesc.S -+++ b/sysdeps/aarch64/dl-tlsdesc.S -@@ -22,6 +22,8 @@ - #include - #include "tlsdesc.h" - -+ .file "dl-tlsdesc.S" -+ - #define NSAVEDQREGPAIRS 16 - #define SAVE_Q_REGISTERS \ - stp q0, q1, [sp, #-32*NSAVEDQREGPAIRS]!; \ -diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S -index 94e965c096..ba18742f3e 100644 ---- a/sysdeps/aarch64/dl-trampoline.S -+++ b/sysdeps/aarch64/dl-trampoline.S -@@ -21,6 +21,8 @@ - - #include "dl-link.h" - -+ .file "dl-trampoline.S" -+ - #define ip0 x16 - #define ip0l PTR_REG (16) - #define ip1 x17 -diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S -index d96cf57e2d..07a523978a 100644 ---- a/sysdeps/aarch64/start.S -+++ b/sysdeps/aarch64/start.S -@@ -18,6 +18,8 @@ - - #include - -+ .file "start.S" -+ - /* This is the canonical entry point, usually the first thing in the text - segment. - -diff --git a/sysdeps/arm/abi-note.S b/sysdeps/arm/abi-note.S -index 07bd4c4619..7213b16f27 100644 ---- a/sysdeps/arm/abi-note.S -+++ b/sysdeps/arm/abi-note.S -@@ -1,3 +1,5 @@ -+ .file "abi-note.S" -+ - /* Tag_ABI_align8_preserved: This code preserves 8-byte - alignment in any callee. */ - .eabi_attribute 25, 1 -diff --git a/sysdeps/arm/crti.S b/sysdeps/arm/crti.S -index 8169783267..f56e0c85a6 100644 ---- a/sysdeps/arm/crti.S -+++ b/sysdeps/arm/crti.S -@@ -57,6 +57,8 @@ - .hidden PREINIT_FUNCTION - #endif - -+ .file "crti.S" -+ - #if PREINIT_FUNCTION_WEAK - .p2align 2 - .type call_weak_fn, %function -diff --git a/sysdeps/arm/crtn.S b/sysdeps/arm/crtn.S -index d60f9f05de..1e10ec439f 100644 ---- a/sysdeps/arm/crtn.S -+++ b/sysdeps/arm/crtn.S -@@ -37,6 +37,8 @@ - #define NO_THUMB - #include - -+ .file "crtn.S" -+ - /* crtn.S puts function epilogues in the .init and .fini sections - corresponding to the prologues in crti.S. */ - -diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S -index 8415e47607..29c2cb8128 100644 ---- a/sysdeps/arm/dl-tlsdesc.S -+++ b/sysdeps/arm/dl-tlsdesc.S -@@ -21,6 +21,8 @@ - #include - #include "tlsdesc.h" - -+ .file "dl-tlsdesc.S" -+ - .text - @ emit debug information with cfi - @ use arm-specific pseudos for unwinding itself -diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S -index a20baf555e..2dd3bef04e 100644 ---- a/sysdeps/arm/dl-trampoline.S -+++ b/sysdeps/arm/dl-trampoline.S -@@ -21,6 +21,8 @@ - #include - #include - -+ .file "dl-trampoline.S" -+ - .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, #function -diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S -index 2ff56179d2..c118046ec6 100644 ---- a/sysdeps/arm/start.S -+++ b/sysdeps/arm/start.S -@@ -57,6 +57,8 @@ - NULL - */ - -+ .file "start.S" -+ - /* Tag_ABI_align8_preserved: This code preserves 8-byte - alignment in any callee. */ - .eabi_attribute 25, 1 -diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S -index fabc8080df..83c6b91d7d 100644 ---- a/sysdeps/mips/start.S -+++ b/sysdeps/mips/start.S -@@ -38,6 +38,8 @@ - #include - #include - -+ .file "start.S" -+ - #ifndef ENTRY_POINT - #error ENTRY_POINT needs to be defined for start.S on MIPS/ELF. - #endif -diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S -index c15242d3bc..6ca27715a4 100644 ---- a/sysdeps/powerpc/powerpc32/dl-start.S -+++ b/sysdeps/powerpc/powerpc32/dl-start.S -@@ -18,6 +18,8 @@ - - #include - -+ .file "dl-start.S" -+ - /* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. */ -diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S -index b7b9a133a2..8df714f81a 100644 ---- a/sysdeps/powerpc/powerpc32/start.S -+++ b/sysdeps/powerpc/powerpc32/start.S -@@ -35,6 +35,8 @@ - - #include - -+ .file "start.S" -+ - /* We do not want .eh_frame info for crt1.o since crt1.o is linked - before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ - #undef cfi_startproc -diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S -index 94bf771e83..cffb99500a 100644 ---- a/sysdeps/powerpc/powerpc64/start.S -+++ b/sysdeps/powerpc/powerpc64/start.S -@@ -35,6 +35,8 @@ - - #include - -+ .file "start.S" -+ - /* We do not want .eh_frame info for crt1.o since crt1.o is linked - before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ - #undef cfi_startproc -diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S -index 12e1131fe7..767e0d043b 100644 ---- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S -+++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S -@@ -18,6 +18,8 @@ - - #include - -+ .file "__read_tp.S" -+ - .hidden __read_tp - ENTRY (__read_tp) - mrs x0, tpidr_el0 -diff --git a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S -index 3b0d611039..4a7e476c37 100644 ---- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S -+++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S -@@ -39,6 +39,8 @@ - a normal function call) in a high page of memory; tail call to the - helper. */ - -+ .file "aeabi_read_tp.S" -+ - .hidden __aeabi_read_tp - ENTRY (__aeabi_read_tp) - #ifdef ARCH_HAS_HARD_TP -diff --git a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S -index fb5e0c7d97..bd07bdb38b 100644 ---- a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S -+++ b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S -@@ -27,6 +27,8 @@ - ARM unwind tables for register to register moves, the actual opcodes - are not defined. */ - -+ .file "libc-do-syscall.S" -+ - #if defined(__thumb__) - .thumb - .syntax unified -diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S -index eeb96544e3..da182b28f8 100644 ---- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S -+++ b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S -@@ -1 +1,3 @@ -+ .file "dl-brk.S" -+ - #include 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 new file mode 100644 index 0000000000..25c046f5cd --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch @@ -0,0 +1,33 @@ +From 70731329feb7ba20364aa37aed83d920de97f028 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Mar 2015 00:11:22 +0000 +Subject: [PATCH 28/29] 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 +Signed-off-by: Khem Raj +--- + elf/readlib.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/elf/readlib.c b/elf/readlib.c +index 994a4426a1..baabf099b1 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[] = +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/meta/recipes-core/glibc/glibc/0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch deleted file mode 100644 index c8c359f2b8..0000000000 --- a/meta/recipes-core/glibc/glibc/0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 66963ad83bdd3b075006ddca9dfe357aed181d6a Mon Sep 17 00:00:00 2001 -From: Martin Jansa -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 -Signed-off-by: Khem Raj ---- - locale/weight.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/locale/weight.h b/locale/weight.h -index e071253f85..2889c395f1 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/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 new file mode 100644 index 0000000000..0ebf8a6183 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch @@ -0,0 +1,70 @@ +From bf1c4b2f01c5f86bb770fd1711a69ea727e0f56e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 15 May 2020 17:05:45 -0700 +Subject: [PATCH 29/29] 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 +--- + sysdeps/aarch64/bits/wordsize.h | 8 ++++++-- + sysdeps/{aarch64 => arm}/bits/wordsize.h | 8 ++++++-- + 2 files changed, 12 insertions(+), 4 deletions(-) + copy sysdeps/{aarch64 => arm}/bits/wordsize.h (85%) + +diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h +index ee01841773..34fcdef1f1 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 + . */ + +-#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 85% +copy from sysdeps/aarch64/bits/wordsize.h +copy to sysdeps/arm/bits/wordsize.h +index ee01841773..34fcdef1f1 100644 +--- a/sysdeps/aarch64/bits/wordsize.h ++++ b/sysdeps/arm/bits/wordsize.h +@@ -17,12 +17,16 @@ + License along with the GNU C Library; if not, see + . */ + +-#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 +-- +2.27.0 + diff --git a/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch b/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch new file mode 100644 index 0000000000..a764552361 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch @@ -0,0 +1,51 @@ +From 8b1d521290218df8ceeaf2e6ee44a54b19d8d328 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 7 Aug 2020 14:31:16 -0700 +Subject: [PATCH 30/30] powerpc: Do not ask compiler for finding arch + +This does not work well in cross compiling environments like OE +and moreover it uses its own -mcpu/-march options via cflags + +Upstream-Status: Inappropriate [ OE-Specific] + +Signed-off-by: Khem Raj +--- + sysdeps/powerpc/preconfigure | 5 +---- + sysdeps/powerpc/preconfigure.ac | 5 +---- + 2 files changed, 2 insertions(+), 8 deletions(-) + +diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure +index dfe8e20399..bbff040f0f 100644 +--- a/sysdeps/powerpc/preconfigure ++++ b/sysdeps/powerpc/preconfigure +@@ -29,10 +29,7 @@ esac + # directive which shows up, and try using it. + case "${machine}:${submachine}" in + *powerpc*:) +- archcpu=`echo "int foo () { return 0; }" \ +- | $CC $CFLAGS $CPPFLAGS -S -frecord-gcc-switches -xc -o - - \ +- | grep -E "mcpu=|.machine" -m 1 \ +- | sed -e "s/.*machine //" -e "s/.*mcpu=\(.*\)\"/\1/"` ++ archcpu='' + # Note if you add patterns here you must ensure that an appropriate + # 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 +--- a/sysdeps/powerpc/preconfigure.ac ++++ b/sysdeps/powerpc/preconfigure.ac +@@ -29,10 +29,7 @@ esac + # directive which shows up, and try using it. + case "${machine}:${submachine}" in + *powerpc*:) +- archcpu=`echo "int foo () { return 0; }" \ +- | $CC $CFLAGS $CPPFLAGS -S -frecord-gcc-switches -xc -o - - \ +- | grep -E "mcpu=|[.]machine" -m 1 \ +- | sed -e "s/.*machine //" -e "s/.*mcpu=\(.*\)\"/\1/"` ++ archcpu='' + # Note if you add patterns here you must ensure that an appropriate + # directory exists in sysdeps/powerpc. Likewise, if we find a + # cpu, don't let the generic configure append extra compiler options. +-- +2.28.0 + diff --git a/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch deleted file mode 100644 index cbef2f2830..0000000000 --- a/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 9cb0a756b017f5961b70ac781d3eaec6c82513cb Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 ---- - sysdeps/aarch64/bits/wordsize.h | 8 ++++++-- - sysdeps/{aarch64 => arm}/bits/wordsize.h | 8 ++++++-- - 2 files changed, 12 insertions(+), 4 deletions(-) - copy sysdeps/{aarch64 => arm}/bits/wordsize.h (85%) - -diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h -index ee01841773..34fcdef1f1 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 - . */ - --#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 85% -copy from sysdeps/aarch64/bits/wordsize.h -copy to sysdeps/arm/bits/wordsize.h -index ee01841773..34fcdef1f1 100644 ---- a/sysdeps/aarch64/bits/wordsize.h -+++ b/sysdeps/arm/bits/wordsize.h -@@ -17,12 +17,16 @@ - License along with the GNU C Library; if not, see - . */ - --#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/CVE-2020-6096.patch b/meta/recipes-core/glibc/glibc/CVE-2020-6096.patch deleted file mode 100644 index 9c26f76432..0000000000 --- a/meta/recipes-core/glibc/glibc/CVE-2020-6096.patch +++ /dev/null @@ -1,112 +0,0 @@ -From beea361050728138b82c57dda0c4810402d342b9 Mon Sep 17 00:00:00 2001 -From: Alexander Anisimov -Date: Wed, 8 Jul 2020 14:18:31 +0200 -Subject: [PATCH] arm: CVE-2020-6096: Fix multiarch memcpy for negative length - [BZ #25620] - -Unsigned branch instructions could be used for r2 to fix the wrong -behavior when a negative length is passed to memcpy. -This commit fixes the armv7 version. - -Upstream-Status: Backport -CVE: CVE-2020-6096 patch #1 -Signed-off-by: Armin Kuster - ---- - sysdeps/arm/armv7/multiarch/memcpy_impl.S | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/sysdeps/arm/armv7/multiarch/memcpy_impl.S b/sysdeps/arm/armv7/multiarch/memcpy_impl.S -index bf4ac7077f..379bb56fc9 100644 ---- a/sysdeps/arm/armv7/multiarch/memcpy_impl.S -+++ b/sysdeps/arm/armv7/multiarch/memcpy_impl.S -@@ -268,7 +268,7 @@ ENTRY(memcpy) - - mov dst, dstin /* Preserve dstin, we need to return it. */ - cmp count, #64 -- bge .Lcpy_not_short -+ bhs .Lcpy_not_short - /* Deal with small copies quickly by dropping straight into the - exit block. */ - -@@ -351,10 +351,10 @@ ENTRY(memcpy) - - 1: - subs tmp2, count, #64 /* Use tmp2 for count. */ -- blt .Ltail63aligned -+ blo .Ltail63aligned - - cmp tmp2, #512 -- bge .Lcpy_body_long -+ bhs .Lcpy_body_long - - .Lcpy_body_medium: /* Count in tmp2. */ - #ifdef USE_VFP -@@ -378,7 +378,7 @@ ENTRY(memcpy) - add src, src, #64 - vstr d1, [dst, #56] - add dst, dst, #64 -- bge 1b -+ bhs 1b - tst tmp2, #0x3f - beq .Ldone - -@@ -412,7 +412,7 @@ ENTRY(memcpy) - ldrd A_l, A_h, [src, #64]! - strd A_l, A_h, [dst, #64]! - subs tmp2, tmp2, #64 -- bge 1b -+ bhs 1b - tst tmp2, #0x3f - bne 1f - ldr tmp2,[sp], #FRAME_SIZE -@@ -482,7 +482,7 @@ ENTRY(memcpy) - add src, src, #32 - - subs tmp2, tmp2, #prefetch_lines * 64 * 2 -- blt 2f -+ blo 2f - 1: - cpy_line_vfp d3, 0 - cpy_line_vfp d4, 64 -@@ -494,7 +494,7 @@ ENTRY(memcpy) - add dst, dst, #2 * 64 - add src, src, #2 * 64 - subs tmp2, tmp2, #prefetch_lines * 64 -- bge 1b -+ bhs 1b - - 2: - cpy_tail_vfp d3, 0 -@@ -615,8 +615,8 @@ ENTRY(memcpy) - 1: - pld [src, #(3 * 64)] - subs count, count, #64 -- ldrmi tmp2, [sp], #FRAME_SIZE -- bmi .Ltail63unaligned -+ ldrlo tmp2, [sp], #FRAME_SIZE -+ blo .Ltail63unaligned - pld [src, #(4 * 64)] - - #ifdef USE_NEON -@@ -633,7 +633,7 @@ ENTRY(memcpy) - neon_load_multi d0-d3, src - neon_load_multi d4-d7, src - subs count, count, #64 -- bmi 2f -+ blo 2f - 1: - pld [src, #(4 * 64)] - neon_store_multi d0-d3, dst -@@ -641,7 +641,7 @@ ENTRY(memcpy) - neon_store_multi d4-d7, dst - neon_load_multi d4-d7, src - subs count, count, #64 -- bpl 1b -+ bhs 1b - 2: - neon_store_multi d0-d3, dst - neon_store_multi d4-d7, dst --- -2.17.1 - diff --git a/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch b/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch deleted file mode 100644 index 905e44c8e3..0000000000 --- a/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 79a4fa341b8a89cb03f84564fd72abaa1a2db394 Mon Sep 17 00:00:00 2001 -From: Evgeny Eremin -Date: Wed, 8 Jul 2020 14:18:19 +0200 -Subject: [PATCH] arm: CVE-2020-6096: fix memcpy and memmove for negative - length [BZ #25620] - -Unsigned branch instructions could be used for r2 to fix the wrong -behavior when a negative length is passed to memcpy and memmove. -This commit fixes the generic arm implementation of memcpy amd memmove. - -Upstream-Status: Backport -CVE: CVE-2020-6096 patch #2 -Signed-off-by: Armin Kuster - ---- - sysdeps/arm/memcpy.S | 24 ++++++++++-------------- - sysdeps/arm/memmove.S | 24 ++++++++++-------------- - 2 files changed, 20 insertions(+), 28 deletions(-) - -diff --git a/sysdeps/arm/memcpy.S b/sysdeps/arm/memcpy.S -index 510e8adaf2..bcfbc51d99 100644 ---- a/sysdeps/arm/memcpy.S -+++ b/sysdeps/arm/memcpy.S -@@ -68,7 +68,7 @@ ENTRY(memcpy) - cfi_remember_state - - subs r2, r2, #4 -- blt 8f -+ blo 8f - ands ip, r0, #3 - PLD( pld [r1, #0] ) - bne 9f -@@ -82,7 +82,7 @@ ENTRY(memcpy) - cfi_rel_offset (r6, 4) - cfi_rel_offset (r7, 8) - cfi_rel_offset (r8, 12) -- blt 5f -+ blo 5f - - CALGN( ands ip, r1, #31 ) - CALGN( rsb r3, ip, #32 ) -@@ -98,9 +98,9 @@ ENTRY(memcpy) - #endif - - PLD( pld [r1, #0] ) --2: PLD( subs r2, r2, #96 ) -+2: PLD( cmp r2, #96 ) - PLD( pld [r1, #28] ) -- PLD( blt 4f ) -+ PLD( blo 4f ) - PLD( pld [r1, #60] ) - PLD( pld [r1, #92] ) - -@@ -108,9 +108,7 @@ ENTRY(memcpy) - 4: ldmia r1!, {r3, r4, r5, r6, r7, r8, ip, lr} - subs r2, r2, #32 - stmia r0!, {r3, r4, r5, r6, r7, r8, ip, lr} -- bge 3b -- PLD( cmn r2, #96 ) -- PLD( bge 4b ) -+ bhs 3b - - 5: ands ip, r2, #28 - rsb ip, ip, #32 -@@ -222,7 +220,7 @@ ENTRY(memcpy) - strbge r4, [r0], #1 - subs r2, r2, ip - strb lr, [r0], #1 -- blt 8b -+ blo 8b - ands ip, r1, #3 - beq 1b - -@@ -236,7 +234,7 @@ ENTRY(memcpy) - .macro forward_copy_shift pull push - - subs r2, r2, #28 -- blt 14f -+ blo 14f - - CALGN( ands ip, r1, #31 ) - CALGN( rsb ip, ip, #32 ) -@@ -253,9 +251,9 @@ ENTRY(memcpy) - cfi_rel_offset (r10, 16) - - PLD( pld [r1, #0] ) -- PLD( subs r2, r2, #96 ) -+ PLD( cmp r2, #96 ) - PLD( pld [r1, #28] ) -- PLD( blt 13f ) -+ PLD( blo 13f ) - PLD( pld [r1, #60] ) - PLD( pld [r1, #92] ) - -@@ -280,9 +278,7 @@ ENTRY(memcpy) - mov ip, ip, PULL #\pull - orr ip, ip, lr, PUSH #\push - stmia r0!, {r3, r4, r5, r6, r7, r8, r10, ip} -- bge 12b -- PLD( cmn r2, #96 ) -- PLD( bge 13b ) -+ bhs 12b - - pop {r5 - r8, r10} - cfi_adjust_cfa_offset (-20) -diff --git a/sysdeps/arm/memmove.S b/sysdeps/arm/memmove.S -index 954037ef3a..0d07b76ee6 100644 ---- a/sysdeps/arm/memmove.S -+++ b/sysdeps/arm/memmove.S -@@ -85,7 +85,7 @@ ENTRY(memmove) - add r1, r1, r2 - add r0, r0, r2 - subs r2, r2, #4 -- blt 8f -+ blo 8f - ands ip, r0, #3 - PLD( pld [r1, #-4] ) - bne 9f -@@ -99,7 +99,7 @@ ENTRY(memmove) - cfi_rel_offset (r6, 4) - cfi_rel_offset (r7, 8) - cfi_rel_offset (r8, 12) -- blt 5f -+ blo 5f - - CALGN( ands ip, r1, #31 ) - CALGN( sbcsne r4, ip, r2 ) @ C is always set here -@@ -114,9 +114,9 @@ ENTRY(memmove) - #endif - - PLD( pld [r1, #-4] ) --2: PLD( subs r2, r2, #96 ) -+2: PLD( cmp r2, #96 ) - PLD( pld [r1, #-32] ) -- PLD( blt 4f ) -+ PLD( blo 4f ) - PLD( pld [r1, #-64] ) - PLD( pld [r1, #-96] ) - -@@ -124,9 +124,7 @@ ENTRY(memmove) - 4: ldmdb r1!, {r3, r4, r5, r6, r7, r8, ip, lr} - subs r2, r2, #32 - stmdb r0!, {r3, r4, r5, r6, r7, r8, ip, lr} -- bge 3b -- PLD( cmn r2, #96 ) -- PLD( bge 4b ) -+ bhs 3b - - 5: ands ip, r2, #28 - rsb ip, ip, #32 -@@ -237,7 +235,7 @@ ENTRY(memmove) - strbge r4, [r0, #-1]! - subs r2, r2, ip - strb lr, [r0, #-1]! -- blt 8b -+ blo 8b - ands ip, r1, #3 - beq 1b - -@@ -251,7 +249,7 @@ ENTRY(memmove) - .macro backward_copy_shift push pull - - subs r2, r2, #28 -- blt 14f -+ blo 14f - - CALGN( ands ip, r1, #31 ) - CALGN( rsb ip, ip, #32 ) -@@ -268,9 +266,9 @@ ENTRY(memmove) - cfi_rel_offset (r10, 16) - - PLD( pld [r1, #-4] ) -- PLD( subs r2, r2, #96 ) -+ PLD( cmp r2, #96 ) - PLD( pld [r1, #-32] ) -- PLD( blt 13f ) -+ PLD( blo 13f ) - PLD( pld [r1, #-64] ) - PLD( pld [r1, #-96] ) - -@@ -295,9 +293,7 @@ ENTRY(memmove) - mov r4, r4, PUSH #\push - orr r4, r4, r3, PULL #\pull - stmdb r0!, {r4 - r8, r10, ip, lr} -- bge 12b -- PLD( cmn r2, #96 ) -- PLD( bge 13b ) -+ bhs 12b - - pop {r5 - r8, r10} - cfi_adjust_cfa_offset (-20) --- -2.17.1 - diff --git a/meta/recipes-core/glibc/glibc_2.31.bb b/meta/recipes-core/glibc/glibc_2.31.bb deleted file mode 100644 index 38563b1a7b..0000000000 --- a/meta/recipes-core/glibc/glibc_2.31.bb +++ /dev/null @@ -1,115 +0,0 @@ -require glibc.inc -require glibc-version.inc - -CVE_CHECK_WHITELIST += "CVE-2020-10029" - -DEPENDS += "gperf-native bison-native make-native" - -NATIVESDKFIXES ?= "" -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 \ -" - -SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ - file://etc/ld.so.conf \ - file://generate-supported.mk \ - file://makedbs.sh \ - \ - ${NATIVESDKFIXES} \ - file://0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \ - file://0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \ - file://0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \ - file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \ - file://0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ - file://0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ - file://0016-Add-unused-attribute.patch \ - file://0017-yes-within-the-path-sets-wrong-config-variables.patch \ - file://0018-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0019-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0020-eglibc-Cross-building-and-testing-instructions.patch \ - file://0021-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0023-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0024-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ - file://0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ - file://0027-intl-Emit-no-lines-in-bison-generated-files.patch \ - file://0028-inject-file-assembly-directives.patch \ - file://0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ - file://0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \ - file://CVE-2020-6096.patch \ - file://CVE-2020-6096_2.patch \ - " -S = "${WORKDIR}/git" -B = "${WORKDIR}/build-${TARGET_SYS}" - -PACKAGES_DYNAMIC = "" - -# the -isystem in bitbake.conf screws up glibc do_stage -BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" -TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" - -GLIBC_BROKEN_LOCALES = "" - -GLIBCPIE ??= "" - -EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ - --disable-profile \ - --disable-debug --without-gd \ - --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 \ - --enable-nscd \ - ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \ - ${GLIBCPIE} \ - ${GLIBC_EXTRA_OECONF}" - -EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" - -do_patch_append() { - bb.build.exec_func('do_fix_readlib_c', d) -} - -do_fix_readlib_c () { - sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c -} - -do_configure () { -# override this function to avoid the autoconf/automake/aclocal/autoheader -# calls for now -# don't pass CPPFLAGS into configure, since it upsets the kernel-headers -# 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 -} - -LDFLAGS += "-fuse-ld=bfd" -do_compile () { - base_do_compile - echo "Adjust ldd script" - if [ -n "${RTLDLIST}" ] - then - prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'` - # remove duplicate entries - newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)` - echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\"" - sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#" - fi -} - -require glibc-package.inc - -BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-core/glibc/glibc_2.32.bb b/meta/recipes-core/glibc/glibc_2.32.bb new file mode 100644 index 0000000000..7049e61625 --- /dev/null +++ b/meta/recipes-core/glibc/glibc_2.32.bb @@ -0,0 +1,113 @@ +require glibc.inc +require glibc-version.inc + +CVE_CHECK_WHITELIST += "CVE-2020-10029" + +DEPENDS += "gperf-native bison-native make-native" + +NATIVESDKFIXES ?= "" +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 \ +" + +SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ + file://etc/ld.so.conf \ + file://generate-supported.mk \ + 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://0026-inject-file-assembly-directives.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 \ + " +S = "${WORKDIR}/git" +B = "${WORKDIR}/build-${TARGET_SYS}" + +PACKAGES_DYNAMIC = "" + +# the -isystem in bitbake.conf screws up glibc do_stage +BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" +TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" + +GLIBC_BROKEN_LOCALES = "" + +GLIBCPIE ??= "" + +EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ + --disable-profile \ + --disable-debug --without-gd \ + --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 \ + --enable-nscd \ + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \ + ${GLIBCPIE} \ + ${GLIBC_EXTRA_OECONF}" + +EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" + +do_patch_append() { + bb.build.exec_func('do_fix_readlib_c', d) +} + +do_fix_readlib_c () { + sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c +} + +do_configure () { +# override this function to avoid the autoconf/automake/aclocal/autoheader +# calls for now +# don't pass CPPFLAGS into configure, since it upsets the kernel-headers +# 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 +} + +LDFLAGS += "-fuse-ld=bfd" +do_compile () { + base_do_compile + echo "Adjust ldd script" + if [ -n "${RTLDLIST}" ] + then + prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'` + # remove duplicate entries + newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)` + echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\"" + sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#" + fi +} + +require glibc-package.inc + +BBCLASSEXTEND = "nativesdk" -- cgit v1.2.3-54-g00ecf