build: fix kernel 5.4 on macos
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Fri, 13 Mar 2020 17:56:40 +0000 (17:56 +0000)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sat, 14 Mar 2020 13:20:06 +0000 (13:20 +0000)
As part of the kernel build process there are utilities built to run on
the host system that expect linux kernel headers to be available.
Unfortunately macos/darwin doesn't have these headers.

vdso2c requires types.h so provide a minimal stub to satisfy it.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
tools/Makefile
tools/include/asm/types.h [new file with mode: 0644]

index 3c37316..02556d4 100644 (file)
@@ -138,6 +138,10 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
        mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
        $(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
        $(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h $(STAGING_DIR_HOST)/include/sys/
+ifneq ($(HOST_OS),Linux)
+       mkdir -p $(STAGING_DIR_HOST)/include/asm
+       $(INSTALL_DATA) $(TOPDIR)/tools/include/asm/*.h $(STAGING_DIR_HOST)/include/asm/
+endif
        ln -snf lib $(STAGING_DIR_HOST)/lib64
        touch $@
 
diff --git a/tools/include/asm/types.h b/tools/include/asm/types.h
new file mode 100644 (file)
index 0000000..2c91232
--- /dev/null
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * asm-generic/int-ll64.h
+ *
+ * Integer declarations for architectures which use "long long"
+ * for 64-bit types.
+ */
+
+#ifndef _ASM_GENERIC_INT_LL64_H
+#define _ASM_GENERIC_INT_LL64_H
+
+typedef __signed__ char __s8;
+
+typedef __signed__ short __s16;
+
+typedef __signed__ int __s32;
+
+#ifdef __GNUC__
+__extension__ typedef __signed__ long long __s64;
+#else
+typedef __signed__ long long __s64;
+#endif
+
+#endif /* _ASM_GENERIC_INT_LL64_H */