Hello.
Here is a patch (attached) which fixes a typo and a section with wrong
attributes
to make IPv6 compile cleanly on 0.9.31. It is required to make glib
work, which
is in turn required by recent udev.
--
WBR, Peter Zotov.
From 35d17ffb0e631800ba2a0f29f4e41366663dfd7c Mon Sep 17 00:00:00 2001
From: Sergey Gridassov <[email protected]>
Date: Thu, 28 Oct 2010 08:11:37 +0400
Subject: [PATCH] Fix #ifdefs to allow IPv6 usage.
---
libc/inet/resolv.c | 5 ++---
libpthread/linuxthreads/pthread.c | 10 +++++-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 364a4b9..8abd6f5 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -3019,16 +3019,15 @@ void res_close(void)
/* This needs to be after the use of _res in res_init, above. */
#undef _res
-#ifndef __UCLIBC_HAS_THREADS__
/* The resolver state for use by single-threaded programs.
This differs from plain `struct __res_state _res;' in that it doesn't
create a common definition, but a plain symbol that resides in .bss,
which can have an alias. */
struct __res_state _res __attribute__((section (".bss")));
+
+#ifndef __UCLIBC_HAS_THREADS__
struct __res_state *__resp = &_res;
#else /* __UCLIBC_HAS_THREADS__ */
-struct __res_state _res __attribute__((section (".bss"))) attribute_hidden;
-
# if defined __UCLIBC_HAS_TLS__
# undef __resp
__thread struct __res_state *__resp = &_res;
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 614cad1..f27fa90 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_IPV4__ || defined __UCLIBC_HAS_IPV6__
/* We need the global/static resolver state here. */
# include <resolv.h>
# undef _res
@@ -73,7 +73,7 @@ struct _pthread_descr_struct __pthread_initial_thread = {
#if !(USE_TLS && HAVE___THREAD)
.p_errnop = &_errno,
.p_h_errnop = &_h_errno,
-# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
+# if defined __UCLIBC_HAS_IPV4__ || defined __UCLIBC_HAS_IPV6__
.p_resp = &_res,
# endif
#endif
@@ -542,14 +542,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_IPV4__ || defined __UCLIBC_HAS_IPV6__)
/* Likewise for the resolver state _res. */
THREAD_SETMEM (((pthread_descr) NULL), p_resp, &_res);
# 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_IPV4__ || defined __UCLIBC_HAS_IPV6__
/* Likewise for the resolver state _res. */
__pthread_initial_thread.p_resp = &_res;
# endif
@@ -1128,7 +1128,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_IPV4__ || defined __UCLIBC_HAS_IPV6__
THREAD_SETMEM(self, p_resp, &_res);
# endif
#endif
--
1.7.1
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc