blob: fbf94d513650c40c0de204c10e97740a595a23c7 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001Upstream-Status: Backport [https://github.com/LINBIT/drbd-9.0/commit/46e8e3f]
2
3Backport patch to fix compile errors:
4
5| LD [M] /home/kkang/buildarea/Yocto/build/tmp/work/qemux86_64-poky-linux/drbd/9.0.17-1-r0/drbd-9.0.17-1/drbd/drbd.o
6| x86_64-poky-linux-ld.bfd: cannot find .../tmp/work/qemux86_64-poky-linux/drbd/9.0.17-1-r0/drbd-9.0.17-1/drbd/drbd_bitmap.o: No such file or directory
7
8Signed-off-by: Kai Kang <kai.kang@windriver.com>
9
10From 46e8e3fc31b651fb56ea38134dcf14382fc43000 Mon Sep 17 00:00:00 2001
11From: Lars Ellenberg <lars.ellenberg@linbit.com>
12Date: Wed, 3 Apr 2019 10:57:46 +0200
13Subject: [PATCH] drbd: kbuild fix: use M=; don't forget addprefix $(obj)
14
15Kernel build started to warn about using SUBDIRS instead of M,
16and we don't support "very old" kernels anymore anyways.
17
18Our list of dependencies for drbd_buildtag.c needs to depend on the
19actual files $(obj)/*.o resulting from the build,
20not on just the list of *.o names.
21
22This apparently also fixes a build failure in opensuse build service for
23tumbleweed when using make-4.2.1-7.5 against kernel 5.0.5-something.
24---
25 drbd/Kbuild | 11 +++++------
26 drbd/Makefile | 4 +---
27 2 files changed, 6 insertions(+), 9 deletions(-)
28
29diff --git a/drbd/Kbuild b/drbd/Kbuild
30index 285f7a81..99228029 100644
31--- a/drbd/Kbuild
32+++ b/drbd/Kbuild
33@@ -1,4 +1,5 @@
34-obj-m := drbd.o drbd_transport_tcp.o
35+obj-m += drbd.o drbd_transport_tcp.o
36+# obj-$(CONFIG_BLK_DEV_DRBD) += drbd.o drbd_transport_tcp.o
37
38 clean-files := compat.h $(wildcard .config.$(KERNELVERSION).timestamp)
39
40@@ -56,10 +57,8 @@ ifndef DISABLE_KREF_DEBUGGING_HERE
41 drbd-y += kref_debug.o drbd_kref_debug.o
42 endif
43
44-$(patsubst %,$(obj)/%,$(drbd-y)): $(obj)/compat.h
45-$(patsubst %,$(obj)/%,drbd_transport_tcp.o): $(obj)/compat.h
46-
47-obj-$(CONFIG_BLK_DEV_DRBD) += drbd.o
48+$(addprefix $(obj)/,$(drbd-y)): $(obj)/compat.h
49+$(obj)/drbd_transport_tcp.o: $(obj)/compat.h
50
51 # ======================================================================
52
53@@ -124,7 +123,7 @@ endif
54 # and not in e.g. dash. I'm too lazy to fix it to be compatible.
55 SHELL=/bin/bash
56
57-$(obj)/drbd_buildtag.c: $(filter-out drbd_buildtag.o,$(drbd-y))
58+$(obj)/drbd_buildtag.c: $(addprefix $(obj)/,$(filter-out drbd_buildtag.o,$(drbd-y)))
59 @$(kecho) ' GEN $@ $(echo-why)'
60 @set -e; exec > $@.new; \
61 echo -e "/* automatically generated. DO NOT EDIT. */"; \
62diff --git a/drbd/Makefile b/drbd/Makefile
63index 5f768fc6..f9e8792a 100644
64--- a/drbd/Makefile
65+++ b/drbd/Makefile
66@@ -102,9 +102,7 @@ else
67
68 kbuild:
69 @rm -f .drbd_kernelrelease*
70- # previous to 2.6.6 (suse: 2.6.5-dunno), this should be:
71- $(MAKE) -C $(KDIR) $(if $(O),O=$(O),) SUBDIRS=$(DRBDSRC) $(ARCH_UM) modules
72-# $(MAKE) -C $(KDIR) M=$(DRBDSRC) $(ARCH_UM) modules
73+ $(MAKE) -C $(KDIR) $(if $(O),O=$(O),) M=$(DRBDSRC) $(ARCH_UM) modules
74 -mv .drbd_kernelrelease.new .drbd_kernelrelease
75 @echo -n "Memorizing module configuration ... "
76 @config=$$( (for x in $(KDIR)/.config $(O)/.config ; do \
77--
782.20.0
79