summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/560-res_init_asterisk.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-04-09 12:48:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-04-09 13:20:59 +0000
commit612be3713458dd94da24e608360f31262e5ecdc6 (patch)
tree81b34b49ca45b02645fce594228f933dde3354c0 /main/libc0.9.32/560-res_init_asterisk.patch
parente2806f76a81ada79bed2bf5a59d2ba1a2a8bb4d2 (diff)
downloadaports-612be3713458dd94da24e608360f31262e5ecdc6.tar.bz2
aports-612be3713458dd94da24e608360f31262e5ecdc6.tar.xz
main/libc0.9.32: fix res_init for asterisk
from https://dev.openwrt.org/ticket/11929
Diffstat (limited to 'main/libc0.9.32/560-res_init_asterisk.patch')
-rw-r--r--main/libc0.9.32/560-res_init_asterisk.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/main/libc0.9.32/560-res_init_asterisk.patch b/main/libc0.9.32/560-res_init_asterisk.patch
new file mode 100644
index 000000000..c86c96a5e
--- /dev/null
+++ b/main/libc0.9.32/560-res_init_asterisk.patch
@@ -0,0 +1,77 @@
+From: https://dev.openwrt.org/ticket/11929
+
+--- a/libc/inet/resolv.c
++++ b/libc/inet/resolv.c
+@@ -3580,35 +3580,6 @@
+ }
+ #endif
+
+-/* 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")));
+-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;
+-/*
+- * FIXME: Add usage of hidden attribute for this when used in the shared
+- * library. It currently crashes the linker when doing section
+- * relocations.
+- */
+-extern __thread struct __res_state *__libc_resp
+- __attribute__ ((alias ("__resp"))) attribute_hidden;
+-# else
+-# undef __resp
+-struct __res_state *__resp = &_res;
+-# endif
+-#endif /* !__UCLIBC_HAS_THREADS__ */
+-
+ static unsigned int
+ res_randomid(void)
+ {
+@@ -3664,6 +3635,36 @@
+ }
+ libc_hidden_def(res_init)
+
++/* 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")));
++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;
++/*
++ * FIXME: Add usage of hidden attribute for this when used in the shared
++ * library. It currently crashes the linker when doing section
++ * relocations.
++ */
++extern __thread struct __res_state *__libc_resp
++ __attribute__ ((alias ("__resp"))) attribute_hidden;
++# else
++# undef __resp
++struct __res_state *__resp = &_res;
++# endif
++#endif /* !__UCLIBC_HAS_THREADS__ */
++
++
+ /*
+ * Set up default settings. If the configuration file exist, the values
+ * there will have precedence. Otherwise, the server address is set to