1 --- a/scripts/genksyms/parse.c_shipped
2 +++ b/scripts/genksyms/parse.c_shipped
12 static int is_typedef;
13 --- a/scripts/genksyms/parse.y
14 +++ b/scripts/genksyms/parse.y
24 static int is_typedef;
25 --- a/scripts/kallsyms.c
26 +++ b/scripts/kallsyms.c
32 +/* Darwin has no memmem implementation, this one is ripped of the uClibc-0.9.28 source */
33 +void *memmem (const void *haystack, size_t haystack_len,
34 + const void *needle, size_t needle_len)
37 + const char *const last_possible
38 + = (const char *) haystack + haystack_len - needle_len;
40 + if (needle_len == 0)
41 + /* The first occurrence of the empty string is deemed to occur at
42 + the beginning of the string. */
43 + return (void *) haystack;
45 + /* Sanity check, otherwise the loop might search through the whole
47 + if (__builtin_expect (haystack_len < needle_len, 0))
50 + for (begin = (const char *) haystack; begin <= last_possible; ++begin)
51 + if (begin[0] == ((const char *) needle)[0] &&
52 + !memcmp ((const void *) &begin[1],
53 + (const void *) ((const char *) needle + 1),
55 + return (void *) begin;
61 #define KSYM_NAME_LEN 127
63 --- a/scripts/kconfig/Makefile
64 +++ b/scripts/kconfig/Makefile
65 @@ -87,6 +87,9 @@ check-lxdialog := $(srctree)/$(src)/lxd
66 # we really need to do so. (Do not call gcc as part of make mrproper)
67 HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
68 HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
69 +ifeq ($(shell uname -s),Darwin)
70 +HOST_LOADLIBES += -lncurses
73 HOST_EXTRACFLAGS += -DLOCALE
75 --- a/scripts/mod/file2alias.c
76 +++ b/scripts/mod/file2alias.c
77 @@ -37,7 +37,21 @@ typedef unsigned char __u8;
78 * even potentially has different endianness and word sizes, since
79 * we handle those differences explicitly below */
80 #include "../../include/linux/mod_devicetable.h"
82 #include "../../include/linux/input.h"
86 +#define KEY_MIN_INTERESTING KEY_MUTE
87 +#define KEY_MAX 0x1ff
97 #define ADD(str, sep, cond, field) \
99 --- a/scripts/mod/mk_elfconfig.c
100 +++ b/scripts/mod/mk_elfconfig.c
108 +#include "../../../../../tools/sstrip/include/elf.h"
112 main(int argc, char **argv)
113 --- a/scripts/mod/modpost.h
114 +++ b/scripts/mod/modpost.h
116 #include <sys/mman.h>
119 +#if !(defined(__APPLE__) || defined(__CYGWIN__))
122 +#include "../../../../../tools/sstrip/include/elf.h"
125 #include "elfconfig.h"
127 --- a/scripts/mod/sumversion.c
128 +++ b/scripts/mod/sumversion.c
138 * Stolen form Cryptographic API.