All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Kevin Darbyshire-Bryant" <ldir@darbyshire-bryant.me.uk>,
	"Jo-Philipp Wich" <jo@mein.io>, "Petr Štetiar" <ynezz@true.cz>,
	"Paul Burton" <paul.burton@mips.com>,
	linux-mips@vger.kernel.org, "Sasha Levin" <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.9 2/7] MIPS: fix build on non-linux hosts
Date: Wed, 10 Jul 2019 11:03:30 -0400	[thread overview]
Message-ID: <20190710150337.7390-2-sashal@kernel.org> (raw)
In-Reply-To: <20190710150337.7390-1-sashal@kernel.org>

From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>

[ Upstream commit 1196364f21ffe5d1e6d83cafd6a2edb89404a3ae ]

calc_vmlinuz_load_addr.c requires SZ_64K to be defined for alignment
purposes.  It included "../../../../include/linux/sizes.h" to define
that size, however "sizes.h" tries to include <linux/const.h> which
assumes linux system headers.  These may not exist eg. the following
error was encountered when building Linux for OpenWrt under macOS:

In file included from arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:16:
arch/mips/boot/compressed/../../../../include/linux/sizes.h:11:10: fatal error: 'linux/const.h' file not found
         ^~~~~~~~~~

Change makefile to force building on local linux headers instead of
system headers.  Also change eye-watering relative reference in include
file spec.

Thanks to Jo-Philip Wich & Petr Štetiar for assistance in tracking this
down & fixing.

Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/boot/compressed/Makefile                 | 2 ++
 arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 90aca95fe314..ad31c76c7a29 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -75,6 +75,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
 $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
 	$(call if_changed,objcopy)
 
+HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
+
 # Calculate the load address of the compressed kernel image
 hostprogs-y := calc_vmlinuz_load_addr
 
diff --git a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
index 542c3ede9722..d14f75ec8273 100644
--- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
+++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
@@ -13,7 +13,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "../../../../include/linux/sizes.h"
+#include <linux/sizes.h>
 
 int main(int argc, char *argv[])
 {
-- 
2.20.1


  reply	other threads:[~2019-07-10 15:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 15:03 [PATCH AUTOSEL 4.9 1/7] MIPS: ath79: fix ar933x uart parity mode Sasha Levin
2019-07-10 15:03 ` Sasha Levin [this message]
2019-07-10 15:03 ` [PATCH AUTOSEL 4.9 3/7] arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly Sasha Levin
2019-07-10 15:03 ` [PATCH AUTOSEL 4.9 4/7] KVM: x86: degrade WARN to pr_warn_ratelimited Sasha Levin
2019-07-10 15:03 ` [PATCH AUTOSEL 4.9 5/7] drm/imx: notify drm core before sending event during crtc disable Sasha Levin
2019-07-10 15:03 ` [PATCH AUTOSEL 4.9 6/7] drm/imx: only send event on crtc disable if kept disabled Sasha Levin
2019-07-10 15:03   ` Sasha Levin
2019-07-10 15:03 ` [PATCH AUTOSEL 4.9 7/7] dmaengine: imx-sdma: fix use-after-free on probe error path Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190710150337.7390-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jo@mein.io \
    --cc=ldir@darbyshire-bryant.me.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=stable@vger.kernel.org \
    --cc=ynezz@true.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.