Skip to content

Commit 34d1091

Browse files
johnhubbardtorvalds
authored andcommitted
selftests/vm: fix incorrect gcc invocation in some cases
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Jason Gunthorpe <jgg@ziepe.ca> Link: https://lkml.kernel.org/r/20200915012901.1655280-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent efc9511 commit 34d1091

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/testing/selftests/vm/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
88
# make invocations:
99
.DELETE_ON_ERROR:
1010

11+
# Avoid accidental wrong builds, due to built-in rules working just a little
12+
# bit too well--but not quite as well as required for our situation here.
13+
#
14+
# In other words, "make userfaultfd" is supposed to fail to build at all,
15+
# because this Makefile only supports either "make" (all), or "make /full/path".
16+
# However, the built-in rules, if not suppressed, will pick up CFLAGS and the
17+
# initial LDLIBS (but not the target-specific LDLIBS, because those are only
18+
# set for the full path target!). This causes it to get pretty far into building
19+
# things despite using incorrect values such as an *occasionally* incomplete
20+
# LDLIBS.
21+
MAKEFLAGS += --no-builtin-rules
22+
1123
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
1224
LDLIBS = -lrt
1325
TEST_GEN_FILES = compaction_test

0 commit comments

Comments
 (0)