linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>,
	Nicolas Schier <n.schier@avm.de>,
	SzuWei Lin <szuweilin@google.com>, <linux-kbuild@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<Matthias.Thomae@de.bosch.com>, <yyankovskyi@de.adit-jv.com>,
	<Dirk.Behme@de.bosch.com>, Eugeniu Rosca <roscaeugeniu@gmail.com>
Subject: Re: [PATCH 3/5] kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}
Date: Fri, 11 Aug 2023 13:25:30 +0200	[thread overview]
Message-ID: <20230811112530.GA453409@lxhi-087> (raw)
In-Reply-To: <CAK7LNAR4rJwrT2KLjLw-AbBvhO38xCZigC9C+DUVkn_5JM-KyQ@mail.gmail.com>

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 <all variables> 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

  reply	other threads:[~2023-08-11 11:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 18:15 [PATCH 1/5] sh: rename suffix-y to suffix_y Masahiro Yamada
2022-01-09 18:15 ` [PATCH 2/5] kbuild: drop $(size_append) from cmd_zstd Masahiro Yamada
2022-01-10 11:32   ` Nicolas Schier
2022-01-09 18:15 ` [PATCH 3/5] kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} Masahiro Yamada
2022-01-10 11:33   ` Nicolas Schier
2023-06-23 14:45     ` Eugeniu Rosca
2023-07-19 19:09       ` Eugeniu Rosca
2023-07-22 16:08         ` Masahiro Yamada
2023-07-25  9:24           ` Eugeniu Rosca
2023-08-02  9:21             ` Masahiro Yamada
2023-08-11 11:25               ` Eugeniu Rosca [this message]
2022-01-09 18:15 ` [PATCH 4/5] arch: decompressor: remove useless vmlinux.bin.all-y Masahiro Yamada
2022-01-10 11:33   ` Nicolas Schier
2022-01-09 18:15 ` [PATCH 5/5] kbuild: add cmd_file_size Masahiro Yamada
2022-01-10 11:33   ` Nicolas Schier
2022-01-10 11:31 ` [PATCH 1/5] sh: rename suffix-y to suffix_y Nicolas Schier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230811112530.GA453409@lxhi-087 \
    --to=erosca@de.adit-jv.com \
    --cc=Dirk.Behme@de.bosch.com \
    --cc=Matthias.Thomae@de.bosch.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=n.schier@avm.de \
    --cc=roscaeugeniu@gmail.com \
    --cc=szuweilin@google.com \
    --cc=yyankovskyi@de.adit-jv.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).