diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2015-06-17 22:37:49 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2015-06-17 22:37:49 +0000 |
commit | 4bdcf79153f55ffe9fbf8432761a48ba64f876d3 (patch) | |
tree | b12f88bc0274272f7f387867f38beef2a5f6c0e4 /package/kernel/broadcom-wl/patches | |
parent | f266b5adec14c19756e6962a28a49d845640a04d (diff) | |
download | master-187ad058-4bdcf79153f55ffe9fbf8432761a48ba64f876d3.tar.gz master-187ad058-4bdcf79153f55ffe9fbf8432761a48ba64f876d3.tar.bz2 master-187ad058-4bdcf79153f55ffe9fbf8432761a48ba64f876d3.zip |
broadcom-wl: fix build with musl
This fixes some build problems with musl. The binary only program
nas.exe wants to link against __assert, which is copied from uClibc.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46021 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/broadcom-wl/patches')
-rw-r--r-- | package/kernel/broadcom-wl/patches/020-musl-fixes.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/package/kernel/broadcom-wl/patches/020-musl-fixes.patch b/package/kernel/broadcom-wl/patches/020-musl-fixes.patch new file mode 100644 index 0000000000..a985b9c24a --- /dev/null +++ b/package/kernel/broadcom-wl/patches/020-musl-fixes.patch @@ -0,0 +1,75 @@ +--- a/shared/wl_linux.c ++++ b/shared/wl_linux.c +@@ -13,6 +13,7 @@ + */ + + #include <stdio.h> ++#include <stdint.h> + #include <unistd.h> + #include <string.h> + #include <errno.h> +@@ -20,10 +21,10 @@ + #include <net/if.h> + #include <linux/types.h> + +-typedef u_int64_t u64; +-typedef u_int32_t u32; +-typedef u_int16_t u16; +-typedef u_int8_t u8; ++typedef uint64_t u64; ++typedef uint32_t u32; ++typedef uint16_t u16; ++typedef uint8_t u8; + #include <linux/sockios.h> + #include <linux/ethtool.h> + +--- a/shared/linux_timer.c ++++ b/shared/linux_timer.c +@@ -125,7 +125,7 @@ void unblock_timer(); + + static struct event *event_queue = NULL; + static struct event *event_freelist; +-static uint g_granularity; ++static unsigned int g_granularity; + static int g_maxevents = 0; + + uclock_t uclock() +--- a/shared/wl.c ++++ b/shared/wl.c +@@ -14,6 +14,7 @@ + #include <typedefs.h> + #include <string.h> + #include <stdio.h> ++#include <stdlib.h> + #include <unistd.h> + #include <errno.h> + #include <sys/ioctl.h> +@@ -263,3 +264,28 @@ wl_printlasterror(char *name) + fprintf(stderr, err_buf); + } + */ ++ ++static int in_assert; /* bss inits to 0. */ ++ ++void __assert(const char *assertion, const char * filename, ++ unsigned int linenumber, register const char * function) ++{ ++ if (!in_assert) { ++ in_assert = 1; ++ ++ fprintf(stderr, ++#ifdef ASSERT_SHOW_PROGNAME ++ "%s: %s: %d: %s: Assertion `%s' failed.\n", __uclibc_progname, ++#else ++ "%s: %d: %s: Assertion `%s' failed.\n", ++#endif ++ filename, ++ linenumber, ++ /* Function name isn't available with some compilers. */ ++ ((function == NULL) ? "?function?" : function), ++ assertion ++ ); ++ } ++ /* shouldn't we? fflush(stderr); */ ++ abort(); ++} |