public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Shuah Khan <shuah@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	 Justin Stitt <justinstitt@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Kees Cook <keescook@chromium.org>,
	Valentin Obst <kernel@valentinobst.de>,
	 linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH] selftests/binderfs: use the Makefile's rules, not Make's implicit rules
Date: Fri, 3 May 2024 11:10:38 +0200	[thread overview]
Message-ID: <20240503-glossar-notfall-bd7c234c2da7@brauner> (raw)
In-Reply-To: <20240503015820.76394-1-jhubbard@nvidia.com>

On Thu, May 02, 2024 at 06:58:20PM -0700, John Hubbard wrote:
> First of all, in order to build with clang at all, one must first apply
> Valentin Obst's build fix for LLVM [1]. Once that is done, then when
> building with clang, via:
> 
>     make LLVM=1 -C tools/testing/selftests
> 
> ...the following error occurs:
> 
>    clang: error: cannot specify -o when generating multiple output files
> 
> This is because clang, unlike gcc, won't accept invocations of this
> form:
> 
>     clang file1.c header2.h
> 
> While trying to fix this, I noticed that:
> 
> a) selftests/lib.mk already avoids the problem, and
> 
> b) The binderfs Makefile indavertently bypasses the selftests/lib.mk
> build system, and quitely uses Make's implicit build rules for .c files
> instead.
> 
> The Makefile attempts to set up both a dependency and a source file,
> neither of which was needed, because lib.mk is able to automatically
> handle both. This line:
> 
>     binderfs_test: binderfs_test.c
> 
> ...causes Make's implicit rules to run, which builds binderfs_test
> without ever looking at lib.mk.
> 
> Fix this by simply deleting the "binderfs_test:" Makefile target and
> letting lib.mk handle it instead.
> 
> [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/
> 
> Fixes: 6e29225af902 ("binderfs: port tests to test harness infrastructure")
> Cc: Christian Brauner <brauner@kernel.org>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>

  reply	other threads:[~2024-05-03  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  1:58 [PATCH] selftests/binderfs: use the Makefile's rules, not Make's implicit rules John Hubbard
2024-05-03  9:10 ` Christian Brauner [this message]
2024-05-03 19:28   ` Shuah Khan

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=20240503-glossar-notfall-bd7c234c2da7@brauner \
    --to=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhubbard@nvidia.com \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel@valentinobst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=shuah@kernel.org \
    /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