From: Shuah Khan <shuah@kernel.org>
To: changbin.du@intel.com
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <shuahkh@osg.samsung.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH v2 3/4] kselftest: install sanitized kernel headers before compiling
Date: Tue, 27 Mar 2018 15:25:41 -0600 [thread overview]
Message-ID: <b6b9600d-5698-0b7e-7865-b77172510098@kernel.org> (raw)
In-Reply-To: <1522120294-24926-4-git-send-email-changbin.du@intel.com>
On 03/26/2018 09:11 PM, changbin.du@intel.com wrote:
> From: Changbin Du <changbin.du@intel.com>
>
> There are test cases that require kernel headers. Some of this
> cases has put the dependency check into individual Makefiles,
> but some not. Let's sync the kernel headers at top level
> Makefile to avoid compiling errors like below.
>
> make[1]: Entering directory '/home/changbin/work/linux/tools/testing/selftests/membarrier'
> gcc -g -I../../../../usr/include/ membarrier_test.c -o /home/changbin/work/linux/tools/testing/selftests/membarrier//membarrier_test
> membarrier_test.c: In function ‘test_membarrier_global_success’:
> membarrier_test.c:64:12: error: ‘MEMBARRIER_CMD_GLOBAL’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_GLOBAL, flags = 0;
> ^
> membarrier_test.c:64:12: note: each undeclared identifier is reported only once for each function it appears in
> membarrier_test.c: In function ‘test_membarrier_private_expedited_fail’:
> membarrier_test.c:80:12: error: ‘MEMBARRIER_CMD_PRIVATE_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_register_private_expedited_success’:
> membarrier_test.c:103:12: error: ‘MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_private_expedited_success’:
> membarrier_test.c:120:12: error: ‘MEMBARRIER_CMD_PRIVATE_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_private_expedited_sync_core_fail’:
> membarrier_test.c:137:12: error: ‘MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_register_private_expedited_sync_core_success’:
> membarrier_test.c:160:12: error: ‘MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_private_expedited_sync_core_success’:
> membarrier_test.c:177:12: error: ‘MEMBARRIER_CMD_PRIVATE_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_register_global_expedited_success’:
> membarrier_test.c:194:12: error: ‘MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier_global_expedited_success’:
> membarrier_test.c:211:12: error: ‘MEMBARRIER_CMD_GLOBAL_EXPEDITED’ undeclared (first use in this function)
> int cmd = MEMBARRIER_CMD_GLOBAL_EXPEDITED, flags = 0;
> ^
> membarrier_test.c: In function ‘test_membarrier’:
> membarrier_test.c:253:15: error: ‘MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE’ undeclared (first use in this function)
> if (status & MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) {
> ^
> membarrier_test.c: In function ‘test_membarrier_query’:
> membarrier_test.c:296:14: error: ‘MEMBARRIER_CMD_GLOBAL’ undeclared (first use in this function)
> if (!(ret & MEMBARRIER_CMD_GLOBAL)) {
> ^
> ../lib.mk:109: recipe for target '/home/changbin/work/linux/tools/testing/selftests/membarrier//membarrier_test' failed
> make[1]: *** [/home/changbin/work/linux/tools/testing/selftests/membarrier//membarrier_test] Error 1
> make[1]: Leaving directory '/home/changbin/work/linux/tools/testing/selftests/membarrier'
>
> Signed-off-by: Changbin Du <changbin.du@intel.com>
> ---
> tools/testing/selftests/Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index 7916aa2..656b674 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -67,13 +67,16 @@ ifndef BUILD
> endif
>
> export BUILD
> -all:
> +all: headers_install
> @for TARGET in $(TARGETS); do \
> BUILD_TARGET=$$BUILD/$$TARGET; \
> mkdir $$BUILD_TARGET -p; \
> make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\
> done;
>
> +headers_install:
> + make -C ../../../ headers_install
> +
> run_tests: all
> @for TARGET in $(TARGETS); do \
> BUILD_TARGET=$$BUILD/$$TARGET; \
>
Sorry. headers_install should not be dependency to run "make kselftest".
Also this will compromise "make O=" use-case where objects are
built in a separate directory to keep the repo clean.
Individual test dependencies should be handled by test Makefiles.
thanks,
-- Shuah
next prev parent reply other threads:[~2018-03-27 21:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 3:11 [PATCH v2 0/4] selftests: fix compiling issues changbin.du
2018-03-27 3:11 ` [PATCH v2 1/4] selftests/Makefile: append a slash to env variable OUTPUT changbin.du
2018-03-27 21:19 ` Shuah Khan
2018-03-28 1:45 ` Du, Changbin
2018-03-27 3:11 ` [PATCH v2 2/4] selftests/gpio: fix paths in Makefile changbin.du
2018-03-27 3:11 ` [PATCH v2 3/4] kselftest: install sanitized kernel headers before compiling changbin.du
2018-03-27 21:25 ` Shuah Khan [this message]
2018-03-27 3:11 ` [PATCH v2 4/4] selftests/bpf: fix compiling errors changbin.du
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=b6b9600d-5698-0b7e-7865-b77172510098@kernel.org \
--to=shuah@kernel.org \
--cc=changbin.du@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuahkh@osg.samsung.com \
/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®