Masahiro Yamada cd968b97c4 kbuild: make built-in.a rule robust against too long argument error
Kbuild runs at the top of objtree instead of changing the working
directory to subdirectories. I think this design is nice overall but
some commands have a scalability issue.

The build command of built-in.a is one of them whose length scales with:

    O(D * N)

Here, D is the length of the directory path (i.e. $(obj)/ prefix),
N is the number of objects in the Makefile, O() is the big O notation.

The deeper directory the Makefile directory is located, the more easily
it will hit the too long argument error.

We can make it better. Trim the $(obj)/ by Make's builtin function, and
restore it by a shell command (sed).

With this, the command length scales with:

    O(D + N)

In-tree modules still have some room to the limit (ARG_MAX=2097152),
but this is more future-proof for big modules in a deep directory.

For example, you can build i915 as builtin (CONFIG_DRM_I915=y) and
compare drivers/gpu/drm/i915/.built-in.a.cmd with/without this commit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
2022-06-01 23:07:29 +09:00
2022-05-29 18:39:35 +09:00
2022-05-24 19:55:07 -07:00
2022-05-26 12:09:50 -07:00
2022-05-26 20:52:24 -07:00
2022-05-26 21:08:40 -07:00
2022-05-26 21:08:40 -07:00
2022-05-26 17:13:43 -07:00
2022-05-26 17:13:43 -07:00
2022-05-26 16:57:20 -07:00
2022-05-26 21:08:40 -07:00
2022-05-25 16:18:27 -07:00
2022-05-25 11:32:53 -07:00
2022-05-25 16:55:16 -07:00
2022-05-26 14:20:14 -07:00
2022-05-26 12:09:50 -07:00
2022-05-26 14:20:14 -07:00
2022-05-24 11:11:13 -07:00
2022-05-26 17:13:43 -07:00
2022-05-26 12:09:50 -07:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%