From patchwork Sun Apr 30 16:16:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 9706137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB4EE601D2 for ; Sun, 30 Apr 2017 16:16:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A857725404 for ; Sun, 30 Apr 2017 16:16:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A3192621B; Sun, 30 Apr 2017 16:16:21 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 1D80125404 for ; Sun, 30 Apr 2017 16:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756335AbdD3QQU (ORCPT ); Sun, 30 Apr 2017 12:16:20 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35547 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756141AbdD3QQT (ORCPT ); Sun, 30 Apr 2017 12:16:19 -0400 Received: by mail-lf0-f67.google.com with SMTP id i3so11505656lfh.2; Sun, 30 Apr 2017 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=AQw1DKyhPRh4wfo61FmkoiTUT09kAUMJi7DcPH/ye4w=; b=De2vTGGwZk8ymQsUspZHAV0U3Yw0dtDrR3VMco8AoFdMAE6Wm4vcVAZXmIq/tQde8g YB4p2VKq7X0kauQsf/aV5u2jLJ5h5A0EnlSEeydzUq6yJ7RqC1qg2/aJXdcn6BO7kPdl lti0N1nAdJYOVBAP116DUNvQmLUxyH774IThW7TbmH6OWzKTCbLsRFeDo2MQLhLzhA4S WH0hKEHjS78zB/fRLcwF/MjKDGiR07N/pX8RLGKdaorAVquRoiSXYEVDkEo8z0nz5E93 jyde1RcB+DAFxTiUvV0+iQSMrpILNMaxCfBaVHbzqtrECghrcFw0iquLV+uQ91iESuBR uRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=AQw1DKyhPRh4wfo61FmkoiTUT09kAUMJi7DcPH/ye4w=; b=NrzVo6wKl76/uQ806t4TV72jPYcEZlmTo/I+o2GQLzCN6R3Bj5uPD5ch6X+ARh+XXi TlXarZxNnqGG/Foht8Lp+YRVKQE53F/gn+jaMb6OM1Br7DPy8SCAnQ9WG4CkdE+KUbtX k3Si4EEQflEYq16CIrvLMWgsaU35X+ppRD8OhN7hU68k896+gtbQqsNz1IG5HEjA1P4b NfaF/cNbtIW9kVcRvLadhdE/uoHvJN/1hAOVePI8ZENOZBbuKkGptXObS32wknCfXL+c hj/KufpdgkqRqV328quN+JW7Wtkmhzv2FDXTfx+U0tJ6OL5qbARDa4VyYALqYJpzSQmM k0DA== X-Gm-Message-State: AN3rC/7d64xSBmlsvKyNOifisNfjSrexxqhr+v9oCtyfWIh/OUvX2blU ABmk/wZSchHIzQ== X-Received: by 10.46.22.4 with SMTP id w4mr7674961ljd.123.1493568977648; Sun, 30 Apr 2017 09:16:17 -0700 (PDT) Received: from localhost.localdomain (90-231-144-194-no56.tbcn.telia.com. [90.231.144.194]) by smtp.gmail.com with ESMTPSA id b62sm2225005lfb.17.2017.04.30.09.16.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 09:16:16 -0700 (PDT) From: Rabin Vincent To: yamada.masahiro@socionext.com, mmarek@suse.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Rabin Vincent Subject: [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once Date: Sun, 30 Apr 2017 18:16:00 +0200 Message-Id: <20170430161600.15845-1-rabin@rab.in> X-Mailer: git-send-email 2.11.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 Evaluate LDFLAGS_BUILD_ID (which involves invoking the compiler) only once instead of over and over. This provides a ~20% reduction in null build time with x86 allnoconfig: $ make allnoconfig && make -j8 $ perf stat -r5 -e sched:sched_process_exec make -j8 - 2 119 sched:sched_process_exec + 1 878 sched:sched_process_exec - 1,238817018 seconds time elapsed + 0,971020553 seconds time elapsed Signed-off-by: Rabin Vincent --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 779302695453..c78a266594c1 100644 --- a/Makefile +++ b/Makefile @@ -815,7 +815,7 @@ KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS) KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) # Use --build-id when available. -LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ +LDFLAGS_BUILD_ID := $(patsubst -Wl$(comma)%,%,\ $(call cc-ldoption, -Wl$(comma)--build-id,)) KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)