From patchwork Sat May 4 12:28:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1931296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hf8+TlAy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VWnYq6qr7z1yb7 for ; Sat, 4 May 2024 22:49:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hf8+TlAy; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VWnYq3RHKz3fnv for ; Sat, 4 May 2024 22:49:35 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hf8+TlAy; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42e; helo=mail-pf1-x42e.google.com; envelope-from=npiggin@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VWn843Xq0z3cb1 for ; Sat, 4 May 2024 22:30:44 +1000 (AEST) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6f460e05101so115657b3a.1 for ; Sat, 04 May 2024 05:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714825843; x=1715430643; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5e7S6CmFvKeffkGPyTCOL8jP7a0oCwEqBFa0CpbZAAo=; b=hf8+TlAyWD7oN78LAHwEOa0ccmKFl1fB2tDxWXN5vkhMbzy92UBbpiy22aUBJrqzSG Nn01ISlIA6Ap4ysu6N6bA/WOpy91ATzB+oOii59BSOHWAA38sEPtokRVsOB8uxglLjCi YZ9lyM7pGQE2FHH+Te9H+MA7qOGzlnErxRRbvNBLmAMXiySbJofGwACWKUHxGmRCDYSs 7M5EMWFCS85ud+U/YOyGtyCRUdMSre0zDz1j9TQxhwmhvq8viZhAG6X6Lu0noRogKPMh xSVlwMYrfaViJNPANmfIp3KjVCAyK8G/HBzYMJOdGZ6EUS1KtIUWFNLG3ik944q0JcBx rjOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714825843; x=1715430643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5e7S6CmFvKeffkGPyTCOL8jP7a0oCwEqBFa0CpbZAAo=; b=bloatVe58wpry8pGURcHZxCW675IT1JvfELJf5A9OCF3VIMSyHpVa3Q+y8dq/Cn4pd NXWrSAPNtC6P9ghfs7iSE9M/ztr/LQfHjmThwhxFVAjbxda7gcYMsY7hKOzUqVdnXNe1 lThY5aVZjqFjni0rtA0F8ZC2J6y1Okdx8yUQmeDOM724NmfEusbj58Z0LaPyDaSw/Ume xeHKZPNsEAwPdE9dd3bU7NLZggwWW7zsN4pV+RvUNEFrUA4D8UGY0eWp63LdbgbCvQu5 GoUMGANd2O+qKKONCGPquhkTd++0UQ1Iw9GHKgQR0Z4lbZwiswXyOJLdY9MKRbfuRkPS wxeQ== X-Forwarded-Encrypted: i=1; AJvYcCUxF0BQ3JgE40d3pR8023nOU4Jr5kzYFbVf5oNxukJwoiD+i0SnrEDk8CzNN6cOhv1+Dcw8zP8KYX2PKnyhG/tq8JVdUZEMheJLPPr4rg== X-Gm-Message-State: AOJu0YwFZums6l8E/43+1Qi9x6qo67DWSjSDjgMH1tBvU66+IBAvjvWN OVx4ijjjjpoiGkM5RJBGZUQB77cKZfsM2DnFe4eSixvhQiL18MUFwMxuJA== X-Google-Smtp-Source: AGHT+IFPZkfPU8Egb2mh6EBzGgW9QChyXJexPKHvEKB5uBRSLxU0nzgY3U6aLmK8CozI1eiDyMOazA== X-Received: by 2002:a05:6a20:8420:b0:1a3:b187:f261 with SMTP id c32-20020a056a20842000b001a3b187f261mr12634372pzd.29.1714825842756; Sat, 04 May 2024 05:30:42 -0700 (PDT) Received: from wheely.local0.net (220-245-239-57.tpgi.com.au. [220.245.239.57]) by smtp.gmail.com with ESMTPSA id b16-20020a056a000a9000b006f4473daa38sm3480068pfl.128.2024.05.04.05.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 05:30:42 -0700 (PDT) From: Nicholas Piggin To: Thomas Huth Subject: [kvm-unit-tests PATCH v9 28/31] configure: Make arch_libdir a first-class entity Date: Sat, 4 May 2024 22:28:34 +1000 Message-ID: <20240504122841.1177683-29-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240504122841.1177683-1-npiggin@gmail.com> References: <20240504122841.1177683-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , linux-s390@vger.kernel.org, =?utf-8?q?Nico_B=C3=B6hr?= , Janosch Frank , kvm@vger.kernel.org, David Hildenbrand , linuxppc-dev@lists.ozlabs.org, Nicholas Piggin , Andrew Jones , Eric Auger , kvm-riscv@lists.infradead.org, kvmarm@lists.linux.dev, Paolo Bonzini , Claudio Imbrenda , Alexandru Elisei Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: Eric Auger Cc: Janosch Frank Cc: Laurent Vivier Cc: Nico Böhr Cc: Paolo Bonzini Cc: Thomas Huth 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 Signed-off-by: Nicholas Piggin --- 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 d744ec4dc..2b788d0c8 100755 --- a/configure +++ b/configure @@ -216,7 +216,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" @@ -284,8 +283,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 @@ -334,6 +335,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)!" @@ -344,6 +346,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= @@ -353,6 +356,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 @@ -415,10 +422,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