From a0adebf861205ba7d61beb24e3efb2e203745845 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Fri, 9 Jun 2017 01:16:33 -0400 Subject: [PATCH] Makefile: Add a rule to build core module on x86_64 only core module is currently supported on x86_64. Trying to build it on powerpc, triggers build failure: make[3]: Entering directory '/root/kernel/linux' CC [M] /root/upstream/kpatch/kmod/core/core.o /root/upstream/kpatch/kmod/core/core.c:48:28: fatal error: asm/stacktrace.h: No such file or directory #include ^ compilation terminated. scripts/Makefile.build:294: recipe for target '/root/upstream/kpatch/kmod/core/core.o' failed make[4]: *** [/root/upstream/kpatch/kmod/core/core.o] Error 1 Add a Makefile rule to build it, only on x86. Signed-off-by: Josh Poimboeuf Signed-off-by: Kamalesh Babulal --- Makefile.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 4828619..4b15d84 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -3,6 +3,8 @@ CC = gcc INSTALL = /usr/bin/install +ARCH = $(shell uname -p) + PREFIX ?= /usr/local LIBDIR ?= lib LIBEXEC ?= libexec @@ -13,7 +15,11 @@ LIBEXECDIR = $(DESTDIR)$(PREFIX)/$(LIBEXEC)/kpatch DATADIR = $(DESTDIR)$(PREFIX)/share/kpatch MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1 SYSTEMDDIR = $(DESTDIR)$(PREFIX)/lib/systemd/system -BUILDMOD ?= yes + +# The core module is only supported on x86_64 +ifeq ($(ARCH),x86_64) +BUILDMOD ?= yes +endif .PHONY: all install clean .DEFAULT: all