Re: [PATCH 4.4 020/115] userfaultfd: selftest: vm: allow to build in vm/ directory

From: Ben Hutchings
Date: Thu Jan 11 2018 - 14:42:59 EST


On Mon, 2017-12-18 at 16:48 +0100, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.ÂÂIf anyone has any objections, please let me know.
>
> ------------------
>
> From: Andrea Arcangeli <aarcange@xxxxxxxxxx>
>
>
> [ Upstream commit 46aa6a302b53f543f8e8b8e1714dc5e449ad36a6 ]
>
> linux/tools/testing/selftests/vm $ make
>
> Â gcc -Wall -I ../../../../usr/includeÂÂÂÂÂcompaction_test.c -lrt -o /compaction_test
> Â /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot open output file /compaction_test: Permission denied
> Â collect2: error: ld returned 1 exit status
> Â make: *** [../lib.mk:54: /compaction_test] Error 1
>
> Since commit a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
> selftests/vm build fails if run from the "selftests/vm" directory, but
> it works in the selftests/ directory.ÂÂIt's quicker to be able to do a
> local vm-only build after a tree wipe and this patch allows for it
> again.

That commit is not included in 4.4 and nothing under
tools/testing/selftests uses the OUTPUT variable that this defines.

Ben.

[...]
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -1,5 +1,9 @@
> Â# Makefile for vm selftests
> Â
> +ifndef OUTPUT
> +ÂÂOUTPUT := $(shell pwd)
> +endif
> +
> ÂCFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
> ÂBINARIES = compaction_test
> ÂBINARIES += hugepage-mmap
>
>
>
--
Ben Hutchings
Software Developer, Codethink Ltd.