linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	linux-s390@vger.kernel.org, "Nico Böhr" <nrb@linux.ibm.com>,
	"Janosch Frank" <frankja@linux.ibm.com>,
	kvm@vger.kernel.org, "David Hildenbrand" <david@redhat.com>,
	linuxppc-dev@lists.ozlabs.org,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Andrew Jones" <andrew.jones@linux.dev>,
	"Eric Auger" <eric.auger@redhat.com>,
	kvm-riscv@lists.infradead.org, kvmarm@lists.linux.dev,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
	"Alexandru Elisei" <alexandru.elisei@arm.com>
Subject: [kvm-unit-tests PATCH v10 09/15] configure: Make arch_libdir a first-class entity
Date: Wed, 12 Jun 2024 15:23:14 +1000	[thread overview]
Message-ID: <20240612052322.218726-10-npiggin@gmail.com> (raw)
In-Reply-To: <20240612052322.218726-1-npiggin@gmail.com>

arch_libdir was brought in to improve the heuristic determination of
the lib/ directory based on arch and testdir names, but it did not
entirely clean that mess up.

Remove the arch_libdir->arch->testdir heuristic and just require
everybody sets arch_libdir correctly. Fail if the lib/arch or
lib/arch/asm directories can not be found.

Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Nico Böhr <nrb@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: kvmarm@lists.linux.dev
Cc: kvm-riscv@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 Makefile  |  2 +-
 configure | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 5b7998b79..7fe93dfd8 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ include config.mak
 VPATH = $(SRCDIR)
 
 libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm")
-ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR))
+ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR))
 OBJDIRS := $(ARCH_LIBDIRS)
 
 DESTDIR := $(PREFIX)/share/kvm-unit-tests/
diff --git a/configure b/configure
index db15e85d6..b93723142 100755
--- a/configure
+++ b/configure
@@ -217,7 +217,6 @@ fi
 arch_name=$arch
 [ "$arch" = "aarch64" ] && arch="arm64"
 [ "$arch_name" = "arm64" ] && arch_name="aarch64"
-arch_libdir=$arch
 
 if [ "$arch" = "riscv" ]; then
     echo "riscv32 or riscv64 must be specified"
@@ -285,8 +284,10 @@ fi
 
 if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then
     testdir=x86
+    arch_libdir=x86
 elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
     testdir=arm
+    arch_libdir=$arch
     if [ "$target" = "qemu" ]; then
         arm_uart_early_addr=0x09000000
     elif [ "$target" = "kvmtool" ]; then
@@ -335,6 +336,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
     fi
 elif [ "$arch" = "ppc64" ]; then
     testdir=powerpc
+    arch_libdir=ppc64
     firmware="$testdir/boot_rom.bin"
     if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then
         echo "You must provide endianness (big or little)!"
@@ -345,6 +347,7 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
     arch_libdir=riscv
 elif [ "$arch" = "s390x" ]; then
     testdir=s390x
+    arch_libdir=s390x
 else
     echo "arch $arch is not supported!"
     arch=
@@ -354,6 +357,10 @@ if [ ! -d "$srcdir/$testdir" ]; then
     echo "$srcdir/$testdir does not exist!"
     exit 1
 fi
+if [ ! -d "$srcdir/lib/$arch_libdir" ]; then
+    echo "$srcdir/lib/$arch_libdir does not exist!"
+    exit 1
+fi
 
 if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then
     ln -fs "$srcdir/$testdir/efi/run" $testdir-run
@@ -416,10 +423,11 @@ fi
 # link lib/asm for the architecture
 rm -f lib/asm
 asm="asm-generic"
-if [ -d "$srcdir/lib/$arch/asm" ]; then
-	asm="$srcdir/lib/$arch/asm"
-elif [ -d "$srcdir/lib/$testdir/asm" ]; then
-	asm="$srcdir/lib/$testdir/asm"
+if [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
+    asm="$srcdir/lib/$arch_libdir/asm"
+else
+    echo "$srcdir/lib/$arch_libdir/asm does not exist"
+    exit 1
 fi
 mkdir -p lib
 ln -sf "$asm" lib/asm
-- 
2.45.1


  parent reply	other threads:[~2024-06-12  5:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  5:23 [kvm-unit-tests PATCH v10 00/15] powerpc improvements Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 01/15] powerpc: Add facility to query TCG or KVM host Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 02/15] powerpc: Add atomics tests Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 03/15] powerpc: Add timebase tests Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 04/15] powerpc: Add MMU support Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 05/15] common/sieve: Support machines without MMU Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 06/15] powerpc: Add sieve.c common test Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 07/15] powerpc: add usermode support Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 08/15] powerpc: add pmu tests Nicholas Piggin
2024-06-18 15:20   ` Thomas Huth
2024-06-18 18:39   ` Thomas Huth
2024-06-25  1:56     ` Nicholas Piggin
2024-06-12  5:23 ` Nicholas Piggin [this message]
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 10/15] powerpc: Remove remnants of ppc64 directory and build structure Nicholas Piggin
2024-06-19  7:36   ` Thomas Huth
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 11/15] powerpc: gitlab CI update Nicholas Piggin
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status Nicholas Piggin
2024-06-12  7:26   ` Andrew Jones
2024-06-14  0:56     ` Nicholas Piggin
2024-06-17 14:12       ` Andrew Jones
2024-06-17 14:13   ` Andrew Jones
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 13/15] powerpc: Add a panic test Nicholas Piggin
2024-06-19  7:42   ` Thomas Huth
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 14/15] powerpc/gitlab-ci: Upgrade powerpc to Fedora 40 Nicholas Piggin
2024-06-19  7:35   ` Thomas Huth
2024-06-12  5:23 ` [kvm-unit-tests PATCH v10 15/15] powerpc/gitlab-ci: Enable more tests with " Nicholas Piggin
2024-06-19  7:44   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240612052322.218726-10-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=david@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvivier@redhat.com \
    --cc=nrb@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).