Re: toolchain/60435: "make depend" is too fussy
"Robert Elz via gnats" <[email protected]>
| Newsgroups | gmane.os.netbsd.bugs |
|---|---|
| Message-ID | <[email protected]> |
The following reply was made to PR toolchain/60435; it has been noted by GNATS. From: Robert Elz <[email protected]> To: [email protected] Cc: Subject: Re: toolchain/60435: "make depend" is too fussy Date: Sat, 11 Jul 2026 03:08:12 +0700 Date: Fri, 10 Jul 2026 19:00:02 +0000 (UTC) From: "Taylor R Campbell via gnats" <[email protected]> Message-ID: <[email protected]> | The transitive dependencies of b.h may not affect the _first_ build of | a.o, but they will affect _subsequent_ builds of a.o. Yes, I know. | We could use `cc -M -MF $*.d' in the .o rule in order to regenerate | the .d file at the same time, but we don't. That's the kind of thing I am requesting, it was a change request, not a bug to be fixed. If a dependency has changed, regenerate the list of dependencies, as well as the object. | It also wouldn't help if a.c includes b.h and b.h includes c.h and | _both_ b.h and c.h have to be generated. That's an unlikely case, generated files don't often include others (that also need generating), they can just generate everything into the one file (they are ephemeral after all) - c.h would (if it had some other use) still get generated, but would be included in b.h as content, not as a dependency). In the extreme case where that isn't possible, then we would need explicit rules in the makefile to make the right thing happen, but I doubt we'd need those very much. | (Note that we would need that _in addition to_ a more lenient | mkdep(1), or else the makefile would still not know that it has to | generate b.h before it can compile a.c -> a.o.) If a.o depends upon b.h then that's make's whole reason for existing isn't it? b.h must be up to date before a.o can be built. Make knows that a.o depende upon b.h because a.c has a #include "b.h" in it, and we have run "make depend" (whether or not b.h actually exists at the time). While I am here, I expect that you (and others) have seem that the sparc, sparc64, and ia64 builds have been broken since I added the changes for the new user.* sysctl vars, as that's where an include file like this was needed. Everything else builds with the sysctl.d: user-version.h dependency that was the last of that set of changes, which made all the other builds work. That include file needs to be generated (it contains the build date/time, so it gets regenerated every time a build is done). For some reason this isn't working on sparc sparc64 or ia64, and at the minute I have no idea why. I can reproduce it in a sparc build here - the file is never generated there. I am still looking, but the build system really is not my area, I have almost no idea how any of it works (I could handle 7th edition make just fine, but not what that has turned into). So if anyone has any ideas, please either implement them, or send me suggestions. The relevant Makefile is src/lib/libc/gen/Makefile.inc kre ps: the atari build is also broken, has been for a while, but that one is just the normal floppy filesystem overflow that happens ...