On Fri, Aug 26, 2011 at 02:55:29PM +0200, Carmelo AMOROSO wrote:
>Hello,
>I'm having some problem in building now NPTL without RESOLVER.
>I've fixed one of this problem (not yet pushed), but other appeared
>(basically __resp variable is not longer visible).
>So for now, NPTL requires RESOLVER.
>
>I'll look at this next week.
Something like the attached might fix it up. untested.
diff --git a/libpthread/linuxthreads/manager.c b/libpthread/linuxthreads/manager.c
index 1dd626e..b1482f1 100644
--- a/libpthread/linuxthreads/manager.c
+++ b/libpthread/linuxthreads/manager.c
@@ -293,7 +293,7 @@ pthread_start_thread(void *arg)
/* Initialize thread-locale current locale to point to the global one.
With __thread support, the variable's initializer takes care of this. */
__uselocale (LC_GLOBAL_LOCALE);
-#else
+#elif defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Initialize __resp. */
__resp = &self->p_res;
#endif
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index c3e28c6..66efe3a 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -45,7 +45,7 @@ extern __typeof(sigaction) __libc_sigaction;
extern int _errno;
extern int _h_errno;
-# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* We need the global/static resolver state here. */
# include <resolv.h>
# undef _res
@@ -539,14 +539,14 @@ static void pthread_initialize(void)
#ifdef USE_TLS
/* Update the descriptor for the initial thread. */
THREAD_SETMEM (((pthread_descr) NULL), p_pid, __getpid());
-# if !defined HAVE___THREAD && (defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__)
+# if !defined HAVE___THREAD && defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Likewise for the resolver state _res. */
THREAD_SETMEM (((pthread_descr) NULL), p_resp, __resp);
# endif
#else
/* Update the descriptor for the initial thread. */
__pthread_initial_thread.p_pid = __getpid();
-# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Likewise for the resolver state _res. */
__pthread_initial_thread.p_resp = __resp;
# endif
@@ -1125,7 +1125,7 @@ void __pthread_reset_main_thread(void)
/* Now this thread modifies the global variables. */
THREAD_SETMEM(self, p_errnop, &_errno);
THREAD_SETMEM(self, p_h_errnop, &_h_errno);
-# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
+# if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
THREAD_SETMEM(self, p_resp, __resp);
# endif
#endif
diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
index 849bd59..158bcae 100644
--- a/libpthread/nptl/Makefile.in
+++ b/libpthread/nptl/Makefile.in
@@ -19,7 +19,7 @@ libpthread-static-only-routines-y = pthread_atfork.c
libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!
-libpthread-routines-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += res.c
+libpthread-routines-$(UCLIBC_HAS_RESOLVER_SUPPORT) += res.c
libpthread-routines-$(UCLIBC_SUSV4_LEGACY) += pthread_getconcurrency.c \
pthread_setconcurrency
libpthread_CSRC = $(filter-out $(libpthread-routines-) \
diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c
index 86ff148..1b2c682 100644
--- a/libpthread/nptl/pthread_create.c
+++ b/libpthread/nptl/pthread_create.c
@@ -233,7 +233,7 @@ start_thread (void *arg)
HP_TIMING_NOW (now);
THREAD_SETMEM (pd, cpuclock_offset, now);
#endif
-#if defined __UCLIBC_HAS_IPV4__ || defined __UCLIBC_HAS_IPV6__
+#if defined __UCLIBC_HAS_RESOLVER_SUPPORT__
/* Initialize resolver state pointer. */
__resp = &pd->res;
#endif
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc