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;
62 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
63 --- a/scripts/kconfig/Makefile
64 +++ b/scripts/kconfig/Makefile
65 @@ -147,6 +147,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) \
69 +ifeq ($(shell uname -s),Darwin)
70 +HOST_LOADLIBES += -lncurses
73 # ===========================================================================
74 # Shared Makefile for the various kconfig executables:
75 --- a/scripts/mod/mk_elfconfig.c
76 +++ b/scripts/mod/mk_elfconfig.c
84 +#include "../../../../../tools/sstrip/include/elf.h"
88 main(int argc, char **argv)
89 --- a/scripts/mod/modpost.h
90 +++ b/scripts/mod/modpost.h
95 +#if !(defined(__APPLE__) || defined(__CYGWIN__))
98 +#include "../../../../../tools/sstrip/include/elf.h"
101 #include "elfconfig.h"