From: Michael Ellerman <mpe@ellerman.id.au>
To: Shuah Khan <shuahkh@osg.samsung.com>,
shuah@kernel.org, bamvor.zhangjian@huawei.com, mingo@kernel.org
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
tglx@linutronix.de, hpa@zytor.com, luto@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: lib.mk Fix individual test builds
Date: Fri, 03 Mar 2017 16:00:58 +1100 [thread overview]
Message-ID: <87d1dzhs39.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170301224623.16973-1-shuahkh@osg.samsung.com>
Shuah Khan <shuahkh@osg.samsung.com> writes:
> In commit a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT"), added
> support to generate compile targets in a user specified directory. OUTPUT
> variable controls the location which is undefined when tests are built in
> the test directory or with "make -C tools/testing/selftests/x86".
>
> make -C tools/testing/selftests/x86/
> make: Entering directory '/lkml/linux_4.11/tools/testing/selftests/x86'
> Makefile:44: warning: overriding recipe for target 'clean'
> ../lib.mk:51: warning: ignoring old recipe for target 'clean'
> gcc -m64 -o /single_step_syscall_64 -O2 -g -std=gnu99 -pthread -Wall single_step_syscall.c -lrt -ldl
> /usr/bin/ld: cannot open output file /single_step_syscall_64: Permission denied
> collect2: error: ld returned 1 exit status
> Makefile:50: recipe for target '/single_step_syscall_64' failed
> make: *** [/single_step_syscall_64] Error 1
> make: Leaving directory '/lkml/linux_4.11/tools/testing/selftests/x86'
>
> Same failure with "cd tools/testing/selftests/x86/;make" run.
>
> Fix this with a change to lib.mk to define OUTPUT to be the pwd when
> MAKELEVEL is 0. This covers both cases mentioned above.
>
> Reported-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> tools/testing/selftests/lib.mk | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index ce96d80..775c589 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -2,6 +2,10 @@
> # Makefile can operate with or without the kbuild infrastructure.
> CC := $(CROSS_COMPILE)gcc
>
> +ifeq (0,$(MAKELEVEL))
> +OUTPUT := $(shell pwd)
> +endif
I preferred my version which just used =? rather than checking
MAKELEVEL, but I don't mind that much.
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
prev parent reply other threads:[~2017-03-03 6:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 22:46 Shuah Khan
2017-03-03 5:00 ` Michael Ellerman [this message]
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=87d1dzhs39.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=bamvor.zhangjian@huawei.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=shuah@kernel.org \
--cc=shuahkh@osg.samsung.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®