On Fri, 8 Aug 2025 18:55:07 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:

>> Thanks for the clarification, I think that it is fine, then, although a 
>> comment explaining in the code would be great.
>
> I suspect that the multiple includes reported in the .d files are accurate. 
> The .d file appears
> to report the number of times we `#include` a file, however, because if the 
> include-guard
> constructs we use, the content is pulled in only once.

The number of times a header is (directly or indirectly) included by a given
source file doesn't affect the number of times that header appears in the .d
file associated with that source file. The compiler uniquifies that set
(though links might confuse things, but that's not an issue here).

The .d files consist of a set of targets, and for each target, the set of
dependencies.

For the <sourcefile>.d files, there's one target, <sourcefile>.o, with its
dependencies (once each).

For BUILD_LIBJVM.d, there's a target for each .o file. And for each of those
targets, it's dependencies (once each). Essentially BUILD_LIBJVM.d includes a
concatenation of all the <sourcefile>.d files. And since there are duplicates
among the dependencies of different targets, there are many(!) duplicates in
this file.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26681#discussion_r2265529851

Reply via email to