summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/drbd/drbd/0001-drbd-kbuild-fix-use-M-don-t-forget-addprefix-obj.patch
blob: fbf94d513650c40c0de204c10e97740a595a23c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Upstream-Status: Backport [https://github.com/LINBIT/drbd-9.0/commit/46e8e3f]

Backport patch to fix compile errors:

|   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
| 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

Signed-off-by: Kai Kang <kai.kang@windriver.com>

From 46e8e3fc31b651fb56ea38134dcf14382fc43000 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Wed, 3 Apr 2019 10:57:46 +0200
Subject: [PATCH] drbd: kbuild fix: use M=; don't forget addprefix $(obj)

Kernel build started to warn about using SUBDIRS instead of M,
and we don't support "very old" kernels anymore anyways.

Our list of dependencies for drbd_buildtag.c needs to depend on the
actual files $(obj)/*.o resulting from the build,
not on just the list of *.o names.

This apparently also fixes a build failure in opensuse build service for
tumbleweed when using make-4.2.1-7.5 against kernel 5.0.5-something.
---
 drbd/Kbuild   | 11 +++++------
 drbd/Makefile |  4 +---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drbd/Kbuild b/drbd/Kbuild
index 285f7a81..99228029 100644
--- a/drbd/Kbuild
+++ b/drbd/Kbuild
@@ -1,4 +1,5 @@
-obj-m := drbd.o drbd_transport_tcp.o
+obj-m += drbd.o drbd_transport_tcp.o
+# obj-$(CONFIG_BLK_DEV_DRBD)     += drbd.o drbd_transport_tcp.o
 
 clean-files := compat.h $(wildcard .config.$(KERNELVERSION).timestamp)
 
@@ -56,10 +57,8 @@ ifndef DISABLE_KREF_DEBUGGING_HERE
       drbd-y += kref_debug.o drbd_kref_debug.o
 endif
 
-$(patsubst %,$(obj)/%,$(drbd-y)): $(obj)/compat.h
-$(patsubst %,$(obj)/%,drbd_transport_tcp.o): $(obj)/compat.h
-
-obj-$(CONFIG_BLK_DEV_DRBD)     += drbd.o
+$(addprefix $(obj)/,$(drbd-y)): $(obj)/compat.h
+$(obj)/drbd_transport_tcp.o: $(obj)/compat.h
 
 # ======================================================================
 
@@ -124,7 +123,7 @@ endif
 # and not in e.g. dash. I'm too lazy to fix it to be compatible.
 SHELL=/bin/bash
 
-$(obj)/drbd_buildtag.c: $(filter-out drbd_buildtag.o,$(drbd-y))
+$(obj)/drbd_buildtag.c: $(addprefix $(obj)/,$(filter-out drbd_buildtag.o,$(drbd-y)))
 	@$(kecho) '  GEN     $@ $(echo-why)'
 	@set -e; exec > $@.new;							\
 	echo -e "/* automatically generated. DO NOT EDIT. */";			\
diff --git a/drbd/Makefile b/drbd/Makefile
index 5f768fc6..f9e8792a 100644
--- a/drbd/Makefile
+++ b/drbd/Makefile
@@ -102,9 +102,7 @@ else
 
   kbuild:
 	@rm -f .drbd_kernelrelease*
-    # previous to 2.6.6 (suse: 2.6.5-dunno), this should be:
-	$(MAKE) -C $(KDIR)  $(if $(O),O=$(O),) SUBDIRS=$(DRBDSRC) $(ARCH_UM) modules
-# $(MAKE) -C $(KDIR) M=$(DRBDSRC) $(ARCH_UM) modules
+	$(MAKE) -C $(KDIR)  $(if $(O),O=$(O),) M=$(DRBDSRC) $(ARCH_UM) modules
 	-mv .drbd_kernelrelease.new .drbd_kernelrelease
 	@echo -n "Memorizing module configuration ... "
 	@config=$$( (for x in $(KDIR)/.config $(O)/.config ; do \
-- 
2.20.0