Skip to content

Commit 1ca8e8f

Browse files
authored
Merge pull request #1205 from joe-lawrence/atomic-replace-fixes
Makefile tweaks for handling non-replace kpatch building
2 parents edf6613 + a19c4ed commit 1ca8e8f

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

kmod/patch/Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
2-
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(PWD)
2+
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(PWD) CFLAGS_MODULE='$(CFLAGS_MODULE)'
33
LDFLAGS += $(KPATCH_LDFLAGS)
44

5-
# ppc64le kernel modules are expected to compile with the
6-
# -mcmodel=large flag. This enables 64-bit relocations
7-
# instead of a 32-bit offset from the TOC pointer.
8-
PROCESSOR = $(shell uname -m)
9-
ifeq ($(PROCESSOR), ppc64le)
10-
KBUILD_CFLAGS_MODULE += -mcmodel=large
11-
endif
12-
135
obj-m += $(KPATCH_NAME).o
146
ldflags-y += -T $(src)/kpatch.lds
157
targets += kpatch.lds

kpatch-build/kpatch-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ if grep -q "CONFIG_LIVEPATCH=y" "$CONFIGFILE" && (kernel_is_rhel || kernel_versi
849849
if [[ "$KLP_REPLACE" -eq 1 ]] ; then
850850
support_klp_replace || die "The kernel doesn't support klp replace"
851851
else
852-
export KBUILD_CFLAGS_MODULE="$KBUILD_CFLAGS_MODULE -DKLP_REPLACE_ENABLE=false"
852+
export CFLAGS_MODULE="$CFLAGS_MODULE -DKLP_REPLACE_ENABLE=false"
853853
fi
854854
else
855855
# No support for livepatch in the kernel. Kpatch core module is needed.

test/integration/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ local: slow
1010
remote: remote_slow
1111

1212
slow: clean
13-
./kpatch-test -d $(PATCH_DIR) $(PATCHES)
13+
./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) $(PATCHES)
1414

1515
quick: clean
16-
./kpatch-test -d $(PATCH_DIR) --quick $(PATCHES)
16+
./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) --quick $(PATCHES)
1717

1818
cached:
19-
./kpatch-test -d $(PATCH_DIR) --cached $(PATCHES)
19+
./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) --cached $(PATCHES)
2020

2121
vagrant: vagrant-quick
2222

0 commit comments

Comments
 (0)