From patchwork Sat Dec 2 15:51:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 120427 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2510001qgn; Sat, 2 Dec 2017 08:24:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMZqtS8gyNnoTvPi7EL2JST3b6Q1NozDVwJuVxHk2SFNV0qcCX3gebct2GcHQwX2fZOzi2zO X-Received: by 10.101.81.73 with SMTP id g9mr9377215pgq.137.1512231860421; Sat, 02 Dec 2017 08:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512231860; cv=none; d=google.com; s=arc-20160816; b=UHPNwcrTsx2S/Lwx4kHOzM5QfDsHo0vKxHEC71zW5OdKojYWSdJ8R/I7nkvFNT0jgC fyyrWLlo/yfKVWj6QySaxtbUpHJm19gVLik6PDwm/useHBrUjLmyO9D52w+yFnhTXSY1 CbZH3Mgrn5YKHNtHcb15ARJ+UqP2gCvyRkq+Xrp2kYdc1Pr8GZKIJpm+VymZdSEU5KPS jwsLmJ4+EugKyyiJtcUfD+FmrwZnmImRVOovafygjm8eLElHB+sb/uRiuSDjzQon1983 r89VhW2aaYMe3ETVx8XjT81zc7TJ0kQc19xJhCqt+bJM2IjOWpwgo9w+1pqYd55V1cjO 1LuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=dCS9pOP5Z/PBw1NRRuUu630lu22UdqyZSYV0xFJLTcU=; b=WFcShSL8L0Lz/J+qfpcRy3WYEVHhqCSq1utGPy9L6M4gKK81FPP/oJ6rlZQzAEJMam eoKmcKzXm2O99dtIyZ5lEWbMXCfOo1CLwZ22+VZRGIKjh33bfttfZGjQ+r914649IRO5 ZOaBdfpUKP6uMYIjk85Ts5mlrlnuBqo+px77VT3SLXquof7RQPezhXa/zHQWIwmum9gB 9fRHet5y1ANQEQKcXzR1t1yzlj6fcuUtcwa9vzdfXUxMz3fEJ7E1CwriTRhtIC6WhqMs CmKs1IFq4hdHneXs/HdDsC/WMxCrun2mTmDE8O1ZDB0enx1GUYv6hua3Crk8KR0NlryO DtAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=X/csYORZ; dkim=fail header.i=@verizon.com header.s=corp header.b=PssSleej; dkim=fail header.i=@verizon.com header.s=corp header.b=kZGA0YUv; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si6572513pgq.711.2017.12.02.08.24.19; Sat, 02 Dec 2017 08:24:20 -0800 (PST) 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; dkim=fail header.i=@verizon.com header.s=corp header.b=X/csYORZ; dkim=fail header.i=@verizon.com header.s=corp header.b=PssSleej; dkim=fail header.i=@verizon.com header.s=corp header.b=kZGA0YUv; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbdLBPvy (ORCPT + 28 others); Sat, 2 Dec 2017 10:51:54 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:18051 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbdLBPvr (ORCPT ); Sat, 2 Dec 2017 10:51:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229907; x=1543765907; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=A6YhbVxqMNm+4TI2LUXC9q0Lko6s8VDw3iCv8FGPeKI=; b=X/csYORZu/Rb8eOYSTIKcKGkkhDQG4WFAL0asCn2EAkGfu1ByjFhrwXm DUybW25SMehMtKEroKzUvBhZnZEd0nGYCP8PwkV/h+/MSex5xmRzdM4lr 6Qr9Nvs9140oNQw/hhfVp0VPEa7vpAFC4DHR9BKwNk/Uw0HK+C7zvJmeZ k=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 02 Dec 2017 15:51:46 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 15:51:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229877; x=1543765877; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=A6YhbVxqMNm+4TI2LUXC9q0Lko6s8VDw3iCv8FGPeKI=; b=PssSleej4EHyq+qEReqWhkD+Qhtwjk1RXebsduCZ4N8ZUqLuJMoeCD2G TYP/rVOmZVul+N/N1oF1EpNrot6wOLpz/LUdc+geQjKBx7Ymbaunc5+lT XlYmvXSditGCDWpgz5E6Ta1AFbRvw94p9lP8ppwT/2XjFrZRLCmUEvmDX M=; Received: from endeavour.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.163]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 10:51:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229877; x=1543765877; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=A6YhbVxqMNm+4TI2LUXC9q0Lko6s8VDw3iCv8FGPeKI=; b=kZGA0YUv9ZJHqwvp1xFh1mRg6wIbtOBYEBjKRZNVO650N3oYH0Hvgiwl pRCto8bx8UwMfP87B30zxeEnwwN+mBmQnm8swYh4nSjv6PPelOzXPD4rZ z0aeNLKP1baB2RtzB7F4i6/UYD2eG2hTsGqegOrIG7Z3xgA9ydLwZEeOI k=; From: alexander.levin@verizon.com Cc: Masahiro Yamada , alexander.levin@verizon.com X-Host: endeavour.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 02 Dec 2017 15:51:16 +0000 Received: from tbwexch06apd.uswin.ad.vzwcorp.com (153.114.162.30) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 2 Dec 2017 10:51:16 -0500 Received: from OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) by tbwexch06apd.uswin.ad.vzwcorp.com (153.114.162.30) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 10:51:16 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 09:51:15 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sat, 2 Dec 2017 09:51:15 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 04/64] kbuild: pkg: use --transform option to prefix paths in tar Thread-Topic: [PATCH AUTOSEL for 4.14 04/64] kbuild: pkg: use --transform option to prefix paths in tar Thread-Index: AQHTa4ViAQoMR03jDEyiKkdOmlm8AQ== Date: Sat, 2 Dec 2017 15:51:14 +0000 Message-ID: <20171202155101.7573-4-alexander.levin@verizon.com> References: <20171202155101.7573-1-alexander.levin@verizon.com> In-Reply-To: <20171202155101.7573-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 2dbc644ac62bbcb9ee78e84719953f611be0413d ] For rpm-pkg and deb-pkg, a source tar file is created. All paths in the archive must be prefixed with the base name of the tar so that everything is contained in the directory when you extract it. Currently, scripts/package/Makefile uses a symlink for that, and removes it after the tar is created. If you terminate the build during the tar creation, the symlink is left over. Then, at the next package build, you will see a warning like follows: ln: '.' and 'kernel-4.14.0+/.' are the same file It is possible to fix it by adding -n (--no-dereference) option to the "ln" command, but a cleaner way is to use --transform option of "tar" command. This option is GNU extension, but it should not hurt to use it in the Linux build system. The 'S' flag is needed to exclude symlinks from the path fixup. Without it, symlinks in the kernel are broken. Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/package/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 73f9f3192b9f..2b4aa4c19b21 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -39,10 +39,9 @@ if test "$(objtree)" != "$(srctree)"; then \ false; \ fi ; \ $(srctree)/scripts/setlocalversion --save-scmversion; \ -ln -sf $(srctree) $(2); \ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ - $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ -rm -f $(2) $(objtree)/.scmversion + --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \ +rm -f $(objtree)/.scmversion # rpm-pkg # --------------------------------------------------------------------------- From patchwork Sat Dec 2 15:51:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 120429 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2512188qgn; Sat, 2 Dec 2017 08:27:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMayqHfEXGyxpfBnDyrfVSlmZ6D/xhRn1XFpgD9oXuPQpa7tFht54p1doxIVFs+bOrcHphHf X-Received: by 10.99.127.25 with SMTP id a25mr9198269pgd.10.1512232034569; Sat, 02 Dec 2017 08:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512232034; cv=none; d=google.com; s=arc-20160816; b=pqgZgZNPw4dR14qZmc5fy4fiRmBPNsEQLjHR2Rp/UcBeRGHE++HMv7nqBjBV6QmNJA 16nOWn+hO1SbRYbboawb8plrmTk8T0g6jqtTNWNI8/ILQI5t/zsJmBn8sgAtNrzI/GH4 hlCJzKpIW/HP+OKw4G4Xxiq30Nak6VYHTiap53Y7zfqkCs4b8afHf5ppLFHRrUHKGgSV 1pUf4apZwBF7BXOT8t4R+L1L3//nMW+dd2T4qPHCnctsGjRPIFRNXMiSvsNOUMR+FtvP TqoaRcGFchxFTzAzyaYsRdcab6dmcLHK8TyB9lTuJpRwOJeP7XBTLzYxwEidAhfQUbpM 4X0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=UqJqfzA4vPu9A9Dcssw75UUXPNjwCNuTLmodG6XYUyA=; b=v9e2bNaonyluWMsUvTIoGxRi0yRDZvYkZUBFhRF1SW33Xsxo8jVZerIgg5qmo7M6wl z4yYptjAdN9kKZ/7Xm/+uOuawgEMw3N6DYkXL3fA7q/WWCCLJmzfkDtXBChljYCtuI4q hdc62fc1eELJWwDHMrnSn6phz4cmc7mL+2uyd02ed/2IXme/AMTJIslqDHpLUB1wjjxl ghpKXFM8MM07HZXIO2FkGvysZhCLml3D0B5H2xbm+RrllGk6fQWgfGdrBCuYStvmcAsw e+OuK79KaosXBcLMOJbKTeG8j3SyAFc6eCV524gRB74ltWepPmMbnFkuhSGp5yrLZxd5 Oj0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=HHIj93e4; dkim=fail header.i=@verizon.com header.s=corp header.b=C56PaSJ1; dkim=fail header.i=@verizon.com header.s=corp header.b=pZj/nDSh; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si6699943plr.754.2017.12.02.08.27.14; Sat, 02 Dec 2017 08:27:14 -0800 (PST) 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; dkim=fail header.i=@verizon.com header.s=corp header.b=HHIj93e4; dkim=fail header.i=@verizon.com header.s=corp header.b=C56PaSJ1; dkim=fail header.i=@verizon.com header.s=corp header.b=pZj/nDSh; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218AbdLBQ1M (ORCPT + 28 others); Sat, 2 Dec 2017 11:27:12 -0500 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:25146 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbdLBPvs (ORCPT ); Sat, 2 Dec 2017 10:51:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229908; x=1543765908; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QtjiuoNoGIY+sE+mYllZ9oRmxSTMLWzD4tZN3A4u5cs=; b=HHIj93e4Kldz/3vECHZm5SGTiMtOEygnp8MEwM/5/kYENM8vw8Tz7jnr 81M3K5ZHtlVwKrFChTyR8WOuPQVzQ0ZiGj+O3fhT9vWJUYPev4+JwlVvK PS1BtIQDF+XUfu8Q+3GqZnR//kExKnv3DISSkoPAlacvGeK3hn7yZTJnS Q=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 02 Dec 2017 15:51:46 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 15:51:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229877; x=1543765877; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QtjiuoNoGIY+sE+mYllZ9oRmxSTMLWzD4tZN3A4u5cs=; b=C56PaSJ15oO4bgDji4hkjIM/xv8FacYY6KN52K1w8bVrw4ZoYd5MEtau 6toRvlpt8sekfSuy/7qkXGiaqqLg4fhi6cXvOgYOF+2NhhJ2a8JPWQMWS iPHBFCg/qpEfS6Xy5o5UoX/rZKDBGu03xpbvIZ5vweChKbIAHp/YfFn/C 8=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 10:51:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229877; x=1543765877; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=QtjiuoNoGIY+sE+mYllZ9oRmxSTMLWzD4tZN3A4u5cs=; b=pZj/nDShYa6BcEMt8t6NKuz8L3CwU/gedpYkYytBWn4hXuj6PgVtr+C8 01Ot8kkkZadQeP6wl8imk1/4PZSgX6G0BPtlzXVU8+ChCp4AI3XSOgPrz H50m7zdOVtufgWSZJKb5FiThO1Z4OyclI/4W/byyZMJ/2wD72oSZvpCvr E=; From: alexander.levin@verizon.com Cc: Masahiro Yamada , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh001.uswin.ad.vzwcorp.com ([10.144.218.43]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 02 Dec 2017 15:51:17 +0000 Received: from tbwexch28apd.uswin.ad.vzwcorp.com (153.114.162.52) by OHTWI1EXH001.uswin.ad.vzwcorp.com (10.144.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 2 Dec 2017 10:51:17 -0500 Received: from OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) by tbwexch28apd.uswin.ad.vzwcorp.com (153.114.162.52) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 10:51:16 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 09:51:15 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sat, 2 Dec 2017 09:51:16 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 05/64] coccinelle: fix parallel build with CHECK=scripts/coccicheck Thread-Topic: [PATCH AUTOSEL for 4.14 05/64] coccinelle: fix parallel build with CHECK=scripts/coccicheck Thread-Index: AQHTa4Vi0cTENhT7Z0mHWW1nI7lg3g== Date: Sat, 2 Dec 2017 15:51:15 +0000 Message-ID: <20171202155101.7573-5-alexander.levin@verizon.com> References: <20171202155101.7573-1-alexander.levin@verizon.com> In-Reply-To: <20171202155101.7573-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit d7059ca0147adcd495f3c5b41f260e1ac55bb679 ] The command "make -j8 C=1 CHECK=scripts/coccicheck" produces lots of "coccicheck failed" error messages. Julia Lawall explained the Coccinelle behavior as follows: "The problem on the Coccinelle side is that it uses a subdirectory with the name of the semantic patch to store standard output and standard error for the different threads. I didn't want to use a name with the pid, so that one could easily find this information while Coccinelle is running. Normally the subdirectory is cleaned up when Coccinelle completes, so there is only one of them at a time. Maybe it is best to just add the pid. There is the risk that these subdirectories will accumulate if Coccinelle crashes in a way such that they don't get cleaned up, but Coccinelle could print a warning if it detects this case, rather than failing." When scripts/coccicheck is used as CHECK tool and -j option is given to Make, the whole of build process runs in parallel. So, multiple processes try to get access to the same subdirectory. I notice spatch creates the subdirectory only when it runs in parallel (i.e. --jobs is given and is greater than 1). Setting NPROC=1 is a reasonable solution; spatch does not create the subdirectory. Besides, ONLINE=1 mode takes a single file input for each spatch invocation, so there is no reason to parallelize it in the first place. Signed-off-by: Masahiro Yamada Acked-by: Julia Lawall Signed-off-by: Sasha Levin --- scripts/coccicheck | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/scripts/coccicheck b/scripts/coccicheck index 28ad1feff9e1..dda283aba96b 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -30,12 +30,6 @@ else VERBOSE=0 fi -if [ -z "$J" ]; then - NPROC=$(getconf _NPROCESSORS_ONLN) -else - NPROC="$J" -fi - FLAGS="--very-quiet" # You can use SPFLAGS to append extra arguments to coccicheck or override any @@ -70,6 +64,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then # Take only the last argument, which is the C file to test shift $(( $# - 1 )) OPTIONS="$COCCIINCLUDE $1" + + # No need to parallelize Coccinelle since this mode takes one input file. + NPROC=1 else ONLINE=0 if [ "$KBUILD_EXTMOD" = "" ] ; then @@ -77,6 +74,12 @@ else else OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE" fi + + if [ -z "$J" ]; then + NPROC=$(getconf _NPROCESSORS_ONLN) + else + NPROC="$J" + fi fi if [ "$KBUILD_EXTMOD" != "" ] ; then From patchwork Sat Dec 2 15:51:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 120426 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2505123qgn; Sat, 2 Dec 2017 08:18:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMaUQFzk2L9M2fjM4CCCjtyzSyq593nj7mmx4BweLb6GLS1GiexHMl15OZ4YxZ90UeOw6tvg X-Received: by 10.84.164.231 with SMTP id l36mr9328556plg.75.1512231515525; Sat, 02 Dec 2017 08:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512231515; cv=none; d=google.com; s=arc-20160816; b=RBvWTfkc1TpDsBrBCHCE+vChmuqkEtb55yj3Kyb0W3DPTKQU6TafgbAuVecZQMkn9Q cWmewQpVOYUGFle8DnhlY9KYQyLLcCgA8ZR5vjVV3jP+OWEFgY2mjRSgB7+67gcJPQ51 bIhf9KvP2N50WcC5b/rmECZATuW8AQl2G6yHlxIhx9HpefaOG2SkoTn37T/X7/n9/nTi 0IRMWnrcO4zNpdcy+bq7lG4eFjZ5BvagN4hsRY8k9OAlrf2a981JQUzJyTI3+8iEgMkn pnn49OnH1ZlQh0EgI/Qp+utfENBDBS9QUgufZnCCJoF46VO59qHL8uQ3x8b4ZIM4Gi60 1VDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=kmNOMlc3oRKJ8Bb1NRaeLSTAsmiy1lXBGqYwlam7SNQ=; b=YavX9nEHOriRXzFoDl1EtHsTqMkGEMdqMloH6XCnAU6ow4zpFcg8XiCxgm1iXc4pWv ZqJLXMHNtMr34unydq/4xdPcvYCyHrc6qBDLt7RMm+Xg5+rqGVU5j2NjA6IMOLu05XIF zh7d/+Eif0RFrF2uE1PrgYTXkH2Rm4Ldgz/RvXOxFe/tilsC6OmGx4eBiHzynU3mT4VS o5Fu6+6CtRHjbYY3SlOmWZ5S7zyI3brCp1p+V9EVwKLdFndcVxVU5jiRhBLoWV57IoMw b5eO7OYUkqymJ32Cqo03UXxaLtLjJgR38Tgj2qW082kVDiRu99W3w2FYkW2dxGo2Vdvz BNPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=mcWekse5; dkim=fail header.i=@verizon.com header.s=corp header.b=LDjBrbYo; dkim=fail header.i=@verizon.com header.s=corp header.b=H5LOngSz; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b77si7037588pfe.377.2017.12.02.08.18.35; Sat, 02 Dec 2017 08:18:35 -0800 (PST) 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; dkim=fail header.i=@verizon.com header.s=corp header.b=mcWekse5; dkim=fail header.i=@verizon.com header.s=corp header.b=LDjBrbYo; dkim=fail header.i=@verizon.com header.s=corp header.b=H5LOngSz; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbdLBQSd (ORCPT + 28 others); Sat, 2 Dec 2017 11:18:33 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:7438 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500AbdLBPwr (ORCPT ); Sat, 2 Dec 2017 10:52:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229967; x=1543765967; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KWiLRmkhva9Xc+xVcW9cwyuzooxbi58gFYq/2/F8tVs=; b=mcWekse5gjxnmS96OODFvsjSZLdZHKP/7fXnAMBZqyPePdGO/KZEy/a2 u6rRM8UZvEaj5o65hxTP4/h36wzZqEB8Pfbzc4qaOQouU6uPN3PH4F+OT o7iOwlq6iiSfaug2A7NxesAOza4nxFx0GcqSz4+V0s5FQaI5p7S4lnJAa M=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 02 Dec 2017 15:52:43 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 15:52:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229931; x=1543765931; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KWiLRmkhva9Xc+xVcW9cwyuzooxbi58gFYq/2/F8tVs=; b=LDjBrbYoDKt5nPCzkQSM5a4XcxWcU3tKAmgBpmwV1oARA2rPPTCI+rVL zFyVvNIfVAo6lWLkmxqs9BdaSfVRoE+wFxjMyLeZ8OkDHcb+Z5M5nDkyJ 8fWHDDVwRdnSgSJZIPOAII06dASVhCJDyAoyhBzgy4KgYEunpz8BQxE23 g=; Received: from mariner.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.84]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 10:52:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229931; x=1543765931; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=KWiLRmkhva9Xc+xVcW9cwyuzooxbi58gFYq/2/F8tVs=; b=H5LOngSz0AQ/v3nwgzdPMFyyA3b+2fSX+kXfcHhkZ9ip7xOXX0M5IO2E HoenSajryuAwrYBgxwALi+NXQcIYA1FRVIeQlMFlJUWLGBnxnvljD0v7y +Tv08g3irWtUw9bYepW6KU0uGftAhSi6u4DRm6YmOKjMTpf/6oBHDbfDL c=; From: alexander.levin@verizon.com Cc: Masahiro Yamada , alexander.levin@verizon.com X-Host: mariner.tdc.vzwcorp.com Received: from ohtwi1exh001.uswin.ad.vzwcorp.com ([10.144.218.43]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 02 Dec 2017 15:52:11 +0000 Received: from OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) by OHTWI1EXH001.uswin.ad.vzwcorp.com (10.144.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 2 Dec 2017 10:52:11 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 09:52:10 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sat, 2 Dec 2017 09:52:10 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 43/64] kbuild: rpm-pkg: fix jobserver unavailable warning Thread-Topic: [PATCH AUTOSEL for 4.14 43/64] kbuild: rpm-pkg: fix jobserver unavailable warning Thread-Index: AQHTa4VudOBqG4dzlkmmCrjXEoUFsQ== Date: Sat, 2 Dec 2017 15:51:35 +0000 Message-ID: <20171202155101.7573-43-alexander.levin@verizon.com> References: <20171202155101.7573-1-alexander.levin@verizon.com> In-Reply-To: <20171202155101.7573-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 606625be47bc87b6fab0af10cd57aaa675cb9e42 ] If "make rpm-pkg" or "make binrpm-pkg" is run with -j[jobs] option, the following warning message is displayed. warning: jobserver unavailable: using -j1. Add '+' to parent make rule. Follow the suggestion. Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/package/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 2b4aa4c19b21..34de8b953ecf 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -49,7 +49,7 @@ rpm-pkg rpm: FORCE $(MAKE) clean $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec $(call cmd,src_tar,$(KERNELPATH),kernel.spec) - rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz rm $(KERNELPATH).tar.gz kernel.spec # binrpm-pkg @@ -57,7 +57,7 @@ rpm-pkg rpm: FORCE binrpm-pkg: FORCE $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec - rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ + +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE) -bb $(objtree)/binkernel.spec rm binkernel.spec From patchwork Sat Dec 2 15:51:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 120425 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2503640qgn; Sat, 2 Dec 2017 08:16:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMY5r2PnpAKuRAqik8sJuKMcbd1G6zG+7IRiDByMMamZlCLm2mhn54NO/6qNVbdImD7naYl7 X-Received: by 10.84.131.227 with SMTP id d90mr9335191pld.117.1512231408133; Sat, 02 Dec 2017 08:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512231408; cv=none; d=google.com; s=arc-20160816; b=q7aD017LHAyiCTddXwQiM8z2NOVxbyDmeP3gty9PQFYMzr4QaFJ9fDmttLV/3EOrqH fF/2lfAznP4TZHCNojHNOOZ3NqVCQQENm16p2S1Qzt5muzFpvLpT84akT44sSnCNK9GY usl8OIw5oN9A5EAwO1Kl31QOOMWRSXXQInDMFrPk3o3DG2PtE1QVELu8EcUk/5d4pgUB xPtZNNnBsGPhZ5HZyUnlXI2e/QH3h3OhJqrluY/r6E0kN/BnS/hX8XymgLRY7K/ltB9l ilg9ts3qUFRxuMKHirn3NhuPXQmyCuUXIlK92O/LHGaazD23R2x+TqTitt4Y+f4Iv4fq v2fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=7xrWe8G3nY+smf6OpZmq4p/gPOoklU/hKsEYMBBkuGw=; b=HYIFyBm1KX+7xyQAgqeg/4y1F4VJ1Ieo5Gt96QstkKoo1Mvm9xFjPH0vXYQvxwv2jr jtOtqWG/BNnydtNKyYvLbYFbrzfzNITel8lPqfoX+5zS8QWAqEUKzbuxnu1U2IRzDXG8 A9R/fU7EfxAr/pDQBuFeymbS2qdyO/abBdbbF9ExtW2o7964XZda4218pwCmaNh/0YF6 bnUY0qvHg35Oms2e6XrN78nfRv64iegkjZuvuxM2wyy43jhUTZ4QyKDQeludhqOQovHa maGXyZXTuozG/7jIT18FNxZNAc7HULaLmzb1ei9th5lkaq3qDqDAfw1W6H+6XxJxZqZR Xt3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=Lc8SnTca; dkim=fail header.i=@verizon.com header.s=corp header.b=HuAXY0fs; dkim=fail header.i=@verizon.com header.s=corp header.b=qkaM+Ny4; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si6422023plm.88.2017.12.02.08.16.47; Sat, 02 Dec 2017 08:16:48 -0800 (PST) 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; dkim=fail header.i=@verizon.com header.s=corp header.b=Lc8SnTca; dkim=fail header.i=@verizon.com header.s=corp header.b=HuAXY0fs; dkim=fail header.i=@verizon.com header.s=corp header.b=qkaM+Ny4; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbdLBQQr (ORCPT + 28 others); Sat, 2 Dec 2017 11:16:47 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:62168 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbdLBPwv (ORCPT ); Sat, 2 Dec 2017 10:52:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229971; x=1543765971; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vNyrV1f8qvvwJNA79tD4BWDLRYroj7NLMwmBYgzyl0g=; b=Lc8SnTcakhaVBk91PoXzLRrhmbfT/if1iLAsNi6wy7QfD06ILb+mYazV 1zQFD3zbIFCE86oWxJFtjkZXpi4ZScMmETBOfbXsWjhER7x8AFoWEPrl3 GXquKXwkSGNf4EyQw269+HSt4Rw1n2hN/mgbrg9b46N5DbPUHkKosxKZQ E=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 02 Dec 2017 15:52:46 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 15:52:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229938; x=1543765938; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vNyrV1f8qvvwJNA79tD4BWDLRYroj7NLMwmBYgzyl0g=; b=HuAXY0fs2sNfPDG9L8QZo0iNiCXrCK5fbRLMvcmP6edT/MJumDshH0aW mGe6afVc2xJoaDw2JQ7OTALCamgV6GIBmeJQZwaihrkcTM88hJZCVVaA2 Lm0kbmCYqJ2//6ibA922m2TFjUsAJEoMldPoxRpvNshQGk55UXttkcsaG s=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 10:52:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229938; x=1543765938; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=vNyrV1f8qvvwJNA79tD4BWDLRYroj7NLMwmBYgzyl0g=; b=qkaM+Ny4G9b4gaZlwcEadSvV3Im4tqDNdK8Ampd7eTkvBpq//UAnNi9q D1YWjZxeR4Ork0uSJXJlF4n9kiTXST/9zRFtERDg0WsRMorXH16JWuYGd yYLpsD+DCPyfIHo2I2vqbsnyFV6yxUOjrC+tFErpl+7RYzHAbWIGlkWpZ Y=; From: alexander.levin@verizon.com Cc: Masahiro Yamada , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh002.uswin.ad.vzwcorp.com ([10.144.218.44]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 02 Dec 2017 15:52:18 +0000 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by OHTWI1EXH002.uswin.ad.vzwcorp.com (10.144.218.44) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 2 Dec 2017 10:52:18 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 09:52:17 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sat, 2 Dec 2017 09:52:17 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 54/64] kbuild: do not call cc-option before KBUILD_CFLAGS initialization Thread-Topic: [PATCH AUTOSEL for 4.14 54/64] kbuild: do not call cc-option before KBUILD_CFLAGS initialization Thread-Index: AQHTa4Vw0a5nJ1zMfUKf3IQFrg1Fpw== Date: Sat, 2 Dec 2017 15:51:39 +0000 Message-ID: <20171202155101.7573-54-alexander.levin@verizon.com> References: <20171202155101.7573-1-alexander.levin@verizon.com> In-Reply-To: <20171202155101.7573-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 433dc2ebe7d17dd21cba7ad5c362d37323592236 ] Some $(call cc-option,...) are invoked very early, even before KBUILD_CFLAGS, etc. are initialized. The returned string from $(call cc-option,...) depends on KBUILD_CPPFLAGS, KBUILD_CFLAGS, and GCC_PLUGINS_CFLAGS. Since they are exported, they are not empty when the top Makefile is recursively invoked. The recursion occurs in several places. For example, the top Makefile invokes itself for silentoldconfig. "make tinyconfig", "make rpm-pkg" are the cases, too. In those cases, the second call of cc-option from the same line runs a different shell command due to non-pristine KBUILD_CFLAGS. To get the same result all the time, KBUILD_* and GCC_PLUGINS_CFLAGS must be initialized before any call of cc-option. This avoids garbage data in the .cache.mk file. Move all calls of cc-option below the config targets because target compiler flags are unnecessary for Kconfig. Signed-off-by: Masahiro Yamada Reviewed-by: Douglas Anderson Signed-off-by: Sasha Levin --- Makefile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- 2.11.0 diff --git a/Makefile b/Makefile index ede4de0d8634..4d04fcd54bae 100644 --- a/Makefile +++ b/Makefile @@ -373,9 +373,6 @@ LDFLAGS_MODULE = CFLAGS_KERNEL = AFLAGS_KERNEL = LDFLAGS_vmlinux = -CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,) -CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) - # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \ @@ -394,21 +391,19 @@ LINUXINCLUDE := \ -I$(objtree)/include \ $(USERINCLUDE) -KBUILD_CPPFLAGS := -D__KERNEL__ - +KBUILD_AFLAGS := -D__ASSEMBLY__ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common -fshort-wchar \ -Werror-implicit-function-declaration \ -Wno-format-security \ - -std=gnu89 $(call cc-option,-fno-PIE) - - + -std=gnu89 +KBUILD_CPPFLAGS := -D__KERNEL__ KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := -KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +GCC_PLUGINS_CFLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) @@ -421,7 +416,7 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS -export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KASAN CFLAGS_UBSAN +export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_KASAN CFLAGS_UBSAN export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL @@ -622,6 +617,12 @@ endif # Defaults to vmlinux, but the arch makefile usually adds further targets all: vmlinux +KBUILD_CFLAGS += $(call cc-option,-fno-PIE) +KBUILD_AFLAGS += $(call cc-option,-fno-PIE) +CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,) +CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) +export CFLAGS_GCOV CFLAGS_KCOV + # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default # values of the respective KBUILD_* variables ARCH_CPPFLAGS :=