Skip to contentSkip to conversation

meson fixups for check-tcg/softfloat

PATCH In review Alex Bennée 2 participants 4 messages Jan 26, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

cover meson fixups for check-tcg/softfloat

Hi,

These 2 patches build on Phillipe's meson clean-ups to stop breakage occurring with --disable-tcg builds.

Based-on: [email protected]

Alex Bennée (2):
scripts/mtest2make.py: export all-%s-targets variable and use it tests/Makefile.include: don't use TARGET_DIRS for check-tcg

 Makefile               | 3 +++
 scripts/mtest2make.py  | 1 +
 tests/Makefile.include | 9 ++++-----
 3 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 scripts/mtest2make.py: export all-%s-targets variable and use it

There are some places where the conditional makefile support is the simplest solution. Now we don't expose CONFIG_TCG as a variable create a new one that can be checked for the check-help output.

As check-tcg is a PHONY target we re-use check-softfloat to gate that as well.

---
 scripts/mtest2make.py  | 1 +
 tests/Makefile.include | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
scripts/mtest2make.py +1 -0
index 25ee6887cf..cbbcba100d 100644
@@ -110,6 +110,7 @@ def emit_suite(name, suite, prefix):
     print('ifneq ($(filter %s %s, $(MAKECMDGOALS)),)' % (target, prefix))
     print('.tests += $(.test.$(SPEED).%s)' % (target, ))
     print('endif')
+    print('all-%s-targets += %s' % (prefix, target))
 
 targets = {t['id']: [os.path.relpath(f) for f in t['filename']]
            for t in introspect['targets']}
tests/Makefile.include +1 -1
index 3a0524ce74..3ce8b03f34 100644
@@ -12,7 +12,7 @@ check-help:
 	@echo " $(MAKE) check-speed          Run qobject speed tests"
 	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
 	@echo " $(MAKE) check-block          Run block tests"
-ifeq ($(CONFIG_TCG),y)
+ifneq ($(filter $(all-check-targets), check-softfloat),)
 	@echo " $(MAKE) check-tcg            Run TCG tests"
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
 endif
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 tests/Makefile.include: don't use TARGET_DIRS for check-tcg

In reply to Alex Bennée

TARGET_DIRS reflects what we wanted to configure which in the normal case is all our targets. However once meson has pared-down our target list due to missing features we need to check the final list of ninja-targets. This prevents check-tcg barfing on a --disable-tcg build.

---
 Makefile               | 3 +++
 tests/Makefile.include | 7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)
Makefile +3 -0
index a380bbfa12..a25b2a5431 100644
@@ -174,6 +174,9 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
 endif
 endif
 
+# Build up our target list from the filtered list of ninja targets
+TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
+
 # Force configure to re-run if the API symbols are updated
 ifeq ($(CONFIG_PLUGIN),y)
 config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
tests/Makefile.include +3 -4
index 3ce8b03f34..ee438f8d6d 100644
@@ -41,10 +41,9 @@ SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
 SPEED = quick
 
 # Per guest TCG tests
-
-BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
-CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
-RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
+BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGETS))
+CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGETS))
+RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGETS))
 
 # Probe for the Docker Builds needed for each build
 $(foreach PROBE_TARGET,$(TARGET_DIRS), 				\
Signature · 1 line
2.20.1
Acked-by on v1 2/2
#3 lore raw

Re: [PATCH v1 2/2] tests/Makefile.include: don't use TARGET_DIRS for check-tcg

Quoted 18 lines · Alex Bennée

TARGET_DIRS reflects what we wanted to configure which in the normal case is all our targets. However once meson has pared-down our target list due to missing features we need to check the final list of ninja-targets. This prevents check-tcg barfing on a --disable-tcg build.

---
  Makefile               | 3 +++
  tests/Makefile.include | 7 +++----
  2 files changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index a380bbfa12..a25b2a5431 100644

Makefile ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),) · line 178

Quoted 5 lines
Makefile +2 -0
@@ -174,6 +174,9 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
  endif
  endif
 
+# Build up our target list from the filtered list of ninja targets
+TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))

I wouldn't mind having this directly in tests/Makefile.include, if you don't expect any other uses.

Apart from this nit, series

Paolo

Quoted 22 lines
Makefile +0 -0
  # Force configure to re-run if the API symbols are updated
  ifeq ($(CONFIG_PLUGIN),y)
  config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
tests/Makefile.include +3 -4
index 3ce8b03f34..ee438f8d6d 100644
@@ -41,10 +41,9 @@ SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
  SPEED = quick
 
  # Per guest TCG tests
-
-BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
-CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
-RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
+BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGETS))
+CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGETS))
+RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGETS))
 
  # Probe for the Docker Builds needed for each build
  $(foreach PROBE_TARGET,$(TARGET_DIRS), 				\