Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp40667pxh; Thu, 7 Apr 2022 13:20:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRpoKP4MRh/u6hruQoEzoqfW1CD3HjIqXyRXSZMvLOl3V/Bk0pBQBZRlKIrtKK8+QyZj7W X-Received: by 2002:a17:902:ccc4:b0:156:5d37:b42f with SMTP id z4-20020a170902ccc400b001565d37b42fmr15547815ple.157.1649362855928; Thu, 07 Apr 2022 13:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362855; cv=none; d=google.com; s=arc-20160816; b=ENhXBFRfSektP83TPreAaJS767b5oyzYZ5fsNaEkTnTltbGte6nz7Rd8mGoB4CazVU fOl/IsrzTQGXZCQ25+z++984DcpxYQcXfUU4ZRNnbnqaUCTYnu8C7pDcP+utG4dC+v+o Op+ioCoijocRW32EZKkhO4rIxxQwdX0r+WdU1W699DfvQxLUtCPjSPKJnHqzLMECFGrM Wt18sJ1oKbri3XvNkd3rgdD6BlSWL7HAnhTia86PRZbrkSXVaplJ78J6I7LZqFrl9mEY lqq1Juz03sVDIJtw1Yyrv6W62w42763OeTBmkiUuX6JKcji6z9wdfTKXOtsS3Y5yjz1m a9uw== 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; bh=nc2KMitqXXwMUX83HKghQR/LRLRxtBXah+9V4xkBICs=; b=nLDa/JH32E69lCjRU1dZ5A6JABo2RDF4GHwarT2h8d6RJIM9yEcAHrzbWfxsKtnLFB IdVZBxBSVkxjPqRi36zYYJ1bvJBO9NQGPrVQ3MWI8BhG+n44ZA+wtk9JSUvFGYhVmrfg HCGcK+BAq6buWnAUk5VabR5rM5Y/E4SYrubLUL8FnmBqEfrBNPL2D3ErxTQyLWsdxst1 A1fK1eZBM9N8oWi7xsnHZBHPjJ3ujYsYgbSoWmpZodS0JM2WsXEauoNkte1zfjA8zaTv 3wRRSzWpVAPoPeqZckWlB9AfMzmlm2ojaj2w+j8Dr0FIDYSFIgq2J/yhgHlKz6J+xHcS Torg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hprdGD8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l10-20020a056a00140a00b004fa3a8dff7asi19261796pfu.49.2022.04.07.13.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hprdGD8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94F69331D08; Thu, 7 Apr 2022 12:39:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234365AbiDGSDe (ORCPT + 99 others); Thu, 7 Apr 2022 14:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbiDGSDc (ORCPT ); Thu, 7 Apr 2022 14:03:32 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1EFBF96B for ; Thu, 7 Apr 2022 11:01:30 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id s17so523879ljp.8 for ; Thu, 07 Apr 2022 11:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nc2KMitqXXwMUX83HKghQR/LRLRxtBXah+9V4xkBICs=; b=hprdGD8oRcrP+d4uMRq8tj1WdE5uLs9uUyfo6bT6s4OBUPvwoSZgf+LKglIBUaAVsq EiLbrypIOSLKiKIYm1K7P8zI23ZeQJubgJBTdKL7UMv96Wr6Dq0XoC1Tn5lrZZIs9R9b wwUpN9IV7XAksdNicmeanV/JLFujJA6YqvRlHAGJEpIJ6qCRLoyuiqSvjWMevdLIlzIn GRpG4fVCfZv9N5jPKhtOUE4KjTYpSOKD/hFkrLvCiZN1VgzqY75o2QB8XK7HZVt98b3g 2W97JbUgNeVqqAuRdQjK77H/3HZN1EZ2m8FNKZ19s/iL08Ph4631mVzBRse2KRaVb4bT HvDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nc2KMitqXXwMUX83HKghQR/LRLRxtBXah+9V4xkBICs=; b=ZHI1vBspjLTx8OBFvS6CqvkZIfHvN/kC91SD8RU5mYsKLX8kEJv68PVFkOHBjKeLbo 3hTWSxDHZbLfvQOac3ZRvQuyiY/9AdkHURJscC+UkNBnfjxyIav37Q30Fh7C0ibMLaLc 7jCQHVJXcB7gy1Kn6xCT6BGHot9boEdTAL67hUAY5UVIH0XRMwNpRc5ygdxx2aLxCeLV OvXSU3lHVvXVvmIgzSKEv2Rb0mFEJA0hviq9mcyv0jSvPlY06Ed9GdhoA2sM3iGHfDBs EcFghMsiDj5Y1u0V3+Yi6c6/xT70lM5CDKpWPUrluCyVs031ugJTLQYL3GnZdY2ZAD9f hsFQ== X-Gm-Message-State: AOAM532XgKjJWQKSFwlCw6m5lgEYC9wuc1P7VCkm+vem0JgVC4wKm+tH ps1jVoSSPg4U+3/O/5Mgk30+bB46P9g9KaWbdUFwTA== X-Received: by 2002:a2e:3a13:0:b0:24b:4025:344 with SMTP id h19-20020a2e3a13000000b0024b40250344mr3190537lja.468.1649354488708; Thu, 07 Apr 2022 11:01:28 -0700 (PDT) MIME-Version: 1.0 References: <20220406153023.500847-1-masahiroy@kernel.org> <20220406153023.500847-8-masahiroy@kernel.org> In-Reply-To: <20220406153023.500847-8-masahiroy@kernel.org> From: Nick Desaulniers Date: Thu, 7 Apr 2022 11:01:17 -0700 Message-ID: Subject: Re: [PATCH 7/7] kbuild: read *.mod to get objects passed to $(LD) or $(AR) To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Marek Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 Wed, Apr 6, 2022 at 8:31 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. Clever! Thanks for the patch! Reviewed-by: Nick Desaulniers > > 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 > -- Thanks, ~Nick Desaulniers