Re: [PATCH v2 2/2] kbuild: handle excessively long argument lists

Masahiro Yamada
2021-01-15T21:55:40Z

On Sat, Jan 16, 2021 at 5:15 AM <jjohnson@codeaurora.org> wrote:
>
> On 2021-01-14 17:12, Masahiro Yamada wrote:
> > On Fri, Jan 15, 2021 at 6:50 AM Jeff Johnson <jjohnson@codeaurora.org>
> > wrote:
> >>
> >> From: Mahesh Kumar Kalikot Veetil <mkalikot@codeaurora.org>
> >>
> >> 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 <mkalikot@codeaurora.org>
> >> Signed-off-by: Jeff Johnson <jjohnson@codeaurora.org>
> >> ---
> >
> >
> >
> >
> > First, is this a real problem?
> > If so, which module is exceeding the command line limit?
>
> On 2021-01-14 17:12, Masahiro Yamada wrote:
> > First, is this a real problem?
> > If so, which module is exceeding the command line limit?
>
> Mahesh & I appreciate all of the feedback.
>
> The issue is seen in an Android environment with an out-of-tree
> driver. The combination of long path names and a large number
> of source files is leading to the issue.
>
> Since Mahesh & I are not Kbuild gurus, is there an alternative
> solution to this issue?
>
> Jeff

I see.

The support for out-of-tree modules
is not nice in this regard, but fixing it
would need many changes.

The long-term solution might be to upstream your driver,
but it might not be possible.

One cheesy workaround might be to point the module path
via a symbolic link.

Let's say your module is located in a very deep
directory,
/home/foo/long/long/.../path/to/your/module

make M=/home/foo/long/long/.../path/to/your/module modules

would fail due to the too long command line.

First, create a symbolic link as follows:

ln -s /home/foo/long/long/.../path/to/your/module mod_dir

Then, pass the symbolic link to M= option.

make M=mod_dir modules

--
Best Regards
Masahiro Yamada