You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "sjanc (via GitHub)" <gi...@apache.org> on 2026/10/22 14:55:17 UTC

[PR] newt/toolchain: Generate dependency files during compilation [mynewt-newt]

sjanc opened a new pull request, #654:
URL: https://github.com/apache/mynewt-newt/pull/654

       Dependency files were generated by a separate "-MM -MG" compiler
       invocation run before compiling each source file. This doubled the
       number of compiler invocations and preprocessed every file twice. It
       also limited ccache: the -MM calls cannot be cached, so even when all
       compiles were served from the cache every file was still preprocessed.
       
       Pass -MMD -MF to the compile command instead, so that the compiler
       writes the dependency file as a side effect of compilation. An object
       file without a dependency file is now rebuilt, as it is not known which
       headers it depends on. Extra dependencies are appended to the
       dependency file after successful compilation. Dependency options are
       left out of compile_commands.json. The test of the removed separate
       dependency generation is removed as well.
       
       Since the compile command changes, existing build directories are
       rebuilt once after upgrading newt.
       
       Measured on 16 cores, building btshell and smp_svr for nRF52840 and
       slinky for native (1076 compiled files), mean of 2-3 runs:
       - no ccache:          17.9 s -> 14.9 s
       - warm ccache:         8.8 s ->  5.0 s
       - -j 4, no ccache:    31.5 s -> 25.6 s
       - -j 4, warm ccache:  13.4 s ->  5.1 s
       Object files and images are byte identical.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] newt/toolchain: Generate dependency files during compilation [mynewt-newt]

Posted by "kasjer (via GitHub)" <gi...@apache.org>.
kasjer merged PR #654:
URL: https://github.com/apache/mynewt-newt/pull/654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org