From d095aec6ce9898c422e86df46195e3410eb1f163 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 12 Dec 2013 18:48:14 +0100 Subject: new mdev fix --- package/base-files/Makefile | 2 +- package/base-files/src/etc/mdev.conf | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 5c5329a9a..cae7b1009 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 61 +PKG_RELEASE:= 62 PKG_SECTION:= base PKG_DESCR:= basic files and scripts PKG_BUILDDEP:= pkgconf-host file-host diff --git a/package/base-files/src/etc/mdev.conf b/package/base-files/src/etc/mdev.conf index 4cc06251a..fc63d80d9 100644 --- a/package/base-files/src/etc/mdev.conf +++ b/package/base-files/src/etc/mdev.conf @@ -10,11 +10,9 @@ rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc device-mapper 0:0 660 @test -d /dev/mapper || mkdir /dev/mapper tun 0:0 660 >net/tun fb0 root:video 660 -audio root:audio 660 >snd/audio -dsp root:audio 660 >snd/dsp -timer root:audio 660 >snd/timer -controlC0 root:audio 660 >snd/controlC0 -pcmC0D0c root:audio 660 >snd/pcmC0D0c -pcmC0D0p root:audio 660 >snd/pcmC0D0p +snd/timer root:audio 660 +snd/controlC0 root:audio 660 +snd/pcmC0D0c root:audio 660 +snd/pcmC0D0p root:audio 660 msr0 root:root 660 @(mkdir -p /dev/cpu/0 && ln -sf /dev/msr0 /dev/cpu/0/msr) .* 0:0 644 @/lib/mdev/init -- cgit v1.2.3 From 18b865b3c0008d5d392cf33660f8e2b98cbf154f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 28 Dec 2013 18:23:22 +0100 Subject: fix for musl compile --- package/ptunnel/Makefile | 2 +- package/ptunnel/patches/patch-ptunnel_c | 11 +++++++++++ package/ptunnel/patches/patch-ptunnel_h | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 package/ptunnel/patches/patch-ptunnel_c create mode 100644 package/ptunnel/patches/patch-ptunnel_h diff --git a/package/ptunnel/Makefile b/package/ptunnel/Makefile index f4186c626..ea564a5fd 100644 --- a/package/ptunnel/Makefile +++ b/package/ptunnel/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= ptunnel PKG_VERSION:= 0.61 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= b45f73875f2af48f101816672f83a5fe PKG_DESCR:= Tunnel TCP connections over ICMP packets PKG_SECTION:= net/security diff --git a/package/ptunnel/patches/patch-ptunnel_c b/package/ptunnel/patches/patch-ptunnel_c new file mode 100644 index 000000000..40fd0a76f --- /dev/null +++ b/package/ptunnel/patches/patch-ptunnel_c @@ -0,0 +1,11 @@ +--- ptunnel-0.61.orig/ptunnel.c 2005-07-13 11:57:27.000000000 +0200 ++++ ptunnel-0.61/ptunnel.c 2013-12-28 18:21:38.000000000 +0100 +@@ -43,7 +43,7 @@ + #include "ptunnel.h" + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/ptunnel/patches/patch-ptunnel_h b/package/ptunnel/patches/patch-ptunnel_h new file mode 100644 index 000000000..85d8caebb --- /dev/null +++ b/package/ptunnel/patches/patch-ptunnel_h @@ -0,0 +1,11 @@ +--- ptunnel-0.61.orig/ptunnel.h 2005-07-13 11:57:27.000000000 +0200 ++++ ptunnel-0.61/ptunnel.h 2013-12-28 18:22:22.000000000 +0100 +@@ -44,7 +44,7 @@ + #define PING_TUNNEL_H + + // Includes +- #include ++ #include + #include + #include + #include -- cgit v1.2.3 From 604bc6783c0b29e27e22606e79aa377b53a4cd23 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 28 Dec 2013 19:41:41 +0100 Subject: fix musl compile, convert to termios --- package/comgt/Makefile | 2 +- package/comgt/patches/patch-comgt_c | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 package/comgt/patches/patch-comgt_c diff --git a/package/comgt/Makefile b/package/comgt/Makefile index cc2041150..f8433814e 100644 --- a/package/comgt/Makefile +++ b/package/comgt/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= comgt PKG_VERSION:= 0.32 -PKG_RELEASE:= 2 +PKG_RELEASE:= 3 PKG_MD5SUM:= db2452680c3d953631299e331daf49ef PKG_DESCR:= 3G/GPRS datacard control tool PKG_SECTION:= utils diff --git a/package/comgt/patches/patch-comgt_c b/package/comgt/patches/patch-comgt_c new file mode 100644 index 000000000..666423ba5 --- /dev/null +++ b/package/comgt/patches/patch-comgt_c @@ -0,0 +1,47 @@ +--- comgt.0.32.orig/comgt.c 2006-10-20 16:49:46.000000000 +0200 ++++ comgt.0.32/comgt.c 2013-12-28 19:40:28.000000000 +0100 +@@ -30,7 +30,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -81,7 +81,7 @@ char token[MAXTOKEN]; /* For gettoken( + char scriptfile[MAXPATH]; /* Script file name */ + char scriptfilepath[MAXPATH]; /* temp storage for full path */ + BOOL verbose=0; /* Log actions */ +-struct termio cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */ ++struct termios cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */ + int comfd=0; /* Communication file descriptor. Defaults to stdin. */ + char msg[STRINGL]; /* Massage messages here */ + int preturn,returns[MAXGOSUBS]; +@@ -926,7 +926,7 @@ void setcom(void) { + } + + void doset(void) { +- struct termio console; ++ struct termios console; + int a,b; + gettoken(); + if(strcmp(token,"echo")==0) { +@@ -1281,7 +1281,7 @@ void opengt(void) { + parity=stbuf.c_cflag & (PARENB | PARODD); + stbuf.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR ); + stbuf.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET); +- stbuf.c_lflag &= ~(ICANON | XCASE | ECHO | ECHOE | ECHONL); ++ stbuf.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHONL); + stbuf.c_lflag &= ~(ECHO | ECHOE); + stbuf.c_cc[VMIN] = 1; + stbuf.c_cc[VTIME] = 0; +@@ -1336,7 +1336,7 @@ void opendevice(void) { + parity=stbuf.c_cflag & (PARENB | PARODD); + stbuf.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR ); + stbuf.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET); +- stbuf.c_lflag &= ~(ICANON | XCASE | ECHO | ECHOE | ECHONL); ++ stbuf.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHONL); + stbuf.c_lflag &= ~(ECHO | ECHOE); + stbuf.c_cc[VMIN] = 1; + stbuf.c_cc[VTIME] = 0; -- cgit v1.2.3 From dcbba47889ece1b83a1744701463a8fb04a1fc50 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 28 Dec 2013 20:16:56 +0100 Subject: update to latest stable version --- package/lsscsi/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lsscsi/Makefile b/package/lsscsi/Makefile index 3a8cd740d..8cc747238 100644 --- a/package/lsscsi/Makefile +++ b/package/lsscsi/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:= lsscsi -PKG_VERSION:= 0.25 +PKG_VERSION:= 0.27 PKG_RELEASE:= 1 -PKG_MD5SUM:= c4e36b106624aff78527c54cf08ecbfe +PKG_MD5SUM:= 33ab2927a9e567a47905e6a618c17859 PKG_DESCR:= list SCSI devices PKG_SECTION:= utils PKG_URL:= http://sg.danny.cz/scsi/lsscsi.html -- cgit v1.2.3 From 37eb0e152762b3471b40a00946f5e6aba354b7c2 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 29 Dec 2013 10:11:40 +0100 Subject: add glib dependency --- package/libmms/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libmms/Makefile b/package/libmms/Makefile index 9e2c2108a..cfd900c0d 100644 --- a/package/libmms/Makefile +++ b/package/libmms/Makefile @@ -9,6 +9,8 @@ PKG_RELEASE:= 1 PKG_MD5SUM:= 9f63aa363deb4874e072a45850161bff PKG_DESCR:= common library for parsing mms:// type network streams PKG_SECTION:= libs +PKG_BUILDDEP:= glib +PKG_DEPENDS:= glib PKG_URL:= http://libmms.sourceforge.net/ PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=libmms/} PKG_OPTS:= dev -- cgit v1.2.3 From df30f7362b13fadf5a996e1303ba8488699a7ec6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 29 Dec 2013 19:08:39 +0100 Subject: disable libwrap --- package/mpd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/mpd/Makefile b/package/mpd/Makefile index 46a1262c4..aa227c4ec 100644 --- a/package/mpd/Makefile +++ b/package/mpd/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= mpd PKG_VERSION:= 0.18.5 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= 63bcf6ce338caa2ae2cd6dc8e9710d5c PKG_DESCR:= A music player daemon PKG_SECTION:= multimedia @@ -126,6 +126,7 @@ CONFIGURE_ARGS+= --disable-jack \ --disable-pulse \ --disable-oss \ --disable-bzip2 \ + --disable-libwrap \ --disable-mpc \ --disable-wavpack \ --disable-modplug \ -- cgit v1.2.3 From e6e5113cb91830bc97a778d98b3c551b25d8f5cb Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Dec 2013 11:24:18 +0100 Subject: fix musl compile --- package/traceroute/Makefile | 4 +- package/traceroute/patches/patch-Make_rules | 14 +-- package/traceroute/patches/patch-traceroute_csum_c | 17 +++ .../patches/patch-traceroute_extension_c | 61 ++++++++++ .../traceroute/patches/patch-traceroute_mod-dccp_c | 55 +++++++++ .../traceroute/patches/patch-traceroute_mod-icmp_c | 22 ++++ .../traceroute/patches/patch-traceroute_mod-tcp_c | 126 +++++++++++++++++++++ .../traceroute/patches/patch-traceroute_mod-udp_c | 20 ++++ .../patches/patch-traceroute_traceroute_c | 34 ++++++ .../patches/patch-traceroute_traceroute_h | 11 ++ 10 files changed, 355 insertions(+), 9 deletions(-) create mode 100644 package/traceroute/patches/patch-traceroute_csum_c create mode 100644 package/traceroute/patches/patch-traceroute_extension_c create mode 100644 package/traceroute/patches/patch-traceroute_mod-dccp_c create mode 100644 package/traceroute/patches/patch-traceroute_mod-icmp_c create mode 100644 package/traceroute/patches/patch-traceroute_mod-tcp_c create mode 100644 package/traceroute/patches/patch-traceroute_mod-udp_c create mode 100644 package/traceroute/patches/patch-traceroute_traceroute_c create mode 100644 package/traceroute/patches/patch-traceroute_traceroute_h diff --git a/package/traceroute/Makefile b/package/traceroute/Makefile index 31ee8bd4c..c908cc34d 100644 --- a/package/traceroute/Makefile +++ b/package/traceroute/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:= traceroute -PKG_VERSION:= 2.0.18 +PKG_VERSION:= 2.0.19 PKG_RELEASE:= 1 -PKG_MD5SUM:= b7254149b7f081cce07f4b9e065ba5ef +PKG_MD5SUM:= dd15d563993020d088ba02e8f987deaf PKG_DESCR:= Utility to trace the route of IP packets PKG_SECTION:= net PKG_URL:= http://traceroute.sourceforge.net/ diff --git a/package/traceroute/patches/patch-Make_rules b/package/traceroute/patches/patch-Make_rules index 35f8b4003..5d347bc68 100644 --- a/package/traceroute/patches/patch-Make_rules +++ b/package/traceroute/patches/patch-Make_rules @@ -1,5 +1,5 @@ ---- traceroute-2.0.16.orig/Make.rules 2010-09-09 16:20:46.000000000 +0200 -+++ traceroute-2.0.16/Make.rules 2010-10-11 20:07:03.000000000 +0200 +--- traceroute-2.0.19.orig/Make.rules 2012-03-27 15:49:04.000000000 +0200 ++++ traceroute-2.0.19/Make.rules 2013-12-29 20:01:35.000000000 +0100 @@ -46,14 +46,14 @@ $(call set, INSTALL, cp) $(call set, INDENT, true) @@ -15,11 +15,11 @@ -prefix = /usr/local +prefix = /usr - exec_prefix = $(prefix) - bindir = $(exec_prefix)/bin -@@ -125,7 +125,7 @@ _libs = $(strip $(foreach lib,$(LIBDIRS) - $(wildcard $(srcdir)/$(lib)/$(lib).so \ - $(srcdir)/$(lib)/$(lib).a)))) + ifneq ($(wildcard /lib64/libc.* /usr/lib64/libc.*),) + lib := lib64 +@@ -131,7 +131,7 @@ _libs = $(strip $(foreach _lib,$(LIBDIRS + $(wildcard $(srcdir)/$(_lib)/$(_lib).so \ + $(srcdir)/$(_lib)/$(_lib).a)))) -override LIBS := $(_libs) -lm $(LIBS) +override LIBS := $(_libs) $(LIBS) diff --git a/package/traceroute/patches/patch-traceroute_csum_c b/package/traceroute/patches/patch-traceroute_csum_c new file mode 100644 index 000000000..8332de5e4 --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_csum_c @@ -0,0 +1,17 @@ +--- traceroute-2.0.19.orig/traceroute/csum.c 2007-07-19 16:47:55.000000000 +0200 ++++ traceroute-2.0.19/traceroute/csum.c 2013-12-29 20:01:35.000000000 +0100 +@@ -12,11 +12,11 @@ + #include "traceroute.h" + + +-u_int16_t in_csum (const void *ptr, size_t len) { +- const u_int16_t *p = (const u_int16_t *) ptr; ++uint16_t in_csum (const void *ptr, size_t len) { ++ const uint16_t *p = (const uint16_t *) ptr; + size_t nw = len / 2; + unsigned int sum = 0; +- u_int16_t res; ++ uint16_t res; + + while (nw--) sum += *p++; + diff --git a/package/traceroute/patches/patch-traceroute_extension_c b/package/traceroute/patches/patch-traceroute_extension_c new file mode 100644 index 000000000..94606f546 --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_extension_c @@ -0,0 +1,61 @@ +--- traceroute-2.0.19.orig/traceroute/extension.c 2010-07-14 16:29:08.000000000 +0200 ++++ traceroute-2.0.19/traceroute/extension.c 2013-12-29 20:01:35.000000000 +0100 +@@ -14,16 +14,16 @@ struct icmp_ext_header { + unsigned int reserved:4; + unsigned int version:4; + #endif +- u_int8_t reserved1; +- u_int16_t checksum; ++ uint8_t reserved1; ++ uint16_t checksum; + } __attribute__ ((packed)); + + + struct icmp_ext_object { +- u_int16_t length; +- u_int8_t class; +- u_int8_t c_type; +- u_int8_t data[0]; ++ uint16_t length; ++ uint8_t class; ++ uint8_t c_type; ++ uint8_t data[0]; + }; + + #define MPLS_CLASS 1 +@@ -49,7 +49,7 @@ static int try_extension (probe *pb, cha + if (iext->version != 2) return -1; + + if (iext->checksum && +- in_csum (iext, len) != (u_int16_t) ~0 ++ in_csum (iext, len) != (uint16_t) ~0 + ) return -1; + + buf += sizeof (*iext); +@@ -60,7 +60,7 @@ static int try_extension (probe *pb, cha + struct icmp_ext_object *obj = (struct icmp_ext_object *) buf; + size_t objlen = ntohs (obj->length); + size_t data_len; +- u_int32_t *ui = (u_int32_t *) obj->data; ++ uint32_t *ui = (uint32_t *) obj->data; + int i, n; + + if (objlen < sizeof (*obj) || +@@ -68,7 +68,7 @@ static int try_extension (probe *pb, cha + ) return -1; + + data_len = objlen - sizeof (*obj); +- if (data_len % sizeof (u_int32_t)) ++ if (data_len % sizeof (uint32_t)) + return -1; /* must be 32bit rounded... */ + + n = data_len / sizeof (*ui); +@@ -85,7 +85,7 @@ static int try_extension (probe *pb, cha + do_snprintf (curr, end, "MPLS:"); + + for (i = 0; i < n; i++, ui++) { +- u_int32_t mpls = ntohl (*ui); ++ uint32_t mpls = ntohl (*ui); + + do_snprintf (curr, end, "%sL=%u,E=%u,S=%u,T=%u", + i ? "/" : "", diff --git a/package/traceroute/patches/patch-traceroute_mod-dccp_c b/package/traceroute/patches/patch-traceroute_mod-dccp_c new file mode 100644 index 000000000..18dcbedaf --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_mod-dccp_c @@ -0,0 +1,55 @@ +--- traceroute-2.0.19.orig/traceroute/mod-dccp.c 2012-11-19 16:51:53.000000000 +0100 ++++ traceroute-2.0.19/traceroute/mod-dccp.c 2013-12-29 20:01:35.000000000 +0100 +@@ -30,7 +30,7 @@ static unsigned int dest_port = 0; + static int raw_sk = -1; + static int last_ttl = 0; + +-static u_int8_t buf[1024]; /* enough, enough... */ ++static uint8_t buf[1024]; /* enough, enough... */ + static size_t csum_len = 0; + static struct dccp_hdr *dh = NULL; + static struct dccp_hdr_ext *dhe = NULL; +@@ -51,8 +51,8 @@ static int dccp_init (const sockaddr_any + int af = dest->sa.sa_family; + sockaddr_any src; + socklen_t len; +- u_int8_t *ptr; +- u_int16_t *lenp; ++ uint8_t *ptr; ++ uint16_t *lenp; + + + dest_addr = *dest; +@@ -117,10 +117,10 @@ static int dccp_init (const sockaddr_any + ptr += len; + } + +- lenp = (u_int16_t *) ptr; +- ptr += sizeof (u_int16_t); +- *((u_int16_t *) ptr) = htons ((u_int16_t) IPPROTO_DCCP); +- ptr += sizeof (u_int16_t); ++ lenp = (uint16_t *) ptr; ++ ptr += sizeof (uint16_t); ++ *((uint16_t *) ptr) = htons ((uint16_t) IPPROTO_DCCP); ++ ptr += sizeof (uint16_t); + + + /* Construct DCCP header */ +@@ -153,7 +153,7 @@ static int dccp_init (const sockaddr_any + if (csum_len > sizeof (buf)) + error ("impossible"); /* paranoia */ + +- len = ptr - (u_int8_t *) dh; ++ len = ptr - (uint8_t *) dh; + if (len & 0x03) error ("impossible"); /* as >>2 ... */ + + *lenp = htons (len); +@@ -232,7 +232,7 @@ static probe *dccp_check_reply (int sk, + char *buf, size_t len) { + probe *pb; + struct dccp_hdr *ndh = (struct dccp_hdr *) buf; +- u_int16_t sport, dport; ++ uint16_t sport, dport; + + + if (len < 8) return NULL; /* too short */ diff --git a/package/traceroute/patches/patch-traceroute_mod-icmp_c b/package/traceroute/patches/patch-traceroute_mod-icmp_c new file mode 100644 index 000000000..13852be0b --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_mod-icmp_c @@ -0,0 +1,22 @@ +--- traceroute-2.0.19.orig/traceroute/mod-icmp.c 2011-08-18 17:12:00.000000000 +0200 ++++ traceroute-2.0.19/traceroute/mod-icmp.c 2013-12-29 20:01:35.000000000 +0100 +@@ -20,8 +20,8 @@ + + + static sockaddr_any dest_addr = {{ 0, }, }; +-static u_int16_t seq = 1; +-static u_int16_t ident = 0; ++static uint16_t seq = 1; ++static uint16_t ident = 0; + + static char *data; + static size_t *length_p; +@@ -173,7 +173,7 @@ static probe *icmp_check_reply (int sk, + char *buf, size_t len) { + int af = dest_addr.sa.sa_family; + int type; +- u_int16_t recv_id, recv_seq; ++ uint16_t recv_id, recv_seq; + probe *pb; + + diff --git a/package/traceroute/patches/patch-traceroute_mod-tcp_c b/package/traceroute/patches/patch-traceroute_mod-tcp_c new file mode 100644 index 000000000..9327a1b86 --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_mod-tcp_c @@ -0,0 +1,126 @@ +--- traceroute-2.0.19.orig/traceroute/mod-tcp.c 2012-03-27 16:01:15.000000000 +0200 ++++ traceroute-2.0.19/traceroute/mod-tcp.c 2013-12-29 20:16:23.000000000 +0100 +@@ -18,6 +18,24 @@ + #include + #include + ++#if !defined(__GLIBC__) ++# define TCPOPT_EOL 0 ++# define TCPOPT_NOP 1 ++# define TCPOPT_MAXSEG 2 ++# define TCPOLEN_MAXSEG 4 ++# define TCPOPT_WINDOW 3 ++# define TCPOLEN_WINDOW 3 ++# define TCPOPT_SACK_PERMITTED 4 /* Experimental */ ++# define TCPOLEN_SACK_PERMITTED 2 ++# define TCPOPT_SACK 5 /* Experimental */ ++# define TCPOPT_TIMESTAMP 8 ++# define TCPOLEN_TIMESTAMP 10 ++# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ ++ ++# define TCPOPT_TSTAMP_HDR \ ++ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) ++#endif ++ + + #include "traceroute.h" + +@@ -33,11 +51,11 @@ static unsigned int dest_port = 0; + static int raw_sk = -1; + static int last_ttl = 0; + +-static u_int8_t buf[1024]; /* enough, enough... */ ++static uint8_t buf[1024]; /* enough, enough... */ + static size_t csum_len = 0; + static struct tcphdr *th = NULL; + +-#define TH_FLAGS(TH) (((u_int8_t *) (TH))[13]) ++#define TH_FLAGS(TH) (((uint8_t *) (TH))[13]) + #define TH_FIN 0x01 + #define TH_SYN 0x02 + #define TH_RST 0x04 +@@ -164,7 +182,7 @@ static CLIF_option tcp_options[] = { + static int check_sysctl (const char *name) { + int fd, res; + char buf[sizeof (SYSCTL_PREFIX) + strlen (name) + 1]; +- u_int8_t ch; ++ uint8_t ch; + + strcpy (buf, SYSCTL_PREFIX); + strcat (buf, name); +@@ -191,8 +209,8 @@ static int tcp_init (const sockaddr_any + sockaddr_any src; + int mtu; + socklen_t len; +- u_int8_t *ptr; +- u_int16_t *lenp; ++ uint8_t *ptr; ++ uint16_t *lenp; + + + dest_addr = *dest; +@@ -286,10 +304,10 @@ static int tcp_init (const sockaddr_any + ptr += len; + } + +- lenp = (u_int16_t *) ptr; +- ptr += sizeof (u_int16_t); +- *((u_int16_t *) ptr) = htons ((u_int16_t) IPPROTO_TCP); +- ptr += sizeof (u_int16_t); ++ lenp = (uint16_t *) ptr; ++ ptr += sizeof (uint16_t); ++ *((uint16_t *) ptr) = htons ((uint16_t) IPPROTO_TCP); ++ ptr += sizeof (uint16_t); + + + /* Construct TCP header */ +@@ -309,13 +327,13 @@ static int tcp_init (const sockaddr_any + + /* Build TCP options */ + +- ptr = (u_int8_t *) (th + 1); ++ ptr = (uint8_t *) (th + 1); + + if (flags & TH_SYN) { + *ptr++ = TCPOPT_MAXSEG; /* 2 */ + *ptr++ = TCPOLEN_MAXSEG; /* 4 */ +- *((u_int16_t *) ptr) = htons (mss ? mss : mtu); +- ptr += sizeof (u_int16_t); ++ *((uint16_t *) ptr) = htons (mss ? mss : mtu); ++ ptr += sizeof (uint16_t); + } + + if (flags & FL_TSTAMP) { +@@ -330,10 +348,10 @@ static int tcp_init (const sockaddr_any + *ptr++ = TCPOPT_TIMESTAMP; /* 8 */ + *ptr++ = TCPOLEN_TIMESTAMP; /* 10 */ + +- *((u_int32_t *) ptr) = random_seq (); /* really! */ +- ptr += sizeof (u_int32_t); +- *((u_int32_t *) ptr) = (flags & TH_ACK) ? random_seq () : 0; +- ptr += sizeof (u_int32_t); ++ *((uint32_t *) ptr) = random_seq (); /* really! */ ++ ptr += sizeof (uint32_t); ++ *((uint32_t *) ptr) = (flags & TH_ACK) ? random_seq () : 0; ++ ptr += sizeof (uint32_t); + } + else if (flags & FL_SACK) { + *ptr++ = TCPOPT_NOP; /* 1 */ +@@ -355,7 +373,7 @@ static int tcp_init (const sockaddr_any + if (csum_len > sizeof (buf)) + error ("impossible"); /* paranoia */ + +- len = ptr - (u_int8_t *) th; ++ len = ptr - (uint8_t *) th; + if (len & 0x03) error ("impossible"); /* as >>2 ... */ + + *lenp = htons (len); +@@ -436,7 +454,7 @@ static probe *tcp_check_reply (int sk, i + char *buf, size_t len) { + probe *pb; + struct tcphdr *tcp = (struct tcphdr *) buf; +- u_int16_t sport, dport; ++ uint16_t sport, dport; + + + if (len < 8) return NULL; /* too short */ diff --git a/package/traceroute/patches/patch-traceroute_mod-udp_c b/package/traceroute/patches/patch-traceroute_mod-udp_c new file mode 100644 index 000000000..1fcbf8b2b --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_mod-udp_c @@ -0,0 +1,20 @@ +--- traceroute-2.0.19.orig/traceroute/mod-udp.c 2010-12-14 16:51:44.000000000 +0100 ++++ traceroute-2.0.19/traceroute/mod-udp.c 2013-12-29 20:01:35.000000000 +0100 +@@ -71,7 +71,7 @@ static int udp_init (const sockaddr_any + dest_addr = *dest; + + if (!port_seq) port_seq = DEF_UDP_PORT; +- dest_addr.sin.sin_port = htons ((u_int16_t) port_seq); ++ dest_addr.sin.sin_port = htons ((uint16_t) port_seq); + + fill_data (packet_len_p); + +@@ -107,7 +107,7 @@ static int udplite_init (const sockaddr_ + dest_addr = *dest; + + if (!port_seq) port_seq = DEF_UDP_PORT; /* XXX: Hmmm... */ +- dest_addr.sin.sin_port = htons ((u_int16_t) port_seq); ++ dest_addr.sin.sin_port = htons ((uint16_t) port_seq); + + protocol = IPPROTO_UDPLITE; + diff --git a/package/traceroute/patches/patch-traceroute_traceroute_c b/package/traceroute/patches/patch-traceroute_traceroute_c new file mode 100644 index 000000000..b9b7f27d9 --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_traceroute_c @@ -0,0 +1,34 @@ +--- traceroute-2.0.19.orig/traceroute/traceroute.c 2012-11-19 17:12:04.000000000 +0100 ++++ traceroute-2.0.19/traceroute/traceroute.c 2013-12-30 11:22:50.000000000 +0100 +@@ -31,6 +31,13 @@ + #include "version.h" + #include "traceroute.h" + ++#ifndef AI_IDN ++# define AI_IDN 0 /* GNU/libc extension */ ++#endif ++ ++#ifndef NI_IDN ++# define NI_IDN 0 /* GNU/libc extension */ ++#endif + + #ifndef ICMP6_DST_UNREACH_BEYONDSCOPE + #ifdef ICMP6_DST_UNREACH_NOTNEIGHBOR +@@ -325,7 +332,7 @@ static void init_ip_options (void) { + rth->ip6r_type = ipv6_rthdr_type; + rth->ip6r_segleft = num_gateways; + +- *((u_int32_t *) (rth + 1)) = 0; ++ *((uint32_t *) (rth + 1)) = 0; + + in6 = (struct in6_addr *) (rtbuf + 8); + for (i = 0; i < num_gateways; i++) +@@ -606,7 +613,7 @@ int main (int argc, char *argv[]) { + htonl (((tos & 0xff) << 20) | (flow_label & 0x000fffff)); + + if (src_port) { +- src_addr.sin.sin_port = htons ((u_int16_t) src_port); ++ src_addr.sin.sin_port = htons ((uint16_t) src_port); + src_addr.sa.sa_family = af; + } + diff --git a/package/traceroute/patches/patch-traceroute_traceroute_h b/package/traceroute/patches/patch-traceroute_traceroute_h new file mode 100644 index 000000000..21efe3210 --- /dev/null +++ b/package/traceroute/patches/patch-traceroute_traceroute_h @@ -0,0 +1,11 @@ +--- traceroute-2.0.19.orig/traceroute/traceroute.h 2012-11-19 15:46:11.000000000 +0100 ++++ traceroute-2.0.19/traceroute/traceroute.h 2013-12-29 20:01:35.000000000 +0100 +@@ -92,7 +92,7 @@ const char *get_as_path (const char *que + int raw_can_connect (void); + + unsigned int random_seq (void); +-u_int16_t in_csum (const void *ptr, size_t len); ++uint16_t in_csum (const void *ptr, size_t len); + + + void tr_register_module (tr_module *module); -- cgit v1.2.3 From 1a8c5c6613b28a9c4afa7a8ce1f4d9ed09d39fda Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Dec 2013 11:41:47 +0100 Subject: disable for uclibc --- package/traceroute/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/traceroute/Makefile b/package/traceroute/Makefile index c908cc34d..64f1e1a48 100644 --- a/package/traceroute/Makefile +++ b/package/traceroute/Makefile @@ -12,6 +12,8 @@ PKG_SECTION:= net PKG_URL:= http://traceroute.sourceforge.net/ PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=traceroute/} +PKG_LIBC_DEPENDS:= eglibc glibc musl + include $(TOPDIR)/mk/package.mk $(eval $(call PKG_template,TRACEROUTE,traceroute,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) -- cgit v1.2.3 From f3f7a7f082ffce3fe30555c73276f4c070c0b6da Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Dec 2013 19:40:44 +0100 Subject: default to 0 --- target/linux/config/Config.in.flash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/config/Config.in.flash b/target/linux/config/Config.in.flash index 26f00845a..773c518e8 100644 --- a/target/linux/config/Config.in.flash +++ b/target/linux/config/Config.in.flash @@ -138,4 +138,4 @@ config ADK_TARGET_MTD_SIZE int default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL - default "" + default "0" -- cgit v1.2.3 From bc2f511c2392159717ea20a3a71a4b23de0ed134 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 1 Jan 2014 17:42:38 +0100 Subject: make native gcc for microblaze working --- package/gcc/Makefile | 9 +- package/gcc/patches/4.7.3/cflags.patch | 253 +++++++ package/gcc/patches/4.7.3/cross-gcc-fix.patch | 13 + package/gcc/patches/4.7.3/gcc-cppflags.patch | 12 + package/gcc/patches/4.7.3/ltmain.patch | 12 + package/gcc/patches/4.7.3/mirbsd-compat.patch | 12 + package/gcc/patches/4.7.3/musl-cris.patch | 11 + package/gcc/patches/4.7.3/musl-cross.patch | 825 +++++++++++++++++++++ package/gcc/patches/4.7.3/musl-m68k.patch | 11 + package/gcc/patches/4.7.3/musl-mips64.patch | 14 + package/gcc/patches/4.7.3/musl-ppc.patch | 155 ++++ package/gcc/patches/4.7.3/musl-sh.patch | 11 + package/gcc/patches/4.7.3/musl-sparc.patch | 24 + package/gcc/patches/4.7.3/sdt.patch | 14 + .../gcc/patches/4.8.2/patch-libatomic_Makefile_in | 12 + package/gcc/patches/cflags.patch | 253 ------- package/gcc/patches/cross-gcc-fix.patch | 13 - package/gcc/patches/gcc-cppflags.patch | 12 - package/gcc/patches/ltmain.patch | 12 - package/gcc/patches/mirbsd-compat.patch | 12 - package/gcc/patches/musl-cris.patch | 11 - package/gcc/patches/musl-cross.patch | 825 --------------------- package/gcc/patches/musl-m68k.patch | 11 - package/gcc/patches/musl-mips64.patch | 14 - package/gcc/patches/musl-ppc.patch | 155 ---- package/gcc/patches/musl-sh.patch | 11 - package/gcc/patches/musl-sparc.patch | 24 - package/gcc/patches/sdt.patch | 14 - package/glibc/files/libc.so.microblaze | 5 + target/microblaze/sys-available/qemu-microblaze | 1 + 30 files changed, 1392 insertions(+), 1369 deletions(-) create mode 100644 package/gcc/patches/4.7.3/cflags.patch create mode 100644 package/gcc/patches/4.7.3/cross-gcc-fix.patch create mode 100644 package/gcc/patches/4.7.3/gcc-cppflags.patch create mode 100644 package/gcc/patches/4.7.3/ltmain.patch create mode 100644 package/gcc/patches/4.7.3/mirbsd-compat.patch create mode 100644 package/gcc/patches/4.7.3/musl-cris.patch create mode 100644 package/gcc/patches/4.7.3/musl-cross.patch create mode 100644 package/gcc/patches/4.7.3/musl-m68k.patch create mode 100644 package/gcc/patches/4.7.3/musl-mips64.patch create mode 100644 package/gcc/patches/4.7.3/musl-ppc.patch create mode 100644 package/gcc/patches/4.7.3/musl-sh.patch create mode 100644 package/gcc/patches/4.7.3/musl-sparc.patch create mode 100644 package/gcc/patches/4.7.3/sdt.patch create mode 100644 package/gcc/patches/4.8.2/patch-libatomic_Makefile_in delete mode 100644 package/gcc/patches/cflags.patch delete mode 100644 package/gcc/patches/cross-gcc-fix.patch delete mode 100644 package/gcc/patches/gcc-cppflags.patch delete mode 100644 package/gcc/patches/ltmain.patch delete mode 100644 package/gcc/patches/mirbsd-compat.patch delete mode 100644 package/gcc/patches/musl-cris.patch delete mode 100644 package/gcc/patches/musl-cross.patch delete mode 100644 package/gcc/patches/musl-m68k.patch delete mode 100644 package/gcc/patches/musl-mips64.patch delete mode 100644 package/gcc/patches/musl-ppc.patch delete mode 100644 package/gcc/patches/musl-sh.patch delete mode 100644 package/gcc/patches/musl-sparc.patch delete mode 100644 package/gcc/patches/sdt.patch create mode 100644 package/glibc/files/libc.so.microblaze diff --git a/package/gcc/Makefile b/package/gcc/Makefile index 2c2fb70a6..f0e17503a 100644 --- a/package/gcc/Makefile +++ b/package/gcc/Makefile @@ -8,7 +8,7 @@ PKG_NAME:= gcc PKG_DESCR:= GNU C compiler PKG_SECTION:= lang PKG_OPTS:= noremove -PKG_DEPENDS:= libmpc libgmp mpfr +PKG_DEPENDS:= libmpc libgmp mpfr libgcc PKG_BUILDDEP:= libmpc gmp mpfr PKG_ARCH_DEPENDS:= !avr32 @@ -37,6 +37,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y) CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI) endif +ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y) +CONFIGURE_ARGS+= --enable-sjlj-exceptions +else +CONFIGURE_ARGS+= --disable-sjlj-exceptions +endif + ifneq ($(ADK_PACKAGE_GXX),) CONFIGURE_ARGS+= --enable-languages=c,c++ else @@ -50,7 +56,6 @@ CONFIGURE_ARGS+= --host=$(REAL_GNU_TARGET_NAME) \ --without-headers \ --libexecdir=/usr/lib \ --disable-libssp \ - --disable-sjlj-exceptions \ --disable-biarch \ --disable-libmudflap \ --disable-libgomp \ diff --git a/package/gcc/patches/4.7.3/cflags.patch b/package/gcc/patches/4.7.3/cflags.patch new file mode 100644 index 000000000..3623d3872 --- /dev/null +++ b/package/gcc/patches/4.7.3/cflags.patch @@ -0,0 +1,253 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks + the default for -O2/-Os, because they trigger gcc bugs + and can delete code with security implications. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -103,6 +103,9 @@ static size_t deferred_count; + /* Number of deferred options scanned for -include. */ + static size_t include_cursor; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx0x (int); +@@ -441,6 +444,9 @@ c_common_handle_option (size_t scode, co + global_dc->warning_as_error_requested = value; + break; + ++ case OPT_Werror_maybe_reset: ++ break; ++ + case OPT_Wformat: + set_Wformat (value); + break; +@@ -584,6 +590,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1058,6 +1070,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -363,6 +363,10 @@ Werror-implicit-function-declaration + C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration) + This switch is deprecated; use -Werror=implicit-function-declaration instead + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality +@@ -794,6 +798,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -520,6 +520,10 @@ Werror= + Common Joined + Treat specified warning as error + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings +@@ -1156,6 +1160,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -477,8 +477,6 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 }, + #endif + { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 }, +@@ -494,6 +492,8 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 }, + + /* -O3 optimizations. */ ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 }, ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 }, + /* Inlining of functions reducing size is a good idea with -Os +@@ -1399,6 +1399,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -164,6 +164,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}. + -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol + -Wno-deprecated-declarations -Wdisabled-optimization @gol + -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol +--Wno-endif-labels -Werror -Werror=* @gol ++-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol + -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-y2k @gol +@@ -4497,6 +4497,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-pedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++ at item -fhonour-copts ++ at opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -6319,7 +6335,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -627,6 +627,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/package/gcc/patches/4.7.3/cross-gcc-fix.patch b/package/gcc/patches/4.7.3/cross-gcc-fix.patch new file mode 100644 index 000000000..f39b35fb9 --- /dev/null +++ b/package/gcc/patches/4.7.3/cross-gcc-fix.patch @@ -0,0 +1,13 @@ +diff -Nur gcc-4.4.2.orig/gcc/Makefile.in gcc-4.4.2/gcc/Makefile.in +--- gcc-4.5.2.orig/gcc/Makefile.in 2010-09-02 15:05:30.000000000 +0200 ++++ gcc-4.5.2/gcc/Makefile.in 2011-01-15 14:29:18.000000000 +0100 +@@ -980,7 +980,8 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $ + # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro + # puts -I options in CPPFLAGS, our include files in the srcdir will always + # win against random include files in /usr/include. +-ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) ++#ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) ++ALL_CPPFLAGS = $(INCLUDES) + + # This is the variable to use when using $(COMPILER). + ifneq ($(ENABLE_BUILD_WITH_CXX),yes) diff --git a/package/gcc/patches/4.7.3/gcc-cppflags.patch b/package/gcc/patches/4.7.3/gcc-cppflags.patch new file mode 100644 index 000000000..0971bbec9 --- /dev/null +++ b/package/gcc/patches/4.7.3/gcc-cppflags.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.4.4.orig/gcc/configure gcc-4.4.4/gcc/configure +--- gcc-4.4.4.orig/gcc/configure 2009-10-19 14:15:27.000000000 +0200 ++++ gcc-4.4.4/gcc/configure 2010-08-02 00:47:36.823620346 +0200 +@@ -13530,7 +13530,7 @@ + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ +- LDFLAGS="${LDFLAGS_FOR_BUILD}" \ ++ LDFLAGS="${LDFLAGS_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias diff --git a/package/gcc/patches/4.7.3/ltmain.patch b/package/gcc/patches/4.7.3/ltmain.patch new file mode 100644 index 000000000..215889b70 --- /dev/null +++ b/package/gcc/patches/4.7.3/ltmain.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.5.2.orig/ltmain.sh gcc-4.5.2/ltmain.sh +--- gcc-4.5.2.orig/ltmain.sh 2009-12-05 18:18:53.000000000 +0100 ++++ gcc-4.5.2/ltmain.sh 2011-01-15 14:45:07.000000000 +0100 +@@ -4980,7 +4980,7 @@ + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ +- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) ++ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|-fstack-protector*|-flto) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" diff --git a/package/gcc/patches/4.7.3/mirbsd-compat.patch b/package/gcc/patches/4.7.3/mirbsd-compat.patch new file mode 100644 index 000000000..2f3ea0c87 --- /dev/null +++ b/package/gcc/patches/4.7.3/mirbsd-compat.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.4.2.orig/gcc/configure gcc-4.4.2/gcc/configure +--- gcc-4.4.2.orig/gcc/configure Tue Mar 24 18:45:39 2009 ++++ gcc-4.4.2/gcc/configure Sat Dec 19 21:07:07 2009 +@@ -19381,7 +19381,7 @@ + dynamic_linker='ldqnx.so' + ;; + +-openbsd*) ++mirbsd*|openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no diff --git a/package/gcc/patches/4.7.3/musl-cris.patch b/package/gcc/patches/4.7.3/musl-cris.patch new file mode 100644 index 000000000..4889263a1 --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-cris.patch @@ -0,0 +1,11 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/cris/linux.h gcc-4.7.3/gcc/config/cris/linux.h +--- gcc-4.7.3.orig/gcc/config/cris/linux.h 2011-04-11 20:46:05.000000000 +0200 ++++ gcc-4.7.3/gcc/config/cris/linux.h 2013-10-11 10:01:51.000000000 +0200 +@@ -104,6 +104,7 @@ + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-cris.1" + + #undef CRIS_LINK_SUBTARGET_SPEC + #define CRIS_LINK_SUBTARGET_SPEC \ diff --git a/package/gcc/patches/4.7.3/musl-cross.patch b/package/gcc/patches/4.7.3/musl-cross.patch new file mode 100644 index 000000000..453ba9aec --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-cross.patch @@ -0,0 +1,825 @@ +diff -Nur gcc-4.7.3.orig/config.sub gcc-4.7.3/config.sub +--- gcc-4.7.3.orig/config.sub 2012-08-06 16:34:27.000000000 +0200 ++++ gcc-4.7.3/config.sub 2013-09-16 15:39:42.000000000 +0200 +@@ -4,7 +4,7 @@ + # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + # 2011 Free Software Foundation, Inc. + +-timestamp='2011-10-29' ++timestamp='2011-03-23' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software +@@ -125,6 +125,7 @@ + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ ++ linux-musl* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ +@@ -251,17 +252,13 @@ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ +- | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ +- | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ +- | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ +@@ -295,7 +292,7 @@ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ +- | rl78 | rx \ ++ | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ +@@ -304,7 +301,7 @@ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ ++ | v850 | v850e \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) +@@ -361,7 +358,6 @@ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ +- | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ +@@ -370,10 +366,8 @@ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ +- | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +@@ -407,7 +401,7 @@ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ ++ | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +@@ -415,11 +409,10 @@ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ ++ | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ ++ | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ +@@ -820,10 +813,6 @@ + basic_machine=i370-ibm + os=-mvs + ;; +- nacl) +- basic_machine=le32-unknown +- os=-nacl +- ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 +@@ -1132,8 +1121,13 @@ + basic_machine=t90-cray + os=-unicos + ;; ++ # This must be matched before tile*. ++ tilegx*) ++ basic_machine=tilegx-unknown ++ os=-linux-gnu ++ ;; + tile*) +- basic_machine=$basic_machine-unknown ++ basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) +@@ -1346,6 +1340,7 @@ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ ++ | -linux-musl* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +diff -Nur gcc-4.7.3.orig/fixincludes/mkfixinc.sh gcc-4.7.3/fixincludes/mkfixinc.sh +--- gcc-4.7.3.orig/fixincludes/mkfixinc.sh 2011-09-22 16:00:17.000000000 +0200 ++++ gcc-4.7.3/fixincludes/mkfixinc.sh 2013-09-16 15:39:42.000000000 +0200 +@@ -20,7 +20,8 @@ + powerpc-*-eabi* | \ + powerpc-*-rtems* | \ + powerpcle-*-eabisim* | \ +- powerpcle-*-eabi* ) ++ powerpcle-*-eabi* | \ ++ *-musl* ) + # IF there is no include fixing, + # THEN create a no-op fixer and exit + (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} +diff -Nur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h +--- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h 2011-11-02 16:03:19.000000000 +0100 ++++ gcc-4.7.3/gcc/config/arm/linux-eabi.h 2013-09-16 15:39:42.000000000 +0200 +@@ -64,6 +64,23 @@ + #undef GLIBC_DYNAMIC_LINKER + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" + ++/* For ARM musl currently supports two dynamic linkers: ++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI ++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI. ++ musl does not support the legacy OABI (i.e. broken) mode. ++ All the dynamic linkers live in /lib. ++ We default to soft-float, but this can be overridden by changing both ++ MUSL_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1" ++#define MUSL_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1" ++#define MUSL_DYNAMIC_LINKER_DEFAULT MUSL_DYNAMIC_LINKER_SOFT_FLOAT ++ ++#define MUSL_DYNAMIC_LINKER \ ++ "%{mfloat-abi=hard:" MUSL_DYNAMIC_LINKER_HARD_FLOAT "} \ ++ %{mfloat-abi=soft*:" MUSL_DYNAMIC_LINKER_SOFT_FLOAT "} \ ++ %{!mfloat-abi=*:" MUSL_DYNAMIC_LINKER_DEFAULT "}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +diff -Nur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h +--- gcc-4.7.3.orig/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200 ++++ gcc-4.7.3/gcc/config/i386/linux64.h 2013-09-16 15:39:42.000000000 +0200 +@@ -31,3 +31,7 @@ + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" ++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" +diff -Nur gcc-4.7.3.orig/gcc/config/i386/linux.h gcc-4.7.3/gcc/config/i386/linux.h +--- gcc-4.7.3.orig/gcc/config/i386/linux.h 2011-06-03 20:30:39.000000000 +0200 ++++ gcc-4.7.3/gcc/config/i386/linux.h 2013-09-16 15:39:42.000000000 +0200 +@@ -22,3 +22,4 @@ + + #define GNU_USER_LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" +diff -Nur gcc-4.7.3.orig/gcc/config/linux.h gcc-4.7.3/gcc/config/linux.h +--- gcc-4.7.3.orig/gcc/config/linux.h 2012-08-14 15:59:04.000000000 +0200 ++++ gcc-4.7.3/gcc/config/linux.h 2013-09-16 15:39:42.000000000 +0200 +@@ -33,10 +33,12 @@ + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ +@@ -54,18 +56,21 @@ + uClibc or Bionic is the default C library and whether + -muclibc or -mglibc or -mbionic has been passed to change the default. */ + +-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ +- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" ++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ ++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" + + #if DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) + #elif DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) + #elif DEFAULT_LIBC == LIBC_BIONIC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) + #else + #error "Unsupported DEFAULT_LIBC" + #endif /* DEFAULT_LIBC */ +@@ -85,21 +90,21 @@ + + #define GNU_USER_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ +- BIONIC_DYNAMIC_LINKER) ++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + #define GNU_USER_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ +- BIONIC_DYNAMIC_LINKER32) ++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ +- BIONIC_DYNAMIC_LINKER64) ++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + #define GNU_USER_DYNAMIC_LINKERX32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ +- BIONIC_DYNAMIC_LINKERX32) ++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) + + /* Determine whether the entire c99 runtime + is present in the runtime library. */ + #undef TARGET_C99_FUNCTIONS +-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) ++#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL) + + /* Whether we have sincos that follows the GNU extension. */ + #undef TARGET_HAS_SINCOS +@@ -108,3 +113,74 @@ + /* Whether we have Bionic libc runtime */ + #undef TARGET_HAS_BIONIC + #define TARGET_HAS_BIONIC (OPTION_BIONIC) ++ ++/* musl avoids problematic includes by rearranging the include directories. ++ * Unfortunately, this is mostly duplicated from cppdefault.c */ ++#if DEFAULT_LIBC == LIBC_MUSL ++#define INCLUDE_DEFAULTS_MUSL_GPP \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, ++ ++#ifdef LOCAL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_LOCAL \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_LOCAL ++#endif ++ ++#ifdef PREFIX_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_PREFIX ++#endif ++ ++#ifdef CROSS_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_CROSS \ ++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#ifdef TOOL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_TOOL \ ++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_TOOL ++#endif ++ ++#ifdef NATIVE_SYSTEM_HEADER_DIR ++#define INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_NATIVE ++#endif ++ ++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) ++# undef INCLUDE_DEFAULTS_MUSL_LOCAL ++# define INCLUDE_DEFAULTS_MUSL_LOCAL ++# undef INCLUDE_DEFAULTS_MUSL_NATIVE ++# define INCLUDE_DEFAULTS_MUSL_NATIVE ++#else ++# undef INCLUDE_DEFAULTS_MUSL_CROSS ++# define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#undef INCLUDE_DEFAULTS ++#define INCLUDE_DEFAULTS \ ++ { \ ++ INCLUDE_DEFAULTS_MUSL_GPP \ ++ INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ INCLUDE_DEFAULTS_MUSL_CROSS \ ++ INCLUDE_DEFAULTS_MUSL_TOOL \ ++ INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++ } ++#endif +diff -Nur gcc-4.7.3.orig/gcc/config/linux.opt gcc-4.7.3/gcc/config/linux.opt +--- gcc-4.7.3.orig/gcc/config/linux.opt 2010-09-29 16:51:52.000000000 +0200 ++++ gcc-4.7.3/gcc/config/linux.opt 2013-09-16 15:39:42.000000000 +0200 +@@ -30,3 +30,7 @@ + muclibc + Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) + Use uClibc C library ++ ++mmusl ++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) ++Use musl C library +diff -Nur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linux.h +--- gcc-4.7.3.orig/gcc/config/mips/linux.h 2011-07-19 20:00:27.000000000 +0200 ++++ gcc-4.7.3/gcc/config/mips/linux.h 2013-09-16 15:39:43.000000000 +0200 +@@ -19,3 +19,5 @@ + . */ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++ ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" +diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h +--- gcc-4.7.3.orig/gcc/config/rs6000/linux64.h 2012-03-12 17:16:51.000000000 +0100 ++++ gcc-4.7.3/gcc/config/rs6000/linux64.h 2013-09-16 15:39:43.000000000 +0200 +@@ -362,17 +362,21 @@ + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER32 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ +diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h +--- gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 +0200 ++++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2013-09-16 15:39:43.000000000 +0200 +@@ -804,15 +808,18 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +diff -Nur gcc-4.7.3.orig/gcc/config.gcc gcc-4.7.3/gcc/config.gcc +--- gcc-4.7.3.orig/gcc/config.gcc 2013-03-06 23:54:11.000000000 +0100 ++++ gcc-4.7.3/gcc/config.gcc 2013-09-16 15:39:43.000000000 +0200 +@@ -522,7 +522,7 @@ + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + + # Common parts for widely ported systems. + case ${target} in +@@ -625,6 +625,9 @@ + *-*-*uclibc*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" + ;; ++ *-*-*musl*) ++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ ;; + *) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" + ;; +@@ -2092,6 +2095,10 @@ + powerpc*-*-linux*paired*) + tm_file="${tm_file} rs6000/750cl.h" ;; + esac ++ case ${target} in ++ *-linux*-musl*) ++ enable_secureplt=yes ;; ++ esac + if test x${enable_secureplt} = xyes; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi +diff -Nur gcc-4.7.3.orig/gcc/configure gcc-4.7.3/gcc/configure +--- gcc-4.7.3.orig/gcc/configure 2013-02-06 16:23:55.000000000 +0100 ++++ gcc-4.7.3/gcc/configure 2013-09-16 15:39:43.000000000 +0200 +@@ -26815,7 +26815,8 @@ + gcc_cv_libc_provides_ssp=yes + fi + ;; +- *-*-gnu*) ++ *-*-gnu* | \ ++ *-linux-musl*) + # Avoid complicated tests (see + # ) and for now + # simply assert that glibc does provide this, which is true for all +@@ -26902,6 +26903,9 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +diff -Nur gcc-4.7.3.orig/gcc/configure.ac gcc-4.7.3/gcc/configure.ac +--- gcc-4.7.3.orig/gcc/configure.ac 2013-02-06 16:23:55.000000000 +0100 ++++ gcc-4.7.3/gcc/configure.ac 2013-09-16 15:39:43.000000000 +0200 +@@ -4692,7 +4692,8 @@ + gcc_cv_libc_provides_ssp=yes + fi] + ;; +- *-*-gnu*) ++ *-*-gnu* | \ ++ *-linux-musl*) + # Avoid complicated tests (see + # ) and for now + # simply assert that glibc does provide this, which is true for all +@@ -4762,6 +4763,9 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +diff -Nur gcc-4.7.3.orig/gcc/ginclude/stddef.h gcc-4.7.3/gcc/ginclude/stddef.h +--- gcc-4.7.3.orig/gcc/ginclude/stddef.h 2012-02-12 02:06:04.000000000 +0100 ++++ gcc-4.7.3/gcc/ginclude/stddef.h 2013-09-16 15:39:43.000000000 +0200 +@@ -184,6 +184,7 @@ + #ifndef _GCC_SIZE_T + #ifndef _SIZET_ + #ifndef __size_t ++#ifndef __DEFINED_size_t /* musl */ + #define __size_t__ /* BeOS */ + #define __SIZE_T__ /* Cray Unicos/Mk */ + #define _SIZE_T +@@ -200,6 +201,7 @@ + #define ___int_size_t_h + #define _GCC_SIZE_T + #define _SIZET_ ++#define __DEFINED_size_t /* musl */ + #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ + || defined(__FreeBSD_kernel__) + /* __size_t is a typedef on FreeBSD 5, must not trash it. */ +@@ -215,6 +217,7 @@ + typedef long ssize_t; + #endif /* __BEOS__ */ + #endif /* !(defined (__GNUG__) &&