aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/musl/patches
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/musl/patches')
-rw-r--r--toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch59
-rw-r--r--toolchain/musl/patches/110-read_timezone_from_fs.patch2
-rw-r--r--toolchain/musl/patches/200-add_libssp_nonshared.patch4
-rw-r--r--toolchain/musl/patches/300-relative.patch2
-rw-r--r--toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch4
-rw-r--r--toolchain/musl/patches/900-iconv_size_hack.patch34
6 files changed, 23 insertions, 82 deletions
diff --git a/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch b/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch
deleted file mode 100644
index 78b487faeb..0000000000
--- a/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 8e85d2c268000b51cc690f3a55a820d8f8a6c0bc Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Thu, 22 Jun 2017 22:04:28 +0200
-Subject: [PATCH] Add additional uapi guards for Linux kernel header files
-
-With Linux kernel 4.15 it will be possible to guard more parts of the
-Linux header files from a libc. Make use of this in musl to guard all
-the structures and other definitions from the Linux header files which
-are also defined by the header files provided by musl. This will make
-musl compile with the unmodified Linux kernel user space headers.
-
-This extends the definitions done in commit 04983f227238 ("make
-netinet/in.h suppress clashing definitions from kernel headers")
-
-The needed patches were recently accepted for Linux 4.15:
-https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0bace798436bca0fdc221ff61143f1376a9c3de
-https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6926e041a8920c8ec27e4e155efa760aa01551fd
----
- include/net/if.h | 7 +++++++
- include/netinet/if_ether.h | 1 +
- include/sys/xattr.h | 2 ++
- 3 files changed, 10 insertions(+)
-
---- a/include/net/if.h
-+++ b/include/net/if.h
-@@ -125,6 +125,13 @@ struct ifconf {
- #define ifc_req ifc_ifcu.ifcu_req
- #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
-
-+#define __UAPI_DEF_IF_IFCONF 0
-+#define __UAPI_DEF_IF_IFMAP 0
-+#define __UAPI_DEF_IF_IFNAMSIZ 0
-+#define __UAPI_DEF_IF_IFREQ 0
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
-+
- #endif
-
- #ifdef __cplusplus
---- a/include/netinet/if_ether.h
-+++ b/include/netinet/if_ether.h
-@@ -133,5 +133,6 @@ do { \
- (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
- } while(0)
-
-+#define __UAPI_DEF_ETHHDR 0
-
- #endif
---- a/include/sys/xattr.h
-+++ b/include/sys/xattr.h
-@@ -24,6 +24,8 @@ int removexattr(const char *, const char
- int lremovexattr(const char *, const char *);
- int fremovexattr(int, const char *);
-
-+#define __UAPI_DEF_XATTR 0
-+
- #ifdef __cplusplus
- }
- #endif
diff --git a/toolchain/musl/patches/110-read_timezone_from_fs.patch b/toolchain/musl/patches/110-read_timezone_from_fs.patch
index b4349e7367..fb98f7d10e 100644
--- a/toolchain/musl/patches/110-read_timezone_from_fs.patch
+++ b/toolchain/musl/patches/110-read_timezone_from_fs.patch
@@ -24,5 +24,5 @@
+ }
+
if (!s) s = "/etc/localtime";
- if (!*s) s = __gmt;
+ if (!*s) s = __utc;
diff --git a/toolchain/musl/patches/200-add_libssp_nonshared.patch b/toolchain/musl/patches/200-add_libssp_nonshared.patch
index 218ca41402..7a2909461b 100644
--- a/toolchain/musl/patches/200-add_libssp_nonshared.patch
+++ b/toolchain/musl/patches/200-add_libssp_nonshared.patch
@@ -21,7 +21,7 @@ Signed-off-by: Steven Barth <steven@midlink.org>
ALL_TOOLS = obj/musl-gcc
WRAPCC_GCC = gcc
-@@ -129,7 +129,8 @@ NOSSP_SRCS = $(wildcard crt/*.c) \
+@@ -125,7 +125,8 @@ NOSSP_SRCS = $(wildcard crt/*.c) \
src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \
src/string/memset.c src/string/$(ARCH)/memset.c \
src/string/memcpy.c src/string/$(ARCH)/memcpy.c \
@@ -31,7 +31,7 @@ Signed-off-by: Steven Barth <steven@midlink.org>
$(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
$(CRT_OBJS): CFLAGS_ALL += -DCRT
-@@ -172,6 +173,11 @@ lib/libc.a: $(AOBJS)
+@@ -168,6 +169,11 @@ lib/libc.a: $(AOBJS)
$(AR) rc $@ $(AOBJS)
$(RANLIB) $@
diff --git a/toolchain/musl/patches/300-relative.patch b/toolchain/musl/patches/300-relative.patch
index 6e30e0a88f..7e1eb7d6bc 100644
--- a/toolchain/musl/patches/300-relative.patch
+++ b/toolchain/musl/patches/300-relative.patch
@@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
-@@ -221,7 +221,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc
+@@ -217,7 +217,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
diff --git a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
index 67fedae30a..915b0b7b47 100644
--- a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
+++ b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
@@ -149,8 +149,8 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#endif
#ifdef _GNU_SOURCE
-@@ -184,6 +192,9 @@ char *fgets_unlocked(char *, int, FILE *
- int fputs_unlocked(const char *, FILE *);
+@@ -198,6 +206,9 @@ typedef struct _IO_cookie_io_functions_t
+ FILE *fopencookie(void *, const char *, cookie_io_functions_t);
#endif
+#undef __fp
diff --git a/toolchain/musl/patches/900-iconv_size_hack.patch b/toolchain/musl/patches/900-iconv_size_hack.patch
index 41cff5b033..6200262b1d 100644
--- a/toolchain/musl/patches/900-iconv_size_hack.patch
+++ b/toolchain/musl/patches/900-iconv_size_hack.patch
@@ -1,14 +1,14 @@
--- a/src/locale/iconv.c
+++ b/src/locale/iconv.c
-@@ -42,6 +42,7 @@ static const unsigned char charmaps[] =
- "ucs4\0ucs4be\0utf32\0utf32be\0\0\300"
- "ucs4le\0utf32le\0\0\303"
- "ascii\0usascii\0iso646\0iso646us\0\0\307"
+@@ -48,6 +48,7 @@ static const unsigned char charmaps[] =
+ "utf16\0\0\312"
+ "ucs4\0utf32\0\0\313"
+ "ucs2\0\0\314"
+#ifdef FULL_ICONV
"eucjp\0\0\320"
"shiftjis\0sjis\0\0\321"
"iso2022jp\0\0\322"
-@@ -50,6 +51,7 @@ static const unsigned char charmaps[] =
+@@ -56,6 +57,7 @@ static const unsigned char charmaps[] =
"gb2312\0\0\332"
"big5\0bigfive\0cp950\0big5hkscs\0\0\340"
"euckr\0ksc5601\0ksx1001\0cp949\0\0\350"
@@ -16,7 +16,7 @@
#include "codepages.h"
;
-@@ -60,6 +62,7 @@ static const unsigned short legacy_chars
+@@ -66,6 +68,7 @@ static const unsigned short legacy_chars
#include "legacychars.h"
};
@@ -24,7 +24,7 @@
static const unsigned short jis0208[84][94] = {
#include "jis0208.h"
};
-@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = {
+@@ -85,6 +88,7 @@ static const unsigned short hkscs[] = {
static const unsigned short ksc[93][94] = {
#include "ksc.h"
};
@@ -32,7 +32,7 @@
static const unsigned short rev_jis[] = {
#include "revjis.h"
-@@ -196,6 +200,7 @@ static unsigned legacy_map(const unsigne
+@@ -205,6 +209,7 @@ static unsigned legacy_map(const unsigne
return x < 256 ? x : legacy_chars[x-256];
}
@@ -40,7 +40,7 @@
static unsigned uni_to_jis(unsigned c)
{
unsigned nel = sizeof rev_jis / sizeof *rev_jis;
-@@ -214,6 +219,7 @@ static unsigned uni_to_jis(unsigned c)
+@@ -223,6 +228,7 @@ static unsigned uni_to_jis(unsigned c)
}
}
}
@@ -48,15 +48,15 @@
size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb)
{
-@@ -285,6 +291,7 @@ size_t iconv(iconv_t cd, char **restrict
- c = ((c-0xd7c0)<<10) + (d-0xdc00);
+@@ -319,6 +325,7 @@ size_t iconv(iconv_t cd, char **restrict
}
- break;
+ type = scd->state;
+ continue;
+#ifdef FULL_ICONV
case SHIFT_JIS:
if (c < 128) break;
if (c-0xa1 <= 0xdf-0xa1) {
-@@ -476,6 +483,7 @@ size_t iconv(iconv_t cd, char **restrict
+@@ -510,6 +517,7 @@ size_t iconv(iconv_t cd, char **restrict
c = ksc[c][d];
if (!c) goto ilseq;
break;
@@ -64,7 +64,7 @@
default:
if (!c) break;
c = legacy_map(map, c);
-@@ -516,6 +524,7 @@ size_t iconv(iconv_t cd, char **restrict
+@@ -550,6 +558,7 @@ size_t iconv(iconv_t cd, char **restrict
}
}
goto subst;
@@ -72,14 +72,14 @@
case SHIFT_JIS:
if (c < 128) goto revout;
if (c == 0xa5) {
-@@ -589,6 +598,7 @@ size_t iconv(iconv_t cd, char **restrict
+@@ -623,6 +632,7 @@ size_t iconv(iconv_t cd, char **restrict
*(*out)++ = 'B';
*outb -= 8;
break;
+#endif
+ case UCS2:
+ totype = UCS2BE;
case UCS2BE:
- case UCS2LE:
- case UTF_16BE:
--- a/src/locale/codepages.h
+++ b/src/locale/codepages.h
@@ -129,6 +129,7 @@