kernel: bump 4.14 to 4.14.134
[openwrt/staging/lynxis.git] / target / linux / generic / pending-4.19 / 100-MIPS-fix-build-on-non-linux-hosts.patch
1 From 4ee213d8c2afeab9a68f8530317260298b4b6b82 Mon Sep 17 00:00:00 2001
2 From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 Date: Wed, 19 Jun 2019 08:16:33 +0100
4 Subject: [PATCH] MIPS: fix build on non-linux hosts
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 calc_vmlinuz_load_addr.c requires SZ_64K to be defined for alignment
10 purposes. It included "../../../../include/linux/sizes.h" to define
11 that size, however "sizes.h" tries to include <linux/const.h> which
12 assumes linux system headers. These may not exist eg. the following
13 error was encountered when building Linux for OpenWrt under macOS:
14
15 In file included from arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:16:
16 arch/mips/boot/compressed/../../../../include/linux/sizes.h:11:10: fatal error: 'linux/const.h' file not found
17 ^~~~~~~~~~
18
19 Change makefile to force building on local linux headers instead of
20 system headers. Also change eye-watering relative reference in include
21 file spec.
22
23 Thanks to Jo-Philip Wich & Petr Štetiar for assistance in tracking this
24 down & fixing.
25
26 Suggested-by: Jo-Philipp Wich <jo@mein.io>
27 Signed-off-by: Petr Štetiar <ynezz@true.cz>
28 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
29 ---
30 arch/mips/boot/compressed/Makefile | 2 ++
31 arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 2 +-
32 2 files changed, 3 insertions(+), 1 deletion(-)
33
34 --- a/arch/mips/boot/compressed/Makefile
35 +++ b/arch/mips/boot/compressed/Makefile
36 @@ -78,6 +78,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.i
37 $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
38 $(call if_changed,objcopy)
39
40 +HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
41 +
42 # Calculate the load address of the compressed kernel image
43 hostprogs-y := calc_vmlinuz_load_addr
44
45 --- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
46 +++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
47 @@ -13,7 +13,7 @@
48 #include <stdint.h>
49 #include <stdio.h>
50 #include <stdlib.h>
51 -#include "../../../../include/linux/sizes.h"
52 +#include <linux/sizes.h>
53
54 int main(int argc, char *argv[])
55 {