From: John Hubbard <jhubbard@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>,
LKML <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<linux-kselftest@vger.kernel.org>,
John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH 2/2] selftests/vm: fix incorrect gcc invocation in some cases
Date: Mon, 14 Sep 2020 18:29:01 -0700 [thread overview]
Message-ID: <20200915012901.1655280-3-jhubbard@nvidia.com> (raw)
In-Reply-To: <20200915012901.1655280-1-jhubbard@nvidia.com>
Avoid accidental wrong builds, due to built-in rules working just a
little bit too well--but not quite as well as required for our situation
here.
In other words, "make userfaultfd" (for example) is supposed to fail to
build at all, because this Makefile only supports either "make" (all),
or "make /full/path". However, the built-in rules, if not suppressed,
will pick up CFLAGS and the initial LDLIBS (but not the target-specific
LDLIBS, because those are only set for the full path target!). This
causes it to get pretty far into building things despite using incorrect
values such as an *occasionally* incomplete LDLIBS value.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
tools/testing/selftests/vm/Makefile | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 9f2625bebf07..30873b19d04b 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -8,6 +8,18 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
# make invocations:
.DELETE_ON_ERROR:
+# Avoid accidental wrong builds, due to built-in rules working just a little
+# bit too well--but not quite as well as required for our situation here.
+#
+# In other words, "make userfaultfd" is supposed to fail to build at all,
+# because this Makefile only supports either "make" (all), or "make /full/path".
+# However, the built-in rules, if not suppressed, will pick up CFLAGS and the
+# initial LDLIBS (but not the target-specific LDLIBS, because those are only
+# set for the full path target!). This causes it to get pretty far into building
+# things despite using incorrect values such as an *occasionally* incomplete
+# LDLIBS.
+MAKEFLAGS += --no-builtin-rules
+
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
LDLIBS = -lrt
TEST_GEN_FILES = compaction_test
--
2.28.0
next prev parent reply other threads:[~2020-09-15 1:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 1:28 [PATCH 0/2] selftests/vm: fix some minor aggravating factors in the Makefile John Hubbard
2020-09-15 1:29 ` [PATCH 1/2] selftests/vm: fix false build success on the second and later attempts John Hubbard
2020-09-15 1:29 ` John Hubbard [this message]
2020-09-15 17:25 ` [PATCH 2/2] selftests/vm: fix incorrect gcc invocation in some cases Jason Gunthorpe
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=20200915012901.1655280-3-jhubbard@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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