Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1299488pxb; Wed, 6 Apr 2022 14:12:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1PwB/hW5wbunTWkoYYL5lqWfECFmsDxo9gr2xUEVLH67aV352aUhS1EhEVLz36Fua+vh4 X-Received: by 2002:a17:90b:1806:b0:1c7:852d:e853 with SMTP id lw6-20020a17090b180600b001c7852de853mr12029366pjb.106.1649279529348; Wed, 06 Apr 2022 14:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649279529; cv=none; d=google.com; s=arc-20160816; b=stV7Q5+UcNETbCn0uiBwIVOybfRPHhuF28Dk0nhfevMYmGgHCwenVmNu6sHnmLTVrf MiDdfIS5Ep4J9oa0iPvJWUaPCkO5knDqYP/3qd9R5qp6vE6ONCgfLaTCnMrnP+dOgrDX 0vfUijW6VBwHPBkmtLAtCEvOrUsS9ZHbkbe5QjBTQ7Fn85D+5h6YHVL3Q86mb8zaJqOs DPeWXSwoWkODgq9ttS+/uViBJf+lCierS6W4BN4K1qGHxpXR1NLlb0/zt+/iHD72mSFZ Cg5Gj0RKEsflqcpxBXEvUHEJSrfVSf8ZwJxgLVV5fOKPYdNLb/OmgY18kgpnUQ38dhPq BALw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BXJ0GIop+UGWRaFV2rjdj0GKaXIQVFtY0SlM5haDrWY=; b=VVMwqlVqZ4QwxIoAWL3Mir39c6GeL8qYcn5UmomhGWPvffpzzwLN2pU2a/QkmNd80l gAhNrZ+QQhWXl4Hwtcfi0AYHNz+J18rb8LvOVSu5cKBkpnuNoDrogY81tf8zp4ECNQcx TTK+08HM0rrBcw23wPuV+UzOK6lNvMDK0mqGdId+f8ERSG/U55ueNmwwi1fXflzpKHqs jTpwz84VgY4IjkfaCZ6Ks52xPrWskVHpzvRyIFeUMxFOfv5nLfeh2CC2gHd+0N8pZWor vEzUMJ/hK57MKObrHWmRK0PZ0mUdB4CGGhSySjVFOW0rHd8NiJK7rZtsFfsB6lpKz99z ucig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=E8Zv7mLG; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a63de4b000000b00398586b09e0si17021938pgi.278.2022.04.06.14.11.47; Wed, 06 Apr 2022 14:12:09 -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=@quicinc.com header.s=qcdkim header.b=E8Zv7mLG; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbiDFTlC (ORCPT + 99 others); Wed, 6 Apr 2022 15:41:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiDFTks (ORCPT ); Wed, 6 Apr 2022 15:40:48 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B872619531F; Wed, 6 Apr 2022 11:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649268823; x=1680804823; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=BXJ0GIop+UGWRaFV2rjdj0GKaXIQVFtY0SlM5haDrWY=; b=E8Zv7mLGURkFsCxLUiVXMQOxCUZxhxhLbe++Uwipe7x3cWscrzswCZ07 L3h/rzg0PO+MfuxZt0dnen+2RNZReJcT6rw8cWsMRGw74H7gPRN1IaDc7 i1Zr3SiOTI8GZIJ6wKWXKg+GFA/M0yU9sC0JNOAR3kXtD87vzBqQjXhVF 8=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 06 Apr 2022 11:13:35 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 11:13:20 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 6 Apr 2022 11:13:20 -0700 Received: from [10.110.72.142] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 6 Apr 2022 11:13:19 -0700 Message-ID: <960102bb-2944-4be0-ab09-7cd2eb0c2cf9@quicinc.com> Date: Wed, 6 Apr 2022 11:13:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 7/7] kbuild: read *.mod to get objects passed to $(LD) or $(AR) Content-Language: en-US To: Masahiro Yamada , CC: , Michal Marek , Nick Desaulniers References: <20220406153023.500847-1-masahiroy@kernel.org> <20220406153023.500847-8-masahiroy@kernel.org> From: Jeff Johnson In-Reply-To: <20220406153023.500847-8-masahiroy@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 4/6/2022 8:30 AM, Masahiro Yamada wrote: > 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) > Looks like this also addresses the out-of-tree issue described in :) /jeff