diff --git a/release/src-rt-6.x.4708/Makefile b/release/src-rt-6.x.4708/Makefile index 36866dc13f..39cde08c5d 100644 --- a/release/src-rt-6.x.4708/Makefile +++ b/release/src-rt-6.x.4708/Makefile @@ -21,12 +21,17 @@ PATH := $(RELEASEDIR)/tools:$(PATH) include target.mak -ifeq ($(CONFIG_TOOLCHAIN53),) +ifeq ($(CONFIG_TOOLCHAIN53)$(CONFIG_TOOLCHAIN73),) export PATH := $(PATH):$(PWD)/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/lib else - export PATH := $(PATH):$(PWD)/toolchains/hndtools-arm-uclibc-5.3/usr/bin - export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-5.3/usr/lib + ifeq ($(CONFIG_TOOLCHAIN73),y) + export PATH := $(PATH):$(PWD)/toolchains/hndtools-arm-uclibc-7.3/usr/bin + export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-7.3/usr/lib + else + export PATH := $(PATH):$(PWD)/toolchains/hndtools-arm-uclibc-5.3/usr/bin + export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-5.3/usr/lib + endif endif CTAGS_EXCLUDE_OPT := --exclude=kernel_header --exclude=$(PLATFORM) diff --git a/release/src-rt-6.x.4708/linux/linux-2.6.36/include/linux/compiler-gcc7.h b/release/src-rt-6.x.4708/linux/linux-2.6.36/include/linux/compiler-gcc7.h new file mode 100644 index 0000000000..9d3fda3d0d --- /dev/null +++ b/release/src-rt-6.x.4708/linux/linux-2.6.36/include/linux/compiler-gcc7.h @@ -0,0 +1,30 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) +#define __always_inline inline __attribute__((always_inline)) + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + diff --git a/release/src-rt-6.x.4708/router/Makefile b/release/src-rt-6.x.4708/router/Makefile index d449b834e4..61345875dc 100644 --- a/release/src-rt-6.x.4708/router/Makefile +++ b/release/src-rt-6.x.4708/router/Makefile @@ -415,10 +415,14 @@ ifeq ($(TCONFIG_BCMARM),y) include $(SRCBASE)/makefiles/WLAN_Common.mk export BASEDIR := $(WLAN_TreeBaseA) export EXTRALIBS = -lgcc_s - ifeq ($(CONFIG_TOOLCHAIN53),) + ifeq ($(CONFIG_TOOLCHAIN53)$(CONFIG_TOOLCHAIN73),) export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/lib else - export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-5.3/usr/lib + ifeq ($(CONFIG_TOOLCHAIN73),y) + export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-7.3/usr/lib + else + export LD_LIBRARY_PATH := $(SRCBASE)/toolchains/hndtools-arm-uclibc-5.3/usr/lib + endif endif ifeq (2_6_36,$(LINUX_VERSION)) ifeq ($(TCONFIG_BCM7),y) @@ -1374,7 +1378,7 @@ iptables-clean: iptables-1.8.x/stamp-h1: $(call patch_files,iptables-1.8.x) cd iptables-1.8.x && ./autogen.sh && \ - CFLAGS="-Os -Wall $(EXTRACFLAGS) -U CONFIG_NVRAM_SIZE" \ + CFLAGS="-Os -Wall $(EXTRACFLAGS) -U CONFIG_NVRAM_SIZE $(if $(CONFIG_TOOLCHAIN73),-DCONFIG_TOOLCHAIN73,)" \ CPPFLAGS="-Os -Wall $(if $(TCONFIG_CONNTRACK_TOOL),-I$(TOP)/libnfnetlink/include -I$(TOP)/libnetfilter_conntrack/include,)" \ LDFLAGS="$(if $(TCONFIG_CONNTRACK_TOOL),-L$(TOP)/libnfnetlink/src/.libs -lnfnetlink -L$(TOP)/libnetfilter_conntrack/src/.libs -Wl$(comma)-rpath$(comma)$(TOP)/libnetfilter_conntrack/src/.libs -Wl$(comma)-rpath$(comma)$(TOP)/libmnl/staged/usr/lib,)" \ PKG_CONFIG_PATH="$(if $(TCONFIG_CONNTRACK_TOOL),$(TOP)/libnfnetlink:$(TOP)/libnetfilter_conntrack/staged/usr/lib/pkgconfig,)" \ @@ -2129,7 +2133,7 @@ hotplug2: @$(SEP) $(call patch_files,hotplug2) $(MAKE) -C $@ \ - EXTRACFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections $(if $(CONFIG_TOOLCHAIN53),-DCONFIG_TOOLCHAIN53,)" \ + EXTRACFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections $(if $(CONFIG_TOOLCHAIN53),-DCONFIG_TOOLCHAIN53) $(if $(CONFIG_TOOLCHAIN73),-DCONFIG_TOOLCHAIN73)" \ LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" hotplug2-install: diff --git a/release/src-rt-6.x.4708/router/nas_arm/nas_wksp.c b/release/src-rt-6.x.4708/router/nas_arm/nas_wksp.c index 78d153f7d3..e70e7a9d8a 100644 --- a/release/src-rt-6.x.4708/router/nas_arm/nas_wksp.c +++ b/release/src-rt-6.x.4708/router/nas_arm/nas_wksp.c @@ -1245,9 +1245,9 @@ nas_get_wsec(nas_wksp_t *nwksp, uint8 *mac, char *osifname) itr = itr->ai_next; } } - if (addr_ok != 1) + if (addr_ok != 1) { printf ("\n func=%s, line=%d, get radius addr error:%s", __FUNCTION__, __LINE__, info.radius_addr); - + } ((struct sockaddr_in *)&(nwcb->nas.server))->sin_port = info.radius_port; } #else diff --git a/release/src-rt-6.x.4708/router/patches/glib2/103-fix-for-newer-toolchain.patch b/release/src-rt-6.x.4708/router/patches/glib2/103-fix-for-newer-toolchain.patch new file mode 100644 index 0000000000..c8cd74f5be --- /dev/null +++ b/release/src-rt-6.x.4708/router/patches/glib2/103-fix-for-newer-toolchain.patch @@ -0,0 +1,44 @@ +--- glib2/gio/gunixconnection.c ++++ glib2/gio/gunixconnection.c +@@ -147,6 +147,10 @@ + * + * Since: 2.22 + **/ ++#if defined(__GNUC__) && __GNUC__ >= 5 ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" ++#endif + gint + g_unix_connection_receive_fd (GUnixConnection *connection, + GCancellable *cancellable, +@@ -241,6 +245,9 @@ + return -1; + #endif + } ++#if defined(__GNUC__) && __GNUC__ >= 5 ++#pragma GCC diagnostic pop ++#endif + + static void + g_unix_connection_init (GUnixConnection *connection) +@@ -493,6 +500,10 @@ + * + * Since: 2.26 + */ ++#if defined(__GNUC__) && __GNUC__ >= 5 ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" ++#endif + GCredentials * + g_unix_connection_receive_credentials (GUnixConnection *connection, + GCancellable *cancellable, +@@ -662,6 +673,9 @@ + g_object_unref (socket); + return ret; + } ++#if defined(__GNUC__) && __GNUC__ >= 5 ++#pragma GCC diagnostic pop ++#endif + + static void + receive_credentials_async_thread (GTask *task, diff --git a/release/src-rt-6.x.4708/router/patches/hotplug2/101-fix-for-newer-toolchain.patch b/release/src-rt-6.x.4708/router/patches/hotplug2/101-fix-for-newer-toolchain.patch index d4ef7df418..b4546ea961 100644 --- a/release/src-rt-6.x.4708/router/patches/hotplug2/101-fix-for-newer-toolchain.patch +++ b/release/src-rt-6.x.4708/router/patches/hotplug2/101-fix-for-newer-toolchain.patch @@ -4,7 +4,7 @@ * * Returns: Seqnum as read from sysfs */ -+#ifndef CONFIG_TOOLCHAIN53 ++#if !defined(CONFIG_TOOLCHAIN53) && !defined(CONFIG_TOOLCHAIN73) inline event_seqnum_t get_kernel_seqnum() { +#else +extern inline event_seqnum_t get_kernel_seqnum() { @@ -16,7 +16,7 @@ * * Returns: Socket fd if succesful, -1 otherwise. */ -+#ifndef CONFIG_TOOLCHAIN53 ++#if !defined(CONFIG_TOOLCHAIN53) && !defined(CONFIG_TOOLCHAIN73) inline int init_netlink_socket(int type) { +#else +extern inline int init_netlink_socket(int type) { @@ -30,7 +30,7 @@ * * Returns: Pointer to freshly allocated memory */ -+#ifndef CONFIG_TOOLCHAIN53 ++#if !defined(CONFIG_TOOLCHAIN53) && !defined(CONFIG_TOOLCHAIN73) inline void *xmalloc(size_t size) { +#else +extern inline void *xmalloc(size_t size) { @@ -42,7 +42,7 @@ * * Returns: Pointer to reallocated memory */ -+#ifndef CONFIG_TOOLCHAIN53 ++#if !defined(CONFIG_TOOLCHAIN53) && !defined(CONFIG_TOOLCHAIN73) inline void *xrealloc(void *inptr, size_t size) { +#else +extern inline void *xrealloc(void *inptr, size_t size) { @@ -50,3 +50,53 @@ void *ptr; ptr = realloc(inptr, size); if (ptr == NULL) { +--- hotplug2/hotplug2.c ++++ hotplug2/hotplug2.c +@@ -62,7 +62,11 @@ + * + * Returns: void + */ ++#ifndef CONFIG_TOOLCHAIN73 + inline void free_hotplug2_event(struct hotplug2_event_t *event) { ++#else ++void free_hotplug2_event(struct hotplug2_event_t *event) { ++#endif + int i; + + for (i = 0; i < event->env_vars_c; i++) { +@@ -81,7 +85,11 @@ + * + * Returns: Macro of the given action + */ ++#ifndef CONFIG_TOOLCHAIN73 + inline int get_hotplug2_event_action(char *action) { ++#else ++int get_hotplug2_event_action(char *action) { ++#endif + if (!strcmp(action, "add")) + return ACTION_ADD; + +@@ -161,7 +169,11 @@ + * + * Returns: A copy of the source event structure + */ ++#ifndef CONFIG_TOOLCHAIN73 + inline struct hotplug2_event_t *dup_hotplug2_event(struct hotplug2_event_t *src) { ++#else ++struct hotplug2_event_t *dup_hotplug2_event(struct hotplug2_event_t *src) { ++#endif + struct hotplug2_event_t *dest; + int i; + +@@ -189,7 +201,11 @@ + * + * Returns: A new event structure + */ ++#ifndef CONFIG_TOOLCHAIN73 + inline struct hotplug2_event_t *get_hotplug2_event(char *event_str, int size) { ++#else ++struct hotplug2_event_t *get_hotplug2_event(char *event_str, int size) { ++#endif + char *ptr; + struct hotplug2_event_t *event; + int skip; diff --git a/release/src-rt-6.x.4708/router/patches/iptables-1.8.x/101-tomato-additional-files.patch b/release/src-rt-6.x.4708/router/patches/iptables-1.8.x/101-tomato-additional-files.patch index e4b914f936..847bf3d86d 100644 --- a/release/src-rt-6.x.4708/router/patches/iptables-1.8.x/101-tomato-additional-files.patch +++ b/release/src-rt-6.x.4708/router/patches/iptables-1.8.x/101-tomato-additional-files.patch @@ -1149,7 +1149,7 @@ + --- iptables-1.8.x/extensions/libipt_account.c +++ iptables-1.8.x/extensions/libipt_account.c -@@ -0,0 +1,366 @@ +@@ -0,0 +1,374 @@ +/* Copyright (c) 2004-2009 Piotr 'QuakeR' Gasidlo + * + * This program is free software; you can redistribute it and/or modify @@ -1325,7 +1325,11 @@ +} + +/* validate netmask */ ++#ifndef CONFIG_TOOLCHAIN73 +inline int valid_netmask(u_int32_t netmask) { ++#else ++int valid_netmask(u_int32_t netmask) { ++#endif + while (netmask & 0x80000000) + netmask <<= 1; + if (netmask != 0) @@ -1334,7 +1338,11 @@ +} + +/* validate network/netmask pair */ ++#ifndef CONFIG_TOOLCHAIN73 +inline int valid_network_and_netmask(struct t_ipt_account_info *info) { ++#else ++int valid_network_and_netmask(struct t_ipt_account_info *info) { ++#endif + if (!valid_netmask(info->netmask)) + return 0; + if ((info->network & info->netmask) != info->network) diff --git a/release/src-rt-6.x.4708/shared/bcmutils.c b/release/src-rt-6.x.4708/shared/bcmutils.c index 8fa36ebbf6..50c02c7de0 100644 --- a/release/src-rt-6.x.4708/shared/bcmutils.c +++ b/release/src-rt-6.x.4708/shared/bcmutils.c @@ -1634,7 +1634,7 @@ bcm_ipv6_ntoa(void *ipv6, char *buf) for (i = 0; i < IPV6_ADDR_LEN/2; i++) { if ((uint8*) (a + i) == a4) { - snprintf(p, 16, ":%u.%u.%u.%u", a4[0], a4[1], a4[2], a4[3]); + snprintf(p, 17, ":%u.%u.%u.%u", a4[0], a4[1], a4[2], a4[3]); break; } else if (i == i_max) { *p++ = ':'; diff --git a/release/src-rt-6.x.4708/target.mak b/release/src-rt-6.x.4708/target.mak index 45f2b47f7e..5ee93a1ff8 100644 --- a/release/src-rt-6.x.4708/target.mak +++ b/release/src-rt-6.x.4708/target.mak @@ -7,4 +7,5 @@ export CONFIG_BCMWL5=y export CONFIG_BCMWL6=y export CONFIG_BCMWL6A=y export CONFIG_TOOLCHAIN53=y +#export CONFIG_TOOLCHAIN73=y export TOMATO_EXPERIMENTAL=0 diff --git a/release/src-rt-7.14.114.x/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h b/release/src-rt-7.14.114.x/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h new file mode 100644 index 0000000000..9d3fda3d0d --- /dev/null +++ b/release/src-rt-7.14.114.x/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h @@ -0,0 +1,30 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) +#define __always_inline inline __attribute__((always_inline)) + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + diff --git a/release/src-rt-7.14.114.x/src/target.mak b/release/src-rt-7.14.114.x/src/target.mak index 12ad212676..b56f71d29d 100644 --- a/release/src-rt-7.14.114.x/src/target.mak +++ b/release/src-rt-7.14.114.x/src/target.mak @@ -9,4 +9,5 @@ export CONFIG_BCMWL6A=y export CONFIG_BCM7=y export CONFIG_BCM714=y export CONFIG_TOOLCHAIN53=y +#export CONFIG_TOOLCHAIN73=y export TOMATO_EXPERIMENTAL=0 diff --git a/release/src-rt-7.x.main/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h b/release/src-rt-7.x.main/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h new file mode 100644 index 0000000000..9d3fda3d0d --- /dev/null +++ b/release/src-rt-7.x.main/src/linux/linux-2.6.36/include/linux/compiler-gcc7.h @@ -0,0 +1,30 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) +#define __always_inline inline __attribute__((always_inline)) + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + diff --git a/release/src-rt-7.x.main/src/target.mak b/release/src-rt-7.x.main/src/target.mak index ba09a17662..9affdc8e85 100644 --- a/release/src-rt-7.x.main/src/target.mak +++ b/release/src-rt-7.x.main/src/target.mak @@ -8,4 +8,5 @@ export CONFIG_BCMWL6=y export CONFIG_BCMWL6A=y export CONFIG_BCM7=y export CONFIG_TOOLCHAIN53=y +#export CONFIG_TOOLCHAIN73=y export TOMATO_EXPERIMENTAL=0