Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1176252pxb; Wed, 6 Apr 2022 10:31:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2LEERvR0fb2bosI5LK7e0KuUyn4dXTv52SfT2Z3ynyg27oGmsP7kmmd71U/L6vqUZ8WBv X-Received: by 2002:a63:9502:0:b0:386:3916:ca8e with SMTP id p2-20020a639502000000b003863916ca8emr7860357pgd.357.1649266306539; Wed, 06 Apr 2022 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649266306; cv=none; d=google.com; s=arc-20160816; b=wJS0XPZrDCbetLedj3oPtZiNNg0akJthbdSCCEnUwW5opRmS+2bxUkOVtOdMui+FOF vMT2UTl9vnMdg7VGqKLUs2Vz0H+m1+1pQ0Ld6tAc+Ge1GI5TwVFhq4V9H09w5nJ7CmF1 Hb3dmuoTIRCqqZ1ntW+tHiXahscbCI/Yw0UerBD8Ecr1SuDuyJdGabtDFyMZwHxDbly5 TF2lB1lRw9je23vD+jZOme9ftyQ2GN8k4xp4hRCCsu6FYeRo7uaQ0zqHYCxWl5TpqnYo gdvdJgxLH+rmaWi+c/0PZ0cVVlx+2yw0wmCBIrfEggn/7Xybp6sHxbLcJ/ZFZpTO/Rjd RO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=xi61ivU7WXkz9So9Rg07E0Isc4c3Oyfk6ijcms131ig=; b=D83dxP+MhPKHzpRnMTl0g5iFCzHkYK0IM4Q8xJFOzLBWWVkuA230U76cggQtz3mdQl kHbjD4VXcuA3BfTAKA310nulHrwj8QbZ4PIcMjfTAUsz1itqonMq7NvA8VUguUbEH/hM vMyeZvzKAwNQScYe0e1q8wtTbtE+KqPJzjJJVcyprKj62BIrsPKuomcvTZdZaMRjY9D9 5WPevybrV+LeZyPDhSS/FfLElyWP8SbnpAbFC4YRtxr3AeoivJYGc1sSiOb5BuI5Ih56 qqEt442ZgEYXHzdNpTNoPmhORK6Epp7UWBb4CZunC4PFTZKXmY9JlIIL9mp+zMFWIH+u 7mCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="l/IgoVgb"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u18-20020a170902e81200b00156c63972a2si6288401plg.421.2022.04.06.10.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 10:31:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="l/IgoVgb"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A0EA2D7D7D; Wed, 6 Apr 2022 10:28:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239129AbiDFRaD (ORCPT + 99 others); Wed, 6 Apr 2022 13:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239105AbiDFR3M (ORCPT ); Wed, 6 Apr 2022 13:29:12 -0400 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BCE439A693; Wed, 6 Apr 2022 08:31:41 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-08.nifty.com with ESMTP id 236FUcaW017647; Thu, 7 Apr 2022 00:30:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 236FUcaW017647 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1649259044; bh=xi61ivU7WXkz9So9Rg07E0Isc4c3Oyfk6ijcms131ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l/IgoVgbWFj4IWz0iLgxZnxikrdfuYjVN6WHn7/uITderaEbd7ocTNr8lMizOBJZF 92dFshMCkZoro3xeyINSpOoNGu3R9SpiwiRDVQtS3w0pLoiVtJwmuN0/hWbp7MQwC8 +au02BeAuOnZhIAKNolJ3KRjBGo7KFVcfYXW7hpGIToMoFPPQrdZgmzH2cBy+QcSVL gU11ko1P5ByatlJPIlEjvqP8rVja0eyYLhTzp3zzFwC2fFFneD1BDhKX8R1gPvBw// oF498F8fSyPQMTy8vC+nsfhrvLdHulLRcDCYQ1lHuCu8SV8yeRSNE/OCgES+dKeAeK k4zfy3YU1ZmVQ== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nick Desaulniers Subject: [PATCH 7/7] kbuild: read *.mod to get objects passed to $(LD) or $(AR) Date: Thu, 7 Apr 2022 00:30:23 +0900 Message-Id: <20220406153023.500847-8-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220406153023.500847-1-masahiroy@kernel.org> References: <20220406153023.500847-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, 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 ld and ar support @file, which command-line options are read from. Now that *.mod lists the member objects in the correct order, without duplication, it is ready to be passed to ld and ar. By using the @file syntax, people will not be worried about the pitfall described in the NOTE. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 3da731cf6978..f6a506318795 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -450,22 +450,18 @@ quiet_cmd_ar_lib = AR $@ $(obj)/lib.a: $(lib-y) FORCE $(call if_changed,ar_lib) -# NOTE: -# Do not replace $(filter %.o,^) with $(real-prereqs). When a single object -# module is turned into a multi object module, $^ will contain header file -# dependencies recorded in the .*.cmd file. ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) quiet_cmd_link_multi-m = AR [M] $@ cmd_link_multi-m = \ $(cmd_update_lto_symversions); \ rm -f $@; \ - $(AR) cDPrsT $@ $(filter %.o,$^) + $(AR) cDPrsT $@ @$(patsubst %.o,%.mod,$@) else quiet_cmd_link_multi-m = LD [M] $@ - cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) + cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ @$(patsubst %.o,%.mod,$@) endif -$(multi-obj-m): FORCE +$(multi-obj-m): %.o: %.mod FORCE $(call if_changed,link_multi-m) $(call multi_depend, $(multi-obj-m), .o, -objs -y -m) -- 2.32.0