configure: Check for KVM linker script support
PATCH v2 1/1 configure: Check for KVM linker script support
Some toolchains don't fully support the KVM linker scripts. Disable KVM tests if linker check fails in configure script.
Signed-off-by Martin Doucha <[email protected]>
---
Changes since v1:
- Set empty CFLAGS to avoid linking failure with -m32
configure.ac | 17 +++++++++++++++++ include/mk/features.mk.in | 3 +++ testcases/kernel/Makefile | 5 ++++- 3 files changed, 24 insertions(+), 1 deletion(-)
configure.ac +17 -0
@@ -397,6 +397,23 @@ LTP_CHECK_TASKSTATS test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC LTP_DETECT_HOST_CPU +AC_MSG_CHECKING([whether linker can handle KVM payloads]) +ltp_backup_ldflags="$LDFLAGS" +ltp_backup_flags="$[]_AC_LANG_PREFIX[]FLAGS" +LDFLAGS="-T ${srcdir}/testcases/kernel/kvm/linker/${HOST_CPU}.lds" +_AC_LANG_PREFIX[]FLAGS= +AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [ + AC_MSG_RESULT([yes]) + AC_SUBST([WITH_KVM_TESTSUITE],["yes"]) + ], + [ + AC_MSG_RESULT([no]) + AC_SUBST([WITH_KVM_TESTSUITE],["no"]) + ]) +_AC_LANG_PREFIX[]FLAGS="$ltp_backup_flags" +LDFLAGS="$ltp_backup_ldflags" + AC_OUTPUT cat << EOF
include/mk/features.mk.in +3 -0
@@ -52,3 +52,6 @@ WITH_REALTIME_TESTSUITE := no else WITH_REALTIME_TESTSUITE := @WITH_REALTIME_TESTSUITE@ endif + +# Enable testcases/kernel/kvm compile and install? +WITH_KVM_TESTSUITE := @WITH_KVM_TESTSUITE@
testcases/kernel/Makefile +4 -1
@@ -29,7 +29,6 @@ SUBDIRS += connectors \ io \ ipc \ irq \ - kvm \ logging \ mem \ numa \
@@ -45,6 +44,10 @@ ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) SUBDIRS += power_management endif +ifeq ($(WITH_KVM_TESTSUITE),yes) +SUBDIRS += kvm +endif + endif ifeq ($(ANDROID),1)
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Applied, thanks.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp