1 --- a/scripts/kallsyms.c
2 +++ b/scripts/kallsyms.c
8 +/* Darwin has no memmem implementation, this one is ripped of the uClibc-0.9.28 source */
9 +void *memmem (const void *haystack, size_t haystack_len,
10 + const void *needle, size_t needle_len)
13 + const char *const last_possible
14 + = (const char *) haystack + haystack_len - needle_len;
16 + if (needle_len == 0)
17 + /* The first occurrence of the empty string is deemed to occur at
18 + the beginning of the string. */
19 + return (void *) haystack;
21 + /* Sanity check, otherwise the loop might search through the whole
23 + if (__builtin_expect (haystack_len < needle_len, 0))
26 + for (begin = (const char *) haystack; begin <= last_possible; ++begin)
27 + if (begin[0] == ((const char *) needle)[0] &&
28 + !memcmp ((const void *) &begin[1],
29 + (const void *) ((const char *) needle + 1),
31 + return (void *) begin;
38 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
39 --- a/scripts/kconfig/Makefile
40 +++ b/scripts/kconfig/Makefile
41 @@ -123,6 +123,9 @@ check-lxdialog := $(srctree)/$(src)/lxd
42 # we really need to do so. (Do not call gcc as part of make mrproper)
43 HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
45 +ifeq ($(shell uname -s),Darwin)
46 +HOST_LOADLIBES += -lncurses
49 # ===========================================================================
50 # Shared Makefile for the various kconfig executables:
51 --- a/scripts/mod/mk_elfconfig.c
52 +++ b/scripts/mod/mk_elfconfig.c
60 +#include "../../../../../tools/sstrip/include/elf.h"
64 main(int argc, char **argv)
65 --- a/scripts/mod/modpost.h
66 +++ b/scripts/mod/modpost.h
71 +#if !(defined(__APPLE__) || defined(__CYGWIN__))
74 +#include "../../../../../tools/sstrip/include/elf.h"
77 #include "elfconfig.h"