r6049 - in glibc-package/trunk/debian: . patches patches/any
Author: aurel32
Date: 2014-05-06 14:53:47 +0000 (Tue, 06 May 2014)
New Revision: 6049
Added:
glibc-package/trunk/debian/patches/any/submitted-nl_langinfo-static.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
patches/any/submitted-nl_langinfo-static.diff: new patch to fix
nl_langinfo() used in static binaries. Closes: #747103.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2014-05-05 16:29:31 UTC (rev 6048)
+++ glibc-package/trunk/debian/changelog 2014-05-06 14:53:47 UTC (rev 6049)
@@ -28,6 +28,8 @@
#733237.
* patches/any/cvs-socketcall-syscall.diff: new patch from upstream to fix
socketcall multiplex syscall features detection. Closes: #730744.
+ * patches/any/submitted-nl_langinfo-static.diff: new patch to fix
+ nl_langinfo() used in static binaries. Closes: #747103.
-- Adam Conrad <adconrad@0c3.net> Sun, 27 Apr 2014 23:15:13 -0600
Added: glibc-package/trunk/debian/patches/any/submitted-nl_langinfo-static.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/submitted-nl_langinfo-static.diff (rev 0)
+++ glibc-package/trunk/debian/patches/any/submitted-nl_langinfo-static.diff 2014-05-06 14:53:47 UTC (rev 6049)
@@ -0,0 +1,89 @@
+ 2014-05-06 Aurelien Jarno <aurelien@aurel32.net>
+
+ * locale/nl_langinfo_l.c: Make direct reference to every
+ _nl_current_CATEGORY symbol.
+ * localedata/Makefile (test-srcs): Add tst-langinfo-static.
+ (tests-static): Add tst-langinfo-static.
+ (tests-special): Add tst-langinfo-static.out.
+ ($(objpfx)tst-langinfo.out): Redirect output.
+ ($(objpfx)tst-langinfo-static.out): New.
+ * localedata/tst-langinfo.sh: Send output to stdout.
+ * localedata/tst-langinfo-static.c: New file.
+
+diff --git a/locale/nl_langinfo_l.c b/locale/nl_langinfo_l.c
+--- a/locale/nl_langinfo_l.c
++++ b/locale/nl_langinfo_l.c
+@@ -43,7 +43,21 @@ __nl_langinfo_l (item, l)
+ if (index == _NL_ITEM_INDEX (_NL_LOCALE_NAME (category)))
+ return (char *) l->__names[category];
+
++#if defined NL_CURRENT_INDIRECT
++ /* Make direct reference to every _nl_current_CATEGORY symbol,
++ since we know only at runtime which categories are used. */
++ switch (category)
++ {
++# define DEFINE_CATEGORY(category, category_name, items, a) \
++ case category: data = *_nl_current_##category; break;
++# include "categories.def"
++# undef DEFINE_CATEGORY
++ default: /* Should be impossible. */
++ return (char *) "";
++ }
++#else
+ data = l->__locales[category];
++#endif
+
+ if (index >= data->nstrings)
+ /* Bogus index for this category: bogus item. */
+diff --git a/localedata/Makefile b/localedata/Makefile
+--- a/localedata/Makefile
++++ b/localedata/Makefile
+@@ -45,7 +45,7 @@
+
+ test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
+ tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
+- tst-ctype tst-wctype tst-langinfo tst-numeric
++ tst-ctype tst-wctype tst-langinfo tst-langinfo-static tst-numeric
+ test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1 da_DK.ISO-8859-1 \
+ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 tr_TR.UTF-8 fr_FR.UTF-8 \
+ si_LK.UTF-8
+@@ -164,7 +164,8 @@
+ tests: $(objpfx)sort-test.out $(objpfx)tst-fmon.out $(objpfx)tst-locale.out \
+ $(objpfx)tst-rpmatch.out $(objpfx)tst-trans.out \
+ $(objpfx)tst-mbswcs.out $(objpfx)tst-ctype.out \
+- $(objpfx)tst-langinfo.out $(objpfx)tst-numeric.out
++ $(objpfx)tst-langinfo.out $(objpfx)tst-langinfo-static.out\
++ $(objpfx)tst-numeric.out
+ ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
+ tests: $(objpfx)tst-wctype.out
+ endif
+@@ -211,7 +212,11 @@
+ $(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
+ $(objpfx)sort-test.out \
+ $(addprefix $(objpfx),$(CTYPE_FILES))
+- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'
++ $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@
++$(objpfx)tst-langinfo-static.out: tst-langinfo.sh $(objpfx)tst-langinfo-static \
++ $(objpfx)sort-test.out \
++ $(addprefix $(objpfx),$(CTYPE_FILES))
++ $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' >$@
+ $(objpfx)tst-digits.out: $(objpfx)tst-locale.out
+ $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
+ endif
+diff --git a/localedata/tst-langinfo-static.c b/localedata/tst-langinfo-static.c
+--- /dev/null
++++ b/localedata/tst-langinfo-static.c
+@@ -0,0 +1 @@
++#include "tst-langinfo.c"
+diff --git a/localedata/tst-langinfo.sh b/localedata/tst-langinfo.sh
+--- a/localedata/tst-langinfo.sh
++++ b/localedata/tst-langinfo.sh
+@@ -340,7 +340,6 @@ ja_JP.EUC-JP NOEXPR ^([nN
+ ja_JP.EUC-JP CODESET EUC-JP
+ EOF
+ LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
+-LC_ALL=tt_TT ${tst_langinfo} \
+- > ${common_objpfx}localedata/tst-langinfo.out
++LC_ALL=tt_TT ${tst_langinfo}
+
+ exit $?
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2014-05-05 16:29:31 UTC (rev 6048)
+++ glibc-package/trunk/debian/patches/series 2014-05-06 14:53:47 UTC (rev 6049)
@@ -280,3 +280,4 @@
any/cvs-resolv-first-query-failure.diff
any/submitted-ptsname_r-uninitialized-memory.diff
any/cvs-socketcall-syscall.diff
+any/submitted-nl_langinfo-static.diff
Reply to: