nuttx/Documentation
chao an 9f10ddc9b0 nuttx/build: Restore ARLOCK to improve compile speed in incremental case
To solve the issue of carrying object files from previous builds,
Matias changed the archiving process to re-archive libapps.a on every compilation,
if libapps.a carries more object files, incremental compilation will waste too
many time in re-archiving, compared with the previous implement, this is a degradation
of the build system.  Referring to mature engineering projects such as cmake, if there
is configuration or source file changed, the best solution should be to reconfigure
the environment.

Revert this PR to ensure the compilation speed during incremental compilation.

|  commit 34b34e2d45 (tag: nuttx-20200914-172150)
|  Author: Matias N <matias@protobits.dev>
|  Date:   Fri Sep 11 22:31:38 2020 -0300
|
|      Fix: ensure archive files do not carry object files from prior builds
|
|      In some cases, when NuttX configuration changes and this makes the
|      object list used to build one of the .a libraries change as well,
|      since the command used to build it is "ar crs" and this simply appends
|      the list of object files, the library could still include object
|      files from prior builds. This commit modifies the ARCHIVE macro to
|      erase the .a file if it already exists.
|
|      Since in some cases this behavior was actually expected (object
|      files from a subdirectory were appended to a library created one
|      level above) I added a ARCHIVE_ADD which works as ARCHIVE did.
|
|      This change should greatly improve behavior of building after
|      configuration changes.

Testing:

sim:nsh
-------------------------------
|   Patched    |  Current
-------------------------------
|$ time make   |  $ time make
|real 0m1.270s |  real 0m1.728s
|user 0m0.971s |  user 0m1.276s
|sys  0m0.363s |  sys  0m0.530s
-------------------------------

Private project (20+ 3rd library needs archive to libapps.a)
-------------------------------
|   Patched     |  Current
-------------------------------
|$ time make    |  $ time make
|real 0m21.181s |  real 0m39.721s
|user 0m14.638s |  user 0m24.837s
|sys  0m6.919s  |  sys  0m14.394s
-------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-12 21:55:23 +08:00
..
_static docs: reduce main content max width from 1200px to 1000px 2021-03-26 23:41:45 -05:00
_templates
applications Removed reference for non-existing document in nxdiag/index.rst 2023-08-22 23:35:29 +08:00
components Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
contributing mm/alloc: remove all unnecessary cast for alloc 2023-08-30 14:34:20 +08:00
faq Doc: Add how to configure network MTU size 2022-11-02 09:14:17 +08:00
guides fix correct spell Cirectory -> directory 2023-09-12 21:54:54 +08:00
introduction boards/risc-v: Add support for PINE64 Star64 JH7110 SBC 2023-08-07 01:08:35 -07:00
platforms Documentation/esp32: Describe RTM support 2023-09-12 17:44:42 +08:00
quickstart nuttx/build: Restore ARLOCK to improve compile speed in incremental case 2023-09-12 21:55:23 +08:00
reference Documentation: Minor fixes in Tickless OS documentation 2023-05-24 10:31:56 +08:00
.gitignore
conf.py docs: Add copy button for code blocks 2023-05-20 12:58:32 +08:00
glossary.rst
index.rst Move "Contributing" to be after getting started 2021-08-23 21:22:49 +08:00
make.bat
Makefile doc: mention sphinx-autobuild in contributing section 2021-03-26 23:41:45 -05:00
Pipfile docs: Add copy button for code blocks 2023-05-20 12:58:32 +08:00
Pipfile.lock build(deps): bump certifi from 2023.5.7 to 2023.7.22 in /Documentation 2023-07-25 18:06:14 -07:00
substitutions.rst Remove the double blank line from source files 2022-02-20 20:10:14 +01:00