musl: update to 1.1.12 + git from 2016-01-22
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48486v19.07.3_mercusys_ac12_duma
parent
d9db303af6
commit
99419349e6
File diff suppressed because it is too large
Load Diff
@ -1,55 +0,0 @@
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Tue, 29 Sep 2015 02:44:05 +0000
|
||||
Subject: [PATCH] eliminate protected-visibility data in libc.so with vis.h
|
||||
preinclude
|
||||
|
||||
some newer binutils versions print scary warnings about protected data
|
||||
because most gcc versions fail to produce the right address
|
||||
references/relocations for such data that might be subject to copy
|
||||
relocations. originally vis.h explicitly assigned default visibility
|
||||
to all public data symbols to avoid this issue, but commit
|
||||
b8dda24fe1caa901a99580f7a52defb95aedb67c removed this treatment for
|
||||
stdin/out/err to work around a gcc 3.x bug, and since they don't
|
||||
actually need it (because taking their addresses is not valid C).
|
||||
|
||||
instead, a check for the gcc 3.x bug is added to the configure check
|
||||
for vis.h preinclude support; this feature will simply be disabled
|
||||
when using a buggy version of gcc.
|
||||
---
|
||||
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -476,10 +476,18 @@ if test "x$visibility" = xauto ; then
|
||||
# - the -include option
|
||||
# - the attributes/pragmas used in vis.h
|
||||
# - linking code that takes the address of protected symbols
|
||||
+# - gcc 3.x bug that wrongly claims declarations mismatch
|
||||
printf "checking whether global visibility preinclude works... "
|
||||
-echo 'int (*fp)(void);' > "$tmpc"
|
||||
-echo 'int foo(void) { }' >> "$tmpc"
|
||||
-echo 'int bar(void) { fp = foo; return foo(); }' >> "$tmpc"
|
||||
+cat > "$tmpc" <<EOF
|
||||
+__attribute__((__visibility__("default")))
|
||||
+extern struct a *const x;
|
||||
+typedef struct a b;
|
||||
+extern b *const x;
|
||||
+b *const x;
|
||||
+int (*fp)(void);
|
||||
+int foo(void) { }
|
||||
+int bar(void) { fp = foo; return foo(); }
|
||||
+EOF
|
||||
if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \
|
||||
-DSHARED -fPIC -I./src/internal -include vis.h \
|
||||
-nostdlib -shared -Wl,-Bsymbolic-functions \
|
||||
--- a/src/internal/vis.h
|
||||
+++ b/src/internal/vis.h
|
||||
@@ -12,6 +12,9 @@
|
||||
* exported data symbols. */
|
||||
|
||||
__attribute__((__visibility__("default")))
|
||||
+extern struct _IO_FILE *const stdin, *const stdout, *const stderr;
|
||||
+
|
||||
+__attribute__((__visibility__("default")))
|
||||
extern int optind, opterr, optopt, optreset, __optreset, getdate_err, h_errno, daylight, __daylight, signgam, __signgam;
|
||||
|
||||
__attribute__((__visibility__("default")))
|
@ -1,79 +0,0 @@
|
||||
From 7b9f57f207b51132f188f750161953b7baf32154 Mon Sep 17 00:00:00 2001
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Thu, 8 Oct 2015 22:03:53 +0000
|
||||
Subject: fix open_[w]memstream behavior when no writes take place
|
||||
|
||||
the specification for these functions requires that the buffer/size
|
||||
exposed to the caller be valid after any successful call to fflush or
|
||||
fclose on the stream. the implementation's approach is to update them
|
||||
only at flush time, but that misses the case where fflush or fclose is
|
||||
called without any writes having taken place, in which case the write
|
||||
flushing callback will not be called.
|
||||
|
||||
to fix both the observable bug and the desired invariant, setup empty
|
||||
buffers at open time and fail the open operation if no memory is
|
||||
available.
|
||||
---
|
||||
src/stdio/open_memstream.c | 11 +++++++++--
|
||||
src/stdio/open_wmemstream.c | 11 +++++++++--
|
||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/stdio/open_memstream.c b/src/stdio/open_memstream.c
|
||||
index 58504c9..eab024d 100644
|
||||
--- a/src/stdio/open_memstream.c
|
||||
+++ b/src/stdio/open_memstream.c
|
||||
@@ -59,14 +59,21 @@ FILE *open_memstream(char **bufp, size_t *sizep)
|
||||
{
|
||||
FILE *f;
|
||||
struct cookie *c;
|
||||
+ char *buf;
|
||||
+
|
||||
if (!(f=malloc(sizeof *f + sizeof *c + BUFSIZ))) return 0;
|
||||
+ if (!(buf=malloc(sizeof *buf))) {
|
||||
+ free(f);
|
||||
+ return 0;
|
||||
+ }
|
||||
memset(f, 0, sizeof *f + sizeof *c);
|
||||
f->cookie = c = (void *)(f+1);
|
||||
|
||||
c->bufp = bufp;
|
||||
c->sizep = sizep;
|
||||
- c->pos = c->len = c->space = 0;
|
||||
- c->buf = 0;
|
||||
+ c->pos = c->len = c->space = *sizep = 0;
|
||||
+ c->buf = *bufp = buf;
|
||||
+ *buf = 0;
|
||||
|
||||
f->flags = F_NORD;
|
||||
f->fd = -1;
|
||||
diff --git a/src/stdio/open_wmemstream.c b/src/stdio/open_wmemstream.c
|
||||
index 7ab2c64..4d90cd9 100644
|
||||
--- a/src/stdio/open_wmemstream.c
|
||||
+++ b/src/stdio/open_wmemstream.c
|
||||
@@ -61,14 +61,21 @@ FILE *open_wmemstream(wchar_t **bufp, size_t *sizep)
|
||||
{
|
||||
FILE *f;
|
||||
struct cookie *c;
|
||||
+ wchar_t *buf;
|
||||
+
|
||||
if (!(f=malloc(sizeof *f + sizeof *c))) return 0;
|
||||
+ if (!(buf=malloc(sizeof *buf))) {
|
||||
+ free(f);
|
||||
+ return 0;
|
||||
+ }
|
||||
memset(f, 0, sizeof *f + sizeof *c);
|
||||
f->cookie = c = (void *)(f+1);
|
||||
|
||||
c->bufp = bufp;
|
||||
c->sizep = sizep;
|
||||
- c->pos = c->len = c->space = 0;
|
||||
- c->buf = 0;
|
||||
+ c->pos = c->len = c->space = *sizep = 0;
|
||||
+ c->buf = *bufp = buf;
|
||||
+ *buf = 0;
|
||||
|
||||
f->flags = F_NORD;
|
||||
f->fd = -1;
|
||||
--
|
||||
cgit v0.11.2
|
||||
|
@ -1,18 +0,0 @@
|
||||
--- a/src/network/getifaddrs.c
|
||||
+++ b/src/network/getifaddrs.c
|
||||
@@ -161,6 +161,15 @@ static int netlink_msg_to_ifaddr(void *p
|
||||
ifs->ifa.ifa_flags = ifs0->ifa.ifa_flags;
|
||||
for (rta = NLMSG_RTA(h, sizeof(*ifa)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {
|
||||
switch (rta->rta_type) {
|
||||
+ case IFA_LOCAL:
|
||||
+ /* If ifa_addr is set and we get IFA_LOCAL, assume we have
|
||||
+ * a point-to-point network. Move address to correct field. */
|
||||
+ if (ifs->ifa.ifa_addr != NULL) {
|
||||
+ ifs->ifu = ifs->addr;
|
||||
+ ifs->ifa.ifa_broadaddr = &ifs->ifu.sa;
|
||||
+ memset(&ifs->addr, 0, sizeof(ifs->addr));
|
||||
+ }
|
||||
+ /* fall through */
|
||||
case IFA_ADDRESS:
|
||||
copy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);
|
||||
break;
|
Loading…
Reference in New Issue