[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] Re: eglibc-2.8 fails to link with OPTION_EGLIBC_LOCAL_CODE=n



Joseph S. Myers wrote:
On Mon, 24 Nov 2008, Maxim Kuvyrkov wrote:

The patch seems fine, modulo missing changelog entry and formatting (see
below).  I've tested the patch on powerpc-linux-gnu with no unexpected
failures.   There are two iconvdata tests (iconvdata/bug-iconv6.out and
iconvdata/tst-iconv7.out) that use UTF-8 locale, and, hence, need conditioning
on OPTION_EGLIBC_LOCALES_CODE; I'll post a separate patch to fix those.

Joseph, can you review/approve this patch?

It seems reasonable to me.

Here is complete patch with changelog; I've tested it on x86_64-linux-gnu and powerpc-linux-gnu. I'll commit it in a moment.


Thanks,

--
Maxim
2008-12-15  Josh Boyer  <jwboyer@xxxxxxxxx>
	    Maxim Kuvyrkov  <maxim@xxxxxxxxxxxxxxxx>

	* intl/dcigettext.c: Condition use of libc_setlocale_lock on
	OPTION_EGLIBC_LOCALE_CODE.
	* debug/Makefile (tests): Condition affected tests on
	OPTION_EGLIBC_LOCALE_CODE.
	* iconvdata/Makefile (tests): Same.

Index: debug/Makefile
===================================================================
--- debug/Makefile	(revision 230794)
+++ debug/Makefile	(working copy)
@@ -123,11 +123,13 @@ LDFLAGS-tst-lfschk4 = -lstdc++
 LDFLAGS-tst-lfschk5 = -lstdc++
 LDFLAGS-tst-lfschk6 = -lstdc++
 
-tests = tst-chk1 tst-chk2 tst-chk3 \
-	tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk
+tests = test-strcpy_chk test-stpcpy_chk
+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+      += tst-chk1 tst-chk2 tst-chk3 tst-lfschk1 tst-lfschk2 tst-lfschk3 
 tests-$(OPTION_EGLIBC_BACKTRACE) += backtrace-tst 
-tests-$(OPTION_EGLIBC_CXX_TESTS) \
-     += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6
+ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_EGLIBC_CXX_TESTS))
+tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6
+endif
 
 extra-libs = libSegFault libpcprofile
 extra-libs-others = $(extra-libs)
Index: intl/dcigettext.c
===================================================================
--- intl/dcigettext.c	(revision 230794)
+++ intl/dcigettext.c	(working copy)
@@ -455,9 +455,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
 #endif
 
 #ifdef _LIBC
+#if __OPTION_EGLIBC_LOCALE_CODE
   __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
   __libc_rwlock_rdlock (__libc_setlocale_lock);
 #endif
+#endif
 
   __libc_rwlock_rdlock (_nl_state_lock);
 
@@ -504,7 +506,9 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
 	retval = (char *) (*foundp)->translation;
 
 # ifdef _LIBC
+#if __OPTION_EGLIBC_LOCALE_CODE
       __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
 # endif
       __libc_rwlock_unlock (_nl_state_lock);
       return retval;
@@ -565,7 +569,9 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
 	  /* We cannot get the current working directory.  Don't signal an
 	     error but simply return the default string.  */
 	  FREE_BLOCKS (block_list);
+#if __OPTION_EGLIBC_LOCALE_CODE
 	  __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
 	  __libc_rwlock_unlock (_nl_state_lock);
 	  __set_errno (saved_errno);
 	  return (plural == 0
@@ -632,7 +638,9 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
 	{
 	no_translation:
 	  FREE_BLOCKS (block_list);
+#if __OPTION_EGLIBC_LOCALE_CODE
 	  __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
 	  __libc_rwlock_unlock (_nl_state_lock);
 	  __set_errno (saved_errno);
 	  return (plural == 0
@@ -746,7 +754,9 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
 	      if (plural)
 		retval = plural_lookup (domain, n, retval, retlen);
 
+#if __OPTION_EGLIBC_LOCALE_CODE
 	      __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
 	      __libc_rwlock_unlock (_nl_state_lock);
 	      return retval;
 	    }
Index: iconvdata/Makefile
===================================================================
--- iconvdata/Makefile	(revision 230794)
+++ iconvdata/Makefile	(working copy)
@@ -70,7 +70,8 @@ include ../Makeconfig
 
 ifeq (yes,$(build-shared))
 tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
-	tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7
+	tst-iconv6 bug-iconv5
+tests-$(OPTION_EGLIBC_LOCALE_CODE) += bug-iconv6 tst-iconv7
 ifeq ($(have-thread-library),yes)
 tests += bug-iconv3
 endif