Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp941066rdg; Fri, 11 Aug 2023 05:09:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNMn8QumgkbQzGZ3hOJyaQww5C436oy3rOY4VF7RWGxxEU+vC7RxTtbxGPXOxQpllTx5+b X-Received: by 2002:a05:6870:e394:b0:1ba:f2eb:baa3 with SMTP id x20-20020a056870e39400b001baf2ebbaa3mr1650337oad.3.1691755744624; Fri, 11 Aug 2023 05:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691755744; cv=none; d=google.com; s=arc-20160816; b=efMp5Kypk9X0ZMBINbgHzoX7fl0worZ6QFuxXj9f4mam9cRM7rbZIbNeR0pkbuk91J k7STvXVcLr8LfBwhHnjelTTPsn/9NkcDm74d28vYa8IIAwG757m9JV/UTqJMmC+8lASP 5LeJL4rzbhy0KI9g9zJ5Gm2s2Xb+6c4jvH6Q1JwWasewBTqlTWfCMTHbXUwednBwLaVs xYHO/5a+CSXaNq3OO2FQxfmI/76zkqO7du4gOKGcCNPraVpGs4TFSK0+LPxnuwxHOFko RJxZR6XMd0PdVFy+K1Foz0wg6F/ruWePJKPo/c9Rzv0/JdFn0QjagDT36CvEhFpCMjAx aK6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/IGiu0QAxYr9ouazfXBeofhup1/BUR4L5D1cYTuvqa4=; fh=hZo+Al4mpCMvqSQP1XYlqhlhUAXa3hUFKidPa4Jpm8I=; b=W3775mqiyaLTa4rdqzywDUfJlUWUIoACffHtfmKbRCvWskop4O035LZ58PPZYS/U93 GM9XeoYCt04945EWPVYAM4nRFdsceHyOszKhYyWtxhCLPfxG4eE3NHpVxQMxKe9qDiKL m2ocHAvt2TY1bWKnsGgx+hdoCVEMVRW+OP0CZkYg/Wej0G8hHbfo50T/yso5QKCVc9n5 HqvJ9APXfV1Nc/CMmKw6H4CKPyeGr7ad/oZFxBThJ8gXyzi4HFL0wwmLbrwxD+JRfkFB BDCLgkiKyAB0EYHEuHgihCEn4qUyuBpiX7eMAwqQFMErksjeR9HLTJ1UxfzTMxap+Ohf n+TQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a17090ac90500b0025ea4dd9071si3372852pjt.61.2023.08.11.05.08.46; Fri, 11 Aug 2023 05:09:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236418AbjHKLZk (ORCPT + 99 others); Fri, 11 Aug 2023 07:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233751AbjHKLZj (ORCPT ); Fri, 11 Aug 2023 07:25:39 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DB3C3; Fri, 11 Aug 2023 04:25:37 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTP id C9870520442; Fri, 11 Aug 2023 13:25:35 +0200 (CEST) Received: from lxhi-087 (10.72.93.211) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Fri, 11 Aug 2023 13:25:35 +0200 Date: Fri, 11 Aug 2023 13:25:30 +0200 From: Eugeniu Rosca To: Masahiro Yamada CC: Eugeniu Rosca , Nicolas Schier , SzuWei Lin , , , , , , , Eugeniu Rosca Subject: Re: [PATCH 3/5] kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} Message-ID: <20230811112530.GA453409@lxhi-087> References: <20220109181529.351420-1-masahiroy@kernel.org> <20220109181529.351420-3-masahiroy@kernel.org> <20230623144544.GA24871@lxhi-065> <20230719190902.GA11207@lxhi-064.domain> <20230725092433.GA57787@lxhi-064.domain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.72.93.211] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 Hello Yamada-san, Appreciate your generous support, which allowed finding the root-cause. On Wed, Aug 02, 2023 at 06:21:14PM +0900, Masahiro Yamada wrote: [..] > Indeed, reverting 7ce7e984ab2b218d6e92d5165629022fe2daf9ee > makes qcom's external module build successfully > (but rebuilding is super slow). Same observation. > > Interestingly, revert 7ce7e984ab2b218d6e92d5165629022fe2daf9ee > then apply the attached patch, then > 'Argument list too long' will come back. > > So, this is unrelated to the actual build commands. > > I suspect bare 'export', which expands all variables > while apparently most of them are not meant exported. Indeed, that seems to be the case and more evidence supports this: * Several pre-existing commits point out to the same root-cause: https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/audio-kernel-ar/-/commit/4025a25a2479fc34 ("makefile: kona: remove make export instances") https://github.com/sonyxperiadev/kernel-techpack-audio/commit/02f00754120df2 ("audio-kernel: Fix build time issue") * The more recent GNU Make 4.4.1 (called with -ddd) reveals more details just before hitting 'Argument list too long': scripts/Makefile.lib:431: not recursively expanding size_append to export to shell function scripts/Makefile.lib:447: not recursively expanding cmd_file_size to export to shell function scripts/Makefile.lib:453: not recursively expanding cmd_bzip2_with_size to export to shell function scripts/Makefile.lib:462: not recursively expanding cmd_lzma_with_size to export to shell function scripts/Makefile.lib:468: not recursively expanding cmd_lzo_with_size to export to shell function scripts/Makefile.lib:474: not recursively expanding cmd_lz4_with_size to export to shell function scripts/Makefile.lib:520: not recursively expanding cmd_xzkern_with_size to export to shell function scripts/Makefile.lib:549: not recursively expanding cmd_zstd22_with_size to export to shell function The "not recursively expanding" messages above come from GNU make commit https://gnu.googlesource.com/make/+/7d484017077089a ("[SV 63016] Don't fail exporting to $(shell ...)"), which appears to be saying that our issue is caused by exporting a makefile variable which contains the 'shell' directive in its definition. I think it would be too much of a burden for Kbuild not to make use of any variables using the 'shell' keyword, so I tend to agree that defending against bare 'export' statements in Kbuild is rather not feasible and it should be fixed in the makefiles of out-of-tree *ko. > Insert the following in your reproducer, then it will work. Thanks for the demo code snippet. -- Best regards, Eugeniu Rosca