From: Jan Kiszka <jan.kis...@siemens.com>

Switch to 'always-y' as suggested by 5.9.

For older kernels, we need to set 'always' to 'always-y'. This has to
happen conditionally in order to avoid warnings from 5.9 onward.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---

Changes in v2:
 - 'include $(ALWAYS_COMPAT_MK)' was missing in tools/Makefile

 Kbuild                              |  3 +++
 configs/Makefile                    |  6 ++++--
 hypervisor/Makefile                 |  6 ++++--
 hypervisor/arch/arm-common/Kbuild   |  2 ++
 hypervisor/arch/arm/Kbuild          |  2 +-
 hypervisor/arch/arm64/Kbuild        |  2 +-
 hypervisor/arch/x86/Kbuild          |  4 +++-
 inmates/lib/arm-common/Makefile.lib |  2 ++
 inmates/lib/arm/Makefile            |  2 +-
 inmates/lib/arm/Makefile.lib        |  2 +-
 inmates/lib/arm64/Makefile          |  2 +-
 inmates/lib/arm64/Makefile.lib      |  2 +-
 inmates/lib/x86/Makefile            |  2 +-
 inmates/lib/x86/Makefile.lib        |  4 +++-
 scripts/always-compat.mk            | 16 ++++++++++++++++
 tools/Makefile                      | 10 ++++++----
 16 files changed, 50 insertions(+), 17 deletions(-)
 create mode 100644 scripts/always-compat.mk

diff --git a/Kbuild b/Kbuild
index 0b25e26e..1808dc77 100644
--- a/Kbuild
+++ b/Kbuild
@@ -11,6 +11,9 @@
 # the COPYING file in the top-level directory.
 #
 
+ALWAYS_COMPAT_MK := $(src)/scripts/always-compat.mk
+export ALWAYS_COMPAT_MK
+
 INC_CONFIG_H = $(src)/include/jailhouse/config.h
 export INC_CONFIG_H
 
diff --git a/configs/Makefile b/configs/Makefile
index 1e59840e..31ca15a3 100644
--- a/configs/Makefile
+++ b/configs/Makefile
@@ -10,6 +10,8 @@
 # the COPYING file in the top-level directory.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 LINUXINCLUDE := -I$(src)/../hypervisor/arch/$(SRCARCH)/include \
@@ -25,12 +27,12 @@ OBJCOPYFLAGS := -O binary
 
 CONFIGS = $(shell cd $(src); ls $(SRCARCH)/*.c)
 
-always := $(CONFIGS:.c=.cell)
+always-y := $(CONFIGS:.c=.cell)
 
 targets += $(CONFIGS:.c=.o) $(CONFIGS:.c=.cell)
 
 DTS = $(shell cd $(src); ls $(SRCARCH)/dts/*.dts 2>/dev/null)
-always += $(DTS:.dts=.dtb)
+always-y += $(DTS:.dts=.dtb)
 targets += $(DTS:.dts=.dtb)
 
 # prevent deleting intermediate files which would cause rebuilds
diff --git a/hypervisor/Makefile b/hypervisor/Makefile
index 893ead42..b8377a33 100644
--- a/hypervisor/Makefile
+++ b/hypervisor/Makefile
@@ -16,6 +16,8 @@
 # Copyright (c) Linux kernel developers, 2014
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 LINUXINCLUDE := -I$(src)/arch/$(SRCARCH)/include \
@@ -87,12 +89,12 @@ ifeq ($(filter %/Makefile.clean,$(MAKEFILE_LIST)),)
 $(obj)/arch/$(SRCARCH): $(obj)/$(ASM_DEFINES_H)
 endif
 
-always :=
+always-y :=
 
 subdir-y := arch/$(SRCARCH)
 
 define BUILD_JAILHOUSE_template
-always += jailhouse$(1).bin
+always-y += jailhouse$(1).bin
 
 $$(obj)/arch/$$(SRCARCH)/lib$(1).a: $$(obj)/arch/$$(SRCARCH)
        @true
diff --git a/hypervisor/arch/arm-common/Kbuild 
b/hypervisor/arch/arm-common/Kbuild
index ab86eca6..9ddbc950 100644
--- a/hypervisor/arch/arm-common/Kbuild
+++ b/hypervisor/arch/arm-common/Kbuild
@@ -10,6 +10,8 @@
 # the COPYING file in the top-level directory.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 ccflags-$(CONFIG_JAILHOUSE_GCOV) += -fprofile-arcs -ftest-coverage
diff --git a/hypervisor/arch/arm/Kbuild b/hypervisor/arch/arm/Kbuild
index 2afc09c0..3d7bd614 100644
--- a/hypervisor/arch/arm/Kbuild
+++ b/hypervisor/arch/arm/Kbuild
@@ -12,7 +12,7 @@
 
 include $(src)/../arm-common/Kbuild
 
-always := lib.a
+always-y := lib.a
 
 # units initialization order as defined by linking order:
 # irqchip (common-objs-y), <generic units>
diff --git a/hypervisor/arch/arm64/Kbuild b/hypervisor/arch/arm64/Kbuild
index c34b0f32..6773714d 100644
--- a/hypervisor/arch/arm64/Kbuild
+++ b/hypervisor/arch/arm64/Kbuild
@@ -14,7 +14,7 @@
 
 include $(src)/../arm-common/Kbuild
 
-always := lib.a
+always-y := lib.a
 
 # units initialization order as defined by linking order:
 # irqchip (common-objs-y), <generic units>
diff --git a/hypervisor/arch/x86/Kbuild b/hypervisor/arch/x86/Kbuild
index eb1910fd..a6badcac 100644
--- a/hypervisor/arch/x86/Kbuild
+++ b/hypervisor/arch/x86/Kbuild
@@ -12,11 +12,13 @@
 # the COPYING file in the top-level directory.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 ccflags-$(CONFIG_JAILHOUSE_GCOV) += -fprofile-arcs -ftest-coverage
 
-always := lib-amd.a lib-intel.a
+always-y := lib-amd.a lib-intel.a
 
 common-objs-y := apic.o dbg-write.o entry.o setup.o control.o mmio.o iommu.o \
                 paging.o pci.o i8042.o vcpu.o efifb.o ivshmem.o
diff --git a/inmates/lib/arm-common/Makefile.lib 
b/inmates/lib/arm-common/Makefile.lib
index c13696f3..1beb08b1 100644
--- a/inmates/lib/arm-common/Makefile.lib
+++ b/inmates/lib/arm-common/Makefile.lib
@@ -36,6 +36,8 @@
 # THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 objs-y := ../string.o ../cmdline.o ../setup.o ../alloc.o ../uart-8250.o
 objs-y += ../printk.o ../pci.o
 objs-y += printk.o gic.o mem.o pci.o timing.o setup.o uart.o
diff --git a/inmates/lib/arm/Makefile b/inmates/lib/arm/Makefile
index ac01d89e..d0d00d0d 100644
--- a/inmates/lib/arm/Makefile
+++ b/inmates/lib/arm/Makefile
@@ -39,7 +39,7 @@
 include $(INMATES_LIB)/Makefile.lib
 include $(INMATES_LIB)/../arm-common/Makefile.lib
 
-always := lib.a inmate.lds
+always-y := lib.a inmate.lds
 
 lib-y := $(common-objs-y)
 lib-y += header.o
diff --git a/inmates/lib/arm/Makefile.lib b/inmates/lib/arm/Makefile.lib
index 0976f894..723ff6aa 100644
--- a/inmates/lib/arm/Makefile.lib
+++ b/inmates/lib/arm/Makefile.lib
@@ -45,7 +45,7 @@ LINUXINCLUDE += -I$(INMATES_LIB)/../arm-common/include
 
 define DECLARE_TARGETS =
  _TARGETS = $(1)
- always := $$(_TARGETS)
+ always-y := $$(_TARGETS)
  # $(NAME-y) NAME-linked.o NAME.bin
  targets += $$(foreach t,$$(_TARGETS:.bin=-y),$$($$t)) \
             $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
diff --git a/inmates/lib/arm64/Makefile b/inmates/lib/arm64/Makefile
index 2cc0c658..6b6b83b3 100644
--- a/inmates/lib/arm64/Makefile
+++ b/inmates/lib/arm64/Makefile
@@ -39,7 +39,7 @@
 include $(INMATES_LIB)/Makefile.lib
 include $(INMATES_LIB)/../arm-common/Makefile.lib
 
-always := lib.a inmate.lds
+always-y := lib.a inmate.lds
 
 lib-y := $(common-objs-y)
 lib-y += header.o
diff --git a/inmates/lib/arm64/Makefile.lib b/inmates/lib/arm64/Makefile.lib
index 0976f894..723ff6aa 100644
--- a/inmates/lib/arm64/Makefile.lib
+++ b/inmates/lib/arm64/Makefile.lib
@@ -45,7 +45,7 @@ LINUXINCLUDE += -I$(INMATES_LIB)/../arm-common/include
 
 define DECLARE_TARGETS =
  _TARGETS = $(1)
- always := $$(_TARGETS)
+ always-y := $$(_TARGETS)
  # $(NAME-y) NAME-linked.o NAME.bin
  targets += $$(foreach t,$$(_TARGETS:.bin=-y),$$($$t)) \
             $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
diff --git a/inmates/lib/x86/Makefile b/inmates/lib/x86/Makefile
index 40d3eba2..35f04161 100644
--- a/inmates/lib/x86/Makefile
+++ b/inmates/lib/x86/Makefile
@@ -38,7 +38,7 @@
 
 include $(INMATES_LIB)/Makefile.lib
 
-always := lib.a lib32.a
+always-y := lib.a lib32.a
 
 TARGETS := cpu-features.o excp.o header-common.o irq.o ioapic.o printk.o
 TARGETS += setup.o uart.o
diff --git a/inmates/lib/x86/Makefile.lib b/inmates/lib/x86/Makefile.lib
index 6190315b..872b7ce0 100644
--- a/inmates/lib/x86/Makefile.lib
+++ b/inmates/lib/x86/Makefile.lib
@@ -36,6 +36,8 @@
 # THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 KBUILD_CFLAGS += -m64 -mno-red-zone
@@ -43,7 +45,7 @@ LINUXINCLUDE += -I$(INMATES_LIB)/include
 
 define DECLARE_TARGETS =
  _TARGETS = $(1)
- always := $$(_TARGETS)
+ always-y := $$(_TARGETS)
  # $(NAME-y) NAME-linked.o NAME.bin
  targets += $$(foreach t,$$(_TARGETS:.bin=-y),$$($$t)) \
             $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
diff --git a/scripts/always-compat.mk b/scripts/always-compat.mk
new file mode 100644
index 00000000..a74f4df4
--- /dev/null
+++ b/scripts/always-compat.mk
@@ -0,0 +1,16 @@
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2020
+#
+# Authors:
+#  Jan Kiszka <jan.kis...@siemens.com>
+#  Benjamin Block <b...@mageta.org>
+#
+# This work is licensed under the terms of the GNU GPL, version 2.  See
+# the COPYING file in the top-level directory.
+#
+
+ifeq ($(shell expr \( $(VERSION) \* $$((0x100)) \+ $(PATCHLEVEL) \) \< 
$$((0x509))),1)
+always = $(always-y)
+endif
diff --git a/tools/Makefile b/tools/Makefile
index 8b4ebf14..66e88fac 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -10,6 +10,8 @@
 # the COPYING file in the top-level directory.
 #
 
+include $(ALWAYS_COMPAT_MK)
+
 -include $(GEN_CONFIG_MK)
 
 # includes installation-related variables and definitions
@@ -33,14 +35,14 @@ KBUILD_CFLAGS += $(call cc-option, -fno-pie)
 KBUILD_CFLAGS += $(call cc-option, -no-pie)
 
 BINARIES := jailhouse ivshmem-demo
-always := $(BINARIES)
+always-y := $(BINARIES)
 
 HAS_PYTHON_MAKO := \
        $(shell $(PYTHON) -c "from mako.template import Template" 2>/dev/null \
        && echo yes)
 
 ifeq ($(strip $(HAS_PYTHON_MAKO)), yes)
-always += jailhouse-config-collect
+always-y += jailhouse-config-collect
 HELPERS := jailhouse-config-collect
 
 else  # !HAS_PYTHON_MAKO
@@ -116,7 +118,7 @@ CFLAGS_jailhouse-gcov-extract.o     := 
-I$(src)/../hypervisor/include \
 LDFLAGS_jailhouse-gcov-extract := -lgcov -fprofile-arcs
 
 targets += jailhouse-gcov-extract.o
-always += jailhouse-gcov-extract
+always-y += jailhouse-gcov-extract
 
 $(obj)/jailhouse-gcov-extract: $(obj)/jailhouse-gcov-extract.o
        $(call if_changed,ld)
@@ -125,7 +127,7 @@ $(obj)/jailhouse-config-collect: 
$(src)/jailhouse-config-create $(src)/jailhouse
        $(call if_changed,gen_collect)
 
 targets += $(MAN8_PAGES)
-always +=  $(MAN8_PAGES)
+always-y +=  $(MAN8_PAGES)
 
 $(obj)/%.8: $(src)/%.8.in
        $(call if_changed,gen_man)
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/8a7dcd47-23bb-b52d-f1a5-be3cc7464028%40siemens.com.

Reply via email to