Received: by 10.213.65.68 with SMTP id h4csp1079516imn; Tue, 27 Mar 2018 14:27:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xJtI967I4PqZVueMAbBg25l8TosmbJ7vPpn5RMtWvbmJpUaelLwugG9Jn+xy7NyEiO1QL X-Received: by 10.101.92.2 with SMTP id u2mr622666pgr.317.1522186043288; Tue, 27 Mar 2018 14:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522186043; cv=none; d=google.com; s=arc-20160816; b=s8y+sOEEdOMTF2fa+NuPny+0M68uN3/eEXSnPPUZehZ1wN0XGVWDDz4Ly4WBRDSNPe UUcx8mOzOIb0qNe4cn+/NozxBG2l8mlxavuO0CM47BtPFmnpkQwOQ0ZC7j59sGcf/UUy Gia0QZDbM3DjzFOPLPv/WO0ScqnLxKNS6EZIM1fW1BfK0OeyMGnIlMIJB+Ssi/IUETC+ j3QmKJK7jtUqoYGF3atd24VY5pamwfcjnGIPFC7tMVqfs93GGHpoKxDkZs/oISE9G5IV OIsyjwXgZN21HpqePIgrNeC2LZ+VatMcznKZivzy504tkROmnlBWBVrZJrbHtAveK4tZ QrwQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=XHcF3fSDqR4Bfawcg1iOljnCXGkqB75g8m4Gf+z2/vY=; b=JJI6293zn+GKCgMdDhrbq43wDiBX00YHinAYLap4Nwbm18ApDjt+XpqU/s+yXlk3e8 CWTXKtUz82cvfWXokrLNvUuPTqmkomVowHwFDExVQNP0XBkAfvyw9f7dw4Ti2a+jSrLe yPv7g2ce9xj/5J0insKIKFOniM0OO9+oZ7BlqhEPMYfJcFczUwCd50NOaOWkYLg0KxiD V2JCep7TB73Yt4hdyMn6PqGCkPVyIRhYtMmxscfDLORUwZvWH3KCz90NYEgjFiIvL3dP jI4ILIqs7B5F6vqMEvED0IirchdGoizz3k9+uopxRE1O9uwa8cRA1K/efY0bN9A4E90V ed5Q== 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 t187si1610202pfb.2.2018.03.27.14.27.08; Tue, 27 Mar 2018 14:27:23 -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 S1752090AbeC0VZv (ORCPT + 99 others); Tue, 27 Mar 2018 17:25:51 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:37775 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbeC0VZt (ORCPT ); Tue, 27 Mar 2018 17:25:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id CE76CC0F10; Tue, 27 Mar 2018 21:25:48 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo01-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fJgl4u-3tZwB; Tue, 27 Mar 2018 21:25:48 +0000 (UTC) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 34DAAC05B5; Tue, 27 Mar 2018 21:25:41 +0000 (UTC) Subject: Re: [PATCH v2 3/4] kselftest: install sanitized kernel headers before compiling To: changbin.du@intel.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Shuah Khan References: <1522120294-24926-1-git-send-email-changbin.du@intel.com> <1522120294-24926-4-git-send-email-changbin.du@intel.com> From: Shuah Khan Message-ID: Date: Tue, 27 Mar 2018 15:25:41 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522120294-24926-4-git-send-email-changbin.du@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/26/2018 09:11 PM, changbin.du@intel.com wrote: > 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; \ > 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