Received: by 10.213.65.68 with SMTP id h4csp237594imn; Mon, 26 Mar 2018 20:22:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELsZdCtRSM6/zQq3oT0DAFcJryw9+M1M4jZHkWWOjKjC0paUQXDeG9iUGTpYqYUF2rsO5fVx X-Received: by 10.98.211.211 with SMTP id z80mr34641366pfk.16.1522120951579; Mon, 26 Mar 2018 20:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522120951; cv=none; d=google.com; s=arc-20160816; b=CquQAxNZlJEdb9lVVODNMqfDeooFBDljm6SPE2jSOJWQuibiQOV35W+0YmIS4RNmoE 1BcDKUwopXKc+DWc5wxhf//hD0ZJLgd2an3NbL1Xz6NQ9IgY0lTsLj1cuqLjZViIbTiR 9xMEydwzbi071lDI5Od/SWE1BTkQyyWkbBA1hKb+b+PW+8tQ9+K6XkLI8EDiYR2/qdAY D+TOEGFxkCHLemrDe+c79etgILfzhjb66j4B8yt/x2v2gxpcN+n4y0mQ5oib/6dZ8zbH J0DuHH06RnykVJf/tNXyGILU9XFPPLUjAEZ2YjVYp56WDnBKxNfTKg1KNaqefz5yk/7N ZSDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Y4nyXF+kO1ahN6qtga2cINCv2mxEL93LTKmBLBlHCIY=; b=UuEfHbbfNBkkGXiomKaTurJcoGGfxy9FgpO8Dfvo5Zmdqk1vruM+3v60Qku1kWM2Sq 1wP/Tswe5zHzDRjQhI2eZkVjcSpnconyNTJyWtIzns/AEKVXyC6sLN9evxnCLToYIOOV BCZJOPochdUUmIjpmYvP2R1nRm0y4l5GiOuxyjg5H8lYY4vGuwMXHtRfe37P0O7Eddyf kIwD8YqjMDYrQzLxDqAHxIDxXlTlosiZDxcjf5eDE7BwX9YPQbAwcUkWejTbz+wdWLGU 1Xz2Zp2i1OcLDBEhpbb7KWky6j78ssr+lZj3qNucJ+VvqNJXsRde4ODTQDTR9Mdacudl CFcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si284499ple.451.2018.03.26.20.22.16; Mon, 26 Mar 2018 20:22:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752161AbeC0DV0 (ORCPT + 99 others); Mon, 26 Mar 2018 23:21:26 -0400 Received: from mga02.intel.com ([134.134.136.20]:63675 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbeC0DVU (ORCPT ); Mon, 26 Mar 2018 23:21:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2018 20:21:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,366,1517904000"; d="scan'208";a="215125708" Received: from gvt-dell.bj.intel.com (HELO gvt-dell-host.bj.intel.com) ([10.238.154.59]) by fmsmga005.fm.intel.com with ESMTP; 26 Mar 2018 20:21:19 -0700 From: changbin.du@intel.com To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH v2 3/4] kselftest: install sanitized kernel headers before compiling Date: Tue, 27 Mar 2018 11:11:33 +0800 Message-Id: <1522120294-24926-4-git-send-email-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522120294-24926-1-git-send-email-changbin.du@intel.com> References: <1522120294-24926-1-git-send-email-changbin.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changbin Du 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 --- 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; \ -- 2.7.4