aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/libc0.9.32/0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch34
-rw-r--r--main/libc0.9.32/APKBUILD4
-rw-r--r--main/libc0.9.32/fixit.patch214
3 files changed, 251 insertions, 1 deletions
diff --git a/main/libc0.9.32/0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch b/main/libc0.9.32/0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch
new file mode 100644
index 0000000000..aca6c8e87d
--- /dev/null
+++ b/main/libc0.9.32/0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch
@@ -0,0 +1,34 @@
+From 965b6424d8288049e9802dfe505bd993b93ff009 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Tue, 24 Aug 2010 08:13:58 +0000
+Subject: [PATCH] create DEVEL_PREFIX/MULTILIB_DIR dir rather than DEVEL_PREFIX/lib
+
+This fixes issue with GNU Make 3.82 when running:
+
+ make install DESTDIR=$someplace
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+---
+ Makefile.in | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1c0e305..bffe998 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -289,10 +289,10 @@ HEADERS_RM-$(UCLIBC_SUSV4_LEGACY) += utime.h
+ ### ucontext.h
+
+ ifneq ($(findstring install,$(MAKECMDGOALS)),)
+-$(addprefix $(PREFIX)$(DEVEL_PREFIX),include lib):
++$(addprefix $(PREFIX)$(DEVEL_PREFIX),include $(MULTILIB_DIR)):
+ $(do_mkdir)
+ # avoid warning about duplicate targets in rule or overrides
+-ifneq ($(abspath $(RUNTIME_PREFIX)$(MULTILIB_DIR)),$(abspath $(DEVEL_PREFIX)lib))
++ifneq ($(abspath $(RUNTIME_PREFIX)$(MULTILIB_DIR)),$(abspath $(DEVEL_PREFIX)$(MULTILIB_DIR)))
+ $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR):
+ $(do_mkdir)
+ endif
+--
+1.7.2.2
+
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD
index d546990325..9c89ef6a85 100644
--- a/main/libc0.9.32/APKBUILD
+++ b/main/libc0.9.32/APKBUILD
@@ -3,7 +3,7 @@ _abiver=0.9.32
pkgname=libc$_abiver
_gitver=1008060645
pkgver=${_abiver}_alpha0_git$_gitver
-pkgrel=1
+pkgrel=2
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
@@ -22,6 +22,7 @@ source="http://build.alpinelinux.org:8010/distfiles/$_snapfile
0001-config-parser-fix-memory-corruption.patch
0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
0001-netdb-increase-line-size-for-etc-services.patch
+ 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch
uclibcconfig.x86
uclibcconfig.i486
"
@@ -108,5 +109,6 @@ d08831b452acdeaa3037525ee617edab uclibc-resolv-tls.patch
d351ca4e5c33f4a7a60d4f1d754db5c4 0001-config-parser-fix-memory-corruption.patch
653b046611f98c990f1b52a28968ece3 0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
39ac96d750ad058030f917912bfea466 0001-netdb-increase-line-size-for-etc-services.patch
+9dd8192227f54d6d3ccb49dc54137ff3 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch
e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.x86
e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.i486"
diff --git a/main/libc0.9.32/fixit.patch b/main/libc0.9.32/fixit.patch
new file mode 100644
index 0000000000..faa1bd08f8
--- /dev/null
+++ b/main/libc0.9.32/fixit.patch
@@ -0,0 +1,214 @@
+diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c
+index 03f5c29..47d26a2 100644
+--- a/libc/inet/getservice.c
++++ b/libc/inet/getservice.c
+@@ -35,6 +35,7 @@ __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
+ static parser_t *servp = NULL;
+ static struct servent serve;
+ static char *servbuf = NULL;
++static size_t servbuf_sz = SBUFSIZE;
+ static smallint serv_stayopen;
+
+ void setservent(int stayopen)
+@@ -64,11 +65,11 @@ libc_hidden_def(endservent)
+ int getservent_r(struct servent *result_buf,
+ char *buf, size_t buflen, struct servent **result)
+ {
+- char **alias, *cp = NULL;
++ char **alias;
+ char **serv_aliases;
+ char **tok = NULL;
+ const size_t aliaslen = sizeof(*serv_aliases) * MAXALIASES;
+- int ret = ERANGE;
++ int ret = ENOENT;
+
+ *result = NULL;
+ if (buflen < aliaslen
+@@ -76,31 +77,24 @@ int getservent_r(struct servent *result_buf,
+ goto DONE_NOUNLOCK;
+
+ __UCLIBC_MUTEX_LOCK(mylock);
+- ret = ENOENT;
++
+ if (servp == NULL)
+ setservent(serv_stayopen);
+ if (servp == NULL)
+ goto DONE;
++
+ servp->data = buf;
+ servp->data_len = aliaslen;
+ servp->line_len = buflen - aliaslen;
+ /* <name>[[:space:]]<port>/<proto>[[:space:]][<aliases>] */
+- if (!config_read(servp, &tok, 4, 3, "# \t/", PARSE_NORMAL)) {
++ if (!config_read(servp, &tok, MAXALIASES, 3, "# \t/", PARSE_NORMAL)) {
++ ret = ERANGE;
+ goto DONE;
+ }
+ result_buf->s_name = *(tok++);
+ result_buf->s_port = htons((u_short) atoi(*(tok++)));
+ result_buf->s_proto = *(tok++);
+ result_buf->s_aliases = alias = serv_aliases = tok;
+- cp = *alias;
+- while (cp && *cp) {
+- if (alias < &serv_aliases[MAXALIASES - 1])
+- *alias++ = cp;
+- cp = strpbrk(cp, " \t");
+- if (cp != NULL)
+- *cp++ = '\0';
+- }
+- *alias = NULL;
+ *result = result_buf;
+ ret = 0;
+ DONE:
+@@ -113,19 +107,20 @@ libc_hidden_def(getservent_r)
+
+ static void __initbuf(void)
+ {
+- if (!servbuf) {
+- servbuf = malloc(SBUFSIZE);
+- if (!servbuf)
+- abort();
+- }
++ if (servbuf)
++ servbuf_sz += BUFSZ;
++ servbuf = realloc(servbuf, servbuf_sz);
++ if (!servbuf)
++ abort();
+ }
+
+ struct servent *getservent(void)
+ {
+ struct servent *result;
+
+- __initbuf();
+- getservent_r(&serve, servbuf, SBUFSIZE, &result);
++ do {
++ __initbuf();
++ } while (getservent_r(&serve, servbuf, servbuf_sz, &result) == ERANGE);
+ return result;
+ }
+
+@@ -160,8 +155,10 @@ struct servent *getservbyname(const char *name, const char *proto)
+ {
+ struct servent *result;
+
+- __initbuf();
+- getservbyname_r(name, proto, &serve, servbuf, SBUFSIZE, &result);
++ do {
++ __initbuf();
++ } while (getservbyname_r(name, proto, &serve, servbuf, servbuf_sz, &result)
++ == ERANGE);
+ return result;
+ }
+
+@@ -191,8 +188,10 @@ struct servent *getservbyport(int port, const char *proto)
+ {
+ struct servent *result;
+
+- __initbuf();
+- getservbyport_r(port, proto, &serve, servbuf, SBUFSIZE, &result);
++ do {
++ __initbuf();
++ } while (getservbyport_r(port, proto, &serve, servbuf, servbuf_sz, &result)
++ == ERANGE);
+ return result;
+ }
+ libc_hidden_def(getservbyport)
+diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
+index d45e5f8..831f521 100644
+--- a/libc/inet/resolv.c
++++ b/libc/inet/resolv.c
+@@ -1597,7 +1597,7 @@ int attribute_hidden __read_etc_hosts_r(
+ struct hostent **result,
+ int *h_errnop)
+ {
+- char **alias, *cp = NULL;
++ char **alias;
+ char **host_aliases;
+ char **tok = NULL;
+ struct in_addr *h_addr0 = NULL;
+@@ -1632,33 +1632,24 @@ int attribute_hidden __read_etc_hosts_r(
+ parser->line_len = buflen - aliaslen;
+ *h_errnop = HOST_NOT_FOUND;
+ /* <ip>[[:space:]][<aliases>] */
+- while (config_read(parser, &tok, 2, 2, "# \t", PARSE_NORMAL)) {
++ while (config_read(parser, &tok, MAXALIASES, 2, "# \t", PARSE_NORMAL)) {
+ result_buf->h_aliases = alias = host_aliases = tok+1;
+- cp = *alias;
+- while (cp && *cp) {
+- if (alias < &host_aliases[MAXALIASES - 1])
+- *alias++ = cp;
+- cp = strpbrk(cp, " \t");
+- if (cp != NULL)
+- *cp++ = '\0';
+- }
+- *alias = NULL;
+ if (action == GETHOSTENT) {
+ /* Return whatever the next entry happens to be. */
+ break;
+ }
+- result_buf->h_name = *(result_buf->h_aliases++);
+ if (action == GET_HOSTS_BYADDR) {
+- if (strcmp(name, result_buf->h_name) != 0)
++ if (strcmp(name, *tok) != 0)
+ continue;
+ } else { /* GET_HOSTS_BYNAME */
+- alias = result_buf->h_aliases;
+- while ((cp = *(alias++)))
+- if (strcasecmp(name, cp) == 0)
++ while (*alias) {
++ if (strcasecmp(name, *(alias++)) == 0)
+ goto found;
++ }
+ continue;
+ }
+ found:
++ result_buf->h_name = *(result_buf->h_aliases++);
+ result_buf->h_addr_list = (char**)(buf + ALIASOFF);
+ *(result_buf->h_addr_list + 1) = '\0';
+ h_addr0 = (struct in_addr*)(buf + ALIASOFF + 2 * sizeof (char*));
+diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c
+index 9ddf3ee..e38025f 100644
+--- a/libc/misc/internals/parse_config.c
++++ b/libc/misc/internals/parse_config.c
+@@ -73,6 +73,10 @@ static off_t bb_get_chunk_with_continuation(parser_t* parsr)
+ --pos;
+ else
+ break;
++ } else if (parsr->allocated) {
++ parsr->line_len += PAGE_SIZE;
++ parsr->data = realloc(parsr->data,
++ parsr->data_len + parsr->line_len);
+ }
+ }
+ return pos;
+@@ -109,9 +113,8 @@ static __always_inline parser_t * FAST_FUNC config_open2(const char *filename,
+ fp = fopen_func(filename, "r");
+ if (!fp)
+ return NULL;
+- parser = malloc(sizeof(*parser));
++ parser = calloc(1, sizeof(*parser));
+ if (parser) {
+- memset(parser, 0, sizeof(*parser));
+ parser->fp = fp;
+ }
+ return parser;
+@@ -179,7 +182,7 @@ int attribute_hidden FAST_FUNC config_read(parser_t *parser, char ***tokens,
+ again:
+ if (parser->data == NULL) {
+ if (parser->line_len == 0)
+- parser->line_len = 161;
++ parser->line_len = 81;
+ if (parser->data_len == 0)
+ parser->data_len += 1 + ntokens * sizeof(char *);
+ parser->data = realloc(parser->data,
+@@ -201,7 +204,7 @@ again:
+ return 0;
+ line = parser->line;
+
+- /* Skip token in the start of line? */
++ /* Skip multiple token-delimiters in the start of line? */
+ if (flags & PARSE_TRIM)
+ line += strspn(line, delims + 1);
+
+