Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp101024pxb; Thu, 14 Jan 2021 20:38:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXUUoLczF6KIQH6sABcL10f9e+tkrwKMM0aw2/9/VM85HY9I5u0X29iJ+Qdv0ISLugrj8/ X-Received: by 2002:a17:906:7b8d:: with SMTP id s13mr7370783ejo.479.1610685533793; Thu, 14 Jan 2021 20:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610685533; cv=none; d=google.com; s=arc-20160816; b=0fKPmTHxdsL1i8DE7lIZWkMwhBU+9hOOPxhZLqJiJwM9kjOdI47l2dbPV+k5exc+sj +NBYoRy6847vSFOGmZEwXQcevchc0c6P87SQGHtJIaSerT/qM1eJkHgEOq6t92WGHWWa zFuUUHUxCdALGF/gVglBQgxG+lZHJrgq1bT3aNBeCWgViiaSAAb34Pj4Mce3EKAEQ6su go6PAUqIrI0O25L9jM0LAF8B+Ez7G1+qcqg1TpXQOLhQbRFdps2eyAC8D8F5/MT+9ho0 HWagMhchBIto0DypwrPGoARSAYaqTZYBShOX21wKEFRHIZdRWoUiW43CgsIztkM0iBvi gMcg== 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=gQ/RwFs5PWoR2SEEMGT7lEv/knCoOXqDWqUOuxqfUzU=; b=o7ugUrHpMD+KN7ZW0IjYA5FCXJHms0QuhVD+HsmNMtAAHPA7dDSIneNGl109bs2Cy/ kV8vcGX2FoqWMvkmqfKd/vlhQIKedcTDdwz7fuqFhEFZK1KT/s4SLyJ8Bg3UDIbJbry0 bQqeq+lcFyrzz3sT8RR0hFSsEhUp4oelpWCIgtCZRtnok/BAluUJlnDGOOklkLhojY9W fRK6gdgNtzPNPE7tJGrGFSCR3XjKP6DQQJilM3lLipSk4drURy7W9rmNei03u6fEyq/8 /oKQ9kmdXuRO4V4/EK5+87T/niGgzqM/67FR7MY6aOlIZYFOMfyzjNz1plmbqlg+1tmo vJWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0k7OT8BO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw17si3224143ejb.331.2021.01.14.20.38.30; Thu, 14 Jan 2021 20:38:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0k7OT8BO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727170AbhAOBOS (ORCPT + 99 others); Thu, 14 Jan 2021 20:14:18 -0500 Received: from conssluserg-01.nifty.com ([210.131.2.80]:28094 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbhAOBOR (ORCPT ); Thu, 14 Jan 2021 20:14:17 -0500 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 10F1DMuT021862; Fri, 15 Jan 2021 10:13:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 10F1DMuT021862 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1610673203; bh=gQ/RwFs5PWoR2SEEMGT7lEv/knCoOXqDWqUOuxqfUzU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0k7OT8BOE3ksIs5m0aQO0nyH0Lok2wVEIeGevS5QBPcA7bhW6Avjebnn+W2ExfPPG NyDuY+1UKrvKMapPcuEehwUaLsi27XW7DFWF43HwVQ7ZBMKWcDZ0pBYbZ2LJq9WnFq t2fOfcWztDiOpwWzX+RxpLFnZPi4X/ZR8FcZlred9aPm0vuVH9fpwPi0O6xrsbjZmC /5sAJkwaeWeT2nwsWvHxSdBEHHL4q+BnwkFU7rW6fkiyOvW96jCz307PxGw7Vpsoix nAgONjj1B62nzkwUoBdvACnP/m4D6uT3yAKyO8t5GyNZe/MhTrGvBM1vrEt+rC2E5O XGJy0uPtDLdIw== X-Nifty-SrcIP: [209.85.215.172] Received: by mail-pg1-f172.google.com with SMTP id 15so4964515pgx.7; Thu, 14 Jan 2021 17:13:23 -0800 (PST) X-Gm-Message-State: AOAM532rr3gDq2E9pVLE/c5zMEktfYO19q7IHgijoU8bTtf2iska05xl pAu0RrxgSVMavBglZQ8YOs2BDe8VtOvANAAKPy0= X-Received: by 2002:a63:ff09:: with SMTP id k9mr10219720pgi.175.1610673202305; Thu, 14 Jan 2021 17:13:22 -0800 (PST) MIME-Version: 1.0 References: <1610500731-30960-2-git-send-email-jjohnson@codeaurora.org> <1610660990-18812-1-git-send-email-jjohnson@codeaurora.org> In-Reply-To: <1610660990-18812-1-git-send-email-jjohnson@codeaurora.org> From: Masahiro Yamada Date: Fri, 15 Jan 2021 10:12:45 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: handle excessively long argument lists To: Jeff Johnson Cc: Linux Kbuild mailing list , Prasad Sodagudi , eberman@quicinc.com, Nick Desaulniers , Mahesh Kumar Kalikot Veetil , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 6:50 AM Jeff Johnson wrote: > > From: Mahesh Kumar Kalikot Veetil > > Modules with a large number of compilation units may be > exceeding AR and LD command argument list. Handle this gracefully by > writing the long argument list in a file. The command line options > read from file are inserted in place of the original @file option. > > The usage is well documented at > https://www.gnu.org/software/make/manual/html_node/File-Function.html > > Signed-off-by: Mahesh Kumar Kalikot Veetil > Signed-off-by: Jeff Johnson > --- First, is this a real problem? If so, which module is exceeding the command line limit? $(file ) is only supported by GNU Make 4.0 or later. The current minimum version is GNU Make 3.81. If we need this feature, Documentation/process/changes.rst must be updated. But, more importantly, none of your patches works correctly. Since $(file ...) is evaluated into an empty string, your patches would break the Kbuild ability that detects the command changes. Steps to reproduce the problem ------------------------------ [1] add a module foo that consists of three objects foo1.o, foo2.o, foo3.o For example, like follows: obj-m += foo.o foo-objs := foo1.o foo2.o foo3.o [2] Run 'make modules' You will get the module foo. [3] Drop foo3.o from the module members Change Makefile as follows: obj-m += foo.o foo-objs := foo1.o foo2.o [4] Re-run 'make modules' The current build system cleverly notices the Makefile change, and correctly rebuilds the foo module. With your patch set applied, the build system would not rebuild the module. > Changes in v2: > - Remove spurious endif > > scripts/Makefile.build | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 252b7d2..787dca2 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -425,7 +425,10 @@ $(obj)/lib.a: $(lib-y) FORCE > # module is turned into a multi object module, $^ will contain header file > # dependencies recorded in the .*.cmd file. > quiet_cmd_link_multi-m = LD [M] $@ > - cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) > + cmd_link_multi-m = \ > + $(file >$@.in,$(filter %.o,$^)) \ > + $(LD) $(ld_flags) -r -o $@ @$@.in; \ > + rm -f $@.in > > $(multi-used-m): FORCE > $(call if_changed,link_multi-m) > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > -- Best Regards Masahiro Yamada