From patchwork Thu Mar 14 23:41:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10853885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1588A14DE for ; Thu, 14 Mar 2019 23:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08DD2A6BE for ; Thu, 14 Mar 2019 23:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E465F2A7D2; Thu, 14 Mar 2019 23:42:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D09D12A6BE for ; Thu, 14 Mar 2019 23:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfCNXmh (ORCPT ); Thu, 14 Mar 2019 19:42:37 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34126 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbfCNXmh (ORCPT ); Thu, 14 Mar 2019 19:42:37 -0400 Received: by mail-pf1-f196.google.com with SMTP id v64so4936875pfb.1 for ; Thu, 14 Mar 2019 16:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+cLFu1OLr7HAquwI//OHn+9FZY+L0BqbhOfx0COGRiM=; b=JOtNPZIDoK/pex8ISPGv4Fehdi58rEZt79hu6C2Nmh19qNvAfaqJ5IOlleljIAvBs1 XQLFrlZ03aPUU4Eo0QKuNp/gNYs8/iNvTUs+HvrHwP+PJgyvXzvNixkMjyLqgnvDjIB2 PpetQL6fWQX4P8fpNoiLeTfSYmouv7se5cYk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+cLFu1OLr7HAquwI//OHn+9FZY+L0BqbhOfx0COGRiM=; b=glhsMaq2fFO+P8ZSBy7KwrymcNdzZtFQpharPVxdm2w5LjU/FRzdQvHrozRSd1hVS+ Rk7kC0JNBOn53yJyYI05PnQto50ovnxRymbHxCDIL/FyPdC3Bn/IFi1T+wgnOhvJRvra ePXyivLi1c1hNf1FyS9SMeWBrIuV/d2jWK35C0u4ExSnvwIrzgqwj+ean2oZ6L1Pz0Qr Kqy8d/Bv8mwTRRqy7YQNxDGTTBXp/7NRyvUCHDs7yEsaMNx6DL4IZKeXR/OTUYHWPpNU A0ahGEh0l+EYIcpG4nt9N8Z610a8R5BST0XyWNc6/Fx8G/2InZRu05ADZMpX37W29nhn 2S/w== X-Gm-Message-State: APjAAAUhJEVSGUekh1uKWdNA1ZRJN6iOzkdUftAfT6BqTI8b6D0qMAHv MqROFosMVJdvfX+pLMdyySkhwA== X-Google-Smtp-Source: APXvYqwc5xdYGSrsQ07ayzL5Y9/TViO1X94RDNHcRJrWzxNbOyx7Ppou2jXyy/T1IeDFfovGPutItw== X-Received: by 2002:a63:fd03:: with SMTP id d3mr430058pgh.359.1552606956251; Thu, 14 Mar 2019 16:42:36 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j9sm270379pfc.67.2019.03.14.16.42.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 16:42:35 -0700 (PDT) From: Douglas Anderson To: Masahiro Yamada Cc: Douglas Anderson , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH] kbuild: Make NOSTDINC_FLAGS a simply expanded variable Date: Thu, 14 Mar 2019 16:41:59 -0700 Message-Id: <20190314234159.191745-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During a simple no-op (nothing changed) build I saw 39 invocations of the C compiler with the argument "-print-file-name=include". We don't need to call the C compiler 39 times for this--one time will suffice. Let's change NOSTDINC_FLAGS to a simply expanded variable to avoid this since there doesn't appear to be any reason it should be recursively expanded. On my build this shaved ~400 ms off my "no-op" build. Note that the recursive expansion seems to date back to the (really old) commit e8f5bdb02ce0 ("[PATCH] Makefile include path ordering"). It's a little unclear to me if the point of that patch was to switch the variable to be recursively expanded (which it did) or to avoid directly assigning to NOSTDINC_FLAGS (AKA to switch to +=) because someone else (out of tree?) was setting it. I presume later since if the only goal was to switch to recursive expansion the patch would have just removed the ":". Signed-off-by: Douglas Anderson --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ef547fc7ffe..3034ba66ad51 100644 --- a/Makefile +++ b/Makefile @@ -402,7 +402,7 @@ CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF) -NOSTDINC_FLAGS = +NOSTDINC_FLAGS := CFLAGS_MODULE = AFLAGS_MODULE = LDFLAGS_MODULE =