Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1746751rwe; Fri, 2 Sep 2022 03:11:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6JI2i6y8uJ3PBkEEqLF3g8HIG4C0hUz/I4aiHQ2xMDISNEorpONWfGUXmBt1BgX+pacXOC X-Received: by 2002:a63:6cb:0:b0:432:6d53:a437 with SMTP id 194-20020a6306cb000000b004326d53a437mr300456pgg.620.1662113499038; Fri, 02 Sep 2022 03:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662113499; cv=none; d=google.com; s=arc-20160816; b=csuwPr3KpvhzOYJyyTgAx1ZHsdxo7Mb4n5NShp+ZiVOAl/keH7kcLNYwMUIh9kOusN ebebegrCsZvJ9I1vaazdkD2q6OnXntwOEb47B+y35RUmV8EjGiP1M4tJ0rdZW15iq7Qw NfJAJS9tb0ZlbtxqIaUHot5T0sCtuVxoL4CU+WlI9zLPTKc7osysASf88u1rF5BbA8L7 dn7T6fUuHB9he4jpFcYFcS4xkOzZWjVV8PpBxPnYew5vasXqqO7vRuQ8GCv3/X3kDy3m GxFnotA3jCbtT54+/JVUVR8X8rTnalePlGMoq/L7nglP/Vu2l3u6E895cdDvokdRGYfV V8XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=Yu6q9CiU0SZ2y8yEyENS2Mjn2VsQqrhZ4sv/qS7Inu0=; b=tXL3F6qOJ+kqb+tQc7ItwEQfkYag7eq3oyREnNSsRq5iR6P4Vj+EfQYOVTLHlRLVHl oJSpgTCW92ewgi/ZuA8c8uoaRTP5Y7VrL8pm7Y+D9j9A2NvnRYrun81RVyfLdX3I3S4p MbO1YgE2uVD1Biy+0soBecLKBHRw3ygr7NAVoEGvQ8UQ3aAF21IxFM1fDfTdaQX6OY9G hmjlg6PlRz1z2ffkBKQG8z9xFR8opXjpEfsmvIXgG/v/ouz/ajKANLYGnezjAarlkr7l 37Km779lS/fTGJ9PvGLjGtlthv3Vw7j+6EzqatZaidbD4vvagEubZo/k3xqY1Ec1R2f9 CDOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hOOYme3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a170903005400b0017524eb62d1si1508329pla.25.2022.09.02.03.11.27; Fri, 02 Sep 2022 03:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hOOYme3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235308AbiIBJmG (ORCPT + 99 others); Fri, 2 Sep 2022 05:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233481AbiIBJmC (ORCPT ); Fri, 2 Sep 2022 05:42:02 -0400 Received: from conssluserg-06.nifty.com (conssluserg-06.nifty.com [210.131.2.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF45A4E63F; Fri, 2 Sep 2022 02:41:51 -0700 (PDT) Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 2829fccx032021; Fri, 2 Sep 2022 18:41:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 2829fccx032021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1662111698; bh=Yu6q9CiU0SZ2y8yEyENS2Mjn2VsQqrhZ4sv/qS7Inu0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hOOYme3dsSbItMMKrdyZPuaHh6lUsJm1eOOS/YSxV1DlV2iWaXMvCnlVaeZjvJGxO 4IVPvp8aEt27DScP+ufYRROYrYUYvuS5CeZqMirCNkVwfLaaJwTKIpYV1+fZPXj8t3 eS0qw5WoKem4psdSrT+xbf5HNdBztvtpBWp3f7+ZSJO8sL/n1Cstwbw4oQOQjy/v1F ALZbLPFxBUtP4MXFDZl6363DWIc/V1JZsrUKB/qomVZduB3pzzWEYRdSVCdMu/39qp Sf0qC0EbaMEIQCvoL2SQXyaYbM07sNMpI6+6qO0oyzyHk9aLBYJFwppkUi+yC1ieWt tQIexKjHpnzbw== X-Nifty-SrcIP: [209.85.160.43] Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-11edd61a9edso3429979fac.5; Fri, 02 Sep 2022 02:41:38 -0700 (PDT) X-Gm-Message-State: ACgBeo2ZRBMhDomXY8t1TLqYc4AY973EwgygwZXbuc9T17Xd4Ww5d8TB vouwQ9E/vKmMwA0M0GNxZ3BhouvqifJGzjTN3XM= X-Received: by 2002:a05:6870:f626:b0:10d:a798:f3aa with SMTP id ek38-20020a056870f62600b0010da798f3aamr1712772oab.194.1662111697432; Fri, 02 Sep 2022 02:41:37 -0700 (PDT) MIME-Version: 1.0 References: <20220828024003.28873-1-masahiroy@kernel.org> <20220828024003.28873-6-masahiroy@kernel.org> In-Reply-To: <20220828024003.28873-6-masahiroy@kernel.org> From: Masahiro Yamada Date: Fri, 2 Sep 2022 18:41:01 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 05/15] kbuild: build init/built-in.a just once To: Linux Kbuild mailing list Cc: Linux Kernel Mailing List , linux-arch Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 28, 2022 at 11:40 AM Masahiro Yamada wrote: > --- a/init/Makefile > +++ b/init/Makefile > @@ -19,20 +19,47 @@ mounts-y := do_mounts.o > mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o > mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o > > -# dependencies on generated files need to be listed explicitly > -$(obj)/version.o: include/generated/compile.h > +# > +# UTS_VERSION > +# > + > +smp-flag-$(CONFIG_SMP) := SMP > +preempt-flag-$(CONFIG_PREEMPT_BUILD) := PREEMPT > +preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC > +preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT > + > +build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto)) > +build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto)) > + > +# Maximum length of UTS_VERSION is 64 chars > +filechk_uts_version = \ > + utsver=$$(echo '$(pound)'"$(build-version)" $(smp-flag-y) $(preempt-flag-y) "$(build-timestamp)" | cut -b -64); \ > + echo '$(pound)'define UTS_VERSION \""$${utsver}"\" > + > +# > +# Build version.c with temporary UTS_VERSION > +# > + > +$(obj)/utsversion-tmp.h: FORCE > + $(call filechk,uts_version) I missed to clean up init/utsversion-tmp.h. I patched like follows, and also added it to init/.gitignore. diff --git a/init/Makefile b/init/Makefile index 63f53d210cad..ba90eb817185 100644 --- a/init/Makefile +++ b/init/Makefile @@ -43,6 +43,8 @@ filechk_uts_version = \ $(obj)/utsversion-tmp.h: FORCE $(call filechk,uts_version) +clean-files += utsversion-tmp.h + $(obj)/version.o: include/generated/compile.h $(obj)/utsversion-tmp.h CFLAGS_version.o := -include $(obj)/utsversion-tmp.h -- Best Regards Masahiro Yamada