From 6617cc92076764d51f0190786f8d62b8c99ae984 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 1 Feb 2015 23:49:10 -0800 Subject: glibc: Upgrade 2.20 -> 2.21 Drop CVE backports and ppc/fpu detection patch which is not needed anymore Forward port eglibc option groups patch Default to using glibc 2.21 Additional patches needed to appease -Werror option Change-Id: I1873097cec8387ea9e8186a255122938fc28c976 Signed-off-by: Khem Raj --- meta/conf/distro/include/tcmode-default.inc | 2 +- .../glibc/cross-localedef-native_2.20.bb | 56 - .../glibc/cross-localedef-native_2.21.bb | 57 + meta/recipes-core/glibc/glibc-initial_2.20.bb | 11 - meta/recipes-core/glibc/glibc-initial_2.21.bb | 11 + meta/recipes-core/glibc/glibc-locale_2.20.bb | 1 - meta/recipes-core/glibc/glibc-locale_2.21.bb | 1 + meta/recipes-core/glibc/glibc-mtrace_2.20.bb | 1 - meta/recipes-core/glibc/glibc-mtrace_2.21.bb | 1 + meta/recipes-core/glibc/glibc-scripts_2.20.bb | 1 - meta/recipes-core/glibc/glibc-scripts_2.21.bb | 1 + meta/recipes-core/glibc/glibc.inc | 4 +- .../glibc/glibc/0001-Add-unused-attribute.patch | 36 + ...ing-SSE-also-make-sure-that-fpmath-is-not.patch | 32 + ...-3406-Stack-overflow-in-vfprintf-BZ-16617.patch | 339 ---- ...4-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch | 215 --- .../CVE-2014-9402_endless-loop-in-getaddr_r.patch | 65 - .../glibc/glibc/eglibc-use-option-groups.patch | 1889 ++++++++++---------- .../glibc/glibc/fsl-ppc-no-fsqrt.patch | 100 -- meta/recipes-core/glibc/glibc/grok_gold.patch | 22 +- meta/recipes-core/glibc/glibc_2.20.bb | 162 -- meta/recipes-core/glibc/glibc_2.21.bb | 158 ++ 22 files changed, 1303 insertions(+), 1862 deletions(-) delete mode 100644 meta/recipes-core/glibc/cross-localedef-native_2.20.bb create mode 100644 meta/recipes-core/glibc/cross-localedef-native_2.21.bb delete mode 100644 meta/recipes-core/glibc/glibc-initial_2.20.bb create mode 100644 meta/recipes-core/glibc/glibc-initial_2.21.bb delete mode 100644 meta/recipes-core/glibc/glibc-locale_2.20.bb create mode 100644 meta/recipes-core/glibc/glibc-locale_2.21.bb delete mode 100644 meta/recipes-core/glibc/glibc-mtrace_2.20.bb create mode 100644 meta/recipes-core/glibc/glibc-mtrace_2.21.bb delete mode 100644 meta/recipes-core/glibc/glibc-scripts_2.20.bb create mode 100644 meta/recipes-core/glibc/glibc-scripts_2.21.bb create mode 100644 meta/recipes-core/glibc/glibc/0001-Add-unused-attribute.patch create mode 100644 meta/recipes-core/glibc/glibc/0001-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch delete mode 100644 meta/recipes-core/glibc/glibc/CVE-2012-3406-Stack-overflow-in-vfprintf-BZ-16617.patch delete mode 100644 meta/recipes-core/glibc/glibc/CVE-2014-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch delete mode 100644 meta/recipes-core/glibc/glibc/CVE-2014-9402_endless-loop-in-getaddr_r.patch delete mode 100644 meta/recipes-core/glibc/glibc/fsl-ppc-no-fsqrt.patch delete mode 100644 meta/recipes-core/glibc/glibc_2.20.bb create mode 100644 meta/recipes-core/glibc/glibc_2.21.bb diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index 7428aa99ff..9e25bf0225 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc @@ -25,7 +25,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "4.9%" SDKGCCVERSION ?= "${GCCVERSION}" BINUVERSION ?= "2.24" -GLIBCVERSION ?= "2.20" +GLIBCVERSION ?= "2.21" UCLIBCVERSION ?= "0.9.33+git%" LINUXLIBCVERSION ?= "3.17.7" diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.20.bb b/meta/recipes-core/glibc/cross-localedef-native_2.20.bb deleted file mode 100644 index 8aaa225706..0000000000 --- a/meta/recipes-core/glibc/cross-localedef-native_2.20.bb +++ /dev/null @@ -1,56 +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=e9a558e243b36d3209f380deb394b213 \ - file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ - file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" - - -inherit native -inherit autotools - -FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:" - -PV = "2.20" - -SRC_URI = "git://sourceware.org/git/glibc.git;branch=release/${PV}/master;name=glibc \ - git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \ - file://fix_for_centos_5.8.patch \ - ${EGLIBCPATCHES} \ - " -EGLIBCPATCHES = "\ - file://timezone-re-written-tzselect-as-posix-sh.patch \ - file://eglibc.patch \ - file://option-groups.patch \ - file://GLRO_dl_debug_mask.patch \ - file://eglibc-header-bootstrap.patch \ - file://eglibc-resolv-dynamic.patch \ - file://eglibc-ppc8xx-cache-line-workaround.patch \ - file://eglibc-sh4-fpscr_values.patch \ - file://eglibc-use-option-groups.patch \ - " - -SRCREV_glibc = "b8079dd0d360648e4e8de48656c5c38972621072" -SRCREV_localedef = "c833367348d39dad7ba018990bfdaffaec8e9ed3" - -# Makes for a rather long rev (22 characters), but... -# -SRCREV_FORMAT = "glibc__localedef" - -S = "${WORKDIR}/git" - -EXTRA_OECONF = "--with-glibc=${S}" -CFLAGS += "-DNOT_IN_libc=1" - -do_configure () { - ${S}/localedef/configure ${EXTRA_OECONF} -} - - -do_install() { - install -d ${D}${bindir} - install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef -} diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.21.bb b/meta/recipes-core/glibc/cross-localedef-native_2.21.bb new file mode 100644 index 0000000000..814ae9df92 --- /dev/null +++ b/meta/recipes-core/glibc/cross-localedef-native_2.21.bb @@ -0,0 +1,57 @@ +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=e9a558e243b36d3209f380deb394b213 \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + + +inherit native +inherit autotools + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:" + +#BRANCH = "release/${PV}/master" +BRANCH = "master" + +SRC_URI = "git://sourceware.org/git/glibc.git;branch=${BRANCH};name=glibc \ + git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \ + file://fix_for_centos_5.8.patch \ + ${EGLIBCPATCHES} \ + " +EGLIBCPATCHES = "\ + file://timezone-re-written-tzselect-as-posix-sh.patch \ + file://eglibc.patch \ + file://option-groups.patch \ + file://GLRO_dl_debug_mask.patch \ + file://eglibc-header-bootstrap.patch \ + file://eglibc-resolv-dynamic.patch \ + file://eglibc-ppc8xx-cache-line-workaround.patch \ + file://eglibc-sh4-fpscr_values.patch \ + file://eglibc-use-option-groups.patch \ + " + +SRCREV_glibc = "edac0a60c7514b8c9b59488cffdac6b22267e757" +SRCREV_localedef = "c833367348d39dad7ba018990bfdaffaec8e9ed3" + +# 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_configure () { + ${S}/localedef/configure ${EXTRA_OECONF} +} + + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef +} diff --git a/meta/recipes-core/glibc/glibc-initial_2.20.bb b/meta/recipes-core/glibc/glibc-initial_2.20.bb deleted file mode 100644 index 8ab01dc79d..0000000000 --- a/meta/recipes-core/glibc/glibc-initial_2.20.bb +++ /dev/null @@ -1,11 +0,0 @@ -require glibc_${PV}.bb -require glibc-initial.inc - -DEPENDS += "kconfig-frontends-native" - -# main glibc recipes muck with TARGET_CPPFLAGS to point into -# final target sysroot but we -# are not there when building glibc-initial -# so reset it here - -TARGET_CPPFLAGS = "" diff --git a/meta/recipes-core/glibc/glibc-initial_2.21.bb b/meta/recipes-core/glibc/glibc-initial_2.21.bb new file mode 100644 index 0000000000..8ab01dc79d --- /dev/null +++ b/meta/recipes-core/glibc/glibc-initial_2.21.bb @@ -0,0 +1,11 @@ +require glibc_${PV}.bb +require glibc-initial.inc + +DEPENDS += "kconfig-frontends-native" + +# main glibc recipes muck with TARGET_CPPFLAGS to point into +# final target sysroot but we +# are not there when building glibc-initial +# so reset it here + +TARGET_CPPFLAGS = "" diff --git a/meta/recipes-core/glibc/glibc-locale_2.20.bb b/meta/recipes-core/glibc/glibc-locale_2.20.bb deleted file mode 100644 index f7702e0358..0000000000 --- a/meta/recipes-core/glibc/glibc-locale_2.20.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-locale.inc diff --git a/meta/recipes-core/glibc/glibc-locale_2.21.bb b/meta/recipes-core/glibc/glibc-locale_2.21.bb new file mode 100644 index 0000000000..f7702e0358 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-locale_2.21.bb @@ -0,0 +1 @@ +require glibc-locale.inc diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.20.bb b/meta/recipes-core/glibc/glibc-mtrace_2.20.bb deleted file mode 100644 index 0b69bad46a..0000000000 --- a/meta/recipes-core/glibc/glibc-mtrace_2.20.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-mtrace.inc diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.21.bb b/meta/recipes-core/glibc/glibc-mtrace_2.21.bb new file mode 100644 index 0000000000..0b69bad46a --- /dev/null +++ b/meta/recipes-core/glibc/glibc-mtrace_2.21.bb @@ -0,0 +1 @@ +require glibc-mtrace.inc diff --git a/meta/recipes-core/glibc/glibc-scripts_2.20.bb b/meta/recipes-core/glibc/glibc-scripts_2.20.bb deleted file mode 100644 index 5a89bd8022..0000000000 --- a/meta/recipes-core/glibc/glibc-scripts_2.20.bb +++ /dev/null @@ -1 +0,0 @@ -require glibc-scripts.inc diff --git a/meta/recipes-core/glibc/glibc-scripts_2.21.bb b/meta/recipes-core/glibc/glibc-scripts_2.21.bb new file mode 100644 index 0000000000..5a89bd8022 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-scripts_2.21.bb @@ -0,0 +1 @@ +require glibc-scripts.inc diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index 8aa78dfb34..767d4b8b5b 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc @@ -20,7 +20,7 @@ def get_optimization(d): SELECTED_OPTIMIZATION := "${@get_optimization(d)}" # siteconfig.bbclass runs configure which needs a working compiler -# For the compiler to work we need a working libc yet libc isn't +# For the compiler to work we need a working libc yet libc isn't # in the sysroots directory at this point. This means the libc.so # linker script won't work as the --sysroot setting isn't correct. # Here we create a hacked up libc linker script and pass in the right @@ -71,7 +71,7 @@ EXTRA_OEMAKE += "${EGLIBCPARALLELISM}" PARALLEL_MAKE = "" # glibc make-syscalls.sh has a number of issues with /bin/dash and -# it's output which make calls via the SHELL also has issues, so +# it's output which make calls via the SHELL also has issues, so # ensure make uses /bin/bash EXTRA_OEMAKE += "SHELL=/bin/bash" diff --git a/meta/recipes-core/glibc/glibc/0001-Add-unused-attribute.patch b/meta/recipes-core/glibc/glibc/0001-Add-unused-attribute.patch new file mode 100644 index 0000000000..f51a0ccb22 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0001-Add-unused-attribute.patch @@ -0,0 +1,36 @@ +2015-02-18 Khem Raj > + + * iconv/gconv_charset.h (strip): + Add unused attribute. + +From 9c4a91cb331ff1e8cde2314dadee74559d8cb0dd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 18 Feb 2015 19:45:31 +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 + +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 80290bc..7890a8e 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; +-- +2.1.4 + diff --git a/meta/recipes-core/glibc/glibc/0001-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch b/meta/recipes-core/glibc/glibc/0001-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch new file mode 100644 index 0000000000..a6395b77bc --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0001-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch @@ -0,0 +1,32 @@ +From 6f5639f6405ff9a42e4f71e7b0f18bddb68d992a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 Feb 2015 03:23:45 +0000 +Subject: [PATCH] When disabling SSE also make sure that fpmath is not set to + use SSE as well + +This fixes errors when we inject sse options through CFLAGS and now +that we have -Werror turned on by default this warning turns to become +error on x86 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + sysdeps/x86/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile +index 19f5eca..827ea71 100644 +--- a/sysdeps/x86/Makefile ++++ b/sysdeps/x86/Makefile +@@ -1,6 +1,6 @@ + ifeq ($(subdir),elf) + CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ +- -mno-sse -mno-mmx) ++ -mno-sse -mno-mmx -mfpmath=387) + + tests-special += $(objpfx)tst-ld-sse-use.out + $(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so +-- +2.1.4 + diff --git a/meta/recipes-core/glibc/glibc/CVE-2012-3406-Stack-overflow-in-vfprintf-BZ-16617.patch b/meta/recipes-core/glibc/glibc/CVE-2012-3406-Stack-overflow-in-vfprintf-BZ-16617.patch deleted file mode 100644 index 8cfdbeaa60..0000000000 --- a/meta/recipes-core/glibc/glibc/CVE-2012-3406-Stack-overflow-in-vfprintf-BZ-16617.patch +++ /dev/null @@ -1,339 +0,0 @@ -From a5357b7ce2a2982c5778435704bcdb55ce3667a0 Mon Sep 17 00:00:00 2001 -From: Jeff Law -Date: Mon, 15 Dec 2014 10:09:32 +0100 -Subject: [PATCH] CVE-2012-3406: Stack overflow in vfprintf [BZ #16617] - -A larger number of format specifiers coudld cause a stack overflow, -potentially allowing to bypass _FORTIFY_SOURCE format string -protection. ---- - ChangeLog | 9 +++++++ - NEWS | 13 +++++---- - stdio-common/Makefile | 2 +- - stdio-common/bug23-2.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ - stdio-common/bug23-3.c | 50 +++++++++++++++++++++++++++++++++++ - stdio-common/bug23-4.c | 31 ++++++++++++++++++++++ - stdio-common/vfprintf.c | 40 ++++++++++++++++++++++++++-- - 7 files changed, 207 insertions(+), 8 deletions(-) - create mode 100644 stdio-common/bug23-2.c - create mode 100644 stdio-common/bug23-3.c - create mode 100644 stdio-common/bug23-4.c - -Index: git/ChangeLog -=================================================================== ---- git.orig/ChangeLog -+++ git/ChangeLog -@@ -1,3 +1,12 @@ -+2014-12-15 Jeff Law -+ -+ [BZ #16617] -+ * stdio-common/vfprintf.c (vfprintf): Allocate large specs array -+ on the heap. (CVE-2012-3406) -+ * stdio-common/bug23-2.c, stdio-common/bug23-3.c: New file. -+ * stdio-common/bug23-4.c: New file. Test case by Joseph Myers. -+ * stdio-common/Makefile (tests): Add bug23-2, bug23-3, bug23-4. -+ - 2014-11-19 Carlos O'Donell - Florian Weimer - Joseph Myers -Index: git/NEWS -=================================================================== ---- git.orig/NEWS -+++ git/NEWS -@@ -13,24 +13,28 @@ Version 2.20 - 15698, 15804, 15894, 15946, 16002, 16064, 16095, 16194, 16198, 16275, - 16284, 16287, 16315, 16348, 16349, 16354, 16357, 16362, 16447, 16516, - 16532, 16539, 16545, 16561, 16562, 16564, 16574, 16599, 16600, 16609, -- 16610, 16611, 16613, 16619, 16623, 16629, 16632, 16634, 16639, 16642, -- 16648, 16649, 16670, 16674, 16677, 16680, 16681, 16683, 16689, 16695, -- 16701, 16706, 16707, 16712, 16713, 16714, 16724, 16731, 16739, 16740, -- 16743, 16754, 16758, 16759, 16760, 16770, 16786, 16789, 16791, 16796, -- 16799, 16800, 16815, 16823, 16824, 16831, 16838, 16839, 16849, 16854, -- 16876, 16877, 16878, 16882, 16885, 16888, 16890, 16892, 16912, 16915, -- 16916, 16917, 16918, 16922, 16927, 16928, 16932, 16943, 16958, 16965, -- 16966, 16967, 16977, 16978, 16984, 16990, 16996, 17009, 17022, 17031, -- 17042, 17048, 17050, 17058, 17061, 17062, 17069, 17075, 17078, 17079, -- 17084, 17086, 17088, 17092, 17097, 17125, 17135, 17137, 17150, 17153, -- 17187, 17213, 17259, 17261, 17262, 17263, 17319, 17325, 17354, 17625. -- -+ 16610, 16611, 16613, 16617, 16619, 16623, 16629, 16632, 16634, 16639, -+ 16642, 16648, 16649, 16670, 16674, 16677, 16680, 16681, 16683, 16689, -+ 16695, 16701, 16706, 16707, 16712, 16713, 16714, 16724, 16731, 16739, -+ 16740, 16743, 16754, 16758, 16759, 16760, 16770, 16786, 16789, 16791, -+ 16796, 16799, 16800, 16815, 16823, 16824, 16831, 16838, 16839, 16849, -+ 16854, 16876, 16877, 16878, 16882, 16885, 16888, 16890, 16892, 16912, -+ 16915, 16916, 16917, 16918, 16922, 16927, 16928, 16932, 16943, 16958, -+ 16965, 16966, 16967, 16977, 16978, 16984, 16990, 16996, 17009, 17022, -+ 17031, 17042, 17048, 17050, 17058, 17061, 17062, 17069, 17075, 17078, -+ 17079, 17084, 17086, 17088, 17092, 17097, 17125, 17135, 17137, 17150, -+ 17153, 17187, 17213, 17259, 17261, 17262, 17263, 17319, 17325, 17354, -+ 17625. -+ - * CVE-2104-7817 The wordexp function could ignore the WRDE_NOCMD flag - under certain input conditions resulting in the execution of a shell for - command substitution when the applicaiton did not request it. The - implementation now checks WRDE_NOCMD immediately before executing the - shell and returns the error WRDE_CMDSUB as expected. - -+* CVE-2012-3406 printf-style functions could run into a stack overflow when -+ processing format strings with a large number of format specifiers. -+ - * Reverted change of ABI data structures for s390 and s390x: - On s390 and s390x the size of struct ucontext and jmp_buf was increased in - 2.19. This change is reverted in 2.20. The introduced 2.19 symbol versions -Index: git/stdio-common/bug23-2.c -=================================================================== ---- /dev/null -+++ git/stdio-common/bug23-2.c -@@ -0,0 +1,70 @@ -+#include -+#include -+#include -+ -+static const char expected[] = "\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55\ -+\n\ -+a\n\ -+abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; -+ -+static int -+do_test (void) -+{ -+ char *buf = malloc (strlen (expected) + 1); -+ snprintf (buf, strlen (expected) + 1, -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", -+ "a", "b", "c", "d", 5); -+ return strcmp (buf, expected) != 0; -+} -+ -+#define TEST_FUNCTION do_test () -+#include "../test-skeleton.c" -Index: git/stdio-common/bug23-3.c -=================================================================== ---- /dev/null -+++ git/stdio-common/bug23-3.c -@@ -0,0 +1,50 @@ -+#include -+#include -+#include -+ -+int -+do_test (void) -+{ -+ size_t instances = 16384; -+#define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" -+ const char *item = "\na\nabbcd55"; -+#define X3 X0 X0 X0 X0 X0 X0 X0 X0 -+#define X6 X3 X3 X3 X3 X3 X3 X3 X3 -+#define X9 X6 X6 X6 X6 X6 X6 X6 X6 -+#define X12 X9 X9 X9 X9 X9 X9 X9 X9 -+#define X14 X12 X12 X12 X12 -+#define TRAILER "%%%%%%%%%%%%%%%%%%%%%%%%%%" -+#define TRAILER2 TRAILER TRAILER -+ size_t length = instances * strlen (item) + strlen (TRAILER) + 1; -+ -+ char *buf = malloc (length + 1); -+ snprintf (buf, length + 1, -+ X14 TRAILER2 "\n", -+ "a", "b", "c", "d", 5); -+ -+ const char *p = buf; -+ size_t i; -+ for (i = 0; i < instances; ++i) -+ { -+ const char *expected; -+ for (expected = item; *expected; ++expected) -+ { -+ if (*p != *expected) -+ { -+ printf ("mismatch at offset %zu (%zu): expected %d, got %d\n", -+ (size_t) (p - buf), i, *expected & 0xFF, *p & 0xFF); -+ return 1; -+ } -+ ++p; -+ } -+ } -+ if (strcmp (p, TRAILER "\n") != 0) -+ { -+ printf ("mismatch at trailer: [%s]\n", p); -+ return 1; -+ } -+ free (buf); -+ return 0; -+} -+#define TEST_FUNCTION do_test () -+#include "../test-skeleton.c" -Index: git/stdio-common/bug23-4.c -=================================================================== ---- /dev/null -+++ git/stdio-common/bug23-4.c -@@ -0,0 +1,31 @@ -+#include -+#include -+#include -+#include -+ -+#define LIMIT 1000000 -+ -+int -+main (void) -+{ -+ struct rlimit lim; -+ getrlimit (RLIMIT_STACK, &lim); -+ lim.rlim_cur = 1048576; -+ setrlimit (RLIMIT_STACK, &lim); -+ char *fmtstr = malloc (4 * LIMIT + 1); -+ if (fmtstr == NULL) -+ abort (); -+ char *output = malloc (LIMIT + 1); -+ if (output == NULL) -+ abort (); -+ for (size_t i = 0; i < LIMIT; i++) -+ memcpy (fmtstr + 4 * i, "%1$d", 4); -+ fmtstr[4 * LIMIT] = '\0'; -+ int ret = snprintf (output, LIMIT + 1, fmtstr, 0); -+ if (ret != LIMIT) -+ abort (); -+ for (size_t i = 0; i < LIMIT; i++) -+ if (output[i] != '0') -+ abort (); -+ return 0; -+} -Index: git/stdio-common/vfprintf.c -=================================================================== ---- git.orig/stdio-common/vfprintf.c -+++ git/stdio-common/vfprintf.c -@@ -276,6 +276,12 @@ vfprintf (FILE *s, const CHAR_T *format, - /* For the argument descriptions, which may be allocated on the heap. */ - void *args_malloced = NULL; - -+ /* For positional argument handling. */ -+ struct printf_spec *specs; -+ -+ /* Track if we malloced the SPECS array and thus must free it. */ -+ bool specs_malloced = false; -+ - /* This table maps a character into a number representing a - class. In each step there is a destination label for each - class. */ -@@ -1699,8 +1705,8 @@ do_positional: - size_t nspecs = 0; - /* A more or less arbitrary start value. */ - size_t nspecs_size = 32 * sizeof (struct printf_spec); -- struct printf_spec *specs = alloca (nspecs_size); - -+ specs = alloca (nspecs_size); - /* The number of arguments the format string requests. This will - determine the size of the array needed to store the argument - attributes. */ -@@ -1743,11 +1749,39 @@ do_positional: - if (nspecs * sizeof (*specs) >= nspecs_size) - { - /* Extend the array of format specifiers. */ -+ if (nspecs_size * 2 < nspecs_size) -+ { -+ __set_errno (ENOMEM); -+ done = -1; -+ goto all_done; -+ } - struct printf_spec *old = specs; -- specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size); -+ if (__libc_use_alloca (2 * nspecs_size)) -+ specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size); -+ else -+ { -+ nspecs_size *= 2; -+ specs = malloc (nspecs_size); -+ if (specs == NULL) -+ { -+ __set_errno (ENOMEM); -+ specs = old; -+ done = -1; -+ goto all_done; -+ } -+ } - - /* Copy the old array's elements to the new space. */ - memmove (specs, old, nspecs * sizeof (*specs)); -+ -+ /* If we had previously malloc'd space for SPECS, then -+ release it after the copy is complete. */ -+ if (specs_malloced) -+ free (old); -+ -+ /* Now set SPECS_MALLOCED if needed. */ -+ if (!__libc_use_alloca (nspecs_size)) -+ specs_malloced = true; - } - - /* Parse the format specifier. */ -@@ -2068,6 +2102,8 @@ do_positional: - } - - all_done: -+ if (specs_malloced) -+ free (specs); - if (__glibc_unlikely (args_malloced != NULL)) - free (args_malloced); - if (__glibc_unlikely (workstart != NULL)) -Index: git/stdio-common/Makefile -=================================================================== ---- git.orig/stdio-common/Makefile -+++ git/stdio-common/Makefile -@@ -66,7 +66,7 @@ tests := tstscanf test_rdwr test-popen t - tst-fwrite bug16 bug17 tst-sprintf2 bug18 \ - bug19 tst-popen2 scanf14 scanf15 bug21 bug22 scanf16 scanf17 \ - tst-setvbuf1 bug23 bug24 bug-vfprintf-nargs tst-sprintf3 bug25 \ -- tst-printf-round bug26 -+ tst-printf-round bug23-2 bug23-3 bug23-4 - - tests-$(OPTION_EGLIBC_LOCALE_CODE) \ - += tst-sscanf tst-swprintf test-vfprintf bug14 scanf13 tst-grouping diff --git a/meta/recipes-core/glibc/glibc/CVE-2014-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch b/meta/recipes-core/glibc/glibc/CVE-2014-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch deleted file mode 100644 index d95d182dc4..0000000000 --- a/meta/recipes-core/glibc/glibc/CVE-2014-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch +++ /dev/null @@ -1,215 +0,0 @@ -From a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c Mon Sep 17 00:00:00 2001 -From: Carlos O'Donell -Date: Wed, 19 Nov 2014 11:44:12 -0500 -Subject: [PATCH] CVE-2014-7817: wordexp fails to honour WRDE_NOCMD. - -The function wordexp() fails to properly handle the WRDE_NOCMD -flag when processing arithmetic inputs in the form of "$((... ``))" -where "..." can be anything valid. The backticks in the arithmetic -epxression are evaluated by in a shell even if WRDE_NOCMD forbade -command substitution. This allows an attacker to attempt to pass -dangerous commands via constructs of the above form, and bypass -the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD -in exec_comm(), the only place that can execute a shell. All other -checks for WRDE_NOCMD are superfluous and removed. - -We expand the testsuite and add 3 new regression tests of roughly -the same form but with a couple of nested levels. - -On top of the 3 new tests we add fork validation to the WRDE_NOCMD -testing. If any forks are detected during the execution of a wordexp() -call with WRDE_NOCMD, the test is marked as failed. This is slightly -heuristic since vfork might be used in the future, but it provides a -higher level of assurance that no shells were executed as part of -command substitution with WRDE_NOCMD in effect. In addition it doesn't -require libpthread or libdl, instead we use the public implementation -namespace function __register_atfork (already part of the public ABI -for libpthread). - -Tested on x86_64 with no regressions. ---- - ChangeLog | 22 ++++++++++++++++++++++ - NEWS | 8 +++++++- - posix/wordexp-test.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - posix/wordexp.c | 16 ++++------------ - 4 files changed, 77 insertions(+), 13 deletions(-) - -Index: git/ChangeLog -=================================================================== ---- git.orig/ChangeLog -+++ git/ChangeLog -@@ -1,3 +1,24 @@ -+2014-11-19 Carlos O'Donell -+ Florian Weimer -+ Joseph Myers -+ Adam Conrad -+ Andreas Schwab -+ Brooks -+ -+ [BZ #17625] -+ * wordexp-test.c (__dso_handle): Add prototype. -+ (__register_atfork): Likewise. -+ (__app_register_atfork): New function. -+ (registered_forks): New global. -+ (register_fork): New function. -+ (test_case): Add 3 new tests for WRDE_CMDSUB. -+ (main): Call __app_register_atfork. -+ (testit): If WRDE_NOCMD set registered_forks to zero, run test, and if -+ fork count is non-zero fail the test. -+ * posix/wordexp.c (exec_comm): Return WRDE_CMDSUB if WRDE_NOCMD flag -+ is set. -+ (parse_dollars): Remove check for WRDE_NOCMD. -+ - 2014-09-07 Allan McRae words); - -+ if (tc->flags & WRDE_NOCMD) -+ registered_forks = 0; -+ - if (tc->flags & WRDE_APPEND) - { - /* initial wordexp() call, to be appended to */ -@@ -378,6 +415,13 @@ testit (struct test_case_struct *tc) - } - retval = wordexp (tc->words, &we, tc->flags); - -+ if ((tc->flags & WRDE_NOCMD) -+ && (registered_forks > 0)) -+ { -+ printf ("FAILED fork called for WRDE_NOCMD\n"); -+ return 1; -+ } -+ - if (tc->flags & WRDE_DOOFFS) - start_offs = sav_we.we_offs; - -Index: git/posix/wordexp.c -=================================================================== ---- git.orig/posix/wordexp.c -+++ git/posix/wordexp.c -@@ -893,6 +893,10 @@ exec_comm (char *comm, char **word, size - pid_t pid; - int noexec = 0; - -+ /* Do nothing if command substitution should not succeed. */ -+ if (flags & WRDE_NOCMD) -+ return WRDE_CMDSUB; -+ - /* Don't fork() unless necessary */ - if (!comm || !*comm) - return 0; -@@ -2082,9 +2086,6 @@ parse_dollars (char **word, size_t *word - } - } - -- if (flags & WRDE_NOCMD) -- return WRDE_CMDSUB; -- - (*offset) += 2; - return parse_comm (word, word_length, max_length, words, offset, flags, - quoted? NULL : pwordexp, ifs, ifs_white); -@@ -2196,9 +2197,6 @@ parse_dquote (char **word, size_t *word_ - break; - - case '`': -- if (flags & WRDE_NOCMD) -- return WRDE_CMDSUB; -- - ++(*offset); - error = parse_backtick (word, word_length, max_length, words, - offset, flags, NULL, NULL, NULL); -@@ -2357,12 +2355,6 @@ wordexp (const char *words, wordexp_t *p - break; - - case '`': -- if (flags & WRDE_NOCMD) -- { -- error = WRDE_CMDSUB; -- goto do_error; -- } -- - ++words_offset; - error = parse_backtick (&word, &word_length, &max_length, words, - &words_offset, flags, pwordexp, ifs, diff --git a/meta/recipes-core/glibc/glibc/CVE-2014-9402_endless-loop-in-getaddr_r.patch b/meta/recipes-core/glibc/glibc/CVE-2014-9402_endless-loop-in-getaddr_r.patch deleted file mode 100644 index ba1da67b76..0000000000 --- a/meta/recipes-core/glibc/glibc/CVE-2014-9402_endless-loop-in-getaddr_r.patch +++ /dev/null @@ -1,65 +0,0 @@ -CVE-2014-9402 endless loop in getaddr_r - - -https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=11e3417af6e354f1942c68a271ae51e892b2814d - -Upstream-Status: Backport - -Signed-off-by: Armin Kuster - -From 11e3417af6e354f1942c68a271ae51e892b2814d Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Mon, 15 Dec 2014 17:41:13 +0100 -Subject: [PATCH] Avoid infinite loop in nss_dns getnetbyname [BZ #17630] - ---- - ChangeLog | 6 ++++++ - NEWS | 7 +++++-- - resolv/nss_dns/dns-network.c | 4 ++-- - 3 files changed, 13 insertions(+), 4 deletions(-) - -Index: git/NEWS -=================================================================== ---- git.orig/NEWS -+++ git/NEWS -@@ -24,7 +24,10 @@ Version 2.20 - 17031, 17042, 17048, 17050, 17058, 17061, 17062, 17069, 17075, 17078, - 17079, 17084, 17086, 17088, 17092, 17097, 17125, 17135, 17137, 17150, - 17153, 17187, 17213, 17259, 17261, 17262, 17263, 17319, 17325, 17354, -- 17625. -+ 17625, 17630. -+ -+* The nss_dns implementation of getnetbyname could run into an infinite loop -+ if the DNS response contained a PTR record of an unexpected format. - - * CVE-2104-7817 The wordexp function could ignore the WRDE_NOCMD flag - under certain input conditions resulting in the execution of a shell for -Index: git/resolv/nss_dns/dns-network.c -=================================================================== ---- git.orig/resolv/nss_dns/dns-network.c -+++ git/resolv/nss_dns/dns-network.c -@@ -398,8 +398,8 @@ getanswer_r (const querybuf *answer, int - - case BYNAME: - { -- char **ap = result->n_aliases++; -- while (*ap != NULL) -+ char **ap; -+ for (ap = result->n_aliases; *ap != NULL; ++ap) - { - /* Check each alias name for being of the forms: - 4.3.2.1.in-addr.arpa = net 1.2.3.4 -Index: git/ChangeLog -=================================================================== ---- git.orig/ChangeLog -+++ git/ChangeLog -@@ -1,3 +1,9 @@ -+2014-12-16 Florian Weimer -+ -+ [BZ #17630] -+ * resolv/nss_dns/dns-network.c (getanswer_r): Iterate over alias -+ names. -+ - 2014-12-15 Jeff Law - - [BZ #16617] diff --git a/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch b/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch index 1910fccd3c..0fcaff9719 100644 --- a/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch +++ b/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch @@ -4,8 +4,8 @@ Upstream-Status: Pending Index: git/argp/argp-fmtstream.c =================================================================== ---- git.orig/argp/argp-fmtstream.c 2014-08-29 20:00:42.976070587 -0700 -+++ git/argp/argp-fmtstream.c 2014-08-29 20:01:15.188070587 -0700 +--- git.orig/argp/argp-fmtstream.c ++++ git/argp/argp-fmtstream.c @@ -42,6 +42,7 @@ #ifdef _LIBC # include @@ -14,7 +14,7 @@ Index: git/argp/argp-fmtstream.c # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a) #endif -@@ -100,7 +101,11 @@ +@@ -100,7 +101,11 @@ __argp_fmtstream_free (argp_fmtstream_t __argp_fmtstream_update (fs); if (fs->p > fs->buf) { @@ -26,7 +26,7 @@ Index: git/argp/argp-fmtstream.c } free (fs->buf); free (fs); -@@ -145,9 +150,17 @@ +@@ -145,9 +150,17 @@ __argp_fmtstream_update (argp_fmtstream_ size_t i; for (i = 0; i < pad; i++) { @@ -45,7 +45,7 @@ Index: git/argp/argp-fmtstream.c putc_unlocked (' ', fs->stream); } } -@@ -308,9 +321,17 @@ +@@ -308,9 +321,17 @@ __argp_fmtstream_update (argp_fmtstream_ *nl++ = ' '; else for (i = 0; i < fs->wmargin; ++i) @@ -66,9 +66,9 @@ Index: git/argp/argp-fmtstream.c /* Copy the tail of the original buffer into the current buffer Index: git/argp/argp-help.c =================================================================== ---- git.orig/argp/argp-help.c 2014-08-29 20:00:42.976070587 -0700 -+++ git/argp/argp-help.c 2014-08-29 20:01:15.188070587 -0700 -@@ -51,6 +51,7 @@ +--- git.orig/argp/argp-help.c ++++ git/argp/argp-help.c +@@ -51,6 +51,7 @@ char *alloca (); #ifdef _LIBC # include <../libio/libioP.h> # include @@ -76,7 +76,7 @@ Index: git/argp/argp-help.c #endif #ifndef _ -@@ -1702,7 +1703,7 @@ +@@ -1702,7 +1703,7 @@ char *__argp_basename (char *name) } char * @@ -85,7 +85,7 @@ Index: git/argp/argp-help.c { # if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME return program_invocation_short_name; -@@ -1873,9 +1874,17 @@ +@@ -1873,9 +1874,17 @@ __argp_failure (const struct argp_state #endif } @@ -106,8 +106,8 @@ Index: git/argp/argp-help.c #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) Index: git/argp/argp-namefrob.h =================================================================== ---- git.orig/argp/argp-namefrob.h 2014-08-29 20:00:42.976070587 -0700 -+++ git/argp/argp-namefrob.h 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/argp/argp-namefrob.h ++++ git/argp/argp-namefrob.h @@ -76,10 +76,12 @@ #undef __argp_fmtstream_wmargin #define __argp_fmtstream_wmargin argp_fmtstream_wmargin @@ -123,8 +123,8 @@ Index: git/argp/argp-namefrob.h #undef __flockfile Index: git/argp/Makefile =================================================================== ---- git.orig/argp/Makefile 2014-08-29 20:00:42.976070587 -0700 -+++ git/argp/Makefile 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/argp/Makefile ++++ git/argp/Makefile @@ -18,6 +18,8 @@ # # Makefile for argp. @@ -136,9 +136,9 @@ Index: git/argp/Makefile include ../Makeconfig Index: git/catgets/Makefile =================================================================== ---- git.orig/catgets/Makefile 2014-08-29 20:00:43.008070587 -0700 -+++ git/catgets/Makefile 2014-08-29 20:01:15.192070587 -0700 -@@ -22,20 +22,23 @@ +--- git.orig/catgets/Makefile ++++ git/catgets/Makefile +@@ -22,20 +22,23 @@ subdir := catgets include ../Makeconfig @@ -171,8 +171,8 @@ Index: git/catgets/Makefile # To find xmalloc.c Index: git/crypt/crypt-entry.c =================================================================== ---- git.orig/crypt/crypt-entry.c 2014-08-29 20:00:43.028070587 -0700 -+++ git/crypt/crypt-entry.c 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/crypt/crypt-entry.c ++++ git/crypt/crypt-entry.c @@ -27,6 +27,7 @@ #include #endif @@ -181,7 +181,7 @@ Index: git/crypt/crypt-entry.c #include #include -@@ -76,9 +77,11 @@ +@@ -76,9 +77,11 @@ __crypt_r (key, salt, data) const char *salt; struct crypt_data * __restrict data; { @@ -193,7 +193,7 @@ Index: git/crypt/crypt-entry.c #ifdef _LIBC /* Try to find out whether we have to use MD5 encryption replacement. */ -@@ -105,6 +108,7 @@ +@@ -105,6 +108,7 @@ __crypt_r (key, salt, data) sizeof (struct crypt_data)); #endif @@ -201,7 +201,7 @@ Index: git/crypt/crypt-entry.c /* * Hack DES tables according to salt */ -@@ -144,6 +148,10 @@ +@@ -144,6 +148,10 @@ __crypt_r (key, salt, data) */ _ufc_output_conversion_r (res[0], res[1], salt, data); return data->crypt_3_buf; @@ -212,7 +212,7 @@ Index: git/crypt/crypt-entry.c } weak_alias (__crypt_r, crypt_r) -@@ -168,7 +176,12 @@ +@@ -168,7 +176,12 @@ crypt (key, salt) return __sha512_crypt (key, salt); #endif @@ -227,8 +227,8 @@ Index: git/crypt/crypt-entry.c Index: git/crypt/Makefile =================================================================== ---- git.orig/crypt/Makefile 2014-08-29 20:00:43.024070587 -0700 -+++ git/crypt/Makefile 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/crypt/Makefile ++++ git/crypt/Makefile @@ -18,21 +18,25 @@ # # Sub-makefile for crypt() portion of the library. @@ -261,7 +261,7 @@ Index: git/crypt/Makefile routines += $(libcrypt-routines) endif -@@ -44,7 +48,7 @@ +@@ -44,7 +48,7 @@ LDLIBS-crypt.so = -lfreebl3 else libcrypt-routines += md5 sha256 sha512 @@ -270,7 +270,7 @@ Index: git/crypt/Makefile # The test md5test-giant uses up to 400 MB of RSS and runs on a fast # machine over a minute. -@@ -64,8 +68,10 @@ +@@ -64,8 +68,10 @@ $(objpfx)sha256test: $(patsubst %, $(obj $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines)) endif @@ -283,8 +283,8 @@ Index: git/crypt/Makefile +endif # eglibc: OPTION_EGLIBC_CRYPT Index: git/csu/Makefile =================================================================== ---- git.orig/csu/Makefile 2014-08-29 20:00:43.032070587 -0700 -+++ git/csu/Makefile 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/csu/Makefile ++++ git/csu/Makefile @@ -22,6 +22,8 @@ # crtn.o, special "initializer" and "finalizer" files used in the link # to make the .init and .fini sections work right. @@ -296,8 +296,8 @@ Index: git/csu/Makefile include ../Makeconfig Index: git/debug/Makefile =================================================================== ---- git.orig/debug/Makefile 2014-08-29 20:00:43.036070587 -0700 -+++ git/debug/Makefile 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/debug/Makefile ++++ git/debug/Makefile @@ -18,6 +18,8 @@ # # Sub-makefile for debug portion of the library. @@ -307,7 +307,7 @@ Index: git/debug/Makefile subdir := debug include ../Makeconfig -@@ -27,7 +29,7 @@ +@@ -27,7 +29,7 @@ headers := execinfo.h # Note that ptsname_r_chk and getlogin_r are not here, but in # login/Makefile instead. If that subdir is omitted from the # build, its _FORTIFY_SOURCE support will be too. @@ -316,7 +316,7 @@ Index: git/debug/Makefile memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \ strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \ sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \ -@@ -36,20 +38,27 @@ +@@ -36,20 +38,27 @@ routines = backtrace backtracesyms back read_chk pread_chk pread64_chk recv_chk recvfrom_chk \ readlink_chk readlinkat_chk getwd_chk getcwd_chk \ realpath_chk fread_chk fread_u_chk \ @@ -352,7 +352,7 @@ Index: git/debug/Makefile static-only-routines := warning-nop stack_chk_fail_local CFLAGS-backtrace.c = -fno-omit-frame-pointer -@@ -129,11 +138,15 @@ +@@ -131,11 +140,15 @@ LDFLAGS-tst-backtrace4 = -rdynamic LDFLAGS-tst-backtrace5 = -rdynamic LDFLAGS-tst-backtrace6 = -rdynamic @@ -371,12 +371,12 @@ Index: git/debug/Makefile +tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 +endif - tests-ifunc := $(stpcpy_chk strcpy_chk:%=test-%-ifunc) - tests += $(tests-ifunc) + extra-libs = libSegFault libpcprofile + extra-libs-others = $(extra-libs) Index: git/debug/segfault.c =================================================================== ---- git.orig/debug/segfault.c 2014-08-29 20:00:46.280070587 -0700 -+++ git/debug/segfault.c 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/debug/segfault.c ++++ git/debug/segfault.c @@ -30,6 +30,7 @@ #include #include <_itoa.h> @@ -385,7 +385,24 @@ Index: git/debug/segfault.c /* This file defines macros to access the content of the sigcontext element passed up by the signal handler. */ -@@ -91,6 +92,7 @@ +@@ -68,11 +69,13 @@ write_strsignal (int fd, int signal) + static void + catch_segfault (int signal, SIGCONTEXT ctx) + { +- int fd, cnt, i; +- void **arr; ++ int fd; + struct sigaction sa; ++#if __OPTION_EGLIBC_BACKTRACE ++ int cnt, i; ++ void **arr; + uintptr_t pc; +- ++#endif + /* This is the name of the file we are writing to. If none is given + or we cannot write to this file write to stderr. */ + fd = 2; +@@ -91,6 +94,7 @@ catch_segfault (int signal, SIGCONTEXT c REGISTER_DUMP; #endif @@ -393,7 +410,7 @@ Index: git/debug/segfault.c WRITE_STRING ("\nBacktrace:\n"); /* Get the backtrace. */ -@@ -113,6 +115,7 @@ +@@ -113,6 +117,7 @@ catch_segfault (int signal, SIGCONTEXT c /* Now generate nicely formatted output. */ __backtrace_symbols_fd (arr + i, cnt - i, fd); @@ -403,8 +420,8 @@ Index: git/debug/segfault.c /* Now the link map. */ Index: git/debug/tst-chk1.c =================================================================== ---- git.orig/debug/tst-chk1.c 2014-08-29 20:00:46.288070587 -0700 -+++ git/debug/tst-chk1.c 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/debug/tst-chk1.c ++++ git/debug/tst-chk1.c @@ -31,6 +31,7 @@ #include #include @@ -413,7 +430,7 @@ Index: git/debug/tst-chk1.c #define obstack_chunk_alloc malloc -@@ -307,6 +308,7 @@ +@@ -307,6 +308,7 @@ do_test (void) snprintf (buf + 8, l0 + 3, "%d", num2); CHK_FAIL_END @@ -421,7 +438,7 @@ Index: git/debug/tst-chk1.c CHK_FAIL_START swprintf (wbuf + 8, 3, L"%d", num1); CHK_FAIL_END -@@ -314,6 +316,7 @@ +@@ -314,6 +316,7 @@ do_test (void) CHK_FAIL_START swprintf (wbuf + 8, l0 + 3, L"%d", num1); CHK_FAIL_END @@ -429,7 +446,7 @@ Index: git/debug/tst-chk1.c # endif memcpy (buf, str1 + 2, l0 + 9); -@@ -381,6 +384,7 @@ +@@ -381,6 +384,7 @@ do_test (void) CHK_FAIL_END #endif @@ -437,7 +454,7 @@ Index: git/debug/tst-chk1.c /* These ops can be done without runtime checking of object size. */ wmemcpy (wbuf, L"abcdefghij", 10); -@@ -605,6 +609,7 @@ +@@ -605,6 +609,7 @@ do_test (void) CHK_FAIL_END #endif @@ -445,7 +462,7 @@ Index: git/debug/tst-chk1.c /* Now checks for %n protection. */ -@@ -1192,6 +1197,7 @@ +@@ -1192,6 +1197,7 @@ do_test (void) # endif #endif @@ -453,7 +470,7 @@ Index: git/debug/tst-chk1.c if (setlocale (LC_ALL, "de_DE.UTF-8") != NULL) { assert (MB_CUR_MAX <= 10); -@@ -1348,6 +1354,7 @@ +@@ -1348,6 +1354,7 @@ do_test (void) puts ("cannot set locale"); ret = 1; } @@ -463,8 +480,8 @@ Index: git/debug/tst-chk1.c if (fd != -1) Index: git/dlfcn/Makefile =================================================================== ---- git.orig/dlfcn/Makefile 2014-08-29 20:00:46.312070587 -0700 -+++ git/dlfcn/Makefile 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/dlfcn/Makefile ++++ git/dlfcn/Makefile @@ -15,6 +15,8 @@ # License along with the GNU C Library; if not, see # . @@ -474,21 +491,23 @@ Index: git/dlfcn/Makefile subdir := dlfcn include ../Makeconfig -@@ -36,7 +38,9 @@ +@@ -36,8 +38,11 @@ endif ifeq (yes,$(build-shared)) tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ -- bug-atexit3 tstatexit bug-dl-leaf -+ tstatexit bug-dl-leaf +- bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen ++ tstatexit bug-dl-leaf tst-rec-dlopen + endif + +tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3 - endif ++ modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \ defaultmod2 errmsg1mod modatexit modcxaatexit \ + bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \ Index: git/elf/dl-support.c =================================================================== ---- git.orig/elf/dl-support.c 2014-08-29 20:00:46.384070587 -0700 -+++ git/elf/dl-support.c 2014-08-29 20:01:15.192070587 -0700 +--- git.orig/elf/dl-support.c ++++ git/elf/dl-support.c @@ -19,6 +19,7 @@ /* This file defines some things that for the dynamic linker are defined in rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */ @@ -497,7 +516,7 @@ Index: git/elf/dl-support.c #include #include #include -@@ -42,7 +43,9 @@ +@@ -42,7 +43,9 @@ char **_dl_argv = &__progname; /* This i const char *_dl_platform; size_t _dl_platformlen; @@ -509,8 +528,8 @@ Index: git/elf/dl-support.c int _dl_dynamic_weak; Index: git/elf/rtld.c =================================================================== ---- git.orig/elf/rtld.c 2014-08-29 20:01:14.708070587 -0700 -+++ git/elf/rtld.c 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/elf/rtld.c ++++ git/elf/rtld.c @@ -16,6 +16,7 @@ License along with the GNU C Library; if not, see . */ @@ -519,7 +538,7 @@ Index: git/elf/rtld.c #include #include #include -@@ -2200,6 +2201,7 @@ +@@ -2200,6 +2201,7 @@ print_missing_version (int errcode __att objname, errstring); } @@ -527,7 +546,7 @@ Index: git/elf/rtld.c /* Nonzero if any of the debugging options is enabled. */ static int any_debug attribute_relro; -@@ -2309,6 +2311,7 @@ +@@ -2309,6 +2311,7 @@ a filename can be specified using the LD _exit (0); } } @@ -535,7 +554,18 @@ Index: git/elf/rtld.c static void process_dl_audit (char *str) -@@ -2376,12 +2379,14 @@ +@@ -2348,8 +2351,9 @@ process_envvars (enum mode *modep) + char **runp = _environ; + char *envline; + enum mode mode = normal; ++#if __OPTION_EGLIBC_RTLD_DEBUG + char *debug_output = NULL; +- ++#endif + /* This is the default place for profiling data file. */ + GLRO(dl_profile_output) + = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0]; +@@ -2376,12 +2380,14 @@ process_envvars (enum mode *modep) break; case 5: @@ -550,7 +580,23 @@ Index: git/elf/rtld.c if (memcmp (envline, "AUDIT", 5) == 0) process_dl_audit (&envline[6]); break; -@@ -2490,7 +2495,9 @@ +@@ -2447,13 +2453,14 @@ process_envvars (enum mode *modep) + break; + } + ++#if __OPTION_EGLIBC_RTLD_DEBUG + /* Where to place the profiling data file. */ + if (memcmp (envline, "DEBUG_OUTPUT", 12) == 0) + { + debug_output = &envline[13]; + break; + } +- ++#endif + if (!__libc_enable_secure + && memcmp (envline, "DYNAMIC_WEAK", 12) == 0) + GLRO(dl_dynamic_weak) = 1; +@@ -2490,7 +2497,9 @@ process_envvars (enum mode *modep) { mode = trace; GLRO(dl_verbose) = 1; @@ -560,7 +606,7 @@ Index: git/elf/rtld.c GLRO(dl_trace_prelink) = &envline[17]; } break; -@@ -2537,12 +2544,15 @@ +@@ -2537,12 +2546,15 @@ process_envvars (enum mode *modep) if (__access ("/etc/suid-debug", F_OK) != 0) { unsetenv ("MALLOC_CHECK_"); @@ -576,7 +622,7 @@ Index: git/elf/rtld.c /* If we have to run the dynamic linker in debugging mode and the LD_DEBUG_OUTPUT environment variable is given, we write the debug messages to this file. */ -@@ -2567,6 +2577,7 @@ +@@ -2567,6 +2579,7 @@ process_envvars (enum mode *modep) /* We use standard output if opening the file failed. */ GLRO(dl_debug_fd) = STDOUT_FILENO; } @@ -586,9 +632,9 @@ Index: git/elf/rtld.c Index: git/extra-lib.mk =================================================================== ---- git.orig/extra-lib.mk 2014-08-29 20:00:46.544070587 -0700 -+++ git/extra-lib.mk 2014-08-29 20:01:15.196070587 -0700 -@@ -25,7 +25,9 @@ +--- git.orig/extra-lib.mk ++++ git/extra-lib.mk +@@ -25,7 +25,9 @@ install-lib := $(install-lib) extra-objs := $(extra-objs) # The modules that go in $(lib). @@ -599,7 +645,7 @@ Index: git/extra-lib.mk # Add each flavor of library to the lists of things to build and install. install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) -@@ -101,7 +103,7 @@ +@@ -101,7 +103,7 @@ endif endif # This will define `libof-ROUTINE := LIB' for each of the routines. @@ -610,8 +656,8 @@ Index: git/extra-lib.mk endif Index: git/grp/Makefile =================================================================== ---- git.orig/grp/Makefile 2014-08-29 20:00:46.556070587 -0700 -+++ git/grp/Makefile 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/grp/Makefile ++++ git/grp/Makefile @@ -18,6 +18,8 @@ # # Sub-makefile for grp portion of the library. @@ -621,7 +667,7 @@ Index: git/grp/Makefile subdir := grp include ../Makeconfig -@@ -29,6 +31,9 @@ +@@ -29,6 +31,9 @@ routines := fgetgrent initgroups setgrou getgrent_r getgrgid_r getgrnam_r fgetgrent_r tests := testgrp @@ -633,8 +679,8 @@ Index: git/grp/Makefile test-srcs := tst_fgetgrent Index: git/hesiod/Makefile =================================================================== ---- git.orig/hesiod/Makefile 2014-08-29 20:00:46.580070587 -0700 -+++ git/hesiod/Makefile 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/hesiod/Makefile ++++ git/hesiod/Makefile @@ -18,12 +18,14 @@ # # Sub-makefile for hesiod portion of the library. @@ -654,8 +700,8 @@ Index: git/hesiod/Makefile vpath %.c nss_hesiod Index: git/iconv/gconv_db.c =================================================================== ---- git.orig/iconv/gconv_db.c 2014-08-29 20:00:46.604070587 -0700 -+++ git/iconv/gconv_db.c 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/iconv/gconv_db.c ++++ git/iconv/gconv_db.c @@ -25,6 +25,7 @@ #include #include @@ -664,7 +710,7 @@ Index: git/iconv/gconv_db.c #include #include -@@ -828,9 +829,11 @@ +@@ -828,9 +829,11 @@ free_modules_db (struct gconv_module *no /* Free all resources if necessary. */ libc_freeres_fn (free_mem) { @@ -678,8 +724,8 @@ Index: git/iconv/gconv_db.c extern void _nl_finddomain_subfreeres (void) attribute_hidden; Index: git/iconv/gconv_trans.c =================================================================== ---- git.orig/iconv/gconv_trans.c 2014-08-29 20:00:46.612070587 -0700 -+++ git/iconv/gconv_trans.c 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/iconv/gconv_trans.c ++++ git/iconv/gconv_trans.c @@ -23,6 +23,7 @@ #include #include @@ -688,7 +734,27 @@ Index: git/iconv/gconv_trans.c #include #include "gconv_int.h" -@@ -59,6 +60,7 @@ +@@ -38,15 +39,19 @@ __gconv_transliterate (struct __gconv_st + unsigned char **outbufstart, size_t *irreversible) + { + /* Find out about the locale's transliteration. */ ++#if __OPTION_EGLIBC_LOCALE_CODE + uint_fast32_t size; + const uint32_t *from_idx; + const uint32_t *from_tbl; + const uint32_t *to_idx; + const uint32_t *to_tbl; ++#endif + const uint32_t *winbuf; + const uint32_t *winbufend; ++#if __OPTION_EGLIBC_LOCALE_CODE + uint_fast32_t low; + uint_fast32_t high; ++#endif + + /* The input buffer. There are actually 4-byte values. */ + winbuf = (const uint32_t *) *inbufp; +@@ -58,6 +63,7 @@ __gconv_transliterate (struct __gconv_st PTR_DEMANGLE (fct); #endif @@ -696,7 +762,7 @@ Index: git/iconv/gconv_trans.c /* If there is no transliteration information in the locale don't do anything and return the error. */ size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_TAB_SIZE); -@@ -194,6 +196,7 @@ +@@ -193,6 +199,7 @@ __gconv_transliterate (struct __gconv_st sorted. */ break; } @@ -706,8 +772,8 @@ Index: git/iconv/gconv_trans.c if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0) Index: git/iconv/iconv_prog.c =================================================================== ---- git.orig/iconv/iconv_prog.c 2014-08-29 20:00:46.612070587 -0700 -+++ git/iconv/iconv_prog.c 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/iconv/iconv_prog.c ++++ git/iconv/iconv_prog.c @@ -35,6 +35,7 @@ #ifdef _POSIX_MAPPED_FILES # include @@ -716,7 +782,7 @@ Index: git/iconv/iconv_prog.c #include #include #include "iconv_prog.h" -@@ -221,10 +222,17 @@ +@@ -221,10 +222,17 @@ main (int argc, char *argv[]) bool to_wrong = (iconv_open (to_code, "UTF-8") == (iconv_t) -1 && errno == EINVAL); @@ -736,8 +802,8 @@ Index: git/iconv/iconv_prog.c { Index: git/iconv/Makefile =================================================================== ---- git.orig/iconv/Makefile 2014-08-29 20:00:46.600070587 -0700 -+++ git/iconv/Makefile 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/iconv/Makefile ++++ git/iconv/Makefile @@ -18,6 +18,8 @@ # # Makefile for iconv. @@ -747,20 +813,22 @@ Index: git/iconv/Makefile subdir := iconv include ../Makeconfig -@@ -57,6 +59,9 @@ - CPPFLAGS-strtab = -DNOT_IN_libc - CPPFLAGS-charmap = -DNOT_IN_libc - CPPFLAGS-charmap-dir = -DNOT_IN_libc +@@ -39,6 +41,11 @@ CFLAGS-iconv_charmap.c = -I../locale/pro + CFLAGS-dummy-repertoire.c = -I../locale/programs + CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ + -DDEFAULT_CHARMAP=null_pointer -DNEED_NULL_POINTER ++ +ifneq (y,$(OPTION_EGLIBC_SPAWN)) -+CPPFLAGS-charmap-dir.c += -DNO_UNCOMPRESS ++CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS +endif ++ + CFLAGS-linereader.c = -DNO_TRANSLITERATION + CFLAGS-simple-hash.c = -I../locale - ifeq ($(run-built-tests),yes) - xtests-special += $(objpfx)test-iconvconfig.out Index: git/iconvdata/Makefile =================================================================== ---- git.orig/iconvdata/Makefile 2014-08-29 20:00:46.628070587 -0700 -+++ git/iconvdata/Makefile 2014-08-29 20:01:15.196070587 -0700 +--- git.orig/iconvdata/Makefile ++++ git/iconvdata/Makefile @@ -18,12 +18,15 @@ # # Makefile for iconv data and code. @@ -778,7 +846,7 @@ Index: git/iconvdata/Makefile ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \ ISO8859-11 ISO8859-13 ISO8859-14 ISO8859-15 ISO8859-16 \ T.61 ISO_6937 SJIS KOI-8 HP-ROMAN8 HP-ROMAN9 EBCDIC-AT-DE \ -@@ -63,11 +66,13 @@ +@@ -63,11 +66,13 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3 MAC-CENTRALEUROPE KOI8-RU ISO8859-9E \ CP770 CP771 CP772 CP773 CP774 @@ -794,7 +862,7 @@ Index: git/iconvdata/Makefile ifeq ($(have-thread-library),yes) tests += bug-iconv3 endif -@@ -130,13 +135,13 @@ +@@ -127,13 +132,13 @@ ifeq (yes,$(build-shared)) # Rule to generate the shared objects. charmaps = ../localedata/charmaps -include $(objpfx)iconv-rules @@ -811,7 +879,7 @@ Index: git/iconvdata/Makefile # We can build the conversion tables for numerous charsets automatically. -@@ -204,7 +209,7 @@ +@@ -201,7 +206,7 @@ before-compile += $(addprefix $(objpfx), ifndef avoid-generated $(objpfx)iconv-rules: Makefile $(make-target-directory) @@ -820,7 +888,7 @@ Index: git/iconvdata/Makefile echo 8bit $(gen-8bit-modules); \ echo 8bit-gap $(gen-8bit-gap-modules); } | \ LC_ALL=C \ -@@ -247,7 +252,7 @@ +@@ -245,7 +250,7 @@ $(addprefix $(inst_gconvdir)/, $(modules $(do-install-program) $(inst_gconvdir)/gconv-modules: gconv-modules $(+force) $(do-install) @@ -829,7 +897,7 @@ Index: git/iconvdata/Makefile # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary # if this libc has more gconv modules than the previously installed one. if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \ -@@ -256,9 +261,9 @@ +@@ -254,9 +259,9 @@ ifeq (no,$(cross-compiling)) $(common-objpfx)iconv/iconvconfig \ $(addprefix --prefix=,$(install_root)); \ fi @@ -844,9 +912,9 @@ Index: git/iconvdata/Makefile Index: git/include/netdb.h =================================================================== ---- git.orig/include/netdb.h 2014-08-29 20:00:47.152070587 -0700 -+++ git/include/netdb.h 2014-08-29 20:01:15.196070587 -0700 -@@ -232,6 +232,10 @@ +--- git.orig/include/netdb.h ++++ git/include/netdb.h +@@ -232,6 +232,10 @@ extern enum nss_status _nss_ ## service (const char *name, int af, struct hostent *host, \ char *buffer, size_t buflen, int *errnop, \ int *h_errnop); \ @@ -859,8 +927,8 @@ Index: git/include/netdb.h size_t buflen, int *errnop, int *h_errnop); \ Index: git/inet/Makefile =================================================================== ---- git.orig/inet/Makefile 2014-08-29 20:00:47.176070587 -0700 -+++ git/inet/Makefile 2014-08-29 20:01:15.200070587 -0700 +--- git.orig/inet/Makefile ++++ git/inet/Makefile @@ -18,6 +18,8 @@ # # Sub-makefile for inet portion of the library. @@ -870,7 +938,7 @@ Index: git/inet/Makefile subdir := inet include ../Makeconfig -@@ -27,7 +29,8 @@ +@@ -27,7 +29,8 @@ headers := netinet/ether.h netinet/in.h netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \ aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h @@ -880,7 +948,7 @@ Index: git/inet/Makefile inet_lnaof inet_mkadr \ inet_netof inet_ntoa inet_net herrno herrno-loc \ gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \ -@@ -41,18 +44,23 @@ +@@ -41,18 +44,23 @@ routines := htonl htons \ getrpcent_r getrpcbyname_r getrpcbynumber_r \ ether_aton ether_aton_r ether_hton ether_line \ ether_ntoa ether_ntoa_r ether_ntoh \ @@ -912,89 +980,112 @@ Index: git/inet/Makefile Index: git/intl/dcigettext.c =================================================================== ---- git.orig/intl/dcigettext.c 2014-08-29 20:00:47.224070587 -0700 -+++ git/intl/dcigettext.c 2014-08-29 20:01:15.200070587 -0700 -@@ -77,6 +77,10 @@ +--- git.orig/intl/dcigettext.c ++++ git/intl/dcigettext.c +@@ -100,11 +100,15 @@ extern int errno; + # include "libgnuintl.h" #endif #include "hash-string.h" - +#ifdef _LIBC +# include +#endif -+ - /* Thread safetyness. */ + + /* Handle multi-threaded applications. */ #ifdef _LIBC # include -@@ -449,9 +453,11 @@ - #endif + # define gl_rwlock_define_initialized __libc_rwlock_define_initialized ++# define gl_rwlock_define __libc_rwlock_define + # define gl_rwlock_rdlock __libc_rwlock_rdlock + # define gl_rwlock_wrlock __libc_rwlock_wrlock + # define gl_rwlock_unlock __libc_rwlock_unlock +@@ -523,8 +527,10 @@ DCIGETTEXT (const char *domainname, cons + saved_errno = errno; #ifdef _LIBC -+#if __OPTION_EGLIBC_LOCALE_CODE - __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden) - __libc_rwlock_rdlock (__libc_setlocale_lock); +- __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden) +- __libc_rwlock_rdlock (__libc_setlocale_lock); ++# if __OPTION_EGLIBC_LOCALE_CODE ++ gl_rwlock_define (extern, __libc_setlocale_lock attribute_hidden) ++ gl_rwlock_rdlock (__libc_setlocale_lock); ++# end