https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84351
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to jpakkane from comment #0) > If linking supported generating dependency files like -M does for source > compilations, this would not be a problem and ... and? The main problem is that GCC doesn't do the linking, it just calls the linker. GCC is not involved in resolving -lmydep to a file on disk, that's the linker. So the feature would have to be added to the linker, not to GCC.